From owner-dev-commits-src-all@freebsd.org Mon Sep 13 01:13:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0128467272D; Mon, 13 Sep 2021 01:13:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H77lH6K3Qz4gYb; Mon, 13 Sep 2021 01:13:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B91401E0AD; Mon, 13 Sep 2021 01:13:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18D1DF39067979; Mon, 13 Sep 2021 01:13:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18D1DFvS067978; Mon, 13 Sep 2021 01:13:15 GMT (envelope-from git) Date: Mon, 13 Sep 2021 01:13:15 GMT Message-Id: <202109130113.18D1DFvS067978@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 5eca96eee3f4 - stable/12 - top(1): support command name and argument grepping MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5eca96eee3f48c0659175f78f9630b59636c2970 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 01:13:16 -0000 The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=5eca96eee3f48c0659175f78f9630b59636c2970 commit 5eca96eee3f48c0659175f78f9630b59636c2970 Author: John Grafton AuthorDate: 2021-06-16 19:40:21 +0000 Commit: Warner Losh CommitDate: 2021-09-13 01:08:08 +0000 top(1): support command name and argument grepping Obtained from: OpenBSD Reviewed by: imp@ Pull Request: https://github.com/freebsd/freebsd-src/pull/479 (cherry picked from commit a00d703f2f438b199d3933d19d535540586b7792) --- usr.bin/top/commands.c | 1 + usr.bin/top/commands.h | 1 + usr.bin/top/machine.c | 35 +++++++++++++++++++++++++++++++++++ usr.bin/top/machine.h | 2 +- usr.bin/top/top.1 | 5 +++++ usr.bin/top/top.c | 15 +++++++++++++++ usr.bin/top/top.h | 2 ++ 7 files changed, 60 insertions(+), 1 deletion(-) diff --git a/usr.bin/top/commands.c b/usr.bin/top/commands.c index 88f4b0867d47..9efc693020ba 100644 --- a/usr.bin/top/commands.c +++ b/usr.bin/top/commands.c @@ -59,6 +59,7 @@ const struct command all_commands[] = {'H', "toggle the displaying of threads", false, CMD_thrtog}, {'h', "show this help text", true, CMD_help}, {'?', NULL, true, CMD_help}, + {'/', "filter on command name (+ selects all commands)", false, CMD_grep}, {'i', "toggle the displaying of idle processes", false, CMD_idletog}, {'I', NULL, false, CMD_idletog}, {'j', "toggle the displaying of jail ID", false, CMD_jidtog}, diff --git a/usr.bin/top/commands.h b/usr.bin/top/commands.h index 0071fbe62fc6..863effd2ddd9 100644 --- a/usr.bin/top/commands.h +++ b/usr.bin/top/commands.h @@ -24,6 +24,7 @@ enum cmd_id { CMD_update, CMD_quit, CMD_help, + CMD_grep, CMD_errors, CMD_number, CMD_delay, diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index 1a2c608f3045..6116a06bb28b 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -220,6 +220,7 @@ static void getsysctl(const char *name, void *ptr, size_t len); static int swapmode(int *retavail, int *retfree); static void update_layout(void); static int find_uid(uid_t needle, int *haystack); +static int cmd_matches(struct kinfo_proc *, const char *); static int find_uid(uid_t needle, int *haystack) @@ -853,6 +854,10 @@ get_process_info(struct system_info *si, struct process_select *sel, if (sel->pid != -1 && pp->ki_pid != sel->pid) continue; + if (!cmd_matches(pp, sel->command)) + /* skip proc. that doesn't match grep string */ + continue; + *prefp++ = pp; active_procs++; } @@ -871,6 +876,36 @@ get_process_info(struct system_info *si, struct process_select *sel, return (&handle); } +static int +cmd_matches(struct kinfo_proc *proc, const char *term) +{ + extern int show_args; + char **args = NULL; + + if (!term) { + /* No command filter set */ + return 1; + } else { + /* Filter set, does process name contain term? */ + if (strstr(proc->ki_comm, term)) + return 1; + /* Search arguments only if arguments are displayed */ + if (show_args) { + args = kvm_getargv(kd, proc, 1024); + if (args == NULL) { + /* Failed to get arguments so can't search them */ + return 0; + } + while (*args != NULL) { + if (strstr(*args, term)) + return 1; + args++; + } + } + } + return 0; +} + char * format_next_process(struct handle * xhandle, char *(*get_userid)(int), int flags) { diff --git a/usr.bin/top/machine.h b/usr.bin/top/machine.h index c3c7777d910e..f73f8f30e1aa 100644 --- a/usr.bin/top/machine.h +++ b/usr.bin/top/machine.h @@ -73,7 +73,7 @@ struct process_select bool swap; /* show swap usage */ bool kidle; /* show per-CPU idle threads */ int pid; /* only this pid (unless pid == -1) */ - const char *command; /* only this command (unless == NULL) */ + char *command; /* only this command (unless == NULL) */ }; /* routines defined by the machine dependent module */ diff --git a/usr.bin/top/top.1 b/usr.bin/top/top.1 index cd297b5aa3a1..104b979abd00 100644 --- a/usr.bin/top/top.1 +++ b/usr.bin/top/top.1 @@ -240,6 +240,11 @@ Remember that the next display counts as one, so typing will make .Nm show one final display and then immediately exit. +.It / +Display only processes that contain the specified string in their +command name. +If displaying arguments is enabled, the arguments are searched +too. '+' shows all processes. .It m Toggle the display between 'cpu' and 'io' modes. .It n or # diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c index 058a53b5f0a3..deba4d8e1ef3 100644 --- a/usr.bin/top/top.c +++ b/usr.bin/top/top.c @@ -52,6 +52,7 @@ typedef void sigret_t; static char stdoutbuf[Buffersize]; static int fmt_flags = 0; +int show_args = false; int pcpu_stats = false; /* signal handling routines */ @@ -898,6 +899,19 @@ restart: } break; + case CMD_grep: /* grep command name */ + new_message(MT_standout, + "Grep command name: "); + if (readline(tempbuf1, sizeof(tempbuf1), false) > 0) { + free(ps.command); + if (tempbuf1[0] == '+' && tempbuf1[1] == '\0') { + ps.command = NULL; + } else if ((ps.command = strdup(tempbuf1)) == NULL) + quit(1); + } + clear_message(); + break; + case CMD_displays: /* change display count */ new_message(MT_standout, "Displays to show (currently %s): ", @@ -1016,6 +1030,7 @@ restart: break; case CMD_showargs: fmt_flags ^= FMT_SHOWARGS; + show_args = fmt_flags & FMT_SHOWARGS; new_message(MT_standout | MT_delayed, " %sisplaying process arguments.", fmt_flags & FMT_SHOWARGS ? "D" : "Not d"); diff --git a/usr.bin/top/top.h b/usr.bin/top/top.h index 7ec2d7f2c199..2f31d5812ee4 100644 --- a/usr.bin/top/top.h +++ b/usr.bin/top/top.h @@ -37,6 +37,8 @@ extern pid_t mypid; extern int (*compares[])(const void*, const void*); +extern int show_args; + const char* kill_procs(char *); const char* renice_procs(char *); From owner-dev-commits-src-all@freebsd.org Mon Sep 13 01:13:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 222126724E6; Mon, 13 Sep 2021 01:13:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H77lK0C94z4gYg; Mon, 13 Sep 2021 01:13:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB8821DC71; Mon, 13 Sep 2021 01:13:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18D1DGT6068003; Mon, 13 Sep 2021 01:13:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18D1DGUa068002; Mon, 13 Sep 2021 01:13:16 GMT (envelope-from git) Date: Mon, 13 Sep 2021 01:13:16 GMT Message-Id: <202109130113.18D1DGUa068002@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 1f7da3e8965d - stable/12 - top(1): indicate how to reset grep string MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 1f7da3e8965d357698e766806499b14ce01415d8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 01:13:17 -0000 The branch stable/12 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=1f7da3e8965d357698e766806499b14ce01415d8 commit 1f7da3e8965d357698e766806499b14ce01415d8 Author: John Grafton AuthorDate: 2021-09-07 17:39:59 +0000 Commit: Warner Losh CommitDate: 2021-09-13 01:08:08 +0000 top(1): indicate how to reset grep string Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/536/files (cherry picked from commit 4ccbbe5f0689513de4399d6dad43e85d97ad9cde) --- usr.bin/top/top.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c index deba4d8e1ef3..4b624aacb6b0 100644 --- a/usr.bin/top/top.c +++ b/usr.bin/top/top.c @@ -901,7 +901,7 @@ restart: case CMD_grep: /* grep command name */ new_message(MT_standout, - "Grep command name: "); + "Grep command name (+ for all): "); if (readline(tempbuf1, sizeof(tempbuf1), false) > 0) { free(ps.command); if (tempbuf1[0] == '+' && tempbuf1[1] == '\0') { From owner-dev-commits-src-all@freebsd.org Mon Sep 13 01:16:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3096467225C; Mon, 13 Sep 2021 01:16:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H77pY0xJJz4hq2; Mon, 13 Sep 2021 01:16:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F40851E198; Mon, 13 Sep 2021 01:16:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18D1G4TL068283; Mon, 13 Sep 2021 01:16:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18D1G4C2068282; Mon, 13 Sep 2021 01:16:04 GMT (envelope-from git) Date: Mon, 13 Sep 2021 01:16:04 GMT Message-Id: <202109130116.18D1G4C2068282@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 72f20536eae7 - stable/13 - top(1): support command name and argument grepping MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 72f20536eae777f8bf77a7cb2c0c0a01b5fc51b3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 01:16:05 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=72f20536eae777f8bf77a7cb2c0c0a01b5fc51b3 commit 72f20536eae777f8bf77a7cb2c0c0a01b5fc51b3 Author: John Grafton AuthorDate: 2021-06-16 19:40:21 +0000 Commit: Warner Losh CommitDate: 2021-09-13 01:12:00 +0000 top(1): support command name and argument grepping Obtained from: OpenBSD Reviewed by: imp@ Pull Request: https://github.com/freebsd/freebsd-src/pull/479 (cherry picked from commit a00d703f2f438b199d3933d19d535540586b7792) --- usr.bin/top/commands.c | 1 + usr.bin/top/commands.h | 1 + usr.bin/top/machine.c | 35 +++++++++++++++++++++++++++++++++++ usr.bin/top/machine.h | 2 +- usr.bin/top/top.1 | 5 +++++ usr.bin/top/top.c | 15 +++++++++++++++ usr.bin/top/top.h | 2 ++ 7 files changed, 60 insertions(+), 1 deletion(-) diff --git a/usr.bin/top/commands.c b/usr.bin/top/commands.c index 88f4b0867d47..9efc693020ba 100644 --- a/usr.bin/top/commands.c +++ b/usr.bin/top/commands.c @@ -59,6 +59,7 @@ const struct command all_commands[] = {'H', "toggle the displaying of threads", false, CMD_thrtog}, {'h', "show this help text", true, CMD_help}, {'?', NULL, true, CMD_help}, + {'/', "filter on command name (+ selects all commands)", false, CMD_grep}, {'i', "toggle the displaying of idle processes", false, CMD_idletog}, {'I', NULL, false, CMD_idletog}, {'j', "toggle the displaying of jail ID", false, CMD_jidtog}, diff --git a/usr.bin/top/commands.h b/usr.bin/top/commands.h index 0071fbe62fc6..863effd2ddd9 100644 --- a/usr.bin/top/commands.h +++ b/usr.bin/top/commands.h @@ -24,6 +24,7 @@ enum cmd_id { CMD_update, CMD_quit, CMD_help, + CMD_grep, CMD_errors, CMD_number, CMD_delay, diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index c7b3e13c700b..1fe2a91a655c 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -224,6 +224,7 @@ static void getsysctl(const char *name, void *ptr, size_t len); static int swapmode(int *retavail, int *retfree); static void update_layout(void); static int find_uid(uid_t needle, int *haystack); +static int cmd_matches(struct kinfo_proc *, const char *); static int find_uid(uid_t needle, int *haystack) @@ -869,6 +870,10 @@ get_process_info(struct system_info *si, struct process_select *sel, if (sel->pid != -1 && pp->ki_pid != sel->pid) continue; + if (!cmd_matches(pp, sel->command)) + /* skip proc. that doesn't match grep string */ + continue; + *prefp++ = pp; active_procs++; } @@ -887,6 +892,36 @@ get_process_info(struct system_info *si, struct process_select *sel, return (&handle); } +static int +cmd_matches(struct kinfo_proc *proc, const char *term) +{ + extern int show_args; + char **args = NULL; + + if (!term) { + /* No command filter set */ + return 1; + } else { + /* Filter set, does process name contain term? */ + if (strstr(proc->ki_comm, term)) + return 1; + /* Search arguments only if arguments are displayed */ + if (show_args) { + args = kvm_getargv(kd, proc, 1024); + if (args == NULL) { + /* Failed to get arguments so can't search them */ + return 0; + } + while (*args != NULL) { + if (strstr(*args, term)) + return 1; + args++; + } + } + } + return 0; +} + char * format_next_process(struct handle * xhandle, char *(*get_userid)(int), int flags) { diff --git a/usr.bin/top/machine.h b/usr.bin/top/machine.h index c2616e9052e3..af66eaead76b 100644 --- a/usr.bin/top/machine.h +++ b/usr.bin/top/machine.h @@ -75,7 +75,7 @@ struct process_select bool swap; /* show swap usage */ bool kidle; /* show per-CPU idle threads */ int pid; /* only this pid (unless pid == -1) */ - const char *command; /* only this command (unless == NULL) */ + char *command; /* only this command (unless == NULL) */ }; /* routines defined by the machine dependent module */ diff --git a/usr.bin/top/top.1 b/usr.bin/top/top.1 index 03301b2f89fc..42282bebdafe 100644 --- a/usr.bin/top/top.1 +++ b/usr.bin/top/top.1 @@ -243,6 +243,11 @@ Remember that the next display counts as one, so typing will make .Nm show one final display and then immediately exit. +.It / +Display only processes that contain the specified string in their +command name. +If displaying arguments is enabled, the arguments are searched +too. '+' shows all processes. .It m Toggle the display between 'cpu' and 'io' modes. .It n or # diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c index 9853ecf914b0..4fbf11b50299 100644 --- a/usr.bin/top/top.c +++ b/usr.bin/top/top.c @@ -53,6 +53,7 @@ typedef void sigret_t; static char stdoutbuf[Buffersize]; static int fmt_flags = 0; +int show_args = false; int pcpu_stats = false; /* signal handling routines */ @@ -907,6 +908,19 @@ restart: } break; + case CMD_grep: /* grep command name */ + new_message(MT_standout, + "Grep command name: "); + if (readline(tempbuf1, sizeof(tempbuf1), false) > 0) { + free(ps.command); + if (tempbuf1[0] == '+' && tempbuf1[1] == '\0') { + ps.command = NULL; + } else if ((ps.command = strdup(tempbuf1)) == NULL) + quit(1); + } + clear_message(); + break; + case CMD_displays: /* change display count */ new_message(MT_standout, "Displays to show (currently %s): ", @@ -1025,6 +1039,7 @@ restart: break; case CMD_showargs: fmt_flags ^= FMT_SHOWARGS; + show_args = fmt_flags & FMT_SHOWARGS; new_message(MT_standout | MT_delayed, " %sisplaying process arguments.", fmt_flags & FMT_SHOWARGS ? "D" : "Not d"); diff --git a/usr.bin/top/top.h b/usr.bin/top/top.h index 7ec2d7f2c199..2f31d5812ee4 100644 --- a/usr.bin/top/top.h +++ b/usr.bin/top/top.h @@ -37,6 +37,8 @@ extern pid_t mypid; extern int (*compares[])(const void*, const void*); +extern int show_args; + const char* kill_procs(char *); const char* renice_procs(char *); From owner-dev-commits-src-all@freebsd.org Mon Sep 13 01:16:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A8C2672AA7; Mon, 13 Sep 2021 01:16:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H77pZ1txQz4hsT; Mon, 13 Sep 2021 01:16:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 218DB1DFC1; Mon, 13 Sep 2021 01:16:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18D1G6HT068312; Mon, 13 Sep 2021 01:16:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18D1G6DJ068311; Mon, 13 Sep 2021 01:16:06 GMT (envelope-from git) Date: Mon, 13 Sep 2021 01:16:06 GMT Message-Id: <202109130116.18D1G6DJ068311@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 3e3f48e6c4f0 - stable/13 - top(1): indicate how to reset grep string MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3e3f48e6c4f0e5d9e5047d1fb9b94babbe6ad68b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 01:16:06 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=3e3f48e6c4f0e5d9e5047d1fb9b94babbe6ad68b commit 3e3f48e6c4f0e5d9e5047d1fb9b94babbe6ad68b Author: John Grafton AuthorDate: 2021-09-07 17:39:59 +0000 Commit: Warner Losh CommitDate: 2021-09-13 01:12:01 +0000 top(1): indicate how to reset grep string Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/536/files (cherry picked from commit 4ccbbe5f0689513de4399d6dad43e85d97ad9cde) --- usr.bin/top/top.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c index 4fbf11b50299..08248911e99a 100644 --- a/usr.bin/top/top.c +++ b/usr.bin/top/top.c @@ -910,7 +910,7 @@ restart: case CMD_grep: /* grep command name */ new_message(MT_standout, - "Grep command name: "); + "Grep command name (+ for all): "); if (readline(tempbuf1, sizeof(tempbuf1), false) > 0) { free(ps.command); if (tempbuf1[0] == '+' && tempbuf1[1] == '\0') { From owner-dev-commits-src-all@freebsd.org Mon Sep 13 01:17:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 000B1672A4E; Mon, 13 Sep 2021 01:17:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H77qn6Tdsz4hll; Mon, 13 Sep 2021 01:17:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE0041E199; Mon, 13 Sep 2021 01:17:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18D1H9PQ068496; Mon, 13 Sep 2021 01:17:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18D1H9jp068495; Mon, 13 Sep 2021 01:17:09 GMT (envelope-from git) Date: Mon, 13 Sep 2021 01:17:09 GMT Message-Id: <202109130117.18D1H9jp068495@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 8d783b1dcdbc - stable/13 - netinet: prevent NULL pointer dereference in in_aifaddr_ioctl() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8d783b1dcdbcce4948878e81d77299070e348dc8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 01:17:10 -0000 The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=8d783b1dcdbcce4948878e81d77299070e348dc8 commit 8d783b1dcdbcce4948878e81d77299070e348dc8 Author: Artem Khramov AuthorDate: 2021-08-24 14:26:35 +0000 Commit: Warner Losh CommitDate: 2021-09-13 01:12:31 +0000 netinet: prevent NULL pointer dereference in in_aifaddr_ioctl() It appears that maliciously crafted ifaliasreq can lead to NULL pointer dereference in in_aifaddr_ioctl(). In order to replicate that, one needs to 1. Ensure that carp(4) is not loaded 2. Issue SIOCAIFADDR call setting ifra_vhid field of the request to a negative value. A repro code would look like this. int main() { struct ifaliasreq req; struct sockaddr_in sin, mask; int fd, error; bzero(&sin, sizeof(struct sockaddr_in)); bzero(&mask, sizeof(struct sockaddr_in)); sin.sin_len = sizeof(struct sockaddr_in); sin.sin_family = AF_INET; sin.sin_addr.s_addr = inet_addr("192.168.88.2"); mask.sin_len = sizeof(struct sockaddr_in); mask.sin_family = AF_INET; mask.sin_addr.s_addr = inet_addr("255.255.255.0"); fd = socket(AF_INET, SOCK_DGRAM, 0); if (fd < 0) return (-1); memset(&req, 0, sizeof(struct ifaliasreq)); strlcpy(req.ifra_name, "lo0", sizeof(req.ifra_name)); memcpy(&req.ifra_addr, &sin, sin.sin_len); memcpy(&req.ifra_mask, &mask, mask.sin_len); req.ifra_vhid = -1; return ioctl(fd, SIOCAIFADDR, (char *)&req); } To fix, discard both positive and negative vhid values in in_aifaddr_ioctl, if carp(4) is not loaded. This prevents NULL pointer dereference and kernel panic. Reviewed by: imp@ Pull Request: https://github.com/freebsd/freebsd-src/pull/530 (cherry picked from commit 620cf65c2bc4035a07e1152da419a4e60d36ff9b) --- sys/netinet/in.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/in.c b/sys/netinet/in.c index d1dd2b31b6ef..f9b46b414007 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -376,7 +376,7 @@ in_aifaddr_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp, struct thread *td) (dstaddr->sin_len != sizeof(struct sockaddr_in) || dstaddr->sin_addr.s_addr == INADDR_ANY)) return (EDESTADDRREQ); - if (vhid > 0 && carp_attach_p == NULL) + if (vhid != 0 && carp_attach_p == NULL) return (EPROTONOSUPPORT); /* From owner-dev-commits-src-all@freebsd.org Mon Sep 13 04:11:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 90B8D674824; Mon, 13 Sep 2021 04:11:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7Chy3RVXz4S1S; Mon, 13 Sep 2021 04:11:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58002200CC; Mon, 13 Sep 2021 04:11:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18D4BUJR004806; Mon, 13 Sep 2021 04:11:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18D4BUs3004805; Mon, 13 Sep 2021 04:11:30 GMT (envelope-from git) Date: Mon, 13 Sep 2021 04:11:30 GMT Message-Id: <202109130411.18D4BUs3004805@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wojciech Macek Subject: git: 6fa041d7f125 - main - Measure latency of PMC interruptions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wma X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6fa041d7f125db65f400af7f520a41ff78d19cd7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 04:11:30 -0000 The branch main has been updated by wma: URL: https://cgit.FreeBSD.org/src/commit/?id=6fa041d7f125db65f400af7f520a41ff78d19cd7 commit 6fa041d7f125db65f400af7f520a41ff78d19cd7 Author: Wojciech Macek AuthorDate: 2021-09-13 04:08:32 +0000 Commit: Wojciech Macek CommitDate: 2021-09-13 04:08:32 +0000 Measure latency of PMC interruptions Add HWPMC events to measure latency. Provide sysctl to choose the number of outstanding events which trigger HWPMC event. Obtained from: Semihalf Sponsored by: Stormshield Differential revision: https://reviews.freebsd.org/D31283 --- sys/kern/kern_intr.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 52 insertions(+), 6 deletions(-) diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c index 1660414a50ef..19401877dfbd 100644 --- a/sys/kern/kern_intr.c +++ b/sys/kern/kern_intr.c @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" +#include "opt_hwpmc_hooks.h" #include "opt_kstack_usage_prof.h" #include @@ -75,6 +76,7 @@ struct intr_thread { struct thread *it_thread; /* Kernel thread. */ int it_flags; /* (j) IT_* flags. */ int it_need; /* Needs service. */ + int it_waiting; /* Waiting in the runq. */ }; /* Interrupt thread flags kept in it_flags */ @@ -100,13 +102,19 @@ SYSCTL_INT(_hw, OID_AUTO, intr_storm_threshold, CTLFLAG_RWTUN, static int intr_epoch_batch = 1000; SYSCTL_INT(_hw, OID_AUTO, intr_epoch_batch, CTLFLAG_RWTUN, &intr_epoch_batch, 0, "Maximum interrupt handler executions without re-entering epoch(9)"); +#ifdef HWPMC_HOOKS +static int intr_hwpmc_waiting_report_threshold = 1; +SYSCTL_INT(_hw, OID_AUTO, intr_hwpmc_waiting_report_threshold, CTLFLAG_RWTUN, + &intr_hwpmc_waiting_report_threshold, 1, + "Threshold for reporting number of events in a workq"); +#endif static TAILQ_HEAD(, intr_event) event_list = TAILQ_HEAD_INITIALIZER(event_list); static struct mtx event_lock; MTX_SYSINIT(intr_event_list, &event_lock, "intr event list", MTX_DEF); static void intr_event_update(struct intr_event *ie); -static int intr_event_schedule_thread(struct intr_event *ie); +static int intr_event_schedule_thread(struct intr_event *ie, struct trapframe *frame); static struct intr_thread *ithread_create(const char *name); static void ithread_destroy(struct intr_thread *ithread); static void ithread_execute_handlers(struct proc *p, @@ -115,6 +123,16 @@ static void ithread_loop(void *); static void ithread_update(struct intr_thread *ithd); static void start_softintr(void *); +#ifdef HWPMC_HOOKS +#include +PMC_SOFT_DEFINE( , , intr, all); +PMC_SOFT_DEFINE( , , intr, ithread); +PMC_SOFT_DEFINE( , , intr, filter); +PMC_SOFT_DEFINE( , , intr, stray); +PMC_SOFT_DEFINE( , , intr, schedule); +PMC_SOFT_DEFINE( , , intr, waiting); +#endif + /* Map an interrupt type to an ithread priority. */ u_char intr_priority(enum intr_type flags) @@ -773,7 +791,7 @@ intr_handler_barrier(struct intr_handler *handler) } if ((handler->ih_flags & IH_CHANGED) == 0) { handler->ih_flags |= IH_CHANGED; - intr_event_schedule_thread(ie); + intr_event_schedule_thread(ie, NULL); } while ((handler->ih_flags & IH_CHANGED) != 0) msleep(handler, &ie->ie_lock, 0, "ih_barr", 0); @@ -872,7 +890,7 @@ intr_event_remove_handler(void *cookie) KASSERT((handler->ih_flags & IH_DEAD) == 0, ("duplicate handle remove")); handler->ih_flags |= IH_DEAD; - intr_event_schedule_thread(ie); + intr_event_schedule_thread(ie, NULL); while (handler->ih_flags & IH_DEAD) msleep(handler, &ie->ie_lock, 0, "iev_rmh", 0); intr_event_update(ie); @@ -944,7 +962,7 @@ intr_event_resume_handler(void *cookie) } static int -intr_event_schedule_thread(struct intr_event *ie) +intr_event_schedule_thread(struct intr_event *ie, struct trapframe *frame) { struct intr_entropy entropy; struct intr_thread *it; @@ -986,11 +1004,28 @@ intr_event_schedule_thread(struct intr_event *ie) atomic_store_rel_int(&it->it_need, 1); thread_lock(td); if (TD_AWAITING_INTR(td)) { +#ifdef HWPMC_HOOKS + atomic_set_int(&it->it_waiting, 0); + if (frame != NULL) + PMC_SOFT_CALL_TF( , , intr, schedule, frame); + else + PMC_SOFT_CALL( , , intr, schedule); +#endif CTR3(KTR_INTR, "%s: schedule pid %d (%s)", __func__, td->td_proc->p_pid, td->td_name); TD_CLR_IWAIT(td); sched_add(td, SRQ_INTR); } else { +#ifdef HWPMC_HOOKS + atomic_add_int(&it->it_waiting, 1); + + if (atomic_load_int(&it->it_waiting) >= intr_hwpmc_waiting_report_threshold) { + if (frame != NULL) + PMC_SOFT_CALL_TF( , , intr, waiting, frame); + else + PMC_SOFT_CALL( , , intr, waiting); + } +#endif CTR5(KTR_INTR, "%s: pid %d (%s): it_need %d, state %d", __func__, td->td_proc->p_pid, td->td_name, it->it_need, TD_GET_STATE(td)); thread_unlock(td); @@ -1083,7 +1118,7 @@ swi_sched(void *cookie, int flags) #endif } else { VM_CNT_INC(v_soft); - error = intr_event_schedule_thread(ie); + error = intr_event_schedule_thread(ie, NULL); KASSERT(error == 0, ("stray software interrupt")); } } @@ -1374,12 +1409,23 @@ intr_event_handle(struct intr_event *ie, struct trapframe *frame) ret = ih->ih_filter(frame); else ret = ih->ih_filter(ih->ih_argument); +#ifdef HWPMC_HOOKS + PMC_SOFT_CALL_TF( , , intr, all, frame); +#endif KASSERT(ret == FILTER_STRAY || ((ret & (FILTER_SCHEDULE_THREAD | FILTER_HANDLED)) != 0 && (ret & ~(FILTER_SCHEDULE_THREAD | FILTER_HANDLED)) == 0), ("%s: incorrect return value %#x from %s", __func__, ret, ih->ih_name)); filter = filter || ret == FILTER_HANDLED; +#ifdef HWPMC_HOOKS + if (ret & FILTER_SCHEDULE_THREAD) + PMC_SOFT_CALL_TF( , , intr, ithread, frame); + else if (ret & FILTER_HANDLED) + PMC_SOFT_CALL_TF( , , intr, filter, frame); + else if (ret == FILTER_STRAY) + PMC_SOFT_CALL_TF( , , intr, stray, frame); +#endif /* * Wrapper handler special handling: @@ -1416,7 +1462,7 @@ intr_event_handle(struct intr_event *ie, struct trapframe *frame) if (thread) { int error __unused; - error = intr_event_schedule_thread(ie); + error = intr_event_schedule_thread(ie, frame); KASSERT(error == 0, ("bad stray interrupt")); } critical_exit(); From owner-dev-commits-src-all@freebsd.org Mon Sep 13 08:01:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5D14367752A; Mon, 13 Sep 2021 08:01:43 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7Jpb1WBdz4YQj; Mon, 13 Sep 2021 08:01:43 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-lf1-x12a.google.com with SMTP id h16so19229963lfk.10; Mon, 13 Sep 2021 01:01:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=WxhzR+ifsHB2h6NyocYKbhdgVzU8llJQ+Y24f2h6pH4=; b=AbBrtdIA1xoAB5OxFLITaBTi5a6SmalHEKUVeG2270RDwiD+TqJhlS5M6JWL/nEeiD IyIOQ7z1hxnQEJMe/noVlQMA1XiViyNnxWaOUF8iiZHWaF+FjFlNYQRyjI6JCZB2hVWQ XPSFGkATEmy6iiZkGbsilzzfxLChvUuF/f6Kclc+UijjPNdnK6kqgAhfa6wsiJbaF5aZ YvuRammobK7RWFU/jyThd7dwapvvhHROLDFwchKDAJp5kr16Ux6Na+MAMuvhCUuQvtOK FCuuJnWDZHGFIgCc3SE/4o8sH/0JnzK1kRlz4mWYXvxHT52PTj2WIp6l849OX73tdQDg eyJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=WxhzR+ifsHB2h6NyocYKbhdgVzU8llJQ+Y24f2h6pH4=; b=w8AEFoqTneePDJMR9leP3yi3SWCHKypno4qIjcAYoEGPSsLAc3Xi1VBDR9EM9cEa/C VAgBzq78KkXaK8bazRdYt8OlFJfbKktauHScrNW9rPqezMDuFwDd2JA5w034ZNvF8KF1 FEOY7AI9JFoV2jKiz90StFL/eAOfMtYJvO/XwWrROBkvvt+8bZhv1mGbO5XTm6ld4VAZ TZrzFtSo7Jw8TXDAUZsvlkAYEHo03H9evbwH6cu9G0ZSTaEg8w31ctlQhp+dOOS0i6Zo HHJgtIHL9GTDTVKoK7r4F3XspofZDn28DAWdoBLN30bfDbx5tPdza0kHUy0AUCGEND2g 2puQ== X-Gm-Message-State: AOAM532tBIauOr2AgDFO7lfM7VPjLg7EdDZwu9HMMkbk+GHa7vwPM6Fg vtfbtDVHWqwnxssTor5/t7cWQgerAuJdN4v+HGuYb7h/ X-Google-Smtp-Source: ABdhPJxt+3Kwn4jnKWza/PUdusakBPWE8sHsTcZoHk+9dPHJ0BEa3N2tJqE/zWMtWa92DjeXs1dy+gkC+SEUI/0YUro= X-Received: by 2002:a05:6512:1296:: with SMTP id u22mr7876016lfs.650.1631520101842; Mon, 13 Sep 2021 01:01:41 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:6f04:0:0:0:0:0 with HTTP; Mon, 13 Sep 2021 01:01:41 -0700 (PDT) In-Reply-To: <202109130411.18D4BUs3004805@gitrepo.freebsd.org> References: <202109130411.18D4BUs3004805@gitrepo.freebsd.org> From: Mateusz Guzik Date: Mon, 13 Sep 2021 10:01:41 +0200 Message-ID: Subject: Re: git: 6fa041d7f125 - main - Measure latency of PMC interruptions To: Wojciech Macek Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4H7Jpb1WBdz4YQj X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 08:01:43 -0000 On 9/13/21, Wojciech Macek wrote: > The branch main has been updated by wma: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=6fa041d7f125db65f400af7f520a41ff78d19cd7 > > commit 6fa041d7f125db65f400af7f520a41ff78d19cd7 > Author: Wojciech Macek > AuthorDate: 2021-09-13 04:08:32 +0000 > Commit: Wojciech Macek > CommitDate: 2021-09-13 04:08:32 +0000 > > Measure latency of PMC interruptions > > Add HWPMC events to measure latency. > Provide sysctl to choose the number of outstanding events which > trigger HWPMC event. > > Obtained from: Semihalf > Sponsored by: Stormshield > Differential revision: https://reviews.freebsd.org/D31283 > --- > sys/kern/kern_intr.c | 58 > ++++++++++++++++++++++++++++++++++++++++++++++------ > 1 file changed, 52 insertions(+), 6 deletions(-) > > diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c > index 1660414a50ef..19401877dfbd 100644 > --- a/sys/kern/kern_intr.c > +++ b/sys/kern/kern_intr.c > @@ -30,6 +30,7 @@ > __FBSDID("$FreeBSD$"); > > #include "opt_ddb.h" > +#include "opt_hwpmc_hooks.h" > #include "opt_kstack_usage_prof.h" > > #include > @@ -75,6 +76,7 @@ struct intr_thread { > struct thread *it_thread; /* Kernel thread. */ > int it_flags; /* (j) IT_* flags. */ > int it_need; /* Needs service. */ > + int it_waiting; /* Waiting in the runq. */ > }; > > /* Interrupt thread flags kept in it_flags */ > @@ -100,13 +102,19 @@ SYSCTL_INT(_hw, OID_AUTO, intr_storm_threshold, > CTLFLAG_RWTUN, > static int intr_epoch_batch = 1000; > SYSCTL_INT(_hw, OID_AUTO, intr_epoch_batch, CTLFLAG_RWTUN, > &intr_epoch_batch, > 0, "Maximum interrupt handler executions without re-entering > epoch(9)"); > +#ifdef HWPMC_HOOKS > +static int intr_hwpmc_waiting_report_threshold = 1; > +SYSCTL_INT(_hw, OID_AUTO, intr_hwpmc_waiting_report_threshold, > CTLFLAG_RWTUN, > + &intr_hwpmc_waiting_report_threshold, 1, > + "Threshold for reporting number of events in a workq"); > +#endif > static TAILQ_HEAD(, intr_event) event_list = > TAILQ_HEAD_INITIALIZER(event_list); > static struct mtx event_lock; > MTX_SYSINIT(intr_event_list, &event_lock, "intr event list", MTX_DEF); > > static void intr_event_update(struct intr_event *ie); > -static int intr_event_schedule_thread(struct intr_event *ie); > +static int intr_event_schedule_thread(struct intr_event *ie, struct > trapframe *frame); > static struct intr_thread *ithread_create(const char *name); > static void ithread_destroy(struct intr_thread *ithread); > static void ithread_execute_handlers(struct proc *p, > @@ -115,6 +123,16 @@ static void ithread_loop(void *); > static void ithread_update(struct intr_thread *ithd); > static void start_softintr(void *); > > +#ifdef HWPMC_HOOKS > +#include > +PMC_SOFT_DEFINE( , , intr, all); > +PMC_SOFT_DEFINE( , , intr, ithread); > +PMC_SOFT_DEFINE( , , intr, filter); > +PMC_SOFT_DEFINE( , , intr, stray); > +PMC_SOFT_DEFINE( , , intr, schedule); > +PMC_SOFT_DEFINE( , , intr, waiting); > +#endif > + > /* Map an interrupt type to an ithread priority. */ > u_char > intr_priority(enum intr_type flags) > @@ -773,7 +791,7 @@ intr_handler_barrier(struct intr_handler *handler) > } > if ((handler->ih_flags & IH_CHANGED) == 0) { > handler->ih_flags |= IH_CHANGED; > - intr_event_schedule_thread(ie); > + intr_event_schedule_thread(ie, NULL); > } > while ((handler->ih_flags & IH_CHANGED) != 0) > msleep(handler, &ie->ie_lock, 0, "ih_barr", 0); > @@ -872,7 +890,7 @@ intr_event_remove_handler(void *cookie) > KASSERT((handler->ih_flags & IH_DEAD) == 0, > ("duplicate handle remove")); > handler->ih_flags |= IH_DEAD; > - intr_event_schedule_thread(ie); > + intr_event_schedule_thread(ie, NULL); > while (handler->ih_flags & IH_DEAD) > msleep(handler, &ie->ie_lock, 0, "iev_rmh", 0); > intr_event_update(ie); > @@ -944,7 +962,7 @@ intr_event_resume_handler(void *cookie) > } > > static int > -intr_event_schedule_thread(struct intr_event *ie) > +intr_event_schedule_thread(struct intr_event *ie, struct trapframe *frame) > { > struct intr_entropy entropy; > struct intr_thread *it; > @@ -986,11 +1004,28 @@ intr_event_schedule_thread(struct intr_event *ie) > atomic_store_rel_int(&it->it_need, 1); > thread_lock(td); > if (TD_AWAITING_INTR(td)) { > +#ifdef HWPMC_HOOKS > + atomic_set_int(&it->it_waiting, 0); atomic_set does not assign the passed value, it or's it. > + if (frame != NULL) > + PMC_SOFT_CALL_TF( , , intr, schedule, frame); > + else > + PMC_SOFT_CALL( , , intr, schedule); > +#endif > CTR3(KTR_INTR, "%s: schedule pid %d (%s)", __func__, td->td_proc->p_pid, > td->td_name); > TD_CLR_IWAIT(td); > sched_add(td, SRQ_INTR); > } else { > +#ifdef HWPMC_HOOKS > + atomic_add_int(&it->it_waiting, 1); Why is this using atomics to begin with? To my reading the field is de facto protected by thread lock, so you can just it->it_waiting++ > + > + if (atomic_load_int(&it->it_waiting) >= > intr_hwpmc_waiting_report_threshold) { The option is enabled by default but hwpmc itself is rarely loaded. Then this avoidable loads intr_hwpmc_waiting_report_threshold to begin with. Instead you can do something in the lines: #define PMC_HOOK_INSTALLED_ANY() __predict_false(pmc_hook != NULL) and use that to guard the other branches. Later on this will be hot patchable so it wont be a problem by default. > + if (frame != NULL) > + PMC_SOFT_CALL_TF( , , intr, waiting, frame); > + else > + PMC_SOFT_CALL( , , intr, waiting); > + } > +#endif > CTR5(KTR_INTR, "%s: pid %d (%s): it_need %d, state %d", > __func__, td->td_proc->p_pid, td->td_name, it->it_need, > TD_GET_STATE(td)); > thread_unlock(td); > @@ -1083,7 +1118,7 @@ swi_sched(void *cookie, int flags) > #endif > } else { > VM_CNT_INC(v_soft); > - error = intr_event_schedule_thread(ie); > + error = intr_event_schedule_thread(ie, NULL); > KASSERT(error == 0, ("stray software interrupt")); > } > } > @@ -1374,12 +1409,23 @@ intr_event_handle(struct intr_event *ie, struct > trapframe *frame) > ret = ih->ih_filter(frame); > else > ret = ih->ih_filter(ih->ih_argument); > +#ifdef HWPMC_HOOKS > + PMC_SOFT_CALL_TF( , , intr, all, frame); > +#endif > KASSERT(ret == FILTER_STRAY || > ((ret & (FILTER_SCHEDULE_THREAD | FILTER_HANDLED)) != 0 && > (ret & ~(FILTER_SCHEDULE_THREAD | FILTER_HANDLED)) == 0), > ("%s: incorrect return value %#x from %s", __func__, ret, > ih->ih_name)); > filter = filter || ret == FILTER_HANDLED; > +#ifdef HWPMC_HOOKS > + if (ret & FILTER_SCHEDULE_THREAD) > + PMC_SOFT_CALL_TF( , , intr, ithread, frame); > + else if (ret & FILTER_HANDLED) > + PMC_SOFT_CALL_TF( , , intr, filter, frame); > + else if (ret == FILTER_STRAY) > + PMC_SOFT_CALL_TF( , , intr, stray, frame); > +#endif > > /* > * Wrapper handler special handling: > @@ -1416,7 +1462,7 @@ intr_event_handle(struct intr_event *ie, struct > trapframe *frame) > if (thread) { > int error __unused; > > - error = intr_event_schedule_thread(ie); > + error = intr_event_schedule_thread(ie, frame); > KASSERT(error == 0, ("bad stray interrupt")); > } > critical_exit(); > -- Mateusz Guzik From owner-dev-commits-src-all@freebsd.org Mon Sep 13 08:01:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E16C677456; Mon, 13 Sep 2021 08:01:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7Jpk2CXbz4YQv; Mon, 13 Sep 2021 08:01:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DC2F237EA; Mon, 13 Sep 2021 08:01:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18D81oA2012721; Mon, 13 Sep 2021 08:01:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18D81odG012720; Mon, 13 Sep 2021 08:01:50 GMT (envelope-from git) Date: Mon, 13 Sep 2021 08:01:50 GMT Message-Id: <202109130801.18D81odG012720@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wojciech Macek Subject: git: d00c1f7f2f4a - main - sdhci: add sysctls to dump sdhci registers and capabilites MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wma X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d00c1f7f2f4a811d5c756cbb0d585c56661839f7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 08:01:50 -0000 The branch main has been updated by wma: URL: https://cgit.FreeBSD.org/src/commit/?id=d00c1f7f2f4a811d5c756cbb0d585c56661839f7 commit d00c1f7f2f4a811d5c756cbb0d585c56661839f7 Author: Bartlomiej Grzesik AuthorDate: 2021-09-13 08:00:25 +0000 Commit: Wojciech Macek CommitDate: 2021-09-13 08:00:25 +0000 sdhci: add sysctls to dump sdhci registers and capabilites Add sysctls dev.sdhci.X.slotY.dumpregs and dev.sdhci.X.slotY.dumpcaps which dumps sdhci registers or capabilities. Obtained from: Semihalf Reviewed by: mw Differential revision: https://reviews.freebsd.org/D31406 --- sys/dev/sdhci/sdhci.c | 223 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 165 insertions(+), 58 deletions(-) diff --git a/sys/dev/sdhci/sdhci.c b/sys/dev/sdhci/sdhci.c index 573e6949b57e..09df5e972ab6 100644 --- a/sys/dev/sdhci/sdhci.c +++ b/sys/dev/sdhci/sdhci.c @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -134,11 +135,18 @@ static int sdhci_cam_update_ios(struct sdhci_slot *slot); /* helper routines */ static int sdhci_dma_alloc(struct sdhci_slot *slot, uint32_t caps); static void sdhci_dma_free(struct sdhci_slot *slot); +static void sdhci_dumpcaps(struct sdhci_slot *slot); +static void sdhci_dumpcaps_buf(struct sdhci_slot *slot, struct sbuf *s); static void sdhci_dumpregs(struct sdhci_slot *slot); +static void sdhci_dumpregs_buf(struct sdhci_slot *slot, struct sbuf *s); +static int sdhci_syctl_dumpcaps(SYSCTL_HANDLER_ARGS); +static int sdhci_syctl_dumpregs(SYSCTL_HANDLER_ARGS); static void sdhci_getaddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error); static int slot_printf(const struct sdhci_slot *slot, const char * fmt, ...) __printflike(2, 3); +static int slot_sprintf(const struct sdhci_slot *slot, struct sbuf *s, + const char * fmt, ...) __printflike(3, 4); static uint32_t sdhci_tuning_intmask(const struct sdhci_slot *slot); #define SDHCI_LOCK(_slot) mtx_lock(&(_slot)->mtx) @@ -202,40 +210,156 @@ slot_printf(const struct sdhci_slot *slot, const char * fmt, ...) return (retval); } -static void -sdhci_dumpregs(struct sdhci_slot *slot) +static int +slot_sprintf(const struct sdhci_slot *slot, struct sbuf *s, + const char * fmt, ...) { + va_list ap; + int retval; - slot_printf(slot, - "============== REGISTER DUMP ==============\n"); + retval = sbuf_printf(s, "%s-slot%d: ", device_get_nameunit(slot->bus), slot->num); - slot_printf(slot, "Sys addr: 0x%08x | Version: 0x%08x\n", + va_start(ap, fmt); + retval += sbuf_vprintf(s, fmt, ap); + va_end(ap); + + return (retval); +} + +static void +sdhci_dumpregs_buf(struct sdhci_slot *slot, struct sbuf *s) +{ + slot_sprintf(slot, s, "============== REGISTER DUMP ==============\n"); + + slot_sprintf(slot, s, "Sys addr: 0x%08x | Version: 0x%08x\n", RD4(slot, SDHCI_DMA_ADDRESS), RD2(slot, SDHCI_HOST_VERSION)); - slot_printf(slot, "Blk size: 0x%08x | Blk cnt: 0x%08x\n", + slot_sprintf(slot, s, "Blk size: 0x%08x | Blk cnt: 0x%08x\n", RD2(slot, SDHCI_BLOCK_SIZE), RD2(slot, SDHCI_BLOCK_COUNT)); - slot_printf(slot, "Argument: 0x%08x | Trn mode: 0x%08x\n", + slot_sprintf(slot, s, "Argument: 0x%08x | Trn mode: 0x%08x\n", RD4(slot, SDHCI_ARGUMENT), RD2(slot, SDHCI_TRANSFER_MODE)); - slot_printf(slot, "Present: 0x%08x | Host ctl: 0x%08x\n", + slot_sprintf(slot, s, "Present: 0x%08x | Host ctl: 0x%08x\n", RD4(slot, SDHCI_PRESENT_STATE), RD1(slot, SDHCI_HOST_CONTROL)); - slot_printf(slot, "Power: 0x%08x | Blk gap: 0x%08x\n", + slot_sprintf(slot, s, "Power: 0x%08x | Blk gap: 0x%08x\n", RD1(slot, SDHCI_POWER_CONTROL), RD1(slot, SDHCI_BLOCK_GAP_CONTROL)); - slot_printf(slot, "Wake-up: 0x%08x | Clock: 0x%08x\n", + slot_sprintf(slot, s, "Wake-up: 0x%08x | Clock: 0x%08x\n", RD1(slot, SDHCI_WAKE_UP_CONTROL), RD2(slot, SDHCI_CLOCK_CONTROL)); - slot_printf(slot, "Timeout: 0x%08x | Int stat: 0x%08x\n", + slot_sprintf(slot, s, "Timeout: 0x%08x | Int stat: 0x%08x\n", RD1(slot, SDHCI_TIMEOUT_CONTROL), RD4(slot, SDHCI_INT_STATUS)); - slot_printf(slot, "Int enab: 0x%08x | Sig enab: 0x%08x\n", + slot_sprintf(slot, s, "Int enab: 0x%08x | Sig enab: 0x%08x\n", RD4(slot, SDHCI_INT_ENABLE), RD4(slot, SDHCI_SIGNAL_ENABLE)); - slot_printf(slot, "AC12 err: 0x%08x | Host ctl2:0x%08x\n", + slot_sprintf(slot, s, "AC12 err: 0x%08x | Host ctl2:0x%08x\n", RD2(slot, SDHCI_ACMD12_ERR), RD2(slot, SDHCI_HOST_CONTROL2)); - slot_printf(slot, "Caps: 0x%08x | Caps2: 0x%08x\n", + slot_sprintf(slot, s, "Caps: 0x%08x | Caps2: 0x%08x\n", RD4(slot, SDHCI_CAPABILITIES), RD4(slot, SDHCI_CAPABILITIES2)); - slot_printf(slot, "Max curr: 0x%08x | ADMA err: 0x%08x\n", + slot_sprintf(slot, s, "Max curr: 0x%08x | ADMA err: 0x%08x\n", RD4(slot, SDHCI_MAX_CURRENT), RD1(slot, SDHCI_ADMA_ERR)); - slot_printf(slot, "ADMA addr:0x%08x | Slot int: 0x%08x\n", + slot_sprintf(slot, s, "ADMA addr:0x%08x | Slot int: 0x%08x\n", RD4(slot, SDHCI_ADMA_ADDRESS_LO), RD2(slot, SDHCI_SLOT_INT_STATUS)); - slot_printf(slot, - "===========================================\n"); + slot_sprintf(slot, s, "===========================================\n"); +} + +static void +sdhci_dumpregs(struct sdhci_slot *slot) +{ + struct sbuf s; + + sbuf_new(&s, NULL, 1024, SBUF_AUTOEXTEND); + sbuf_set_drain(&s, &sbuf_printf_drain, NULL); + sdhci_dumpregs_buf(slot, &s); + sbuf_finish(&s); + sbuf_delete(&s); +} + +static int +sdhci_syctl_dumpregs(SYSCTL_HANDLER_ARGS) +{ + struct sdhci_slot *slot = arg1; + struct sbuf s; + + sbuf_new_for_sysctl(&s, NULL, 1024, req); + sbuf_putc(&s, '\n'); + sdhci_dumpregs_buf(slot, &s); + sbuf_finish(&s); + sbuf_delete(&s); + + return (0); +} + +static void +sdhci_dumpcaps_buf(struct sdhci_slot *slot, struct sbuf *s) +{ + int host_caps = slot->host.caps; + int caps = slot->caps; + + slot_sprintf(slot, s, + "%uMHz%s %s VDD:%s%s%s VCCQ: 3.3V%s%s DRV: B%s%s%s %s %s\n", + slot->max_clk / 1000000, + (caps & SDHCI_CAN_DO_HISPD) ? " HS" : "", + (host_caps & MMC_CAP_8_BIT_DATA) ? "8bits" : + ((host_caps & MMC_CAP_4_BIT_DATA) ? "4bits" : "1bit"), + (caps & SDHCI_CAN_VDD_330) ? " 3.3V" : "", + (caps & SDHCI_CAN_VDD_300) ? " 3.0V" : "", + ((caps & SDHCI_CAN_VDD_180) && + (slot->opt & SDHCI_SLOT_EMBEDDED)) ? " 1.8V" : "", + (host_caps & MMC_CAP_SIGNALING_180) ? " 1.8V" : "", + (host_caps & MMC_CAP_SIGNALING_120) ? " 1.2V" : "", + (host_caps & MMC_CAP_DRIVER_TYPE_A) ? "A" : "", + (host_caps & MMC_CAP_DRIVER_TYPE_C) ? "C" : "", + (host_caps & MMC_CAP_DRIVER_TYPE_D) ? "D" : "", + (slot->opt & SDHCI_HAVE_DMA) ? "DMA" : "PIO", + (slot->opt & SDHCI_SLOT_EMBEDDED) ? "embedded" : + (slot->opt & SDHCI_NON_REMOVABLE) ? "non-removable" : + "removable"); + if (host_caps & (MMC_CAP_MMC_DDR52 | MMC_CAP_MMC_HS200 | + MMC_CAP_MMC_HS400 | MMC_CAP_MMC_ENH_STROBE)) + slot_sprintf(slot, s, "eMMC:%s%s%s%s\n", + (host_caps & MMC_CAP_MMC_DDR52) ? " DDR52" : "", + (host_caps & MMC_CAP_MMC_HS200) ? " HS200" : "", + (host_caps & MMC_CAP_MMC_HS400) ? " HS400" : "", + ((host_caps & + (MMC_CAP_MMC_HS400 | MMC_CAP_MMC_ENH_STROBE)) == + (MMC_CAP_MMC_HS400 | MMC_CAP_MMC_ENH_STROBE)) ? + " HS400ES" : ""); + if (host_caps & (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 | + MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR104)) + slot_sprintf(slot, s, "UHS-I:%s%s%s%s%s\n", + (host_caps & MMC_CAP_UHS_SDR12) ? " SDR12" : "", + (host_caps & MMC_CAP_UHS_SDR25) ? " SDR25" : "", + (host_caps & MMC_CAP_UHS_SDR50) ? " SDR50" : "", + (host_caps & MMC_CAP_UHS_SDR104) ? " SDR104" : "", + (host_caps & MMC_CAP_UHS_DDR50) ? " DDR50" : ""); + if (slot->opt & SDHCI_TUNING_SUPPORTED) + slot_sprintf(slot, s, + "Re-tuning count %d secs, mode %d\n", + slot->retune_count, slot->retune_mode + 1); +} + +static void +sdhci_dumpcaps(struct sdhci_slot *slot) +{ + struct sbuf s; + + sbuf_new(&s, NULL, 1024, SBUF_AUTOEXTEND); + sbuf_set_drain(&s, &sbuf_printf_drain, NULL); + sdhci_dumpcaps_buf(slot, &s); + sbuf_finish(&s); + sbuf_delete(&s); +} + +static int +sdhci_syctl_dumpcaps(SYSCTL_HANDLER_ARGS) +{ + struct sdhci_slot *slot = arg1; + struct sbuf s; + + sbuf_new_for_sysctl(&s, NULL, 1024, req); + sbuf_putc(&s, '\n'); + sdhci_dumpcaps_buf(slot, &s); + sbuf_finish(&s); + sbuf_delete(&s); + + return (0); } static void @@ -799,6 +923,8 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, int num) kobj_method_t *kobj_method; uint32_t caps, caps2, freq, host_caps; int err; + char node_name[8]; + struct sysctl_oid *node_oid; SDHCI_LOCK_INIT(slot); @@ -1047,46 +1173,7 @@ no_tuning: } if (bootverbose || sdhci_debug) { - slot_printf(slot, - "%uMHz%s %s VDD:%s%s%s VCCQ: 3.3V%s%s DRV: B%s%s%s %s %s\n", - slot->max_clk / 1000000, - (caps & SDHCI_CAN_DO_HISPD) ? " HS" : "", - (host_caps & MMC_CAP_8_BIT_DATA) ? "8bits" : - ((host_caps & MMC_CAP_4_BIT_DATA) ? "4bits" : "1bit"), - (caps & SDHCI_CAN_VDD_330) ? " 3.3V" : "", - (caps & SDHCI_CAN_VDD_300) ? " 3.0V" : "", - ((caps & SDHCI_CAN_VDD_180) && - (slot->opt & SDHCI_SLOT_EMBEDDED)) ? " 1.8V" : "", - (host_caps & MMC_CAP_SIGNALING_180) ? " 1.8V" : "", - (host_caps & MMC_CAP_SIGNALING_120) ? " 1.2V" : "", - (host_caps & MMC_CAP_DRIVER_TYPE_A) ? "A" : "", - (host_caps & MMC_CAP_DRIVER_TYPE_C) ? "C" : "", - (host_caps & MMC_CAP_DRIVER_TYPE_D) ? "D" : "", - (slot->opt & SDHCI_HAVE_DMA) ? "DMA" : "PIO", - (slot->opt & SDHCI_SLOT_EMBEDDED) ? "embedded" : - (slot->opt & SDHCI_NON_REMOVABLE) ? "non-removable" : - "removable"); - if (host_caps & (MMC_CAP_MMC_DDR52 | MMC_CAP_MMC_HS200 | - MMC_CAP_MMC_HS400 | MMC_CAP_MMC_ENH_STROBE)) - slot_printf(slot, "eMMC:%s%s%s%s\n", - (host_caps & MMC_CAP_MMC_DDR52) ? " DDR52" : "", - (host_caps & MMC_CAP_MMC_HS200) ? " HS200" : "", - (host_caps & MMC_CAP_MMC_HS400) ? " HS400" : "", - ((host_caps & - (MMC_CAP_MMC_HS400 | MMC_CAP_MMC_ENH_STROBE)) == - (MMC_CAP_MMC_HS400 | MMC_CAP_MMC_ENH_STROBE)) ? - " HS400ES" : ""); - if (host_caps & (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 | - MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR104)) - slot_printf(slot, "UHS-I:%s%s%s%s%s\n", - (host_caps & MMC_CAP_UHS_SDR12) ? " SDR12" : "", - (host_caps & MMC_CAP_UHS_SDR25) ? " SDR25" : "", - (host_caps & MMC_CAP_UHS_SDR50) ? " SDR50" : "", - (host_caps & MMC_CAP_UHS_SDR104) ? " SDR104" : "", - (host_caps & MMC_CAP_UHS_DDR50) ? " DDR50" : ""); - if (slot->opt & SDHCI_TUNING_SUPPORTED) - slot_printf(slot, "Re-tuning count %d secs, mode %d\n", - slot->retune_count, slot->retune_mode + 1); + sdhci_dumpcaps(slot); sdhci_dumpregs(slot); } @@ -1110,6 +1197,26 @@ no_tuning: sdhci_init(slot); + snprintf(node_name, sizeof(node_name), "slot%d", slot->num); + + node_oid = SYSCTL_ADD_NODE(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, node_name, CTLFLAG_RW, 0, "slot specific node"); + + node_oid = SYSCTL_ADD_NODE(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(node_oid), OID_AUTO, "debug", CTLFLAG_RW, 0, + "Debugging node"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(node_oid), + OID_AUTO, "dumpregs", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + slot, 0, &sdhci_syctl_dumpregs, + "A", "Dump SDHCI registers"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(node_oid), + OID_AUTO, "dumpcaps", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, + slot, 0, &sdhci_syctl_dumpcaps, + "A", "Dump SDHCI capabilites"); + return (0); } From owner-dev-commits-src-all@freebsd.org Mon Sep 13 08:57:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 554A7677CDD; Mon, 13 Sep 2021 08:57:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7L2d1yHnz4p1Q; Mon, 13 Sep 2021 08:57:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 22E5724456; Mon, 13 Sep 2021 08:57:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18D8vDmO079374; Mon, 13 Sep 2021 08:57:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18D8vDnb079373; Mon, 13 Sep 2021 08:57:13 GMT (envelope-from git) Date: Mon, 13 Sep 2021 08:57:13 GMT Message-Id: <202109130857.18D8vDnb079373@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: ddd74e40e27d - main - stress2: Added missing unmount MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ddd74e40e27db29494e9591b837c2a01b543ef80 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 08:57:13 -0000 The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=ddd74e40e27db29494e9591b837c2a01b543ef80 commit ddd74e40e27db29494e9591b837c2a01b543ef80 Author: Peter Holm AuthorDate: 2021-09-13 08:55:19 +0000 Commit: Peter Holm CommitDate: 2021-09-13 08:55:19 +0000 stress2: Added missing unmount --- tools/test/stress2/misc/unionfs.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/test/stress2/misc/unionfs.sh b/tools/test/stress2/misc/unionfs.sh index dbf3ba0fbc2e..6e04e809b501 100755 --- a/tools/test/stress2/misc/unionfs.sh +++ b/tools/test/stress2/misc/unionfs.sh @@ -45,8 +45,10 @@ mount -t unionfs -o noatime $mntpoint /tmp export RUNDIR=/tmp/stressX export runRUNTIME=10m # Run tests for 10 minutes (cd ..; ./run.sh disk.cfg) +umount /tmp while mount | grep $mntpoint | grep -q /dev/md; do umount $mntpoint || sleep 1 done mdconfig -d -u $mdstart rm -f $diskimage +exit 0 From owner-dev-commits-src-all@freebsd.org Mon Sep 13 08:57:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 992A4677C31; Mon, 13 Sep 2021 08:57:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7L2f2yXkz4p8S; Mon, 13 Sep 2021 08:57:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F859244E0; Mon, 13 Sep 2021 08:57:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18D8vE6D079398; Mon, 13 Sep 2021 08:57:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18D8vElp079397; Mon, 13 Sep 2021 08:57:14 GMT (envelope-from git) Date: Mon, 13 Sep 2021 08:57:14 GMT Message-Id: <202109130857.18D8vElp079397@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: 89379af43f11 - main - stress2: Update test to the sysctl 'vfs.lookup_shared' being removed MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 89379af43f110243788ee1bd63506223d5858c0b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 08:57:14 -0000 The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=89379af43f110243788ee1bd63506223d5858c0b commit 89379af43f110243788ee1bd63506223d5858c0b Author: Peter Holm AuthorDate: 2021-09-13 08:56:06 +0000 Commit: Peter Holm CommitDate: 2021-09-13 08:56:06 +0000 stress2: Update test to the sysctl 'vfs.lookup_shared' being removed --- tools/test/stress2/misc/unionfs2.sh | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/tools/test/stress2/misc/unionfs2.sh b/tools/test/stress2/misc/unionfs2.sh index 7af786ae9ce4..29e1847714c8 100755 --- a/tools/test/stress2/misc/unionfs2.sh +++ b/tools/test/stress2/misc/unionfs2.sh @@ -28,19 +28,15 @@ [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 -saved=`sysctl vfs.lookup_shared | awk '{print $NF}'` -for i in 1 0; do - sysctl vfs.lookup_shared=$i - [ -d /var/tmp/unionfs ] || mkdir -p /var/tmp/unionfs - mount_unionfs /var/tmp/unionfs /tmp/stressX +[ -d /var/tmp/unionfs ] || mkdir -p /var/tmp/unionfs +mount_unionfs /var/tmp/unionfs /tmp/stressX - export RUNDIR=/var/tmp/unionfs/stressX - export runRUNTIME=10m # Run tests for 10 minutes - (cd ..; ./run.sh disk.cfg) - false - while mount | grep -q /unionfs; do - umount /tmp/stressX > /dev/null 2>&1 - done - rm -rf /var/tmp/unionfs +export RUNDIR=/var/tmp/unionfs/stressX +export runRUNTIME=10m # Run tests for 10 minutes +(cd ..; ./run.sh disk.cfg) +false +while mount | grep -q /unionfs; do + umount /tmp/stressX > /dev/null 2>&1 done -sysctl vfs.lookup_shared=$saved +rm -rf /var/tmp/unionfs +exit 0 From owner-dev-commits-src-all@freebsd.org Mon Sep 13 09:33:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 19FCF67852D; Mon, 13 Sep 2021 09:33:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7LrQ74nHz3DVD; Mon, 13 Sep 2021 09:33:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D342C24BA5; Mon, 13 Sep 2021 09:33:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18D9XQiT032485; Mon, 13 Sep 2021 09:33:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18D9XQqg032484; Mon, 13 Sep 2021 09:33:26 GMT (envelope-from git) Date: Mon, 13 Sep 2021 09:33:26 GMT Message-Id: <202109130933.18D9XQqg032484@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: d7d962ead0b6 - main - Add a test for https://reviews.freebsd.org/D31858 (PR 258310) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d7d962ead0b6e5e8a39202d0590022082bf5bfb6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 09:33:27 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=d7d962ead0b6e5e8a39202d0590022082bf5bfb6 commit d7d962ead0b6e5e8a39202d0590022082bf5bfb6 Author: Alex Richardson AuthorDate: 2021-09-13 09:16:05 +0000 Commit: Alex Richardson CommitDate: 2021-09-13 09:16:05 +0000 Add a test for https://reviews.freebsd.org/D31858 (PR 258310) This test (based on https://github.com/jiixyj/epoll-shim/pull/32#issuecomment-891276654) fails reproducibly on QEMU with KVM and `-smp 2` prior to D31858 (committed as 98168a6e6c12dab8f608f6b5f5b0b175d2b87ef0) and passes with the patch applied. Reviewed By: kib, imp Differential Revision: https://reviews.freebsd.org/D31862 --- tests/sys/kqueue/Makefile | 2 + tests/sys/kqueue/kqueue_peek_signal.c | 106 ++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+) diff --git a/tests/sys/kqueue/Makefile b/tests/sys/kqueue/Makefile index 40f892d36fbd..1bf13772f0f2 100644 --- a/tests/sys/kqueue/Makefile +++ b/tests/sys/kqueue/Makefile @@ -5,6 +5,8 @@ TESTSRC= ${SRCTOP}/contrib/netbsd-tests/kernel/kqueue TESTSDIR= ${TESTSBASE}/sys/kqueue BINDIR= ${TESTSDIR} +ATF_TESTS_C+= kqueue_peek_signal + NETBSD_ATF_TESTS_C= proc1_test # XXX: fails `ke.fflags & NOTE_TRACKERR` invariant #NETBSD_ATF_TESTS_C+= proc2_test diff --git a/tests/sys/kqueue/kqueue_peek_signal.c b/tests/sys/kqueue/kqueue_peek_signal.c new file mode 100644 index 000000000000..16dbce68a57c --- /dev/null +++ b/tests/sys/kqueue/kqueue_peek_signal.c @@ -0,0 +1,106 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright 2021 Jan Kokemüller + * Copyright 2021 Alex Richardson + * + * This work was supported by Innovate UK project 105694, "Digital Security by + * Design (DSbD) Technology Platform Prototype". + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include +#include + +#include +#include +#include + +ATF_TC_WITHOUT_HEAD(main); + +ATF_TC_BODY(main, tc) +{ + int rv; + + sigset_t set; + rv = sigemptyset(&set); + ATF_REQUIRE_EQ(0, rv); + rv = sigaddset(&set, SIGUSR1); + ATF_REQUIRE_EQ(0, rv); + rv = sigprocmask(SIG_BLOCK, &set, NULL); + ATF_REQUIRE_EQ(0, rv); + + int skq = kqueue(); + ATF_REQUIRE(skq >= 0); + + struct kevent kev; + EV_SET(&kev, SIGUSR1, EVFILT_SIGNAL, EV_ADD, 0, 0, 0); + rv = kevent(skq, &kev, 1, NULL, 0, NULL); + ATF_REQUIRE_EQ(0, rv); + + int kq = kqueue(); + ATF_REQUIRE(kq >= 0); + + EV_SET(&kev, skq, EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, 0); + rv = kevent(kq, &kev, 1, NULL, 0, NULL); + ATF_REQUIRE_EQ(0, rv); + + /* + * It was previously not guaranteed that sending a signal to self would + * be immediately visible in the nested kqueue activation with a zero + * timeout. As of https://reviews.freebsd.org/D31858, the kqueue task + * queue will be processed in this case, so we are guaranteed to see the + * SIGUSR1 here even with a zero timeout. We run the code below in a + * loop to make it more likely that older kernels without the fix fail + * this test. + */ + for (int i = 0; i < 100; i++) { + rv = kill(getpid(), SIGUSR1); + ATF_REQUIRE_EQ(0, rv); + + rv = kevent(kq, NULL, 0, &kev, 1, &(struct timespec) { 0, 0 }); + ATF_REQUIRE_EQ_MSG(1, rv, + "Unexpected result %d from kevent() after %d iterations", + rv, i); + rv = kevent(kq, NULL, 0, &kev, 1, &(struct timespec) { 0, 0 }); + ATF_REQUIRE_EQ(0, rv); + + rv = kevent(skq, NULL, 0, &kev, 1, &(struct timespec) { 0, 0 }); + ATF_REQUIRE_EQ(1, rv); + rv = kevent(skq, NULL, 0, &kev, 1, &(struct timespec) { 0, 0 }); + ATF_REQUIRE_EQ(0, rv); + + siginfo_t siginfo; + rv = sigtimedwait(&set, &siginfo, &(struct timespec) { 0, 0 }); + ATF_REQUIRE_EQ(SIGUSR1, rv); + + rv = sigtimedwait(&set, &siginfo, &(struct timespec) { 0, 0 }); + ATF_REQUIRE_ERRNO(EAGAIN, rv < 0); + } +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, main); + + return (atf_no_error()); +} From owner-dev-commits-src-all@freebsd.org Mon Sep 13 09:37:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1BC00678247; Mon, 13 Sep 2021 09:37:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7Lwz0HpZz3FPV; Mon, 13 Sep 2021 09:37:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DEBC8249A8; Mon, 13 Sep 2021 09:37:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18D9bMKO032882; Mon, 13 Sep 2021 09:37:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18D9bMjp032881; Mon, 13 Sep 2021 09:37:22 GMT (envelope-from git) Date: Mon, 13 Sep 2021 09:37:22 GMT Message-Id: <202109130937.18D9bMjp032881@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wojciech Macek Subject: git: 1e1253510ab4 - main - e6000sw: Use taskqueue subsytem for MDIO polling MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wma X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1e1253510ab434484472ee2a4ce94426d18f3764 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 09:37:23 -0000 The branch main has been updated by wma: URL: https://cgit.FreeBSD.org/src/commit/?id=1e1253510ab434484472ee2a4ce94426d18f3764 commit 1e1253510ab434484472ee2a4ce94426d18f3764 Author: Hubert Mazur AuthorDate: 2021-09-13 09:35:51 +0000 Commit: Wojciech Macek CommitDate: 2021-09-13 09:37:11 +0000 e6000sw: Use taskqueue subsytem for MDIO polling Previosuly the link status was pooled in an infinite loop in a separate kproc. Use taskqueue subsytem instead. This is a prequisite for making this driver work as a loadable module. Obtained from: Semihalf Differential revision: https://reviews.freebsd.org/D31579 --- sys/dev/etherswitch/e6000sw/e6000sw.c | 65 ++++++++++++++++++++--------------- 1 file changed, 38 insertions(+), 27 deletions(-) diff --git a/sys/dev/etherswitch/e6000sw/e6000sw.c b/sys/dev/etherswitch/e6000sw/e6000sw.c index 4803e200e8fb..e6c76c578d14 100644 --- a/sys/dev/etherswitch/e6000sw/e6000sw.c +++ b/sys/dev/etherswitch/e6000sw/e6000sw.c @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -79,7 +80,8 @@ typedef struct e6000sw_softc { struct ifnet *ifp[E6000SW_MAX_PORTS]; char *ifname[E6000SW_MAX_PORTS]; device_t miibus[E6000SW_MAX_PORTS]; - struct proc *kproc; + struct taskqueue *sc_tq; + struct timeout_task sc_tt; int vlans[E6000SW_NUM_VLANS]; uint32_t swid; @@ -127,7 +129,7 @@ static int e6000sw_setvgroup_wrapper(device_t, etherswitch_vlangroup_t *); static int e6000sw_setvgroup(device_t, etherswitch_vlangroup_t *); static int e6000sw_getvgroup(device_t, etherswitch_vlangroup_t *); static void e6000sw_setup(device_t, e6000sw_softc_t *); -static void e6000sw_tick(void *); +static void e6000sw_tick(void *, int); static void e6000sw_set_atustat(device_t, e6000sw_softc_t *, int, int); static int e6000sw_atu_flush(device_t, e6000sw_softc_t *, int); static int e6000sw_vtu_flush(e6000sw_softc_t *); @@ -450,8 +452,13 @@ e6000sw_attach(device_t dev) E6000SW_LOCK(sc); e6000sw_setup(dev, sc); - ports = ofw_bus_find_child(sc->node, "ports"); + sc->sc_tq = taskqueue_create("e6000sw_taskq", M_NOWAIT, + taskqueue_thread_enqueue, &sc->sc_tq); + + TIMEOUT_TASK_INIT(sc->sc_tq, &sc->sc_tt, 0, e6000sw_tick, sc); + taskqueue_start_threads(&sc->sc_tq, 1, PI_NET, "%s taskq", + device_get_nameunit(dev)); if (ports == 0) { device_printf(dev, "failed to parse DTS: no ports found for " @@ -544,7 +551,7 @@ e6000sw_attach(device_t dev) bus_generic_probe(dev); bus_generic_attach(dev); - kproc_create(e6000sw_tick, sc, &sc->kproc, 0, 0, "e6000sw tick kproc"); + taskqueue_enqueue_timeout(sc->sc_tq, &sc->sc_tt, hz); return (0); @@ -711,6 +718,13 @@ e6000sw_detach(device_t dev) e6000sw_softc_t *sc; sc = device_get_softc(dev); + + if (device_is_attached(dev)) + taskqueue_drain_timeout(sc->sc_tq, &sc->sc_tt); + + if (sc->sc_tq != NULL) + taskqueue_free(sc->sc_tq); + bus_generic_detach(dev); sx_destroy(&sc->sx); for (phy = 0; phy < sc->num_ports; phy++) { @@ -1460,7 +1474,7 @@ e6000sw_update_ifmedia(uint16_t portstatus, u_int *media_status, u_int *media_ac } static void -e6000sw_tick(void *arg) +e6000sw_tick(void *arg, int p __unused) { e6000sw_softc_t *sc; struct mii_data *mii; @@ -1472,34 +1486,31 @@ e6000sw_tick(void *arg) E6000SW_LOCK_ASSERT(sc, SA_UNLOCKED); - for (;;) { - E6000SW_LOCK(sc); - for (port = 0; port < sc->num_ports; port++) { - /* Tick only on PHY ports */ - if (!e6000sw_is_portenabled(sc, port) || - !e6000sw_is_phyport(sc, port)) - continue; + E6000SW_LOCK(sc); + for (port = 0; port < sc->num_ports; port++) { + /* Tick only on PHY ports */ + if (!e6000sw_is_portenabled(sc, port) || + !e6000sw_is_phyport(sc, port)) + continue; - mii = e6000sw_miiforphy(sc, port); - if (mii == NULL) - continue; + mii = e6000sw_miiforphy(sc, port); + if (mii == NULL) + continue; - portstatus = e6000sw_readreg(sc, REG_PORT(sc, port), - PORT_STATUS); + portstatus = e6000sw_readreg(sc, REG_PORT(sc, port), + PORT_STATUS); - e6000sw_update_ifmedia(portstatus, - &mii->mii_media_status, &mii->mii_media_active); + e6000sw_update_ifmedia(portstatus, + &mii->mii_media_status, &mii->mii_media_active); - LIST_FOREACH(miisc, &mii->mii_phys, mii_list) { - if (IFM_INST(mii->mii_media.ifm_cur->ifm_media) - != miisc->mii_inst) - continue; - mii_phy_update(miisc, MII_POLLSTAT); - } + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) { + if (IFM_INST(mii->mii_media.ifm_cur->ifm_media) + != miisc->mii_inst) + continue; + mii_phy_update(miisc, MII_POLLSTAT); } - E6000SW_UNLOCK(sc); - pause("e6000sw tick", 1000); } + E6000SW_UNLOCK(sc); } static void From owner-dev-commits-src-all@freebsd.org Mon Sep 13 09:43:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC856678B06; Mon, 13 Sep 2021 09:43:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7M3b4mzjz3Gyn; Mon, 13 Sep 2021 09:43:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 83B51249CC; Mon, 13 Sep 2021 09:43:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18D9h7Cr045528; Mon, 13 Sep 2021 09:43:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18D9h7ai045527; Mon, 13 Sep 2021 09:43:07 GMT (envelope-from git) Date: Mon, 13 Sep 2021 09:43:07 GMT Message-Id: <202109130943.18D9h7ai045527@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wojciech Macek Subject: git: ee1b7811a3e1 - main - e6000sw: Build the driver as a kernel module MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wma X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ee1b7811a3e19633aad02eab8bc81eae2ccbd8af Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 09:43:07 -0000 The branch main has been updated by wma: URL: https://cgit.FreeBSD.org/src/commit/?id=ee1b7811a3e19633aad02eab8bc81eae2ccbd8af commit ee1b7811a3e19633aad02eab8bc81eae2ccbd8af Author: Hubert Mazur AuthorDate: 2021-09-13 09:42:16 +0000 Commit: Wojciech Macek CommitDate: 2021-09-13 09:42:16 +0000 e6000sw: Build the driver as a kernel module Fix detach routine. Driver was tested on EspressoBin. Remove it from GENERIC, since now it can be loaded automatically. Obtained from: Semihalf Reviewed by: manu Differential revision: https://reviews.freebsd.org/D31580 --- sys/arm64/conf/std.marvell | 1 - sys/dev/etherswitch/e6000sw/e6000sw.c | 75 ++++++++++++++--------------------- sys/modules/Makefile | 2 + sys/modules/e6000sw/Makefile | 10 +++++ 4 files changed, 41 insertions(+), 47 deletions(-) diff --git a/sys/arm64/conf/std.marvell b/sys/arm64/conf/std.marvell index d6437a426d48..cb49d8aedc2b 100644 --- a/sys/arm64/conf/std.marvell +++ b/sys/arm64/conf/std.marvell @@ -42,7 +42,6 @@ device neta # Marvell Armada 370/38x/XP/3700 NIC # Etherswitch devices device etherswitch # Enable etherswitch support device miiproxy # Required for etherswitch -device e6000sw # Marvell mv88e6085 based switches # USB support device ehci_mv # Marvell EHCI USB interface diff --git a/sys/dev/etherswitch/e6000sw/e6000sw.c b/sys/dev/etherswitch/e6000sw/e6000sw.c index e6c76c578d14..68caf61f9358 100644 --- a/sys/dev/etherswitch/e6000sw/e6000sw.c +++ b/sys/dev/etherswitch/e6000sw/e6000sw.c @@ -122,8 +122,6 @@ static int e6000sw_setport(device_t, etherswitch_port_t *); static int e6000sw_set_vlan_mode(e6000sw_softc_t *, uint32_t); static int e6000sw_readreg_wrapper(device_t, int); static int e6000sw_writereg_wrapper(device_t, int, int); -static int e6000sw_readphy_wrapper(device_t, int, int); -static int e6000sw_writephy_wrapper(device_t, int, int, int); static int e6000sw_getvgroup_wrapper(device_t, etherswitch_vlangroup_t *); static int e6000sw_setvgroup_wrapper(device_t, etherswitch_vlangroup_t *); static int e6000sw_setvgroup(device_t, etherswitch_vlangroup_t *); @@ -174,8 +172,8 @@ static device_method_t e6000sw_methods[] = { DEVMETHOD(etherswitch_setport, e6000sw_setport), DEVMETHOD(etherswitch_readreg, e6000sw_readreg_wrapper), DEVMETHOD(etherswitch_writereg, e6000sw_writereg_wrapper), - DEVMETHOD(etherswitch_readphyreg, e6000sw_readphy_wrapper), - DEVMETHOD(etherswitch_writephyreg, e6000sw_writephy_wrapper), + DEVMETHOD(etherswitch_readphyreg, e6000sw_readphy), + DEVMETHOD(etherswitch_writephyreg, e6000sw_writephy), DEVMETHOD(etherswitch_setvgroup, e6000sw_setvgroup_wrapper), DEVMETHOD(etherswitch_getvgroup, e6000sw_getvgroup_wrapper), @@ -463,6 +461,7 @@ e6000sw_attach(device_t dev) if (ports == 0) { device_printf(dev, "failed to parse DTS: no ports found for " "switch\n"); + E6000SW_UNLOCK(sc); return (ENXIO); } @@ -531,11 +530,20 @@ e6000sw_attach(device_t dev) if (!e6000sw_is_phyport(sc, port)) continue; + /* + * It's necessary to unlock mutex, because e6000sw_attach_miibus + * calls functions, which try to lock mutex.That leads + * to recursive lock on non recursive mutex. + */ + E6000SW_UNLOCK(sc); + err = e6000sw_attach_miibus(sc, port); if (err != 0) { device_printf(sc->dev, "failed to attach miibus\n"); goto out_fail; } + + E6000SW_LOCK(sc); } etherswitch_info.es_nports = sc->num_ports; @@ -556,7 +564,6 @@ e6000sw_attach(device_t dev) return (0); out_fail: - E6000SW_UNLOCK(sc); e6000sw_detach(dev); return (err); @@ -661,14 +668,18 @@ e6000sw_readphy(device_t dev, int phy, int reg) uint32_t val; sc = device_get_softc(dev); + E6000SW_LOCK_ASSERT(sc, SA_UNLOCKED); + if (!e6000sw_is_phyport(sc, phy) || reg >= E6000SW_NUM_PHY_REGS) { device_printf(dev, "Wrong register address.\n"); return (EINVAL); } - E6000SW_LOCK_ASSERT(sc, SA_XLOCKED); + E6000SW_LOCK(sc); + if (E6000SW_WAITREADY2(sc, SMI_PHY_CMD_REG, SMI_CMD_BUSY)) { device_printf(dev, "Timeout while waiting for switch\n"); + E6000SW_UNLOCK(sc); return (ETIMEDOUT); } @@ -677,11 +688,14 @@ e6000sw_readphy(device_t dev, int phy, int reg) ((phy << SMI_CMD_DEV_ADDR) & SMI_CMD_DEV_ADDR_MASK)); if (E6000SW_WAITREADY2(sc, SMI_PHY_CMD_REG, SMI_CMD_BUSY)) { device_printf(dev, "Timeout while waiting for switch\n"); + E6000SW_UNLOCK(sc); return (ETIMEDOUT); } val = e6000sw_readreg(sc, REG_GLOBAL2, SMI_PHY_DATA_REG); + E6000SW_UNLOCK(sc); + return (val & PHY_DATA_MASK); } @@ -691,14 +705,18 @@ e6000sw_writephy(device_t dev, int phy, int reg, int data) e6000sw_softc_t *sc; sc = device_get_softc(dev); + E6000SW_LOCK_ASSERT(sc, SA_UNLOCKED); + if (!e6000sw_is_phyport(sc, phy) || reg >= E6000SW_NUM_PHY_REGS) { device_printf(dev, "Wrong register address.\n"); return (EINVAL); } - E6000SW_LOCK_ASSERT(sc, SA_XLOCKED); + E6000SW_LOCK(sc); + if (E6000SW_WAITREADY2(sc, SMI_PHY_CMD_REG, SMI_CMD_BUSY)) { device_printf(dev, "Timeout while waiting for switch\n"); + E6000SW_UNLOCK(sc); return (ETIMEDOUT); } @@ -708,6 +726,8 @@ e6000sw_writephy(device_t dev, int phy, int reg, int data) SMI_CMD_OP_C22_WRITE | (reg & SMI_CMD_REG_ADDR_MASK) | ((phy << SMI_CMD_DEV_ADDR) & SMI_CMD_DEV_ADDR_MASK)); + E6000SW_UNLOCK(sc); + return (0); } @@ -725,11 +745,10 @@ e6000sw_detach(device_t dev) if (sc->sc_tq != NULL) taskqueue_free(sc->sc_tq); - bus_generic_detach(dev); + device_delete_children(dev); + sx_destroy(&sc->sx); for (phy = 0; phy < sc->num_ports; phy++) { - if (sc->miibus[phy] != NULL) - device_delete_child(dev, sc->miibus[phy]); if (sc->ifp[phy] != NULL) if_free(sc->ifp[phy]); if (sc->ifname[phy] != NULL) @@ -1051,42 +1070,6 @@ e6000sw_writereg_wrapper(device_t dev, int addr_reg, int val) return (0); } -/* - * These wrappers are necessary because PHY accesses from etherswitchcfg - * need to be synchronized with locks, while miibus PHY accesses do not. - */ -static int -e6000sw_readphy_wrapper(device_t dev, int phy, int reg) -{ - e6000sw_softc_t *sc; - int ret; - - sc = device_get_softc(dev); - E6000SW_LOCK_ASSERT(sc, SA_UNLOCKED); - - E6000SW_LOCK(sc); - ret = e6000sw_readphy(dev, phy, reg); - E6000SW_UNLOCK(sc); - - return (ret); -} - -static int -e6000sw_writephy_wrapper(device_t dev, int phy, int reg, int data) -{ - e6000sw_softc_t *sc; - int ret; - - sc = device_get_softc(dev); - E6000SW_LOCK_ASSERT(sc, SA_UNLOCKED); - - E6000SW_LOCK(sc); - ret = e6000sw_writephy(dev, phy, reg, data); - E6000SW_UNLOCK(sc); - - return (ret); -} - /* * setvgroup/getvgroup called from etherswitchfcg need to be locked, * while internal calls do not. diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 030c64701de8..7ed2169445e4 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -108,6 +108,7 @@ SUBDIR= \ ${_dpms} \ dummynet \ ${_dwwdt} \ + ${_e6000sw} \ ${_efirt} \ ${_em} \ ${_ena} \ @@ -624,6 +625,7 @@ _rockchip= rockchip .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" _sdhci_fdt= sdhci_fdt +_e6000sw= e6000sw .endif .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" diff --git a/sys/modules/e6000sw/Makefile b/sys/modules/e6000sw/Makefile new file mode 100644 index 000000000000..51afb6d8f3a4 --- /dev/null +++ b/sys/modules/e6000sw/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/etherswitch/e6000sw + +KMOD= e6000sw +SRCS= e6000sw.c + +SRCS+= bus_if.h etherswitch_if.h mdio_if.h miibus_if.h ofw_bus_if.h + +.include From owner-dev-commits-src-all@freebsd.org Mon Sep 13 09:45:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0AD886789AC; Mon, 13 Sep 2021 09:45:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7M656sl7z3H4f; Mon, 13 Sep 2021 09:45:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7CCF24E20; Mon, 13 Sep 2021 09:45:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18D9jHDe045809; Mon, 13 Sep 2021 09:45:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18D9jHm3045808; Mon, 13 Sep 2021 09:45:17 GMT (envelope-from git) Date: Mon, 13 Sep 2021 09:45:17 GMT Message-Id: <202109130945.18D9jHm3045808@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wojciech Macek Subject: git: 41b0190cc404 - main - if_mvneta: Build the driver as a kernel module MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wma X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 41b0190cc404e21cb8b430602eabfedc20107471 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 09:45:18 -0000 The branch main has been updated by wma: URL: https://cgit.FreeBSD.org/src/commit/?id=41b0190cc404e21cb8b430602eabfedc20107471 commit 41b0190cc404e21cb8b430602eabfedc20107471 Author: Hubert Mazur AuthorDate: 2021-09-13 09:44:31 +0000 Commit: Wojciech Macek CommitDate: 2021-09-13 09:44:31 +0000 if_mvneta: Build the driver as a kernel module Fix device detach and attach routine. Add required Makefile to build as a module. Remove entry from GENERIC, since now it can be loaded automatically. Tested on EspressoBin. Obtained from: Semihalf Reviewed by: manu Differential revision: https://reviews.freebsd.org/D31581 --- sys/dev/neta/if_mvneta.c | 73 ++++++++++++++++++++++++++++-------------------- sys/modules/Makefile | 2 ++ 2 files changed, 45 insertions(+), 30 deletions(-) diff --git a/sys/dev/neta/if_mvneta.c b/sys/dev/neta/if_mvneta.c index debb4a922cbc..242e139b8cac 100644 --- a/sys/dev/neta/if_mvneta.c +++ b/sys/dev/neta/if_mvneta.c @@ -222,6 +222,11 @@ static device_method_t mvneta_methods[] = { DEVMETHOD_END }; +static struct ofw_compat_data compat_data[] = { + { "marvell,armada-3700-neta", true }, + { NULL, false } +}; + DEFINE_CLASS_0(mvneta, mvneta_driver, mvneta_methods, sizeof(struct mvneta_softc)); DRIVER_MODULE(miibus, mvneta, miibus_driver, miibus_devclass, 0, 0); @@ -229,7 +234,7 @@ DRIVER_MODULE(mdio, mvneta, mdio_driver, mdio_devclass, 0, 0); MODULE_DEPEND(mvneta, mdio, 1, 1, 1); MODULE_DEPEND(mvneta, ether, 1, 1, 1); MODULE_DEPEND(mvneta, miibus, 1, 1, 1); -MODULE_DEPEND(mvneta, mvxpbm, 1, 1, 1); +SIMPLEBUS_PNP_INFO(compat_data); /* * List of MIB register and names @@ -609,6 +614,16 @@ mvneta_attach(device_t self) } #endif + error = bus_setup_intr(self, sc->res[1], + INTR_TYPE_NET | INTR_MPSAFE, NULL, mvneta_intrs[0].handler, sc, + &sc->ih_cookie[0]); + if (error) { + device_printf(self, "could not setup %s\n", + mvneta_intrs[0].description); + mvneta_detach(self); + return (error); + } + /* * MAC address */ @@ -704,8 +719,6 @@ mvneta_attach(device_t self) } } - ether_ifattach(ifp, sc->enaddr); - /* * Enable DMA engines and Initialize Device Registers. */ @@ -835,20 +848,11 @@ mvneta_attach(device_t self) mvneta_update_media(sc, ifm_target); } - sysctl_mvneta_init(sc); + ether_ifattach(ifp, sc->enaddr); callout_reset(&sc->tick_ch, 0, mvneta_tick, sc); - error = bus_setup_intr(self, sc->res[1], - INTR_TYPE_NET | INTR_MPSAFE, NULL, mvneta_intrs[0].handler, sc, - &sc->ih_cookie[0]); - if (error) { - device_printf(self, "could not setup %s\n", - mvneta_intrs[0].description); - ether_ifdetach(sc->ifp); - mvneta_detach(self); - return (error); - } + sysctl_mvneta_init(sc); return (0); } @@ -857,20 +861,28 @@ STATIC int mvneta_detach(device_t dev) { struct mvneta_softc *sc; + struct ifnet *ifp; int q; sc = device_get_softc(dev); + ifp = sc->ifp; - mvneta_stop(sc); - /* Detach network interface */ - if (sc->ifp) - if_free(sc->ifp); + if (device_is_attached(dev)) { + mvneta_stop(sc); + callout_drain(&sc->tick_ch); + ether_ifdetach(sc->ifp); + } for (q = 0; q < MVNETA_RX_QNUM_MAX; q++) mvneta_ring_dealloc_rx_queue(sc, q); for (q = 0; q < MVNETA_TX_QNUM_MAX; q++) mvneta_ring_dealloc_tx_queue(sc, q); + device_delete_children(dev); + + if (sc->ih_cookie[0] != NULL) + bus_teardown_intr(dev, sc->res[1], sc->ih_cookie[0]); + if (sc->tx_dtag != NULL) bus_dma_tag_destroy(sc->tx_dtag); if (sc->rx_dtag != NULL) @@ -881,6 +893,13 @@ mvneta_detach(device_t dev) bus_dma_tag_destroy(sc->rxbuf_dtag); bus_release_resources(dev, res_spec, sc->res); + + if (sc->ifp) + if_free(sc->ifp); + + if (mtx_initialized(&sc->mtx)) + mtx_destroy(&sc->mtx); + return (0); } @@ -1254,6 +1273,9 @@ mvneta_ring_alloc_rx_queue(struct mvneta_softc *sc, int q) return (0); fail: + mvneta_rx_lockq(sc, q); + mvneta_ring_flush_rx_queue(sc, q); + mvneta_rx_unlockq(sc, q); mvneta_ring_dealloc_rx_queue(sc, q); device_printf(sc->dev, "DMA Ring buffer allocation failure.\n"); return (error); @@ -1295,6 +1317,9 @@ mvneta_ring_alloc_tx_queue(struct mvneta_softc *sc, int q) return (0); fail: + mvneta_tx_lockq(sc, q); + mvneta_ring_flush_tx_queue(sc, q); + mvneta_tx_unlockq(sc, q); mvneta_ring_dealloc_tx_queue(sc, q); device_printf(sc->dev, "DMA Ring buffer allocation failure.\n"); return (error); @@ -1324,16 +1349,6 @@ mvneta_ring_dealloc_tx_queue(struct mvneta_softc *sc, int q) #endif if (sc->txmbuf_dtag != NULL) { - if (mtx_name(&tx->ring_mtx) != NULL) { - /* - * It is assumed that maps are being loaded after mutex - * is initialized. Therefore we can skip unloading maps - * when mutex is empty. - */ - mvneta_tx_lockq(sc, q); - mvneta_ring_flush_tx_queue(sc, q); - mvneta_tx_unlockq(sc, q); - } for (i = 0; i < MVNETA_TX_RING_CNT; i++) { txbuf = &tx->txbuf[i]; if (txbuf->dmap != NULL) { @@ -1372,8 +1387,6 @@ mvneta_ring_dealloc_rx_queue(struct mvneta_softc *sc, int q) rx = MVNETA_RX_RING(sc, q); - mvneta_ring_flush_rx_queue(sc, q); - if (rx->desc_pa != 0) bus_dmamap_unload(sc->rx_dtag, rx->desc_map); diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 7ed2169445e4..b1063ad003d8 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -264,6 +264,7 @@ SUBDIR= \ mxge \ my \ ${_nctgpio} \ + ${_neta} \ ${_netgraph} \ ${_nfe} \ nfscl \ @@ -626,6 +627,7 @@ _rockchip= rockchip .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" _sdhci_fdt= sdhci_fdt _e6000sw= e6000sw +_neta= neta .endif .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" From owner-dev-commits-src-all@freebsd.org Mon Sep 13 10:55:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6D0967907B; Mon, 13 Sep 2021 10:55:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7NgP5jNRz3qLy; Mon, 13 Sep 2021 10:55:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A363925BBB; Mon, 13 Sep 2021 10:55:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DAtjFf038706; Mon, 13 Sep 2021 10:55:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DAtj1O038705; Mon, 13 Sep 2021 10:55:45 GMT (envelope-from git) Date: Mon, 13 Sep 2021 10:55:45 GMT Message-Id: <202109131055.18DAtj1O038705@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wojciech Macek Subject: git: 6e93bdfff3ce - main - Revert "if_mvneta: Build the driver as a kernel module" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wma X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6e93bdfff3cec34f72d98da70b0c6b2b00b2d564 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 10:55:45 -0000 The branch main has been updated by wma: URL: https://cgit.FreeBSD.org/src/commit/?id=6e93bdfff3cec34f72d98da70b0c6b2b00b2d564 commit 6e93bdfff3cec34f72d98da70b0c6b2b00b2d564 Author: Wojciech Macek AuthorDate: 2021-09-13 10:55:15 +0000 Commit: Wojciech Macek CommitDate: 2021-09-13 10:55:15 +0000 Revert "if_mvneta: Build the driver as a kernel module" This reverts commit 41b0190cc404e21cb8b430602eabfedc20107471. --- sys/dev/neta/if_mvneta.c | 73 ++++++++++++++++++++---------------------------- sys/modules/Makefile | 2 -- 2 files changed, 30 insertions(+), 45 deletions(-) diff --git a/sys/dev/neta/if_mvneta.c b/sys/dev/neta/if_mvneta.c index 242e139b8cac..debb4a922cbc 100644 --- a/sys/dev/neta/if_mvneta.c +++ b/sys/dev/neta/if_mvneta.c @@ -222,11 +222,6 @@ static device_method_t mvneta_methods[] = { DEVMETHOD_END }; -static struct ofw_compat_data compat_data[] = { - { "marvell,armada-3700-neta", true }, - { NULL, false } -}; - DEFINE_CLASS_0(mvneta, mvneta_driver, mvneta_methods, sizeof(struct mvneta_softc)); DRIVER_MODULE(miibus, mvneta, miibus_driver, miibus_devclass, 0, 0); @@ -234,7 +229,7 @@ DRIVER_MODULE(mdio, mvneta, mdio_driver, mdio_devclass, 0, 0); MODULE_DEPEND(mvneta, mdio, 1, 1, 1); MODULE_DEPEND(mvneta, ether, 1, 1, 1); MODULE_DEPEND(mvneta, miibus, 1, 1, 1); -SIMPLEBUS_PNP_INFO(compat_data); +MODULE_DEPEND(mvneta, mvxpbm, 1, 1, 1); /* * List of MIB register and names @@ -614,16 +609,6 @@ mvneta_attach(device_t self) } #endif - error = bus_setup_intr(self, sc->res[1], - INTR_TYPE_NET | INTR_MPSAFE, NULL, mvneta_intrs[0].handler, sc, - &sc->ih_cookie[0]); - if (error) { - device_printf(self, "could not setup %s\n", - mvneta_intrs[0].description); - mvneta_detach(self); - return (error); - } - /* * MAC address */ @@ -719,6 +704,8 @@ mvneta_attach(device_t self) } } + ether_ifattach(ifp, sc->enaddr); + /* * Enable DMA engines and Initialize Device Registers. */ @@ -848,11 +835,20 @@ mvneta_attach(device_t self) mvneta_update_media(sc, ifm_target); } - ether_ifattach(ifp, sc->enaddr); + sysctl_mvneta_init(sc); callout_reset(&sc->tick_ch, 0, mvneta_tick, sc); - sysctl_mvneta_init(sc); + error = bus_setup_intr(self, sc->res[1], + INTR_TYPE_NET | INTR_MPSAFE, NULL, mvneta_intrs[0].handler, sc, + &sc->ih_cookie[0]); + if (error) { + device_printf(self, "could not setup %s\n", + mvneta_intrs[0].description); + ether_ifdetach(sc->ifp); + mvneta_detach(self); + return (error); + } return (0); } @@ -861,28 +857,20 @@ STATIC int mvneta_detach(device_t dev) { struct mvneta_softc *sc; - struct ifnet *ifp; int q; sc = device_get_softc(dev); - ifp = sc->ifp; - if (device_is_attached(dev)) { - mvneta_stop(sc); - callout_drain(&sc->tick_ch); - ether_ifdetach(sc->ifp); - } + mvneta_stop(sc); + /* Detach network interface */ + if (sc->ifp) + if_free(sc->ifp); for (q = 0; q < MVNETA_RX_QNUM_MAX; q++) mvneta_ring_dealloc_rx_queue(sc, q); for (q = 0; q < MVNETA_TX_QNUM_MAX; q++) mvneta_ring_dealloc_tx_queue(sc, q); - device_delete_children(dev); - - if (sc->ih_cookie[0] != NULL) - bus_teardown_intr(dev, sc->res[1], sc->ih_cookie[0]); - if (sc->tx_dtag != NULL) bus_dma_tag_destroy(sc->tx_dtag); if (sc->rx_dtag != NULL) @@ -893,13 +881,6 @@ mvneta_detach(device_t dev) bus_dma_tag_destroy(sc->rxbuf_dtag); bus_release_resources(dev, res_spec, sc->res); - - if (sc->ifp) - if_free(sc->ifp); - - if (mtx_initialized(&sc->mtx)) - mtx_destroy(&sc->mtx); - return (0); } @@ -1273,9 +1254,6 @@ mvneta_ring_alloc_rx_queue(struct mvneta_softc *sc, int q) return (0); fail: - mvneta_rx_lockq(sc, q); - mvneta_ring_flush_rx_queue(sc, q); - mvneta_rx_unlockq(sc, q); mvneta_ring_dealloc_rx_queue(sc, q); device_printf(sc->dev, "DMA Ring buffer allocation failure.\n"); return (error); @@ -1317,9 +1295,6 @@ mvneta_ring_alloc_tx_queue(struct mvneta_softc *sc, int q) return (0); fail: - mvneta_tx_lockq(sc, q); - mvneta_ring_flush_tx_queue(sc, q); - mvneta_tx_unlockq(sc, q); mvneta_ring_dealloc_tx_queue(sc, q); device_printf(sc->dev, "DMA Ring buffer allocation failure.\n"); return (error); @@ -1349,6 +1324,16 @@ mvneta_ring_dealloc_tx_queue(struct mvneta_softc *sc, int q) #endif if (sc->txmbuf_dtag != NULL) { + if (mtx_name(&tx->ring_mtx) != NULL) { + /* + * It is assumed that maps are being loaded after mutex + * is initialized. Therefore we can skip unloading maps + * when mutex is empty. + */ + mvneta_tx_lockq(sc, q); + mvneta_ring_flush_tx_queue(sc, q); + mvneta_tx_unlockq(sc, q); + } for (i = 0; i < MVNETA_TX_RING_CNT; i++) { txbuf = &tx->txbuf[i]; if (txbuf->dmap != NULL) { @@ -1387,6 +1372,8 @@ mvneta_ring_dealloc_rx_queue(struct mvneta_softc *sc, int q) rx = MVNETA_RX_RING(sc, q); + mvneta_ring_flush_rx_queue(sc, q); + if (rx->desc_pa != 0) bus_dmamap_unload(sc->rx_dtag, rx->desc_map); diff --git a/sys/modules/Makefile b/sys/modules/Makefile index b1063ad003d8..7ed2169445e4 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -264,7 +264,6 @@ SUBDIR= \ mxge \ my \ ${_nctgpio} \ - ${_neta} \ ${_netgraph} \ ${_nfe} \ nfscl \ @@ -627,7 +626,6 @@ _rockchip= rockchip .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" _sdhci_fdt= sdhci_fdt _e6000sw= e6000sw -_neta= neta .endif .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" From owner-dev-commits-src-all@freebsd.org Mon Sep 13 11:52:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55CBC67A44B; Mon, 13 Sep 2021 11:52:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7PxN1hgXz4ZHK; Mon, 13 Sep 2021 11:52:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19EDB2698D; Mon, 13 Sep 2021 11:52:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DBquwu018165; Mon, 13 Sep 2021 11:52:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DBqu1C018164; Mon, 13 Sep 2021 11:52:56 GMT (envelope-from git) Date: Mon, 13 Sep 2021 11:52:56 GMT Message-Id: <202109131152.18DBqu1C018164@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 7c0226cad3f3 - main - bsd.lib.mk: add conditions for building _pie.a archives MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7c0226cad3f36a05832f9c5216dfa3dadb91c92d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 11:52:56 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7c0226cad3f36a05832f9c5216dfa3dadb91c92d commit 7c0226cad3f36a05832f9c5216dfa3dadb91c92d Author: Ed Maste AuthorDate: 2021-09-12 16:45:50 +0000 Commit: Ed Maste CommitDate: 2021-09-13 11:52:02 +0000 bsd.lib.mk: add conditions for building _pie.a archives As with other .a targets, build _pie.a archives only if LIB is set. At present we build _pie.a only for INTERNALLIBs, and none of them include bsd.lib.mk without setting LIB. However, we might want to build _pie.a for non-INTERNALLIBs in the future. Reviewed by: arichardson MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31920 --- share/mk/bsd.lib.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index 0c80dd63d5e8..4afe719b8152 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -390,7 +390,7 @@ lib${LIB_PRIVATE}${LIB}_nossp_pic.a: ${NOSSPSOBJS} .endif # !defined(INTERNALLIB) -.if defined(INTERNALLIB) && ${MK_PIE} != "no" +.if defined(INTERNALLIB) && ${MK_PIE} != "no" && defined(LIB) && !empty(LIB) PIEOBJS+= ${OBJS:.o=.pieo} DEPENDOBJS+= ${PIEOBJS} CLEANFILES+= ${PIEOBJS} From owner-dev-commits-src-all@freebsd.org Mon Sep 13 12:22:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC39267A961; Mon, 13 Sep 2021 12:22:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7Qbv6KGRz4jHW; Mon, 13 Sep 2021 12:22:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8BD826DD1; Mon, 13 Sep 2021 12:22:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DCMphU058368; Mon, 13 Sep 2021 12:22:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DCMpt1058367; Mon, 13 Sep 2021 12:22:51 GMT (envelope-from git) Date: Mon, 13 Sep 2021 12:22:51 GMT Message-Id: <202109131222.18DCMpt1058367@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: 2d78130185b5 - main - Add missing dep patterns for .pieo MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2d78130185b5518e0bdb4a2f3c5d5ede6773312d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 12:22:52 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=2d78130185b5518e0bdb4a2f3c5d5ede6773312d commit 2d78130185b5518e0bdb4a2f3c5d5ede6773312d Author: Alex Richardson AuthorDate: 2021-09-13 12:22:07 +0000 Commit: Alex Richardson CommitDate: 2021-09-13 12:22:31 +0000 Add missing dep patterns for .pieo While adding sanitizer support, I noticed that all other extensions were handled but .pieo was missing. Reviewed By: emaste, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31040 --- share/mk/bsd.dep.mk | 5 ++++- share/mk/local.autodep.mk | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index b8dc59d52543..d1bbdd722c1b 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -170,10 +170,13 @@ ${_D}.o: ${_DSRC} ${OBJS:S/^${_D}.o$//} @rm -f ${.TARGET} ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h} .if defined(LIB) -CLEANFILES+= ${_D}.pico ${_D}.po ${_D}.nossppico +CLEANFILES+= ${_D}.pico ${_D}.pieo ${_D}.po ${_D}.nossppico ${_D}.pico: ${_DSRC} ${SOBJS:S/^${_D}.pico$//} @rm -f ${.TARGET} ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h} +${_D}.pieo: ${_DSRC} ${OBJS:S/^${_D}.pieo$//} + @rm -f ${.TARGET} + ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h} ${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$//} @rm -f ${.TARGET} ${DTRACE} ${DTRACEFLAGS} -G -o ${.TARGET} -s ${.ALLSRC:N*.h} diff --git a/share/mk/local.autodep.mk b/share/mk/local.autodep.mk index ee73b23aadcf..0e14d844fcff 100644 --- a/share/mk/local.autodep.mk +++ b/share/mk/local.autodep.mk @@ -9,7 +9,8 @@ UPDATE_DEPENDFILE= no .endif NOSSPPICO?= .nossppico -OBJ_EXTENSIONS+= ${NOSSPPICO} +PIEO?= .pieo +OBJ_EXTENSIONS+= ${NOSSPPICO} ${PIEO} CFLAGS+= ${CFLAGS_LAST} CXXFLAGS+= ${CXXFLAGS_LAST} From owner-dev-commits-src-all@freebsd.org Mon Sep 13 13:02:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 04D9E67B56C; Mon, 13 Sep 2021 13:02:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7RTf6McHz4tkD; Mon, 13 Sep 2021 13:02:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B52832789D; Mon, 13 Sep 2021 13:02:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DD2UsP011779; Mon, 13 Sep 2021 13:02:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DD2Uxp011778; Mon, 13 Sep 2021 13:02:30 GMT (envelope-from git) Date: Mon, 13 Sep 2021 13:02:30 GMT Message-Id: <202109131302.18DD2Uxp011778@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: e76786909ce0 - main - Fix data race in scsi cd driver. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e76786909ce0195855196305a04d86b40f138894 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 13:02:31 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=e76786909ce0195855196305a04d86b40f138894 commit e76786909ce0195855196305a04d86b40f138894 Author: Alexander Motin AuthorDate: 2021-09-13 12:59:51 +0000 Commit: Alexander Motin CommitDate: 2021-09-13 12:59:51 +0000 Fix data race in scsi cd driver. There is a data race between cdsysctlinit and cdcheckmedia. Both functions change softc->flags without synchronization. Submitted by: Arseny Smalyuk MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D31726 --- sys/cam/scsi/scsi_cd.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c index 4babe4003050..3e8187544bff 100644 --- a/sys/cam/scsi/scsi_cd.c +++ b/sys/cam/scsi/scsi_cd.c @@ -371,6 +371,7 @@ cdoninvalidate(struct cam_periph *periph) { struct cd_softc *softc; + cam_periph_assert(periph, MA_OWNED); softc = (struct cd_softc *)periph->softc; /* @@ -451,7 +452,7 @@ cdasync(void *callback_arg, u_int32_t code, printf("cdasync: Unable to attach new device " "due to status 0x%x\n", status); - break; + return; } case AC_UNIT_ATTENTION: { @@ -471,10 +472,10 @@ cdasync(void *callback_arg, u_int32_t code, if (asc == 0x28 && ascq == 0x00) disk_media_changed(softc->disk, M_NOWAIT); } - cam_periph_async(periph, code, path, arg); break; } case AC_SCSI_AEN: + cam_periph_assert(periph, MA_OWNED); softc = (struct cd_softc *)periph->softc; if (softc->state == CD_STATE_NORMAL && !softc->tur) { if (cam_periph_acquire(periph) == 0) { @@ -488,6 +489,7 @@ cdasync(void *callback_arg, u_int32_t code, { struct ccb_hdr *ccbh; + cam_periph_assert(periph, MA_OWNED); softc = (struct cd_softc *)periph->softc; /* * Don't fail on the expected unit attention @@ -496,12 +498,13 @@ cdasync(void *callback_arg, u_int32_t code, softc->flags |= CD_FLAG_RETRY_UA; LIST_FOREACH(ccbh, &softc->pending_ccbs, periph_links.le) ccbh->ccb_state |= CD_CCB_RETRY_UA; - /* FALLTHROUGH */ + break; } default: - cam_periph_async(periph, code, path, arg); break; } + + cam_periph_async(periph, code, path, arg); } static void @@ -520,7 +523,9 @@ cdsysctlinit(void *context, int pending) snprintf(tmpstr2, sizeof(tmpstr2), "%d", periph->unit_number); sysctl_ctx_init(&softc->sysctl_ctx); + cam_periph_lock(periph); softc->flags |= CD_FLAG_SCTX_INIT; + cam_periph_unlock(periph); softc->sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&softc->sysctl_ctx, SYSCTL_STATIC_CHILDREN(_kern_cam_cd), OID_AUTO, tmpstr2, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, tmpstr, @@ -899,6 +904,7 @@ cdstart(struct cam_periph *periph, union ccb *start_ccb) struct bio *bp; struct ccb_scsiio *csio; + cam_periph_assert(periph, MA_OWNED); softc = (struct cd_softc *)periph->softc; CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cdstart\n")); @@ -1143,6 +1149,7 @@ cddone(struct cam_periph *periph, union ccb *done_ccb) CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cddone\n")); + cam_periph_assert(periph, MA_OWNED); softc = (struct cd_softc *)periph->softc; csio = &done_ccb->csio; @@ -2624,6 +2631,7 @@ cdprevent(struct cam_periph *periph, int action) CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("entering cdprevent\n")); + cam_periph_assert(periph, MA_OWNED); softc = (struct cd_softc *)periph->softc; if (((action == PR_ALLOW) @@ -2661,6 +2669,7 @@ cdmediaprobedone(struct cam_periph *periph) { struct cd_softc *softc; + cam_periph_assert(periph, MA_OWNED); softc = (struct cd_softc *)periph->softc; softc->flags &= ~CD_FLAG_MEDIA_SCAN_ACT; @@ -2682,6 +2691,7 @@ cdcheckmedia(struct cam_periph *periph, int do_wait) struct cd_softc *softc; int error; + cam_periph_assert(periph, MA_OWNED); softc = (struct cd_softc *)periph->softc; error = 0; @@ -3071,13 +3081,14 @@ cderror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags) periph = xpt_path_periph(ccb->ccb_h.path); softc = (struct cd_softc *)periph->softc; - error = 0; + cam_periph_assert(periph, MA_OWNED); /* * We use a status of CAM_REQ_INVALID as shorthand -- if a 6 byte * CDB comes back with this particular error, try transforming it * into the 10 byte version. */ + error = 0; if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INVALID) { error = cd6byteworkaround(ccb); } else if (scsi_extract_sense_ccb(ccb, From owner-dev-commits-src-all@freebsd.org Mon Sep 13 13:05:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A0EE67B363; Mon, 13 Sep 2021 13:05:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7RXk335Dz3Bnf; Mon, 13 Sep 2021 13:05:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 49B582747C; Mon, 13 Sep 2021 13:05:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DD5A4k012085; Mon, 13 Sep 2021 13:05:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DD5AVx012084; Mon, 13 Sep 2021 13:05:10 GMT (envelope-from git) Date: Mon, 13 Sep 2021 13:05:10 GMT Message-Id: <202109131305.18DD5AVx012084@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: b9df18d6e891 - main - libprocstat: extend zfs_defs hack for .pieo MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b9df18d6e8917a9bfb62babb7cf9efeca23aa2fc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 13:05:10 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=b9df18d6e8917a9bfb62babb7cf9efeca23aa2fc commit b9df18d6e8917a9bfb62babb7cf9efeca23aa2fc Author: Ed Maste AuthorDate: 2021-09-12 23:04:31 +0000 Commit: Ed Maste CommitDate: 2021-09-13 13:03:55 +0000 libprocstat: extend zfs_defs hack for .pieo By default _pie.a archives are built only for INTERNALLIBs, so there is usually no need for zfs_defs.pieo to exist. However, some experimental work builds _pie.a archives for everything. Extend the existing set of zfs_defs hacks to build zfs_defs.pieo as well. Reviewed by: arichardson MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31924 --- lib/libprocstat/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/libprocstat/Makefile b/lib/libprocstat/Makefile index 2e60a7b0dc4d..e8ca072066d5 100644 --- a/lib/libprocstat/Makefile +++ b/lib/libprocstat/Makefile @@ -64,6 +64,8 @@ zfs/zfs_defs.o: .PHONY @cd ${.CURDIR}/zfs && ${MAKE} zfs_defs.o zfs/zfs_defs.pico: .PHONY @cd ${.CURDIR}/zfs && ${MAKE} zfs_defs.pico +zfs/zfs_defs.pieo: .PHONY + @cd ${.CURDIR}/zfs && ${MAKE} zfs_defs.pieo zfs/zfs_defs.po: .PHONY @cd ${.CURDIR}/zfs && ${MAKE} zfs_defs.po .endif From owner-dev-commits-src-all@freebsd.org Mon Sep 13 14:40:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A1D767C6BC; Mon, 13 Sep 2021 14:40:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7Tfx1tMSz3r99; Mon, 13 Sep 2021 14:40:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 206C6E05; Mon, 13 Sep 2021 14:40:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DEefpF041863; Mon, 13 Sep 2021 14:40:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DEefbn041862; Mon, 13 Sep 2021 14:40:41 GMT (envelope-from git) Date: Mon, 13 Sep 2021 14:40:41 GMT Message-Id: <202109131440.18DEefbn041862@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 97de1b27db7a - stable/13 - linux: make sure to zero the l_siginfo structure for ptrace(2) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 97de1b27db7a2e8386cbbd50a0d06a6ea0bf1221 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 14:40:41 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=97de1b27db7a2e8386cbbd50a0d06a6ea0bf1221 commit 97de1b27db7a2e8386cbbd50a0d06a6ea0bf1221 Author: Edward Tomasz Napierala AuthorDate: 2021-06-08 09:18:29 +0000 Commit: Ed Maste CommitDate: 2021-09-13 14:39:42 +0000 linux: make sure to zero the l_siginfo structure for ptrace(2) Reported By: dchagin Sponsored By: EPSRC (cherry picked from commit f102b61d0ecffc6d9cc322fa7a48e0927391421b) --- sys/amd64/linux/linux_ptrace.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/amd64/linux/linux_ptrace.c b/sys/amd64/linux/linux_ptrace.c index 89fda7979359..d209590e3680 100644 --- a/sys/amd64/linux/linux_ptrace.c +++ b/sys/amd64/linux/linux_ptrace.c @@ -408,6 +408,7 @@ linux_ptrace_getsiginfo(struct thread *td, pid_t pid, l_ulong data) } sig = bsd_to_linux_signal(lwpinfo.pl_siginfo.si_signo); + memset(&l_siginfo, 0, sizeof(l_siginfo)); siginfo_to_lsiginfo(&lwpinfo.pl_siginfo, &l_siginfo, sig); error = copyout(&l_siginfo, (void *)data, sizeof(l_siginfo)); return (error); From owner-dev-commits-src-all@freebsd.org Mon Sep 13 14:40:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8492067C80D; Mon, 13 Sep 2021 14:40:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7Tfy2ScTz3rNF; Mon, 13 Sep 2021 14:40:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 35AADD7D; Mon, 13 Sep 2021 14:40:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DEegHW041887; Mon, 13 Sep 2021 14:40:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DEeggm041886; Mon, 13 Sep 2021 14:40:42 GMT (envelope-from git) Date: Mon, 13 Sep 2021 14:40:42 GMT Message-Id: <202109131440.18DEeggm041886@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: fc1b69d0311e - stable/13 - apr: Merge r1889604, r1807975 from trunk: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: fc1b69d0311e50ed05c00c46ad7dd5d560e57cb6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 14:40:42 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=fc1b69d0311e50ed05c00c46ad7dd5d560e57cb6 commit fc1b69d0311e50ed05c00c46ad7dd5d560e57cb6 Author: Joe Orton AuthorDate: 2021-07-02 11:10:33 +0000 Commit: Ed Maste CommitDate: 2021-09-13 14:39:43 +0000 apr: Merge r1889604, r1807975 from trunk: * random/unix/sha2.c (apr__SHA256_Final, apr__SHA256_End): Fix parameter buffer lengths to match declaration, avoiding GCC 11 warning. (no functional change) Bounds-check human-readable date fields (credit: Stefan Sperling) Submitted by: jorton, niq Reviewed by: jorton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1891198 13f79535-47bb-0310-9956-ffa450edef68 --- contrib/apr/random/unix/sha2.c | 4 ++-- contrib/apr/time/unix/time.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/apr/random/unix/sha2.c b/contrib/apr/random/unix/sha2.c index 12c257d1fa1b..8059a9d78a71 100644 --- a/contrib/apr/random/unix/sha2.c +++ b/contrib/apr/random/unix/sha2.c @@ -425,7 +425,7 @@ void apr__SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) usedspace = freespace = 0; } -void apr__SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { +void apr__SHA256_Final(sha2_byte digest[SHA256_DIGEST_LENGTH], SHA256_CTX* context) { sha2_word32 *d = (sha2_word32*)digest; unsigned int usedspace; @@ -496,7 +496,7 @@ void apr__SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { usedspace = 0; } -char *apr__SHA256_End(SHA256_CTX* context, char buffer[]) { +char *apr__SHA256_End(SHA256_CTX* context, char buffer[SHA256_DIGEST_STRING_LENGTH]) { sha2_byte digest[SHA256_DIGEST_LENGTH], *d = digest; int i; diff --git a/contrib/apr/time/unix/time.c b/contrib/apr/time/unix/time.c index dfa45e690c62..7f0958192769 100644 --- a/contrib/apr/time/unix/time.c +++ b/contrib/apr/time/unix/time.c @@ -142,6 +142,9 @@ APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *t, apr_time_exp_t *xt) static const int dayoffset[12] = {306, 337, 0, 31, 61, 92, 122, 153, 184, 214, 245, 275}; + if (xt->tm_mon < 0 || xt->tm_mon >= 12) + return APR_EBADDATE; + /* shift new year to 1st March in order to make leap year calc easy */ if (xt->tm_mon < 2) From owner-dev-commits-src-all@freebsd.org Mon Sep 13 14:42:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 18E8A67C374; Mon, 13 Sep 2021 14:42:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7Thk04mkz3sHg; Mon, 13 Sep 2021 14:42:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D81BBA6F; Mon, 13 Sep 2021 14:42:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DEgDZ6043710; Mon, 13 Sep 2021 14:42:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DEgDIn043709; Mon, 13 Sep 2021 14:42:13 GMT (envelope-from git) Date: Mon, 13 Sep 2021 14:42:13 GMT Message-Id: <202109131442.18DEgDIn043709@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: ddedf2a11eb2 - main - tzcode: Implement timezone change detection MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ddedf2a11eb20af1ee52cb3da70a57c21904af8f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 14:42:14 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=ddedf2a11eb20af1ee52cb3da70a57c21904af8f commit ddedf2a11eb20af1ee52cb3da70a57c21904af8f Author: Edward Tomasz Napierala AuthorDate: 2021-09-12 03:07:26 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-09-12 03:07:58 +0000 tzcode: Implement timezone change detection Implement optional timezone change detection for local time libc functions. This is disabled by default; set WITH_DETECT_TZ_CHANGES to build it. Reviewed By: imp Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. X-NetApp-PR: #47 Differential Revision: https://reviews.freebsd.org/D30183 --- contrib/tzcode/stdtime/localtime.c | 89 +++++++++++++++++++++++++++++- lib/libc/stdtime/Makefile.inc | 4 ++ share/mk/src.opts.mk | 1 + tools/build/options/WITH_DETECT_TZ_CHANGES | 2 + 4 files changed, 95 insertions(+), 1 deletion(-) diff --git a/contrib/tzcode/stdtime/localtime.c b/contrib/tzcode/stdtime/localtime.c index e221c1fa3964..926b24470e19 100644 --- a/contrib/tzcode/stdtime/localtime.c +++ b/contrib/tzcode/stdtime/localtime.c @@ -354,6 +354,45 @@ settzname(void) } } +#ifdef DETECT_TZ_CHANGES +/* + * Determine if there's a change in the timezone since the last time we checked. + * Returns: -1 on error + * 0 if the timezone has not changed + * 1 if the timezone has changed + */ +static int +change_in_tz(const char *name) +{ + static char old_name[PATH_MAX]; + static struct stat old_sb; + struct stat sb; + int error; + + error = stat(name, &sb); + if (error != 0) + return -1; + + if (strcmp(name, old_name) != 0) { + strlcpy(old_name, name, sizeof(old_name)); + old_sb = sb; + return 1; + } + + if (sb.st_dev != old_sb.st_dev || + sb.st_ino != old_sb.st_ino || + sb.st_ctime != old_sb.st_ctime || + sb.st_mtime != old_sb.st_mtime) { + old_sb = sb; + return 1; + } + + return 0; +} +#else /* !DETECT_TZ_CHANGES */ +#define change_in_tz(X) 0 +#endif /* !DETECT_TZ_CHANGES */ + static int differ_by_repeat(const time_t t1, const time_t t0) { @@ -379,6 +418,7 @@ register const int doextend; int stored; int nread; int res; + int ret; union { struct tzhead tzhead; char buf[2 * sizeof(struct tzhead) + @@ -427,6 +467,22 @@ register const int doextend; (void) strcat(fullname, name); name = fullname; } + if (doextend == TRUE) { + /* + * Detect if the timezone file has changed. Check + * 'doextend' to ignore TZDEFRULES; the change_in_tz() + * function can only keep state for a single file. + */ + ret = change_in_tz(name); + if (ret <= 0) { + /* + * Returns -1 if there was an error, + * and 0 if the timezone had not changed. + */ + free(fullname); + return ret; + } + } if ((fid = _open(name, OPEN_MODE)) == -1) { free(fullname); return -1; @@ -1209,12 +1265,43 @@ gmtload(struct state *const sp) (void) tzparse(gmt, sp, TRUE); } +#ifdef DETECT_TZ_CHANGES +static int +recheck_tzdata() +{ + static time_t last_checked; + struct timespec now; + time_t current_time; + int error; + + /* + * We want to recheck the timezone file every 61 sec. + */ + error = clock_gettime(CLOCK_MONOTONIC, &now); + if (error <= 0) { + /* XXX: Can we somehow report this? */ + return 0; + } + + current_time = now.tv_sec; + if ((current_time - last_checked > 61) || + (last_checked > current_time)) { + last_checked = current_time; + return 1; + } + + return 0; +} +#else /* !DETECT_TZ_CHANGES */ +#define recheck_tzdata() 0 +#endif /* !DETECT_TZ_CHANGES */ + static void tzsetwall_basic(int rdlocked) { if (!rdlocked) _RWLOCK_RDLOCK(&lcl_rwlock); - if (lcl_is_set < 0) { + if (lcl_is_set < 0 && recheck_tzdata() == 0) { if (!rdlocked) _RWLOCK_UNLOCK(&lcl_rwlock); return; diff --git a/lib/libc/stdtime/Makefile.inc b/lib/libc/stdtime/Makefile.inc index fb0d2b934148..3d483469bc97 100644 --- a/lib/libc/stdtime/Makefile.inc +++ b/lib/libc/stdtime/Makefile.inc @@ -12,6 +12,10 @@ CFLAGS+= -I${SRCTOP}/contrib/tzcode/stdtime -I${LIBC_SRCTOP}/stdtime CFLAGS.localtime.c= -fwrapv +.if ${MK_DETECT_TZ_CHANGES} != "no" +CFLAGS+= -DDETECT_TZ_CHANGES +.endif + MAN+= ctime.3 strftime.3 strptime.3 time2posix.3 MAN+= tzfile.5 diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 28e18260affd..ff894d3b3517 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -196,6 +196,7 @@ __DEFAULT_NO_OPTIONS = \ BHYVE_SNAPSHOT \ CLANG_EXTRAS \ CLANG_FORMAT \ + DETECT_TZ_CHANGES \ DTRACE_TESTS \ EXPERIMENTAL \ HESIOD \ diff --git a/tools/build/options/WITH_DETECT_TZ_CHANGES b/tools/build/options/WITH_DETECT_TZ_CHANGES new file mode 100644 index 000000000000..6a2d18473892 --- /dev/null +++ b/tools/build/options/WITH_DETECT_TZ_CHANGES @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Make the time handling code detect changes to the timezone files. From owner-dev-commits-src-all@freebsd.org Mon Sep 13 14:48:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E57167CA96; Mon, 13 Sep 2021 14:48:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7TqV0SJTz3t6X; Mon, 13 Sep 2021 14:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF589A79; Mon, 13 Sep 2021 14:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DEm5ng044298; Mon, 13 Sep 2021 14:48:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DEm5Jj044297; Mon, 13 Sep 2021 14:48:05 GMT (envelope-from git) Date: Mon, 13 Sep 2021 14:48:05 GMT Message-Id: <202109131448.18DEm5Jj044297@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 7dddc1074434 - stable/12 - linux: make sure to zero the l_siginfo structure for ptrace(2) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7dddc107443465b59fe05843ed57909714100f3c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 14:48:06 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=7dddc107443465b59fe05843ed57909714100f3c commit 7dddc107443465b59fe05843ed57909714100f3c Author: Edward Tomasz Napierala AuthorDate: 2021-06-08 09:18:29 +0000 Commit: Ed Maste CommitDate: 2021-09-13 14:40:45 +0000 linux: make sure to zero the l_siginfo structure for ptrace(2) Reported By: dchagin Sponsored By: EPSRC (cherry picked from commit f102b61d0ecffc6d9cc322fa7a48e0927391421b) --- sys/amd64/linux/linux_ptrace.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/amd64/linux/linux_ptrace.c b/sys/amd64/linux/linux_ptrace.c index aab62e3793cb..792572294764 100644 --- a/sys/amd64/linux/linux_ptrace.c +++ b/sys/amd64/linux/linux_ptrace.c @@ -408,6 +408,7 @@ linux_ptrace_getsiginfo(struct thread *td, pid_t pid, l_ulong data) } sig = bsd_to_linux_signal(lwpinfo.pl_siginfo.si_signo); + memset(&l_siginfo, 0, sizeof(l_siginfo)); siginfo_to_lsiginfo(&lwpinfo.pl_siginfo, &l_siginfo, sig); error = copyout(&l_siginfo, (void *)data, sizeof(l_siginfo)); return (error); From owner-dev-commits-src-all@freebsd.org Mon Sep 13 14:52:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 022FF67CD87; Mon, 13 Sep 2021 14:52:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7Tx36f3rz3vSk; Mon, 13 Sep 2021 14:52:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4446128D; Mon, 13 Sep 2021 14:52:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DEqtX1057854; Mon, 13 Sep 2021 14:52:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DEqtlS057853; Mon, 13 Sep 2021 14:52:55 GMT (envelope-from git) Date: Mon, 13 Sep 2021 14:52:55 GMT Message-Id: <202109131452.18DEqtlS057853@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 159a0e32d58f - stable/11 - apr: Merge r1889604, r1807975 from trunk: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/11 X-Git-Reftype: branch X-Git-Commit: 159a0e32d58f9e7b8d511571935df21f4bfc02a9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 14:52:56 -0000 The branch stable/11 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=159a0e32d58f9e7b8d511571935df21f4bfc02a9 commit 159a0e32d58f9e7b8d511571935df21f4bfc02a9 Author: Joe Orton AuthorDate: 2021-07-02 11:10:33 +0000 Commit: Ed Maste CommitDate: 2021-09-13 14:51:58 +0000 apr: Merge r1889604, r1807975 from trunk: * random/unix/sha2.c (apr__SHA256_Final, apr__SHA256_End): Fix parameter buffer lengths to match declaration, avoiding GCC 11 warning. (no functional change) Bounds-check human-readable date fields (credit: Stefan Sperling) Submitted by: jorton, niq Reviewed by: jorton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1891198 13f79535-47bb-0310-9956-ffa450edef68 (cherry picked from commit fc1b69d0311e50ed05c00c46ad7dd5d560e57cb6) --- contrib/apr/random/unix/sha2.c | 4 ++-- contrib/apr/time/unix/time.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/apr/random/unix/sha2.c b/contrib/apr/random/unix/sha2.c index 12c257d1fa1b..8059a9d78a71 100644 --- a/contrib/apr/random/unix/sha2.c +++ b/contrib/apr/random/unix/sha2.c @@ -425,7 +425,7 @@ void apr__SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) usedspace = freespace = 0; } -void apr__SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { +void apr__SHA256_Final(sha2_byte digest[SHA256_DIGEST_LENGTH], SHA256_CTX* context) { sha2_word32 *d = (sha2_word32*)digest; unsigned int usedspace; @@ -496,7 +496,7 @@ void apr__SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { usedspace = 0; } -char *apr__SHA256_End(SHA256_CTX* context, char buffer[]) { +char *apr__SHA256_End(SHA256_CTX* context, char buffer[SHA256_DIGEST_STRING_LENGTH]) { sha2_byte digest[SHA256_DIGEST_LENGTH], *d = digest; int i; diff --git a/contrib/apr/time/unix/time.c b/contrib/apr/time/unix/time.c index dfa45e690c62..7f0958192769 100644 --- a/contrib/apr/time/unix/time.c +++ b/contrib/apr/time/unix/time.c @@ -142,6 +142,9 @@ APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *t, apr_time_exp_t *xt) static const int dayoffset[12] = {306, 337, 0, 31, 61, 92, 122, 153, 184, 214, 245, 275}; + if (xt->tm_mon < 0 || xt->tm_mon >= 12) + return APR_EBADDATE; + /* shift new year to 1st March in order to make leap year calc easy */ if (xt->tm_mon < 2) From owner-dev-commits-src-all@freebsd.org Mon Sep 13 15:46:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C36A67D58E; Mon, 13 Sep 2021 15:46:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7W6R6g9Rz4fJK; Mon, 13 Sep 2021 15:46:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C52561D07; Mon, 13 Sep 2021 15:46:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DFk7le024803; Mon, 13 Sep 2021 15:46:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DFk7P2024802; Mon, 13 Sep 2021 15:46:07 GMT (envelope-from git) Date: Mon, 13 Sep 2021 15:46:07 GMT Message-Id: <202109131546.18DFk7P2024802@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: b029ef7fe618 - main - Restrict spsr updated in the arm64 set_regs* MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b029ef7fe618c6fa0482958422cc362905c15376 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 15:46:08 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=b029ef7fe618c6fa0482958422cc362905c15376 commit b029ef7fe618c6fa0482958422cc362905c15376 Author: Andrew Turner AuthorDate: 2021-09-13 15:24:34 +0000 Commit: Andrew Turner CommitDate: 2021-09-13 15:32:50 +0000 Restrict spsr updated in the arm64 set_regs* When using ptrace(2) on arm64 to set registers in a 32-bit program we need to take care to only set some of the fields. Follow the existing arm64 path and only let the user set the flags fields. This is also the case in the arm kernel so fixes a change in behaviour between the two. While here update set_regs to only set spsr and elr once. Sponsored by: The FreeBSD Foundation --- sys/arm64/arm64/machdep.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c index ee6f5157f5f3..89c4f21134f8 100644 --- a/sys/arm64/arm64/machdep.c +++ b/sys/arm64/arm64/machdep.c @@ -254,9 +254,7 @@ set_regs(struct thread *td, struct reg *regs) frame = td->td_frame; frame->tf_sp = regs->sp; frame->tf_lr = regs->lr; - frame->tf_elr = regs->elr; frame->tf_spsr &= ~PSR_FLAGS; - frame->tf_spsr |= regs->spsr & PSR_FLAGS; memcpy(frame->tf_x, regs->x, sizeof(frame->tf_x)); @@ -268,9 +266,13 @@ set_regs(struct thread *td, struct reg *regs) * it put it. */ frame->tf_elr = regs->x[15]; - frame->tf_spsr = regs->x[16] & PSR_FLAGS; - } + frame->tf_spsr |= regs->x[16] & PSR_FLAGS; + } else #endif + { + frame->tf_elr = regs->elr; + frame->tf_spsr |= regs->spsr & PSR_FLAGS; + } return (0); } @@ -490,7 +492,8 @@ set_regs32(struct thread *td, struct reg32 *regs) tf->tf_x[13] = regs->r_sp; tf->tf_x[14] = regs->r_lr; tf->tf_elr = regs->r_pc; - tf->tf_spsr = regs->r_cpsr; + tf->tf_spsr &= ~PSR_FLAGS; + tf->tf_spsr |= regs->r_cpsr & PSR_FLAGS; return (0); } From owner-dev-commits-src-all@freebsd.org Mon Sep 13 16:07:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D6B967D7FB; Mon, 13 Sep 2021 16:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7WZb3rkqz4l3d; Mon, 13 Sep 2021 16:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 63E721F4A; Mon, 13 Sep 2021 16:07:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DG736f052475; Mon, 13 Sep 2021 16:07:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DG73f4052474; Mon, 13 Sep 2021 16:07:03 GMT (envelope-from git) Date: Mon, 13 Sep 2021 16:07:03 GMT Message-Id: <202109131607.18DG73f4052474@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dimitry Andric Subject: git: 45feade38ec3 - main - Add -Wno-error=unused-but-set-variable when building with Clang 13+ MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 45feade38ec3e8e30086dedc6ee81cbf816293e3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 16:07:03 -0000 The branch main has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=45feade38ec3e8e30086dedc6ee81cbf816293e3 commit 45feade38ec3e8e30086dedc6ee81cbf816293e3 Author: Dimitry Andric AuthorDate: 2021-08-26 15:36:03 +0000 Commit: Dimitry Andric CommitDate: 2021-09-13 16:05:43 +0000 Add -Wno-error=unused-but-set-variable when building with Clang 13+ This warning triggers many times while building world. Downgrade it to a warning until all occurrences have been fixed. Once the Clang warnings have been fixed we should be able to turn it on for GCC as well. See also f4fed768bba45a406f73ed1491d7e52fd1a8711d which did the same for the kernel builds. Reviewed by: arichardson, imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D31927 --- share/mk/bsd.sys.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index a4bb54e19890..304d8dd7d243 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -80,6 +80,9 @@ CWARNFLAGS+= -Wno-pointer-sign .if ${WARNS} <= 6 CWARNFLAGS.clang+= -Wno-empty-body -Wno-string-plus-int CWARNFLAGS.clang+= -Wno-unused-const-variable +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 130000 +CWARNFLAGS.clang+= -Wno-error=unused-but-set-variable +.endif .endif # WARNS <= 6 .if ${WARNS} <= 3 CWARNFLAGS.clang+= -Wno-tautological-compare -Wno-unused-value\ From owner-dev-commits-src-all@freebsd.org Mon Sep 13 16:29:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7E1367D965; Mon, 13 Sep 2021 16:29:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7X4Q48CXz4r8Z; Mon, 13 Sep 2021 16:29:26 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (unknown [IPv6:2601:648:8681:1cb0:d43:6314:1d25:bd0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 0351636B33; Mon, 13 Sep 2021 16:29:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: b864b67a0d19 - main - socket: Do not include control messages in FIONREAD return value To: Mark Johnston , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202109122039.18CKdpwW094531@gitrepo.freebsd.org> From: John Baldwin Message-ID: <270ac6c6-1fdf-879a-cbea-ef43200ef12a@FreeBSD.org> Date: Mon, 13 Sep 2021 09:29:24 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <202109122039.18CKdpwW094531@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 16:29:26 -0000 On 9/12/21 1:39 PM, Mark Johnston wrote: > The branch main has been updated by markj: > > URL: https://cgit.FreeBSD.org/src/commit/?id=b864b67a0d197f59ecf6698940600956ceee2cae > > commit b864b67a0d197f59ecf6698940600956ceee2cae > Author: Mark Johnston > AuthorDate: 2021-09-12 20:05:49 +0000 > Commit: Mark Johnston > CommitDate: 2021-09-12 20:39:44 +0000 > > socket: Do not include control messages in FIONREAD return value > > Some system software expects to be able to read at least the number of > bytes returned by FIONREAD. When control messages are counted in this > return value, this assumption is violated. Follow Linux and OpenBSD > here (as well as our own kevent(EVFILT_READ)) and only return the number > of data bytes available. > > Reported by: avg > MFC after: 2 weeks In a somewhat similar vein, it would be nice to eventually have new ioctls to know how much data and control are available in the next message for datagram-oriented sockets. Right now if you are working with a datagram socket with variable-sized messages there's no good way to know how big the next message is (to resize a read buffer) as FIONREAD can count multiple messages. There's also no way at all to cope with control messages aside from retrying with some naive algorithm like doubling the size if MSG_CTRUNC is set, but that also requires always using MSG_PEEK so that you always end up reading a message at least twice. -- John Baldwin From owner-dev-commits-src-all@freebsd.org Mon Sep 13 16:56:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 834D667E504; Mon, 13 Sep 2021 16:56:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7Xg72xcSz3FfC; Mon, 13 Sep 2021 16:56:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 454692871; Mon, 13 Sep 2021 16:56:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DGu304018316; Mon, 13 Sep 2021 16:56:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DGu3b2018315; Mon, 13 Sep 2021 16:56:03 GMT (envelope-from git) Date: Mon, 13 Sep 2021 16:56:03 GMT Message-Id: <202109131656.18DGu3b2018315@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: e99255c8a6ca - main - amd64: do not touch low memory in acpi_wakeup_ap() if booted by UEFI MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e99255c8a6cae324aeede7f5013d080a2d361e3f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 16:56:03 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=e99255c8a6cae324aeede7f5013d080a2d361e3f commit e99255c8a6cae324aeede7f5013d080a2d361e3f Author: Konstantin Belousov AuthorDate: 2021-09-11 18:19:27 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-13 16:51:52 +0000 amd64: do not touch low memory in acpi_wakeup_ap() if booted by UEFI Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31916 --- sys/x86/acpica/acpi_wakeup.c | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/sys/x86/acpica/acpi_wakeup.c b/sys/x86/acpica/acpi_wakeup.c index b4bbe660bea4..ef52ccc3aef6 100644 --- a/sys/x86/acpica/acpi_wakeup.c +++ b/sys/x86/acpica/acpi_wakeup.c @@ -164,16 +164,22 @@ acpi_wakeup_cpus(struct acpi_softc *sc) int cpu; u_char mpbiosreason; - /* save the current value of the warm-start vector */ - mpbioswarmvec = *((uint32_t *)WARMBOOT_OFF); - outb(CMOS_REG, BIOS_RESET); - mpbiosreason = inb(CMOS_DATA); - - /* setup a vector to our boot code */ - *((volatile u_short *)WARMBOOT_OFF) = WARMBOOT_TARGET; - *((volatile u_short *)WARMBOOT_SEG) = sc->acpi_wakephys >> 4; - outb(CMOS_REG, BIOS_RESET); - outb(CMOS_DATA, BIOS_WARM); /* 'warm-start' */ +#ifdef __amd64__ + if (!efi_boot) { +#endif + /* save the current value of the warm-start vector */ + mpbioswarmvec = *((uint32_t *)WARMBOOT_OFF); + outb(CMOS_REG, BIOS_RESET); + mpbiosreason = inb(CMOS_DATA); + + /* setup a vector to our boot code */ + *((volatile u_short *)WARMBOOT_OFF) = WARMBOOT_TARGET; + *((volatile u_short *)WARMBOOT_SEG) = sc->acpi_wakephys >> 4; + outb(CMOS_REG, BIOS_RESET); + outb(CMOS_DATA, BIOS_WARM); /* 'warm-start' */ +#ifdef __amd64__ + } +#endif /* Wake up each AP. */ for (cpu = 1; cpu < mp_ncpus; cpu++) { @@ -197,11 +203,17 @@ acpi_wakeup_cpus(struct acpi_softc *sc) pmap_remap_lowptdi(false); #endif - /* restore the warmstart vector */ - *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; +#ifdef __amd64__ + if (!efi_boot) { +#endif + /* restore the warmstart vector */ + *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; - outb(CMOS_REG, BIOS_RESET); - outb(CMOS_DATA, mpbiosreason); + outb(CMOS_REG, BIOS_RESET); + outb(CMOS_DATA, mpbiosreason); +#ifdef __amd64__ + } +#endif } #endif From owner-dev-commits-src-all@freebsd.org Mon Sep 13 16:56:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B3D1A67E44C; Mon, 13 Sep 2021 16:56:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7Xg84KXRz3Fm6; Mon, 13 Sep 2021 16:56:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B6BF2C17; Mon, 13 Sep 2021 16:56:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DGu4Lh018344; Mon, 13 Sep 2021 16:56:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DGu43L018343; Mon, 13 Sep 2021 16:56:04 GMT (envelope-from git) Date: Mon, 13 Sep 2021 16:56:04 GMT Message-Id: <202109131656.18DGu43L018343@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: ceca8ac1ce47 - main - x86 acpi_install_wakeup_handler(): style MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ceca8ac1ce47e1f87ba09463aa84eb1c879c37d9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 16:56:04 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ceca8ac1ce47e1f87ba09463aa84eb1c879c37d9 commit ceca8ac1ce47e1f87ba09463aa84eb1c879c37d9 Author: Konstantin Belousov AuthorDate: 2021-09-11 18:26:51 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-13 16:52:06 +0000 x86 acpi_install_wakeup_handler(): style Do not use tab between type and variable name in local declarations. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31916 --- sys/x86/acpica/acpi_wakeup.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/x86/acpica/acpi_wakeup.c b/sys/x86/acpica/acpi_wakeup.c index ef52ccc3aef6..17946ede45d0 100644 --- a/sys/x86/acpica/acpi_wakeup.c +++ b/sys/x86/acpica/acpi_wakeup.c @@ -423,12 +423,12 @@ freepages: void acpi_install_wakeup_handler(struct acpi_softc *sc) { - static void *wakeaddr; - void *wakepages[ACPI_WAKEPAGES]; + static void *wakeaddr; + void *wakepages[ACPI_WAKEPAGES]; #ifdef __amd64__ - uint64_t *pt5, *pt4, *pt3, *pt2; - vm_paddr_t pt5pa, pt4pa, pt3pa, pt2pa; - int i; + uint64_t *pt5, *pt4, *pt3, *pt2; + vm_paddr_t pt5pa, pt4pa, pt3pa, pt2pa; + int i; #endif if (wakeaddr != NULL) From owner-dev-commits-src-all@freebsd.org Mon Sep 13 16:56:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD2F567E49F; Mon, 13 Sep 2021 16:56:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7Xg95GfRz3FfM; Mon, 13 Sep 2021 16:56:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 901322C18; Mon, 13 Sep 2021 16:56:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DGu5j8018371; Mon, 13 Sep 2021 16:56:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DGu5mH018370; Mon, 13 Sep 2021 16:56:05 GMT (envelope-from git) Date: Mon, 13 Sep 2021 16:56:05 GMT Message-Id: <202109131656.18DGu5mH018370@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: db2ba218d9fe - main - amd64 acpi_wakeup: map 1:1 whole low 4G for the trampoline page table MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: db2ba218d9fe6a541a4f537a641cce95f952fd98 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 16:56:06 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=db2ba218d9fe6a541a4f537a641cce95f952fd98 commit db2ba218d9fe6a541a4f537a641cce95f952fd98 Author: Konstantin Belousov AuthorDate: 2021-09-11 18:36:38 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-13 16:52:13 +0000 amd64 acpi_wakeup: map 1:1 whole low 4G for the trampoline page table This is required since kernel text might be physically located anywhere below 4G. PR: 258432 Reported by: Taku YAMAMOTO Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31916 --- sys/x86/acpica/acpi_wakeup.c | 77 +++++++++++++++++++++++++++----------------- 1 file changed, 48 insertions(+), 29 deletions(-) diff --git a/sys/x86/acpica/acpi_wakeup.c b/sys/x86/acpica/acpi_wakeup.c index 17946ede45d0..68e0892a31e6 100644 --- a/sys/x86/acpica/acpi_wakeup.c +++ b/sys/x86/acpica/acpi_wakeup.c @@ -99,7 +99,7 @@ static void acpi_wakeup_cpus(struct acpi_softc *); #endif #ifdef __amd64__ -#define ACPI_WAKEPAGES 5 +#define ACPI_WAKEPAGES 8 #else #define ACPI_WAKEPAGES 1 #endif @@ -426,8 +426,8 @@ acpi_install_wakeup_handler(struct acpi_softc *sc) static void *wakeaddr; void *wakepages[ACPI_WAKEPAGES]; #ifdef __amd64__ - uint64_t *pt5, *pt4, *pt3, *pt2; - vm_paddr_t pt5pa, pt4pa, pt3pa, pt2pa; + uint64_t *pt5, *pt4, *pt3, *pt2_0, *pt2_1, *pt2_2, *pt2_3; + vm_paddr_t pt5pa, pt4pa, pt3pa, pt2_0pa, pt2_1pa, pt2_2pa, pt2_3pa; int i; #endif @@ -443,15 +443,21 @@ acpi_install_wakeup_handler(struct acpi_softc *sc) #ifdef __amd64__ if (la57) { - pt5 = wakepages[4]; + pt5 = wakepages[7]; pt5pa = vtophys(pt5); } pt4 = wakepages[1]; pt3 = wakepages[2]; - pt2 = wakepages[3]; + pt2_0 = wakepages[3]; + pt2_1 = wakepages[4]; + pt2_2 = wakepages[5]; + pt2_3 = wakepages[6]; pt4pa = vtophys(pt4); pt3pa = vtophys(pt3); - pt2pa = vtophys(pt2); + pt2_0pa = vtophys(pt2_0); + pt2_1pa = vtophys(pt2_1); + pt2_2pa = vtophys(pt2_2); + pt2_3pa = vtophys(pt2_3); #endif bcopy(wakecode, (void *)sc->acpi_wakeaddr, sizeof(wakecode)); @@ -473,31 +479,44 @@ acpi_install_wakeup_handler(struct acpi_softc *sc) #ifndef __amd64__ WAKECODE_FIXUP(wakeup_cr3, register_t, pmap_get_kcr3()); #else /* __amd64__ */ - /* Create the initial 1GB replicated page tables */ - for (i = 0; i < NPTEPG; i++) { - if (la57) { - pt5[i] = (uint64_t)pt4pa; - pt5[i] |= PG_V | PG_RW | PG_U; - } - - /* - * Each slot of the level 4 pages points - * to the same level 3 page - */ - pt4[i] = (uint64_t)pt3pa; - pt4[i] |= PG_V | PG_RW | PG_U; - - /* - * Each slot of the level 3 pages points - * to the same level 2 page - */ - pt3[i] = (uint64_t)pt2pa; - pt3[i] |= PG_V | PG_RW | PG_U; + /* Create 1:1 mapping for the low 4G */ + if (la57) { + bcopy(kernel_pmap->pm_pmltop, pt5, PAGE_SIZE); + pt5[0] = (uint64_t)pt4pa; + pt5[0] |= PG_V | PG_RW | PG_U; + } else { + bcopy(kernel_pmap->pm_pmltop, pt4, PAGE_SIZE); + } - /* The level 2 page slots are mapped with 2MB pages for 1GB. */ - pt2[i] = i * NBPDR; - pt2[i] |= PG_V | PG_RW | PG_PS | PG_U; + pt4[0] = (uint64_t)pt3pa; + pt4[0] |= PG_V | PG_RW | PG_U; + + pt3[0] = (uint64_t)pt2_0pa; + pt3[0] |= PG_V | PG_RW | PG_U; + pt3[1] = (uint64_t)pt2_1pa; + pt3[1] |= PG_V | PG_RW | PG_U; + pt3[2] = (uint64_t)pt2_2pa; + pt3[2] |= PG_V | PG_RW | PG_U; + pt3[3] = (uint64_t)pt2_3pa; + pt3[3] |= PG_V | PG_RW | PG_U; + + for (i = 0; i < NPDEPG; i++) { + pt2_0[i] = (pd_entry_t)i * NBPDR; + pt2_0[i] |= PG_V | PG_RW | PG_PS | PG_U; + } + for (i = 0; i < NPDEPG; i++) { + pt2_1[i] = (pd_entry_t)NBPDP + i * NBPDR; + pt2_1[i] |= PG_V | PG_RW | PG_PS | PG_U; } + for (i = 0; i < NPDEPG; i++) { + pt2_2[i] = (pd_entry_t)2 * NBPDP + i * NBPDR; + pt2_2[i] |= PG_V | PG_RW | PG_PS | PG_U; + } + for (i = 0; i < NPDEPG; i++) { + pt2_3[i] = (pd_entry_t)3 * NBPDP + i * NBPDR; + pt2_3[i] |= PG_V | PG_RW | PG_PS | PG_U; + } + #endif /* !__amd64__ */ if (bootverbose) From owner-dev-commits-src-all@freebsd.org Mon Sep 13 17:04:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C7BA67E7A4; Mon, 13 Sep 2021 17:04:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7XrZ43tsz3HSl; Mon, 13 Sep 2021 17:04:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D6B62CA3; Mon, 13 Sep 2021 17:04:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DH4E5X032331; Mon, 13 Sep 2021 17:04:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DH4EdU032330; Mon, 13 Sep 2021 17:04:14 GMT (envelope-from git) Date: Mon, 13 Sep 2021 17:04:14 GMT Message-Id: <202109131704.18DH4EdU032330@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 9b1bb0aee697 - main - cxgbei: Disable ISO for -SO cards without external memory. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9b1bb0aee697352b39b3efa1843f581ca29068ba Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 17:04:14 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9b1bb0aee697352b39b3efa1843f581ca29068ba commit 9b1bb0aee697352b39b3efa1843f581ca29068ba Author: John Baldwin AuthorDate: 2021-09-13 16:57:54 +0000 Commit: John Baldwin CommitDate: 2021-09-13 16:57:54 +0000 cxgbei: Disable ISO for -SO cards without external memory. Reported by: Jithesh Arakkan @ Chelsio Sponsored by: Chelsio Communications --- sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c index 687fc545cebd..4b1eb0718e86 100644 --- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c @@ -95,6 +95,7 @@ __FBSDID("$FreeBSD$"); #include #include "common/common.h" +#include "common/t4_regs.h" #include "common/t4_tcb.h" #include "tom/t4_tom.h" #include "cxgbei.h" @@ -707,6 +708,19 @@ find_offload_adapter(struct adapter *sc, void *arg) INP_WUNLOCK(inp); } +static bool +is_memfree(struct adapter *sc) +{ + uint32_t em; + + em = t4_read_reg(sc, A_MA_TARGET_MEM_ENABLE); + if ((em & F_EXT_MEM_ENABLE) != 0) + return (false); + if (is_t5(sc) && (em & F_EXT_MEM1_ENABLE) != 0) + return (false); + return (true); +} + /* XXXNP: move this to t4_tom. */ static void send_iscsi_flowc_wr(struct adapter *sc, struct toepcb *toep, int maxlen) @@ -863,7 +877,8 @@ icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd) if (ic->ic_data_crc32c) icc->ulp_submode |= ULP_CRC_DATA; - if (icc->sc->tt.iso && chip_id(icc->sc) >= CHELSIO_T5) { + if (icc->sc->tt.iso && chip_id(icc->sc) >= CHELSIO_T5 && + !is_memfree(icc->sc)) { max_iso_pdus = CXGBEI_MAX_ISO_PAYLOAD / max_tx_pdu_len; ic->ic_hw_isomax = max_iso_pdus * From owner-dev-commits-src-all@freebsd.org Mon Sep 13 17:04:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D438467E555; Mon, 13 Sep 2021 17:04:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7Xrb5J1Dz3HYp; Mon, 13 Sep 2021 17:04:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 92EAA2E94; Mon, 13 Sep 2021 17:04:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DH4FOv032386; Mon, 13 Sep 2021 17:04:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DH4FQn032385; Mon, 13 Sep 2021 17:04:15 GMT (envelope-from git) Date: Mon, 13 Sep 2021 17:04:15 GMT Message-Id: <202109131704.18DH4FQn032385@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: b7caa8157602 - main - cxgbei: Return early for EBUSY error in icl_cxgbei_conn_handoff. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b7caa8157602f4eb9acd2729b48ba3a0c0cdc045 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 17:04:15 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b7caa8157602f4eb9acd2729b48ba3a0c0cdc045 commit b7caa8157602f4eb9acd2729b48ba3a0c0cdc045 Author: John Baldwin AuthorDate: 2021-09-13 16:57:54 +0000 Commit: John Baldwin CommitDate: 2021-09-13 16:57:54 +0000 cxgbei: Return early for EBUSY error in icl_cxgbei_conn_handoff. This permits unindenting almost half of the function. Sponsored by: Chelsio Communications --- sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 80 ++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 43 deletions(-) diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c index 4b1eb0718e86..6bec1f812cc0 100644 --- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c @@ -857,52 +857,46 @@ icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd) inp = sotoinpcb(so); INP_WLOCK(inp); tp = intotcpcb(inp); - if (inp->inp_flags & (INP_DROPPED | INP_TIMEWAIT)) - error = EBUSY; - else { - /* - * socket could not have been "unoffloaded" if here. - */ - MPASS(tp->t_flags & TF_TOE); - MPASS(tp->tod != NULL); - MPASS(tp->t_toe != NULL); - toep = tp->t_toe; - MPASS(toep->vi->adapter == icc->sc); - icc->toep = toep; - icc->cwt = cxgbei_select_worker_thread(icc); - - icc->ulp_submode = 0; - if (ic->ic_header_crc32c) - icc->ulp_submode |= ULP_CRC_HEADER; - if (ic->ic_data_crc32c) - icc->ulp_submode |= ULP_CRC_DATA; - - if (icc->sc->tt.iso && chip_id(icc->sc) >= CHELSIO_T5 && - !is_memfree(icc->sc)) { - max_iso_pdus = CXGBEI_MAX_ISO_PAYLOAD / - max_tx_pdu_len; - ic->ic_hw_isomax = max_iso_pdus * - ic->ic_max_send_data_segment_length; - } else - max_iso_pdus = 1; - - so->so_options |= SO_NO_DDP; - toep->params.ulp_mode = ULP_MODE_ISCSI; - toep->ulpcb = icc; - - send_iscsi_flowc_wr(icc->sc, toep, - roundup(max_iso_pdus * max_tx_pdu_len, tp->t_maxseg)); - set_ulp_mode_iscsi(icc->sc, toep, icc->ulp_submode); - error = 0; + if (inp->inp_flags & (INP_DROPPED | INP_TIMEWAIT)) { + INP_WUNLOCK(inp); + return (EBUSY); } - INP_WUNLOCK(inp); - if (error == 0) { - error = icl_cxgbei_setsockopt(ic, so, max_tx_pdu_len, - max_rx_pdu_len); - } + /* + * socket could not have been "unoffloaded" if here. + */ + MPASS(tp->t_flags & TF_TOE); + MPASS(tp->tod != NULL); + MPASS(tp->t_toe != NULL); + toep = tp->t_toe; + MPASS(toep->vi->adapter == icc->sc); + icc->toep = toep; + icc->cwt = cxgbei_select_worker_thread(icc); + + icc->ulp_submode = 0; + if (ic->ic_header_crc32c) + icc->ulp_submode |= ULP_CRC_HEADER; + if (ic->ic_data_crc32c) + icc->ulp_submode |= ULP_CRC_DATA; + + if (icc->sc->tt.iso && chip_id(icc->sc) >= CHELSIO_T5 && + !is_memfree(icc->sc)) { + max_iso_pdus = CXGBEI_MAX_ISO_PAYLOAD / max_tx_pdu_len; + ic->ic_hw_isomax = max_iso_pdus * + ic->ic_max_send_data_segment_length; + } else + max_iso_pdus = 1; + + so->so_options |= SO_NO_DDP; + toep->params.ulp_mode = ULP_MODE_ISCSI; + toep->ulpcb = icc; + + send_iscsi_flowc_wr(icc->sc, toep, + roundup(max_iso_pdus * max_tx_pdu_len, tp->t_maxseg)); + set_ulp_mode_iscsi(icc->sc, toep, icc->ulp_submode); + INP_WUNLOCK(inp); - return (error); + return (icl_cxgbei_setsockopt(ic, so, max_tx_pdu_len, max_rx_pdu_len)); } void From owner-dev-commits-src-all@freebsd.org Mon Sep 13 17:04:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4458467E810; Mon, 13 Sep 2021 17:04:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7Xrc72gmz3HYy; Mon, 13 Sep 2021 17:04:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B02D72C3E; Mon, 13 Sep 2021 17:04:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DH4G2g032410; Mon, 13 Sep 2021 17:04:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DH4GBA032409; Mon, 13 Sep 2021 17:04:16 GMT (envelope-from git) Date: Mon, 13 Sep 2021 17:04:16 GMT Message-Id: <202109131704.18DH4GBA032409@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: f63ddf465fe0 - main - cxgbei: Only convert "plain" TCP connections to ISCSI. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f63ddf465fe09d3547deaf80fbdb91bc7b816dfb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 17:04:17 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=f63ddf465fe09d3547deaf80fbdb91bc7b816dfb commit f63ddf465fe09d3547deaf80fbdb91bc7b816dfb Author: John Baldwin AuthorDate: 2021-09-13 16:57:54 +0000 Commit: John Baldwin CommitDate: 2021-09-13 16:57:54 +0000 cxgbei: Only convert "plain" TCP connections to ISCSI. Reject attempts to convert a connection using a different ULP mode: (e.g. DDP or TLS) to ISCSI. Reported by: Jithesh Arakkan @ Chelsio Sponsored by: Chelsio Communications --- sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c index 6bec1f812cc0..cf1032f2a3a2 100644 --- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c +++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c @@ -870,6 +870,12 @@ icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd) MPASS(tp->t_toe != NULL); toep = tp->t_toe; MPASS(toep->vi->adapter == icc->sc); + + if (ulp_mode(toep) != ULP_MODE_NONE) { + INP_WUNLOCK(inp); + return (EINVAL); + } + icc->toep = toep; icc->cwt = cxgbei_select_worker_thread(icc); @@ -887,7 +893,6 @@ icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd) } else max_iso_pdus = 1; - so->so_options |= SO_NO_DDP; toep->params.ulp_mode = ULP_MODE_ISCSI; toep->ulpcb = icc; From owner-dev-commits-src-all@freebsd.org Mon Sep 13 17:04:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5108367E813; Mon, 13 Sep 2021 17:04:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7Xrg0vPtz3Hhc; Mon, 13 Sep 2021 17:04:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEFF82E95; Mon, 13 Sep 2021 17:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DH4Irq032458; Mon, 13 Sep 2021 17:04:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DH4IlS032457; Mon, 13 Sep 2021 17:04:18 GMT (envelope-from git) Date: Mon, 13 Sep 2021 17:04:18 GMT Message-Id: <202109131704.18DH4IlS032457@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 3b5f95d7bd20 - main - ctld: Disable TCP DDP for connection sockets. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3b5f95d7bd20e366d720a47a79c451ae037a3ae1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 17:04:19 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=3b5f95d7bd20e366d720a47a79c451ae037a3ae1 commit 3b5f95d7bd20e366d720a47a79c451ae037a3ae1 Author: John Baldwin AuthorDate: 2021-09-13 16:57:54 +0000 Commit: John Baldwin CommitDate: 2021-09-13 16:57:54 +0000 ctld: Disable TCP DDP for connection sockets. cxgbei is not able to offload PDU processing for a socket using TCP DDP offload. Sponsored by: Chelsio Communications --- usr.sbin/ctld/ctld.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.sbin/ctld/ctld.c b/usr.sbin/ctld/ctld.c index 7af1d88da44a..c37181ff00d0 100644 --- a/usr.sbin/ctld/ctld.c +++ b/usr.sbin/ctld/ctld.c @@ -2178,6 +2178,10 @@ conf_apply(struct conf *oldconf, struct conf *newconf) &sockbuf, sizeof(sockbuf)) == -1) log_warn("setsockopt(SO_SNDBUF) failed " "for %s", newp->p_listen); + if (setsockopt(newp->p_socket, SOL_SOCKET, SO_NO_DDP, + &one, sizeof(one)) == -1) + log_warn("setsockopt(SO_NO_DDP) failed " + "for %s", newp->p_listen); error = setsockopt(newp->p_socket, SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one)); if (error != 0) { From owner-dev-commits-src-all@freebsd.org Mon Sep 13 17:04:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6934767E731; Mon, 13 Sep 2021 17:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7Xrf0gp7z3HW3; Mon, 13 Sep 2021 17:04:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3E8E2F1C; Mon, 13 Sep 2021 17:04:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DH4Huj032434; Mon, 13 Sep 2021 17:04:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DH4HBL032433; Mon, 13 Sep 2021 17:04:17 GMT (envelope-from git) Date: Mon, 13 Sep 2021 17:04:17 GMT Message-Id: <202109131704.18DH4HBL032433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 91c62d626d0e - main - iscsid: Disable TCP DDP for connection sockets. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 91c62d626d0e9995da9dc424120a4f1b0b987eea Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 17:04:18 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=91c62d626d0e9995da9dc424120a4f1b0b987eea commit 91c62d626d0e9995da9dc424120a4f1b0b987eea Author: John Baldwin AuthorDate: 2021-09-13 16:57:54 +0000 Commit: John Baldwin CommitDate: 2021-09-13 16:57:54 +0000 iscsid: Disable TCP DDP for connection sockets. cxgbei is not able to offload PDU processing for a socket using TCP DDP offload. Sponsored by: Chelsio Communications --- usr.sbin/iscsid/iscsid.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/usr.sbin/iscsid/iscsid.c b/usr.sbin/iscsid/iscsid.c index 797a7561f79c..db8b5d4f5e4c 100644 --- a/usr.sbin/iscsid/iscsid.c +++ b/usr.sbin/iscsid/iscsid.c @@ -164,7 +164,7 @@ connection_new(int iscsi_fd, const struct iscsi_daemon_request *request) #ifdef ICL_KERNEL_PROXY struct iscsi_daemon_connect idc; #endif - int error, sockbuf; + int error, optval; conn = calloc(1, sizeof(*conn)); if (conn == NULL) @@ -275,14 +275,18 @@ connection_new(int iscsi_fd, const struct iscsi_daemon_request *request) fail(conn, strerror(errno)); log_err(1, "failed to create socket for %s", from_addr); } - sockbuf = SOCKBUF_SIZE; + optval = SOCKBUF_SIZE; if (setsockopt(conn->conn_socket, SOL_SOCKET, SO_RCVBUF, - &sockbuf, sizeof(sockbuf)) == -1) + &optval, sizeof(optval)) == -1) log_warn("setsockopt(SO_RCVBUF) failed"); - sockbuf = SOCKBUF_SIZE; + optval = SOCKBUF_SIZE; if (setsockopt(conn->conn_socket, SOL_SOCKET, SO_SNDBUF, - &sockbuf, sizeof(sockbuf)) == -1) + &optval, sizeof(optval)) == -1) log_warn("setsockopt(SO_SNDBUF) failed"); + optval = 1; + if (setsockopt(conn->conn_socket, SOL_SOCKET, SO_NO_DDP, + &optval, sizeof(optval)) == -1) + log_warn("setsockopt(SO_NO_DDP) failed"); if (conn->conn_conf.isc_dscp != -1) { int tos = conn->conn_conf.isc_dscp << 2; if (to_ai->ai_family == AF_INET) { From owner-dev-commits-src-all@freebsd.org Mon Sep 13 18:02:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BEEF467EDDF; Mon, 13 Sep 2021 18:02:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7Z7P548Fz3r4D; Mon, 13 Sep 2021 18:02:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DF393BFA; Mon, 13 Sep 2021 18:02:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DI294k011452; Mon, 13 Sep 2021 18:02:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DI29QQ011451; Mon, 13 Sep 2021 18:02:09 GMT (envelope-from git) Date: Mon, 13 Sep 2021 18:02:09 GMT Message-Id: <202109131802.18DI29QQ011451@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 93d6fa53c995 - main - Disable -Woverflow errors for i386 for GCC 9. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 93d6fa53c9951563be3081a347cc4dc1917ad452 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 18:02:09 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=93d6fa53c9951563be3081a347cc4dc1917ad452 commit 93d6fa53c9951563be3081a347cc4dc1917ad452 Author: John Baldwin AuthorDate: 2021-09-13 18:00:38 +0000 Commit: John Baldwin CommitDate: 2021-09-13 18:00:38 +0000 Disable -Woverflow errors for i386 for GCC 9. GCC 9 warns about floating point constants overflowing for i386. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D26201 --- share/mk/bsd.sys.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 304d8dd7d243..14b643fe0a20 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -196,6 +196,13 @@ CWARNFLAGS+= -Wno-error=aggressive-loop-optimizations \ -Wno-error=stringop-truncation .endif +# GCC 9.2.0 +.if ${COMPILER_VERSION} >= 90200 +.if ${MACHINE_ARCH} == "i386" +CWARNFLAGS+= -Wno-error=overflow +.endif +.endif + # GCC's own arm_neon.h triggers various warnings .if ${MACHINE_CPUARCH} == "aarch64" CWARNFLAGS+= -Wno-system-headers From owner-dev-commits-src-all@freebsd.org Mon Sep 13 19:25:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 435666A8525; Mon, 13 Sep 2021 19:25:37 +0000 (UTC) (envelope-from michael.tuexen@macmic.franken.de) Received: from drew.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.franken.de", Issuer "Sectigo RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7bzh6qSpz4pVB; Mon, 13 Sep 2021 19:25:36 +0000 (UTC) (envelope-from michael.tuexen@macmic.franken.de) Received: from smtpclient.apple (unknown [IPv6:2a02:8109:1140:c3d:1442:bd8b:13ff:7b32]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTPSA id 19AC5721E2825; Mon, 13 Sep 2021 21:25:24 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: b864b67a0d19 - main - socket: Do not include control messages in FIONREAD return value From: Michael Tuexen In-Reply-To: <270ac6c6-1fdf-879a-cbea-ef43200ef12a@FreeBSD.org> Date: Mon, 13 Sep 2021 21:25:23 +0200 Cc: Mark Johnston , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202109122039.18CKdpwW094531@gitrepo.freebsd.org> <270ac6c6-1fdf-879a-cbea-ef43200ef12a@FreeBSD.org> To: John Baldwin X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=disabled version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail-n.franken.de X-Rspamd-Queue-Id: 4H7bzh6qSpz4pVB X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 19:25:37 -0000 > On 13. Sep 2021, at 18:29, John Baldwin wrote: >=20 > On 9/12/21 1:39 PM, Mark Johnston wrote: >> The branch main has been updated by markj: >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Db864b67a0d197f59ecf6698940600956= ceee2cae >> commit b864b67a0d197f59ecf6698940600956ceee2cae >> Author: Mark Johnston >> AuthorDate: 2021-09-12 20:05:49 +0000 >> Commit: Mark Johnston >> CommitDate: 2021-09-12 20:39:44 +0000 >> socket: Do not include control messages in FIONREAD return value >> Some system software expects to be able to read at least the = number of >> bytes returned by FIONREAD. When control messages are counted in = this >> return value, this assumption is violated. Follow Linux and = OpenBSD >> here (as well as our own kevent(EVFILT_READ)) and only return the = number >> of data bytes available. >> Reported by: avg >> MFC after: 2 weeks >=20 > In a somewhat similar vein, it would be nice to eventually have new = ioctls > to know how much data and control are available in the next message = for > datagram-oriented sockets. Right now if you are working with a = datagram > socket with variable-sized messages there's no good way to know how = big the > next message is (to resize a read buffer) as FIONREAD can count = multiple > messages. There's also no way at all to cope with control messages = aside > from retrying with some naive algorithm like doubling the size if = MSG_CTRUNC > is set, but that also requires always using MSG_PEEK so that you = always > end up reading a message at least twice. That still requires two system calls. In SCTP, there is a CMSG you can receive with a messages, which contains the metadata of the next message you will receive. So it might be an idea to define a CMSG containing the length of the = next message (if available). Best regards Michael >=20 > --=20 > John Baldwin From owner-dev-commits-src-all@freebsd.org Mon Sep 13 19:25:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 691E96A84DA; Mon, 13 Sep 2021 19:25:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7bzt1ZxJz4pKp; Mon, 13 Sep 2021 19:25:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37D365088; Mon, 13 Sep 2021 19:25:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DJPjw1019146; Mon, 13 Sep 2021 19:25:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DJPjOA019145; Mon, 13 Sep 2021 19:25:45 GMT (envelope-from git) Date: Mon, 13 Sep 2021 19:25:45 GMT Message-Id: <202109131925.18DJPjOA019145@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mariusz Zaborski Subject: git: e673ac3ffbfb - main - libnv: Fix array unpack endianness logic MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: oshogbo X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e673ac3ffbfb2e300d02a47f984df63bd20a6578 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 19:25:46 -0000 The branch main has been updated by oshogbo: URL: https://cgit.FreeBSD.org/src/commit/?id=e673ac3ffbfb2e300d02a47f984df63bd20a6578 commit e673ac3ffbfb2e300d02a47f984df63bd20a6578 Author: Stefan Grundmann AuthorDate: 2021-08-18 16:26:29 +0000 Commit: Mariusz Zaborski CommitDate: 2021-09-13 19:21:14 +0000 libnv: Fix array unpack endianness logic When a nvlist(9) is converted into a binary buffer by nvlist_pack(9), the host endianness is encoded in the nvlist_header of the binary buffer. The nvlist_unpack(9) function converts a given binary buffer to an nvlist. In the conversion process the endianness encoded in the nvlist_header is evaluated and -- should the encoded endianness differ from the endianess of the decoding host -- endianness conversion is applied to nvlist_header and nvpair_header elements as well as to some nvpair values. In 2015 @oshogbo extended libnv with array support (in 347a39b). The unpacking code misses the possible need to convert the endianness of the nvph_nitems element of nvpair_headers. The patch (re)enables libnv to unpack nvlists regardless of the endianness of the packing host. Pull Request: https://github.com/freebsd/freebsd-src/pull/528 --- sys/contrib/libnv/bsd_nvpair.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/contrib/libnv/bsd_nvpair.c b/sys/contrib/libnv/bsd_nvpair.c index 6405dcd1c516..00eee223fe92 100644 --- a/sys/contrib/libnv/bsd_nvpair.c +++ b/sys/contrib/libnv/bsd_nvpair.c @@ -661,11 +661,13 @@ nvpair_unpack_header(bool isbe, nvpair_t *nvp, const unsigned char *ptr, if (!isbe) { nvphdr.nvph_namesize = le16toh(nvphdr.nvph_namesize); nvphdr.nvph_datasize = le64toh(nvphdr.nvph_datasize); + nvphdr.nvph_nitems = le64toh(nvphdr.nvph_nitems); } #else if (isbe) { nvphdr.nvph_namesize = be16toh(nvphdr.nvph_namesize); nvphdr.nvph_datasize = be64toh(nvphdr.nvph_datasize); + nvphdr.nvph_nitems = be64toh(nvphdr.nvph_nitems); } #endif From owner-dev-commits-src-all@freebsd.org Mon Sep 13 20:06:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 936316A8EDD; Mon, 13 Sep 2021 20:06:33 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7ctx3Q8cz524c; Mon, 13 Sep 2021 20:06:33 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from mail-yb1-f175.google.com (mail-yb1-f175.google.com [209.85.219.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: mhorne) by smtp.freebsd.org (Postfix) with ESMTPSA id 529413EB; Mon, 13 Sep 2021 20:06:33 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: by mail-yb1-f175.google.com with SMTP id a93so23054394ybi.1; Mon, 13 Sep 2021 13:06:33 -0700 (PDT) X-Gm-Message-State: AOAM530NKrXzb7lYbLbD1phv8VbTlOvbGVOas0IDIqYzLtS2COERac/K D/dp1BX59msrP5cbuKwZifK0/6gsiIRleTH5C8E= X-Google-Smtp-Source: ABdhPJyOr1qxL04JzPiQj3kL9M9xZ/ak7hKpPRTLj+oJUgN4zRtfSg+vr9CqoZWdvnotk4N9/yz5P2oGJNh9l9eFjE4= X-Received: by 2002:a25:3086:: with SMTP id w128mr17634472ybw.139.1631563592771; Mon, 13 Sep 2021 13:06:32 -0700 (PDT) MIME-Version: 1.0 References: <202109130411.18D4BUs3004805@gitrepo.freebsd.org> In-Reply-To: <202109130411.18D4BUs3004805@gitrepo.freebsd.org> From: Mitchell Horne Date: Mon, 13 Sep 2021 17:06:21 -0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 6fa041d7f125 - main - Measure latency of PMC interruptions To: Wojciech Macek Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 20:06:33 -0000 On Mon, Sep 13, 2021 at 1:11 AM Wojciech Macek wrote: > > The branch main has been updated by wma: > > URL: https://cgit.FreeBSD.org/src/commit/?id=6fa041d7f125db65f400af7f520a41ff78d19cd7 > > commit 6fa041d7f125db65f400af7f520a41ff78d19cd7 > Author: Wojciech Macek > AuthorDate: 2021-09-13 04:08:32 +0000 > Commit: Wojciech Macek > CommitDate: 2021-09-13 04:08:32 +0000 > > Measure latency of PMC interruptions > > Add HWPMC events to measure latency. > Provide sysctl to choose the number of outstanding events which > trigger HWPMC event. > > Obtained from: Semihalf > Sponsored by: Stormshield > Differential revision: https://reviews.freebsd.org/D31283 > --- > sys/kern/kern_intr.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++------ > 1 file changed, 52 insertions(+), 6 deletions(-) > > diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c > index 1660414a50ef..19401877dfbd 100644 > --- a/sys/kern/kern_intr.c > +++ b/sys/kern/kern_intr.c > @@ -30,6 +30,7 @@ > __FBSDID("$FreeBSD$"); > > #include "opt_ddb.h" > +#include "opt_hwpmc_hooks.h" > #include "opt_kstack_usage_prof.h" > > #include > @@ -75,6 +76,7 @@ struct intr_thread { > struct thread *it_thread; /* Kernel thread. */ > int it_flags; /* (j) IT_* flags. */ > int it_need; /* Needs service. */ > + int it_waiting; /* Waiting in the runq. */ > }; > > /* Interrupt thread flags kept in it_flags */ > @@ -100,13 +102,19 @@ SYSCTL_INT(_hw, OID_AUTO, intr_storm_threshold, CTLFLAG_RWTUN, > static int intr_epoch_batch = 1000; > SYSCTL_INT(_hw, OID_AUTO, intr_epoch_batch, CTLFLAG_RWTUN, &intr_epoch_batch, > 0, "Maximum interrupt handler executions without re-entering epoch(9)"); > +#ifdef HWPMC_HOOKS > +static int intr_hwpmc_waiting_report_threshold = 1; > +SYSCTL_INT(_hw, OID_AUTO, intr_hwpmc_waiting_report_threshold, CTLFLAG_RWTUN, > + &intr_hwpmc_waiting_report_threshold, 1, > + "Threshold for reporting number of events in a workq"); > +#endif > static TAILQ_HEAD(, intr_event) event_list = > TAILQ_HEAD_INITIALIZER(event_list); > static struct mtx event_lock; > MTX_SYSINIT(intr_event_list, &event_lock, "intr event list", MTX_DEF); > > static void intr_event_update(struct intr_event *ie); > -static int intr_event_schedule_thread(struct intr_event *ie); > +static int intr_event_schedule_thread(struct intr_event *ie, struct trapframe *frame); > static struct intr_thread *ithread_create(const char *name); > static void ithread_destroy(struct intr_thread *ithread); > static void ithread_execute_handlers(struct proc *p, > @@ -115,6 +123,16 @@ static void ithread_loop(void *); > static void ithread_update(struct intr_thread *ithd); > static void start_softintr(void *); > > +#ifdef HWPMC_HOOKS > +#include > +PMC_SOFT_DEFINE( , , intr, all); > +PMC_SOFT_DEFINE( , , intr, ithread); > +PMC_SOFT_DEFINE( , , intr, filter); > +PMC_SOFT_DEFINE( , , intr, stray); > +PMC_SOFT_DEFINE( , , intr, schedule); > +PMC_SOFT_DEFINE( , , intr, waiting); > +#endif > + Hi Wojciech, Do you plan to document these new events in the pmc.soft(3) man page? Cheers, Mitchell > /* Map an interrupt type to an ithread priority. */ > u_char > intr_priority(enum intr_type flags) > @@ -773,7 +791,7 @@ intr_handler_barrier(struct intr_handler *handler) > } > if ((handler->ih_flags & IH_CHANGED) == 0) { > handler->ih_flags |= IH_CHANGED; > - intr_event_schedule_thread(ie); > + intr_event_schedule_thread(ie, NULL); > } > while ((handler->ih_flags & IH_CHANGED) != 0) > msleep(handler, &ie->ie_lock, 0, "ih_barr", 0); > @@ -872,7 +890,7 @@ intr_event_remove_handler(void *cookie) > KASSERT((handler->ih_flags & IH_DEAD) == 0, > ("duplicate handle remove")); > handler->ih_flags |= IH_DEAD; > - intr_event_schedule_thread(ie); > + intr_event_schedule_thread(ie, NULL); > while (handler->ih_flags & IH_DEAD) > msleep(handler, &ie->ie_lock, 0, "iev_rmh", 0); > intr_event_update(ie); > @@ -944,7 +962,7 @@ intr_event_resume_handler(void *cookie) > } > > static int > -intr_event_schedule_thread(struct intr_event *ie) > +intr_event_schedule_thread(struct intr_event *ie, struct trapframe *frame) > { > struct intr_entropy entropy; > struct intr_thread *it; > @@ -986,11 +1004,28 @@ intr_event_schedule_thread(struct intr_event *ie) > atomic_store_rel_int(&it->it_need, 1); > thread_lock(td); > if (TD_AWAITING_INTR(td)) { > +#ifdef HWPMC_HOOKS > + atomic_set_int(&it->it_waiting, 0); > + if (frame != NULL) > + PMC_SOFT_CALL_TF( , , intr, schedule, frame); > + else > + PMC_SOFT_CALL( , , intr, schedule); > +#endif > CTR3(KTR_INTR, "%s: schedule pid %d (%s)", __func__, td->td_proc->p_pid, > td->td_name); > TD_CLR_IWAIT(td); > sched_add(td, SRQ_INTR); > } else { > +#ifdef HWPMC_HOOKS > + atomic_add_int(&it->it_waiting, 1); > + > + if (atomic_load_int(&it->it_waiting) >= intr_hwpmc_waiting_report_threshold) { > + if (frame != NULL) > + PMC_SOFT_CALL_TF( , , intr, waiting, frame); > + else > + PMC_SOFT_CALL( , , intr, waiting); > + } > +#endif > CTR5(KTR_INTR, "%s: pid %d (%s): it_need %d, state %d", > __func__, td->td_proc->p_pid, td->td_name, it->it_need, TD_GET_STATE(td)); > thread_unlock(td); > @@ -1083,7 +1118,7 @@ swi_sched(void *cookie, int flags) > #endif > } else { > VM_CNT_INC(v_soft); > - error = intr_event_schedule_thread(ie); > + error = intr_event_schedule_thread(ie, NULL); > KASSERT(error == 0, ("stray software interrupt")); > } > } > @@ -1374,12 +1409,23 @@ intr_event_handle(struct intr_event *ie, struct trapframe *frame) > ret = ih->ih_filter(frame); > else > ret = ih->ih_filter(ih->ih_argument); > +#ifdef HWPMC_HOOKS > + PMC_SOFT_CALL_TF( , , intr, all, frame); > +#endif > KASSERT(ret == FILTER_STRAY || > ((ret & (FILTER_SCHEDULE_THREAD | FILTER_HANDLED)) != 0 && > (ret & ~(FILTER_SCHEDULE_THREAD | FILTER_HANDLED)) == 0), > ("%s: incorrect return value %#x from %s", __func__, ret, > ih->ih_name)); > filter = filter || ret == FILTER_HANDLED; > +#ifdef HWPMC_HOOKS > + if (ret & FILTER_SCHEDULE_THREAD) > + PMC_SOFT_CALL_TF( , , intr, ithread, frame); > + else if (ret & FILTER_HANDLED) > + PMC_SOFT_CALL_TF( , , intr, filter, frame); > + else if (ret == FILTER_STRAY) > + PMC_SOFT_CALL_TF( , , intr, stray, frame); > +#endif > > /* > * Wrapper handler special handling: > @@ -1416,7 +1462,7 @@ intr_event_handle(struct intr_event *ie, struct trapframe *frame) > if (thread) { > int error __unused; > > - error = intr_event_schedule_thread(ie); > + error = intr_event_schedule_thread(ie, frame); > KASSERT(error == 0, ("bad stray interrupt")); > } > critical_exit(); From owner-dev-commits-src-all@freebsd.org Mon Sep 13 20:43:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7E3A6A9703; Mon, 13 Sep 2021 20:43:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7djM3pGlz3FZ1; Mon, 13 Sep 2021 20:43:19 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id D8F68ABD; Mon, 13 Sep 2021 20:43:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) To: Michael Tuexen Cc: Mark Johnston , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" References: <202109122039.18CKdpwW094531@gitrepo.freebsd.org> <270ac6c6-1fdf-879a-cbea-ef43200ef12a@FreeBSD.org> From: John Baldwin Subject: Re: git: b864b67a0d19 - main - socket: Do not include control messages in FIONREAD return value Message-ID: <4ae85e22-a95f-5046-fe7d-40f2cc881c82@FreeBSD.org> Date: Mon, 13 Sep 2021 13:43:18 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 20:43:19 -0000 On 9/13/21 12:25 PM, Michael Tuexen wrote: >> On 13. Sep 2021, at 18:29, John Baldwin wrote: >> >> On 9/12/21 1:39 PM, Mark Johnston wrote: >>> The branch main has been updated by markj: >>> URL: https://cgit.FreeBSD.org/src/commit/?id=b864b67a0d197f59ecf6698940600956ceee2cae >>> commit b864b67a0d197f59ecf6698940600956ceee2cae >>> Author: Mark Johnston >>> AuthorDate: 2021-09-12 20:05:49 +0000 >>> Commit: Mark Johnston >>> CommitDate: 2021-09-12 20:39:44 +0000 >>> socket: Do not include control messages in FIONREAD return value >>> Some system software expects to be able to read at least the number of >>> bytes returned by FIONREAD. When control messages are counted in this >>> return value, this assumption is violated. Follow Linux and OpenBSD >>> here (as well as our own kevent(EVFILT_READ)) and only return the number >>> of data bytes available. >>> Reported by: avg >>> MFC after: 2 weeks >> >> In a somewhat similar vein, it would be nice to eventually have new ioctls >> to know how much data and control are available in the next message for >> datagram-oriented sockets. Right now if you are working with a datagram >> socket with variable-sized messages there's no good way to know how big the >> next message is (to resize a read buffer) as FIONREAD can count multiple >> messages. There's also no way at all to cope with control messages aside >> from retrying with some naive algorithm like doubling the size if MSG_CTRUNC >> is set, but that also requires always using MSG_PEEK so that you always >> end up reading a message at least twice. > That still requires two system calls. In SCTP, there is a CMSG you can > receive with a messages, which contains the metadata of the next message > you will receive. > So it might be an idea to define a CMSG containing the length of the next > message (if available). We could at least just have a single ioctl that returns a struct with two members (data length and control length) perhaps to get it back down to just 1 syscall similar to FIONREAD. -- John Baldwin From owner-dev-commits-src-all@freebsd.org Mon Sep 13 20:54:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11B816A925E; Mon, 13 Sep 2021 20:54:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7dxq6rlJz3HTt; Mon, 13 Sep 2021 20:54:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB7085DF3; Mon, 13 Sep 2021 20:54:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DKs7W0037746; Mon, 13 Sep 2021 20:54:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DKs7NG037745; Mon, 13 Sep 2021 20:54:07 GMT (envelope-from git) Date: Mon, 13 Sep 2021 20:54:07 GMT Message-Id: <202109132054.18DKs7NG037745@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: f28c1d0c5c6c - main - llvm-objcopy: Install llvm-strip, and optionally strip, links MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f28c1d0c5c6c6532df0dfa38eaf804343988d163 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 20:54:08 -0000 The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=f28c1d0c5c6c6532df0dfa38eaf804343988d163 commit f28c1d0c5c6c6532df0dfa38eaf804343988d163 Author: Jessica Clarke AuthorDate: 2021-09-13 20:52:40 +0000 Commit: Jessica Clarke CommitDate: 2021-09-13 20:52:40 +0000 llvm-objcopy: Install llvm-strip, and optionally strip, links Just as elftoolchain's objcopy doubles as strip, so does LLVM's. This ensures that a strip binary is still present for WITH_LLVM_BINUTILS builds. Note that we do not currently have a committed copy of the manpage generated from the rST source so no manpage is installed for (llvm-)strip. Reported by: Shawn Webb Tested by: Shawn Webb MFC after: 1 week --- usr.bin/clang/llvm-objcopy/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.bin/clang/llvm-objcopy/Makefile b/usr.bin/clang/llvm-objcopy/Makefile index 2e6fc8aba356..afd03b848b19 100644 --- a/usr.bin/clang/llvm-objcopy/Makefile +++ b/usr.bin/clang/llvm-objcopy/Makefile @@ -44,8 +44,11 @@ CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/} LIBADD+= z +LINKS= ${BINDIR}/llvm-objcopy ${BINDIR}/llvm-strip + .if ${MK_LLVM_BINUTILS} != "no" -LINKS= ${BINDIR}/llvm-objcopy ${BINDIR}/objcopy +LINKS+= ${BINDIR}/llvm-objcopy ${BINDIR}/objcopy \ + ${BINDIR}/llvm-strip ${BINDIR}/strip MLINKS= llvm-objcopy.1 objcopy.1 .endif From owner-dev-commits-src-all@freebsd.org Mon Sep 13 21:01:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A2BFE6A9914; Mon, 13 Sep 2021 21:01:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7f5z34tvz3K14; Mon, 13 Sep 2021 21:01:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40B3F6304; Mon, 13 Sep 2021 21:01:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DL1BkI048136; Mon, 13 Sep 2021 21:01:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DL1B03048135; Mon, 13 Sep 2021 21:01:11 GMT (envelope-from git) Date: Mon, 13 Sep 2021 21:01:11 GMT Message-Id: <202109132101.18DL1B03048135@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Eric Joyner Subject: git: abf774528d7e - main - ixl(4): Fix 2.5 and 5G speeds reporting and update shared code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: erj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: abf774528d7e497460510b0026db85e30f054142 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 21:01:11 -0000 The branch main has been updated by erj: URL: https://cgit.FreeBSD.org/src/commit/?id=abf774528d7e497460510b0026db85e30f054142 commit abf774528d7e497460510b0026db85e30f054142 Author: Krzysztof Galazka AuthorDate: 2021-09-13 20:39:59 +0000 Commit: Eric Joyner CommitDate: 2021-09-13 21:00:50 +0000 ixl(4): Fix 2.5 and 5G speeds reporting and update shared code Fix 2.5 and 5G speeds reporting and update shared code with recent changes: - Update expected FW API versions for X710 and X722 adapters - Define pointers related to Preservation Rules Module - Add definitions for Shadow RAM pointers to new modules: 5th and 6th FPA, and Preservation Rules Module. - Add I40E_RX_PTYPE_PARSER_ABORTED definition, so the driver will know opcode for parser aborted packets. - Add the new filter types needed for custom cloud filters. - Add support for Minimum Rollback Revision - Fix RX_ONLY mode for unicast promiscuous on VLAN - Add EEE LPI status check for X722 adapters - Fix PHY type identifiers for 2.5G and 5G adapters - Fix update link data for X722 - Increase the timeout value for PF reset to give PF more time to finish reset if it is loaded with filters. - Added support for Min Rollback Revision for 4 more X722 modules - Fix reporting of Active Optical Cable media type - Add flags and fields for double VLAN processing - Fix potentially uninitialized variables in NVM code Reviewed by: kbowling@, mike.jakubik@gmail.com Tested by: gowtham.kumar.ks@intel.com Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D31565 --- sys/dev/ixl/i40e_adminq.c | 6 +- sys/dev/ixl/i40e_adminq_cmd.h | 71 +++++++++++++-- sys/dev/ixl/i40e_common.c | 206 ++++++++++++++++++++++++++---------------- sys/dev/ixl/i40e_dcb.c | 10 +- sys/dev/ixl/i40e_lan_hmc.c | 2 +- sys/dev/ixl/i40e_nvm.c | 13 ++- sys/dev/ixl/i40e_prototype.h | 10 +- sys/dev/ixl/i40e_register.h | 3 + sys/dev/ixl/i40e_type.h | 17 ++-- sys/dev/ixl/if_ixl.c | 4 +- 10 files changed, 234 insertions(+), 108 deletions(-) diff --git a/sys/dev/ixl/i40e_adminq.c b/sys/dev/ixl/i40e_adminq.c index d25798d23bd1..efca7f1e61ff 100644 --- a/sys/dev/ixl/i40e_adminq.c +++ b/sys/dev/ixl/i40e_adminq.c @@ -646,8 +646,10 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw) { struct i40e_adminq_info *aq = &hw->aq; enum i40e_status_code ret_code; - u16 cfg_ptr, oem_hi, oem_lo; - u16 eetrack_lo, eetrack_hi; + u16 oem_hi = 0, oem_lo = 0; + u16 eetrack_hi = 0; + u16 eetrack_lo = 0; + u16 cfg_ptr = 0; int retry = 0; /* verify input for valid configuration */ diff --git a/sys/dev/ixl/i40e_adminq_cmd.h b/sys/dev/ixl/i40e_adminq_cmd.h index 6161805a7cf0..564a076761d0 100644 --- a/sys/dev/ixl/i40e_adminq_cmd.h +++ b/sys/dev/ixl/i40e_adminq_cmd.h @@ -43,8 +43,8 @@ #define I40E_FW_API_VERSION_MAJOR 0x0001 -#define I40E_FW_API_VERSION_MINOR_X722 0x000A -#define I40E_FW_API_VERSION_MINOR_X710 0x000A +#define I40E_FW_API_VERSION_MINOR_X722 0x000C +#define I40E_FW_API_VERSION_MINOR_X710 0x000E #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \ I40E_FW_API_VERSION_MINOR_X710 : \ @@ -267,7 +267,8 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_nvm_update = 0x0703, i40e_aqc_opc_nvm_config_read = 0x0704, i40e_aqc_opc_nvm_config_write = 0x0705, - i40e_aqc_opc_nvm_progress = 0x0706, + i40e_aqc_opc_nvm_update_in_process = 0x0706, + i40e_aqc_opc_rollback_revision_update = 0x0707, i40e_aqc_opc_oem_post_update = 0x0720, i40e_aqc_opc_thermal_sensor = 0x0721, @@ -467,6 +468,7 @@ struct i40e_aqc_list_capabilities_element_resp { #define I40E_AQ_CAP_ID_SDP 0x0062 #define I40E_AQ_CAP_ID_MDIO 0x0063 #define I40E_AQ_CAP_ID_WSR_PROT 0x0064 +#define I40E_AQ_CAP_ID_DIS_UNUSED_PORTS 0x0067 #define I40E_AQ_CAP_ID_NVM_MGMT 0x0080 #define I40E_AQ_CAP_ID_FLEX10 0x00F1 #define I40E_AQ_CAP_ID_CEM 0x00F2 @@ -793,6 +795,7 @@ struct i40e_aqc_set_switch_config { #define I40E_AQ_SET_SWITCH_CFG_PROMISC 0x0001 #define I40E_AQ_SET_SWITCH_CFG_L2_FILTER 0x0002 #define I40E_AQ_SET_SWITCH_CFG_HW_ATR_EVICT 0x0004 +#define I40E_AQ_SET_SWITCH_CFG_OUTER_VLAN 0x0008 __le16 valid_flags; /* The ethertype in switch_tag is dropped on ingress and used * internally by the switch. Set this to zero for the default @@ -929,7 +932,7 @@ struct i40e_aqc_vsi_properties_data { u8 sec_reserved; /* VLAN section */ __le16 pvid; /* VLANS include priority bits */ - __le16 fcoe_pvid; + __le16 outer_vlan; u8 port_vlan_flags; #define I40E_AQ_VSI_PVLAN_MODE_SHIFT 0x00 #define I40E_AQ_VSI_PVLAN_MODE_MASK (0x03 << \ @@ -945,7 +948,24 @@ struct i40e_aqc_vsi_properties_data { #define I40E_AQ_VSI_PVLAN_EMOD_STR_UP 0x08 #define I40E_AQ_VSI_PVLAN_EMOD_STR 0x10 #define I40E_AQ_VSI_PVLAN_EMOD_NOTHING 0x18 - u8 pvlan_reserved[3]; + u8 outer_vlan_flags; +#define I40E_AQ_VSI_OVLAN_MODE_SHIFT 0x00 +#define I40E_AQ_VSI_OVLAN_MODE_MASK (0x03 << \ + I40E_AQ_VSI_OVLAN_MODE_SHIFT) +#define I40E_AQ_VSI_OVLAN_MODE_UNTAGGED 0x01 +#define I40E_AQ_VSI_OVLAN_MODE_TAGGED 0x02 +#define I40E_AQ_VSI_OVLAN_MODE_ALL 0x03 +#define I40E_AQ_VSI_OVLAN_INSERT_PVID 0x04 +#define I40E_AQ_VSI_OVLAN_EMOD_SHIFT 0x03 +#define I40E_AQ_VSI_OVLAN_EMOD_MASK (0x03 <<\ + I40E_AQ_VSI_OVLAN_EMOD_SHIFT) +#define I40E_AQ_VSI_OVLAN_EMOD_SHOW_ALL 0x00 +#define I40E_AQ_VSI_OVLAN_EMOD_SHOW_UP 0x01 +#define I40E_AQ_VSI_OVLAN_EMOD_HIDE_ALL 0x02 +#define I40E_AQ_VSI_OVLAN_EMOD_NOTHING 0x03 +#define I40E_AQ_VSI_OVLAN_CTRL_ENA 0x04 + + u8 pvlan_reserved[2]; /* ingress egress up sections */ __le32 ingress_table; /* bitmap, 3 bits per up */ #define I40E_AQ_VSI_UP_TABLE_UP0_SHIFT 0 @@ -1247,7 +1267,7 @@ struct i40e_aqc_set_vsi_promiscuous_modes { #define I40E_AQC_SET_VSI_PROMISC_BROADCAST 0x04 #define I40E_AQC_SET_VSI_DEFAULT 0x08 #define I40E_AQC_SET_VSI_PROMISC_VLAN 0x10 -#define I40E_AQC_SET_VSI_PROMISC_TX 0x8000 +#define I40E_AQC_SET_VSI_PROMISC_RX_ONLY 0x8000 __le16 seid; #define I40E_AQC_VSI_PROM_CMD_SEID_MASK 0x3FF __le16 vlan_tag; @@ -1433,6 +1453,8 @@ struct i40e_aqc_cloud_filters_element_data { #define I40E_AQC_ADD_CLOUD_FILTER_IMAC 0x000A #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC 0x000B #define I40E_AQC_ADD_CLOUD_FILTER_IIP 0x000C +#define I40E_AQC_ADD_CLOUD_FILTER_OIP1 0x0010 +#define I40E_AQC_ADD_CLOUD_FILTER_OIP2 0x0012 /* 0x000D reserved */ /* 0x000E reserved */ /* 0x000F reserved */ @@ -1940,8 +1962,10 @@ enum i40e_aq_phy_type { I40E_PHY_TYPE_25GBASE_LR = 0x22, I40E_PHY_TYPE_25GBASE_AOC = 0x23, I40E_PHY_TYPE_25GBASE_ACC = 0x24, - I40E_PHY_TYPE_2_5GBASE_T = 0x30, - I40E_PHY_TYPE_5GBASE_T = 0x31, + I40E_PHY_TYPE_2_5GBASE_T = 0x26, + I40E_PHY_TYPE_5GBASE_T = 0x27, + I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS = 0x30, + I40E_PHY_TYPE_5GBASE_T_LINK_STATUS = 0x31, I40E_PHY_TYPE_MAX, I40E_PHY_TYPE_NOT_SUPPORTED_HIGH_TEMP = 0xFD, I40E_PHY_TYPE_EMPTY = 0xFE, @@ -2411,6 +2435,16 @@ struct i40e_aqc_nvm_config_data_feature { I40E_CHECK_STRUCT_LEN(0x6, i40e_aqc_nvm_config_data_feature); +/* NVM Update in Process (direct 0x0706) */ +struct i40e_aqc_nvm_update_in_process { + u8 command; +#define I40E_AQ_UPDATE_FLOW_END 0x0 +#define I40E_AQ_UPDATE_FLOW_START 0x1 + u8 reserved[15]; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_update_in_process); + struct i40e_aqc_nvm_config_data_immediate_field { __le32 field_id; __le32 field_value; @@ -2420,6 +2454,27 @@ struct i40e_aqc_nvm_config_data_immediate_field { I40E_CHECK_STRUCT_LEN(0xc, i40e_aqc_nvm_config_data_immediate_field); +/* Minimal Rollback Revision Update (direct 0x0707) */ +struct i40e_aqc_rollback_revision_update { + u8 optin_mode; /* bool */ +#define I40E_AQ_RREV_OPTIN_MODE 0x01 + u8 module_selected; +#define I40E_AQ_RREV_MODULE_PCIE_ANALOG 0 +#define I40E_AQ_RREV_MODULE_PHY_ANALOG 1 +#define I40E_AQ_RREV_MODULE_OPTION_ROM 2 +#define I40E_AQ_RREV_MODULE_EMP_IMAGE 3 +#define I40E_AQ_RREV_MODULE_PE_IMAGE 4 +#define I40E_AQ_RREV_MODULE_PHY_PLL_O_CONFIGURATION 5 +#define I40E_AQ_RREV_MODULE_PHY_0_CONFIGURATION 6 +#define I40E_AQ_RREV_MODULE_PHY_PLL_1_CONFIGURATION 7 +#define I40E_AQ_RREV_MODULE_PHY_1_CONFIGURATION 8 + u8 reserved1[2]; + u32 min_rrev; + u8 reserved2[8]; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_rollback_revision_update); + /* OEM Post Update (indirect 0x0720) * no command data struct used */ diff --git a/sys/dev/ixl/i40e_common.c b/sys/dev/ixl/i40e_common.c index 4325901c0920..332893938c19 100644 --- a/sys/dev/ixl/i40e_common.c +++ b/sys/dev/ixl/i40e_common.c @@ -1251,12 +1251,15 @@ static enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw) case I40E_PHY_TYPE_40GBASE_LR4: case I40E_PHY_TYPE_25GBASE_LR: case I40E_PHY_TYPE_25GBASE_SR: + case I40E_PHY_TYPE_10GBASE_AOC: + case I40E_PHY_TYPE_25GBASE_AOC: + case I40E_PHY_TYPE_40GBASE_AOC: media = I40E_MEDIA_TYPE_FIBER; break; case I40E_PHY_TYPE_100BASE_TX: case I40E_PHY_TYPE_1000BASE_T: - case I40E_PHY_TYPE_2_5GBASE_T: - case I40E_PHY_TYPE_5GBASE_T: + case I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS: + case I40E_PHY_TYPE_5GBASE_T_LINK_STATUS: case I40E_PHY_TYPE_10GBASE_T: media = I40E_MEDIA_TYPE_BASET; break; @@ -1265,10 +1268,7 @@ static enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw) case I40E_PHY_TYPE_10GBASE_CR1: case I40E_PHY_TYPE_40GBASE_CR4: case I40E_PHY_TYPE_10GBASE_SFPP_CU: - case I40E_PHY_TYPE_40GBASE_AOC: - case I40E_PHY_TYPE_10GBASE_AOC: case I40E_PHY_TYPE_25GBASE_CR: - case I40E_PHY_TYPE_25GBASE_AOC: case I40E_PHY_TYPE_25GBASE_ACC: media = I40E_MEDIA_TYPE_DA; break; @@ -1316,7 +1316,7 @@ static enum i40e_status_code i40e_poll_globr(struct i40e_hw *hw, return I40E_ERR_RESET_FAILED; } -#define I40E_PF_RESET_WAIT_COUNT 200 +#define I40E_PF_RESET_WAIT_COUNT 1000 /** * i40e_pf_reset - Reset the PF * @hw: pointer to the hardware structure @@ -1563,7 +1563,6 @@ static u32 i40e_led_is_mine(struct i40e_hw *hw, int idx) **/ u32 i40e_led_get(struct i40e_hw *hw) { - u32 current_mode = 0; u32 mode = 0; int i; @@ -1576,20 +1575,6 @@ u32 i40e_led_get(struct i40e_hw *hw) if (!gpio_val) continue; - /* ignore gpio LED src mode entries related to the activity - * LEDs - */ - current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) - >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); - switch (current_mode) { - case I40E_COMBINED_ACTIVITY: - case I40E_FILTER_ACTIVITY: - case I40E_MAC_ACTIVITY: - case I40E_LINK_ACTIVITY: - continue; - default: - break; - } mode = (gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT; @@ -1610,7 +1595,6 @@ u32 i40e_led_get(struct i40e_hw *hw) **/ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink) { - u32 current_mode = 0; int i; if (mode & ~I40E_LED_MODE_VALID) { @@ -1627,20 +1611,6 @@ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink) if (!gpio_val) continue; - /* ignore gpio LED src mode entries related to the activity - * LEDs - */ - current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) - >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); - switch (current_mode) { - case I40E_COMBINED_ACTIVITY: - case I40E_FILTER_ACTIVITY: - case I40E_MAC_ACTIVITY: - case I40E_LINK_ACTIVITY: - continue; - default: - break; - } if (I40E_IS_X710TL_DEVICE(hw->device_id)) { u32 pin_func = 0; @@ -2053,6 +2023,9 @@ enum i40e_status_code i40e_aq_get_link_info(struct i40e_hw *hw, hw->aq.fw_min_ver < 40)) && hw_link_info->phy_type == 0xE) hw_link_info->phy_type = I40E_PHY_TYPE_10GBASE_SFPP_CU; + /* 'Get Link Status' response data structure from X722 FW has + * different format and does not contain this information + */ if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE && hw->mac.type != I40E_MAC_X722) { __le32 tmp; @@ -2251,6 +2224,22 @@ enum i40e_status_code i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags, return status; } +/** + * i40e_hw_ver_ge + * @hw: pointer to the hw struct + * @maj: api major value + * @min: api minor value + * + * Assert whether current HW api version is greater/equal than provided. + **/ +static bool i40e_hw_ver_ge(struct i40e_hw *hw, u16 maj, u16 min) +{ + if (hw->aq.api_maj_ver > maj || + (hw->aq.api_maj_ver == maj && hw->aq.api_min_ver >= min)) + return TRUE; + return FALSE; +} + /** * i40e_aq_add_vsi * @hw: pointer to the hw struct @@ -2376,18 +2365,16 @@ enum i40e_status_code i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw, if (set) { flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST; - if (rx_only_promisc && - (((hw->aq.api_maj_ver == 1) && (hw->aq.api_min_ver >= 5)) || - (hw->aq.api_maj_ver > 1))) - flags |= I40E_AQC_SET_VSI_PROMISC_TX; + if (rx_only_promisc && i40e_hw_ver_ge(hw, 1, 5)) + flags |= I40E_AQC_SET_VSI_PROMISC_RX_ONLY; } cmd->promiscuous_flags = CPU_TO_LE16(flags); cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_UNICAST); - if (((hw->aq.api_maj_ver >= 1) && (hw->aq.api_min_ver >= 5)) || - (hw->aq.api_maj_ver > 1)) - cmd->valid_flags |= CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_TX); + if (i40e_hw_ver_ge(hw, 1, 5)) + cmd->valid_flags |= + CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_RX_ONLY); cmd->seid = CPU_TO_LE16(seid); status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); @@ -2519,11 +2506,17 @@ enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw, i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_set_vsi_promiscuous_modes); - if (enable) + if (enable) { flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST; + if (i40e_hw_ver_ge(hw, 1, 5)) + flags |= I40E_AQC_SET_VSI_PROMISC_RX_ONLY; + } cmd->promiscuous_flags = CPU_TO_LE16(flags); cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_UNICAST); + if (i40e_hw_ver_ge(hw, 1, 5)) + cmd->valid_flags |= + CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_RX_ONLY); cmd->seid = CPU_TO_LE16(seid); cmd->vlan_tag = CPU_TO_LE16(vid | I40E_AQC_SET_VSI_VLAN_VALID); @@ -2633,7 +2626,7 @@ enum i40e_status_code i40e_aq_set_vsi_vlan_promisc(struct i40e_hw *hw, } /** - * i40e_get_vsi_params - get VSI configuration info + * i40e_aq_get_vsi_params - get VSI configuration info * @hw: pointer to the hw struct * @vsi_ctx: pointer to a vsi context struct * @cmd_details: pointer to command details structure or NULL @@ -2893,7 +2886,7 @@ enum i40e_status_code i40e_get_link_status(struct i40e_hw *hw, bool *link_up) } /** - * i40e_updatelink_status - update status of the HW network link + * i40e_update_link_info - update status of the HW network link * @hw: pointer to the hw struct **/ enum i40e_status_code i40e_update_link_info(struct i40e_hw *hw) @@ -2906,10 +2899,13 @@ enum i40e_status_code i40e_update_link_info(struct i40e_hw *hw) return status; /* extra checking needed to ensure link info to user is timely */ - if ((hw->phy.link_info.link_info & I40E_AQ_MEDIA_AVAILABLE) && - ((hw->phy.link_info.link_info & I40E_AQ_LINK_UP) || - !(hw->phy.link_info_old.link_info & I40E_AQ_LINK_UP))) { - status = i40e_aq_get_phy_capabilities(hw, FALSE, false, + if (((hw->phy.link_info.link_info & I40E_AQ_MEDIA_AVAILABLE) && + ((hw->phy.link_info.link_info & I40E_AQ_LINK_UP) || + !(hw->phy.link_info_old.link_info & I40E_AQ_LINK_UP))) || + hw->mac.type == I40E_MAC_X722) { + status = i40e_aq_get_phy_capabilities(hw, FALSE, + hw->mac.type == + I40E_MAC_X722, &abilities, NULL); if (status) return status; @@ -3666,6 +3662,64 @@ enum i40e_status_code i40e_aq_write_nvm_config(struct i40e_hw *hw, return status; } +/** + * i40e_aq_nvm_update_in_process + * @hw: pointer to the hw struct + * @update_flow_state: True indicates that update flow starts, FALSE that ends + * @cmd_details: pointer to command details structure or NULL + * + * Indicate NVM update in process. + **/ +enum i40e_status_code i40e_aq_nvm_update_in_process(struct i40e_hw *hw, + bool update_flow_state, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aq_desc desc; + struct i40e_aqc_nvm_update_in_process *cmd = + (struct i40e_aqc_nvm_update_in_process *)&desc.params.raw; + enum i40e_status_code status; + + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_nvm_update_in_process); + + cmd->command = I40E_AQ_UPDATE_FLOW_END; + + if (update_flow_state) + cmd->command |= I40E_AQ_UPDATE_FLOW_START; + + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); + + return status; +} + +/** + * i40e_aq_min_rollback_rev_update - triggers an ow after update + * @hw: pointer to the hw struct + * @mode: opt-in mode, 1b for single module update, 0b for bulk update + * @module: module to be updated. Ignored if mode is 0b + * @min_rrev: value of the new minimal version. Ignored if mode is 0b + * @cmd_details: pointer to command details structure or NULL + **/ +enum i40e_status_code +i40e_aq_min_rollback_rev_update(struct i40e_hw *hw, u8 mode, u8 module, + u32 min_rrev, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aq_desc desc; + struct i40e_aqc_rollback_revision_update *cmd = + (struct i40e_aqc_rollback_revision_update *)&desc.params.raw; + enum i40e_status_code status; + + i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_rollback_revision_update); + cmd->optin_mode = mode; + cmd->module_selected = module; + cmd->min_rrev = min_rrev; + + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); + + return status; +} + /** * i40e_aq_oem_post_update - triggers an OEM specific flow after update * @hw: pointer to the hw struct @@ -3998,7 +4052,13 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff, p->wr_csr_prot |= (u64)logical_id << 32; i40e_debug(hw, I40E_DEBUG_INIT, "HW Capability: wr_csr_prot = 0x%llX\n\n", - (p->wr_csr_prot & 0xffff)); + (unsigned long long)(p->wr_csr_prot & 0xffff)); + break; + case I40E_AQ_CAP_ID_DIS_UNUSED_PORTS: + p->dis_unused_ports = (bool)number; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: dis_unused_ports = %d\n\n", + p->dis_unused_ports); break; case I40E_AQ_CAP_ID_NVM_MGMT: if (number & I40E_NVM_MGMT_SEC_REV_DISABLED) @@ -4193,28 +4253,6 @@ i40e_aq_update_nvm_exit: return status; } -/** - * i40e_aq_nvm_progress - * @hw: pointer to the hw struct - * @progress: pointer to progress returned from AQ - * @cmd_details: pointer to command details structure or NULL - * - * Gets progress of flash rearrangement process - **/ -enum i40e_status_code i40e_aq_nvm_progress(struct i40e_hw *hw, u8 *progress, - struct i40e_asq_cmd_details *cmd_details) -{ - enum i40e_status_code status; - struct i40e_aq_desc desc; - - DEBUGFUNC("i40e_aq_nvm_progress"); - - i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_nvm_progress); - status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); - *progress = desc.params.raw[0]; - return status; -} - /** * i40e_aq_get_lldp_mib * @hw: pointer to the hw struct @@ -4593,7 +4631,7 @@ enum i40e_status_code i40e_aq_del_udp_tunnel(struct i40e_hw *hw, u8 index, } /** - * i40e_aq_get_switch_resource_alloc (0x0204) + * i40e_aq_get_switch_resource_alloc - command (0x0204) to get allocations * @hw: pointer to the hw struct * @num_entries: pointer to u8 to store the number of resource entries returned * @buf: pointer to a user supplied buffer. This buffer must be large enough @@ -6705,7 +6743,7 @@ u8 i40e_get_phy_address(struct i40e_hw *hw, u8 dev_num) } /** - * i40e_blink_phy_led + * i40e_blink_phy_link_led * @hw: pointer to the HW structure * @time: time how long led will blinks in secs * @interval: gap between LED on and off in msecs @@ -6942,15 +6980,23 @@ enum i40e_status_code i40e_get_phy_lpi_status(struct i40e_hw *hw, struct i40e_hw_port_stats *stat) { enum i40e_status_code ret = I40E_SUCCESS; + bool eee_mrvl_phy; + bool eee_bcm_phy; u32 val; stat->rx_lpi_status = 0; stat->tx_lpi_status = 0; - if ((hw->device_id == I40E_DEV_ID_10G_BASE_T_BC || - hw->device_id == I40E_DEV_ID_5G_BASE_T_BC) && - (hw->phy.link_info.link_speed == I40E_LINK_SPEED_2_5GB || - hw->phy.link_info.link_speed == I40E_LINK_SPEED_5GB)) { + eee_bcm_phy = + (hw->device_id == I40E_DEV_ID_10G_BASE_T_BC || + hw->device_id == I40E_DEV_ID_5G_BASE_T_BC) && + (hw->phy.link_info.link_speed == I40E_LINK_SPEED_2_5GB || + hw->phy.link_info.link_speed == I40E_LINK_SPEED_5GB); + eee_mrvl_phy = + hw->device_id == I40E_DEV_ID_1G_BASE_T_X722; + + if (eee_bcm_phy || eee_mrvl_phy) { + // read Clause 45 PCS Status 1 register ret = i40e_aq_get_phy_register(hw, I40E_AQ_PHY_REG_ACCESS_EXTERNAL, I40E_BCM_PHY_PCS_STATUS1_PAGE, @@ -7542,7 +7588,7 @@ enum i40e_status_code i40e_aq_set_arp_proxy_config(struct i40e_hw *hw, } /** - * i40e_aq_opc_set_ns_proxy_table_entry + * i40e_aq_set_ns_proxy_table_entry * @hw: pointer to the HW structure * @ns_proxy_table_entry: pointer to NS table entry command struct * @cmd_details: pointer to command details diff --git a/sys/dev/ixl/i40e_dcb.c b/sys/dev/ixl/i40e_dcb.c index b2f0b5c0acad..a02cbc80d361 100644 --- a/sys/dev/ixl/i40e_dcb.c +++ b/sys/dev/ixl/i40e_dcb.c @@ -265,7 +265,7 @@ static void i40e_parse_ieee_app_tlv(struct i40e_lldp_org_tlv *tlv, } /** - * i40e_parse_ieee_etsrec_tlv + * i40e_parse_ieee_tlv * @tlv: IEEE 802.1Qaz TLV * @dcbcfg: Local store to update ETS REC data * @@ -345,9 +345,15 @@ static void i40e_parse_cee_pgcfg_tlv(struct i40e_cee_feat_tlv *tlv, * |pg0|pg1|pg2|pg3|pg4|pg5|pg6|pg7| * --------------------------------- */ - for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) + for (i = 0; i < I40E_MAX_TRAFFIC_CLASS; i++) { etscfg->tcbwtable[i] = buf[offset++]; + if (etscfg->prioritytable[i] == I40E_CEE_PGID_STRICT) + dcbcfg->etscfg.tsatable[i] = I40E_IEEE_TSA_STRICT; + else + dcbcfg->etscfg.tsatable[i] = I40E_IEEE_TSA_ETS; + } + /* Number of TCs supported (1 octet) */ etscfg->maxtcs = buf[offset]; } diff --git a/sys/dev/ixl/i40e_lan_hmc.c b/sys/dev/ixl/i40e_lan_hmc.c index c280393ef1c8..eb2c44c92067 100644 --- a/sys/dev/ixl/i40e_lan_hmc.c +++ b/sys/dev/ixl/i40e_lan_hmc.c @@ -546,7 +546,7 @@ configure_lan_hmc_out: } /** - * i40e_delete_hmc_object - remove hmc objects + * i40e_delete_lan_hmc_object - remove hmc objects * @hw: pointer to the HW structure * @info: pointer to i40e_hmc_delete_obj_info struct * diff --git a/sys/dev/ixl/i40e_nvm.c b/sys/dev/ixl/i40e_nvm.c index 20ba63a05b4e..58e5c1a0cdd9 100644 --- a/sys/dev/ixl/i40e_nvm.c +++ b/sys/dev/ixl/i40e_nvm.c @@ -35,7 +35,7 @@ #include "i40e_prototype.h" /** - * i40e_init_nvm_ops - Initialize NVM function pointers + * i40e_init_nvm - Initialize NVM function pointers * @hw: pointer to the HW structure * * Setup the function pointers and the NVM info structure. Should be called @@ -108,7 +108,8 @@ enum i40e_status_code i40e_acquire_nvm(struct i40e_hw *hw, if (ret_code) i40e_debug(hw, I40E_DEBUG_NVM, "NVM acquire type %d failed time_left=%llu ret=%d aq_err=%d\n", - access, time_left, ret_code, hw->aq.asq_last_status); + access, (unsigned long long)time_left, ret_code, + hw->aq.asq_last_status); if (ret_code && time_left) { /* Poll until the current NVM owner timeouts */ @@ -130,7 +131,8 @@ enum i40e_status_code i40e_acquire_nvm(struct i40e_hw *hw, hw->nvm.hw_semaphore_timeout = 0; i40e_debug(hw, I40E_DEBUG_NVM, "NVM acquire timed out, wait %llu ms before trying again. status=%d aq_err=%d\n", - time_left, ret_code, hw->aq.asq_last_status); + (unsigned long long)time_left, ret_code, + hw->aq.asq_last_status); } } @@ -782,10 +784,11 @@ enum i40e_status_code i40e_update_nvm_checksum(struct i40e_hw *hw) DEBUGFUNC("i40e_update_nvm_checksum"); ret_code = i40e_calc_nvm_checksum(hw, &checksum); - le_sum = CPU_TO_LE16(checksum); - if (ret_code == I40E_SUCCESS) + if (ret_code == I40E_SUCCESS) { + le_sum = CPU_TO_LE16(checksum); ret_code = i40e_write_nvm_aq(hw, 0x00, I40E_SR_SW_CHECKSUM_WORD, 1, &le_sum, TRUE); + } return ret_code; } diff --git a/sys/dev/ixl/i40e_prototype.h b/sys/dev/ixl/i40e_prototype.h index 23ce2edb22a3..2febf9d6662d 100644 --- a/sys/dev/ixl/i40e_prototype.h +++ b/sys/dev/ixl/i40e_prototype.h @@ -268,6 +268,10 @@ enum i40e_status_code i40e_aq_write_nvm_config(struct i40e_hw *hw, u8 cmd_flags, void *data, u16 buf_size, u16 element_count, struct i40e_asq_cmd_details *cmd_details); +enum i40e_status_code +i40e_aq_min_rollback_rev_update(struct i40e_hw *hw, u8 mode, u8 module, + u32 min_rrev, + struct i40e_asq_cmd_details *cmd_details); enum i40e_status_code i40e_aq_oem_post_update(struct i40e_hw *hw, void *buff, u16 buff_size, struct i40e_asq_cmd_details *cmd_details); @@ -279,7 +283,11 @@ enum i40e_status_code i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer, u32 offset, u16 length, void *data, bool last_command, u8 preservation_flags, struct i40e_asq_cmd_details *cmd_details); -enum i40e_status_code i40e_aq_nvm_progress(struct i40e_hw *hw, u8 *progress, +enum i40e_status_code i40e_aq_rearrange_nvm(struct i40e_hw *hw, + u8 rearrange_nvm, + struct i40e_asq_cmd_details *cmd_details); +enum i40e_status_code i40e_aq_nvm_update_in_process(struct i40e_hw *hw, + bool update_flow_state, struct i40e_asq_cmd_details *cmd_details); enum i40e_status_code i40e_aq_get_lldp_mib(struct i40e_hw *hw, u8 bridge_type, u8 mib_type, void *buff, u16 buff_size, diff --git a/sys/dev/ixl/i40e_register.h b/sys/dev/ixl/i40e_register.h index 6c57d0a25f7e..ffc6a7e506a6 100644 --- a/sys/dev/ixl/i40e_register.h +++ b/sys/dev/ixl/i40e_register.h @@ -232,6 +232,9 @@ #define I40E_VFCM_PE_ERRINFO1_RLU_ERROR_CNT_MASK I40E_MASK(0xFF, I40E_VFCM_PE_ERRINFO1_RLU_ERROR_CNT_SHIFT) #define I40E_VFCM_PE_ERRINFO1_RLS_ERROR_CNT_SHIFT 24 #define I40E_VFCM_PE_ERRINFO1_RLS_ERROR_CNT_MASK I40E_MASK(0xFF, I40E_VFCM_PE_ERRINFO1_RLS_ERROR_CNT_SHIFT) +#define I40E_PRT_SWR_PM_THR 0x0026CD00 /* Reset: CORER */ +#define I40E_PRT_SWR_PM_THR_THRESHOLD_SHIFT 0 +#define I40E_PRT_SWR_PM_THR_THRESHOLD_MASK I40E_MASK(0xFF, I40E_PRT_SWR_PM_THR_THRESHOLD_SHIFT) #define I40E_GLDCB_GENC 0x00083044 /* Reset: CORER */ #define I40E_GLDCB_GENC_PCIRTT_SHIFT 0 #define I40E_GLDCB_GENC_PCIRTT_MASK I40E_MASK(0xFFFF, I40E_GLDCB_GENC_PCIRTT_SHIFT) diff --git a/sys/dev/ixl/i40e_type.h b/sys/dev/ixl/i40e_type.h index 699576ff5b43..f34002d7dc35 100644 --- a/sys/dev/ixl/i40e_type.h +++ b/sys/dev/ixl/i40e_type.h @@ -347,12 +347,8 @@ struct i40e_phy_info { I40E_PHY_TYPE_OFFSET) #define I40E_CAP_PHY_TYPE_25GBASE_ACC BIT_ULL(I40E_PHY_TYPE_25GBASE_ACC + \ I40E_PHY_TYPE_OFFSET) -/* Offset for 2.5G/5G PHY Types value to bit number conversion */ -#define I40E_PHY_TYPE_OFFSET2 (-10) -#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T + \ - I40E_PHY_TYPE_OFFSET2) -#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T + \ - I40E_PHY_TYPE_OFFSET2) +#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T) +#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T) #define I40E_HW_CAP_MAX_GPIO 30 #define I40E_HW_CAP_MDIO_PORT_MODE_MDIO 0 #define I40E_HW_CAP_MDIO_PORT_MODE_I2C 1 @@ -443,6 +439,7 @@ struct i40e_hw_capabilities { u32 enabled_tcmap; u32 maxtc; u64 wr_csr_prot; + bool dis_unused_ports; bool apm_wol_support; enum i40e_acpi_programming_method acpi_prog_method; bool proxy_support; @@ -975,7 +972,8 @@ enum i40e_rx_l2_ptype { I40E_RX_PTYPE_GRENAT4_MAC_PAY3 = 58, I40E_RX_PTYPE_GRENAT4_MACVLAN_IPV6_ICMP_PAY4 = 87, I40E_RX_PTYPE_GRENAT6_MAC_PAY3 = 124, - I40E_RX_PTYPE_GRENAT6_MACVLAN_IPV6_ICMP_PAY4 = 153 + I40E_RX_PTYPE_GRENAT6_MACVLAN_IPV6_ICMP_PAY4 = 153, + I40E_RX_PTYPE_PARSER_ABORTED = 255 }; struct i40e_rx_ptype_decoded { @@ -1551,6 +1549,9 @@ struct i40e_hw_port_stats { #define I40E_SR_CONFIGURATION_METADATA_PTR 0x4D #define I40E_SR_IMMEDIATE_VALUES_PTR 0x4E #define I40E_SR_5TH_FREE_PROVISION_AREA_PTR 0x50 +#define I40E_SR_PRESERVATION_RULES_PTR 0x70 +#define I40E_FPK_SR_5TH_FREE_PROVISION_AREA_PTR 0x71 +#define I40E_SR_6TH_FREE_PROVISION_AREA_PTR 0x71 /* Auxiliary field, mask and shift definition for Shadow RAM and NVM Flash */ #define I40E_SR_VPD_MODULE_MAX_SIZE 1024 @@ -1720,6 +1721,8 @@ struct i40e_lldp_variables { #define I40E_L4_DST_MASK (0x1ULL << I40E_L4_DST_SHIFT) #define I40E_VERIFY_TAG_SHIFT 31 #define I40E_VERIFY_TAG_MASK (0x3ULL << I40E_VERIFY_TAG_SHIFT) +#define I40E_VLAN_SRC_SHIFT 55 +#define I40E_VLAN_SRC_MASK (0x1ULL << I40E_VLAN_SRC_SHIFT) #define I40E_FLEX_50_SHIFT 13 #define I40E_FLEX_50_MASK (0x1ULL << I40E_FLEX_50_SHIFT) diff --git a/sys/dev/ixl/if_ixl.c b/sys/dev/ixl/if_ixl.c index f620771e93b1..e7e6e31a7fca 100644 --- a/sys/dev/ixl/if_ixl.c +++ b/sys/dev/ixl/if_ixl.c @@ -1514,11 +1514,11 @@ ixl_if_media_status(if_ctx_t ctx, struct ifmediareq *ifmr) ifmr->ifm_active |= IFM_1000_T; break; /* 2.5 G */ - case I40E_PHY_TYPE_2_5GBASE_T: + case I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS: ifmr->ifm_active |= IFM_2500_T; break; /* 5 G */ - case I40E_PHY_TYPE_5GBASE_T: + case I40E_PHY_TYPE_5GBASE_T_LINK_STATUS: ifmr->ifm_active |= IFM_5000_T; break; /* 10 G */ From owner-dev-commits-src-all@freebsd.org Mon Sep 13 21:13:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C4986A9670; Mon, 13 Sep 2021 21:13:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7fMc3QlBz3PMh; Mon, 13 Sep 2021 21:13:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56434614F; Mon, 13 Sep 2021 21:13:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DLD0eI065220; Mon, 13 Sep 2021 21:13:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DLD06u065219; Mon, 13 Sep 2021 21:13:00 GMT (envelope-from git) Date: Mon, 13 Sep 2021 21:13:00 GMT Message-Id: <202109132113.18DLD06u065219@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: c3ec04ec6fbf - stable/12 - [wpa] Add support for hostapd/wpa_supplicant when WITHOUT_CRYPT=YES is enabled. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: c3ec04ec6fbfe7cdfe521e625f42a7daef567265 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 21:13:00 -0000 The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=c3ec04ec6fbfe7cdfe521e625f42a7daef567265 commit c3ec04ec6fbfe7cdfe521e625f42a7daef567265 Author: Adrian Chadd AuthorDate: 2021-01-04 20:39:53 +0000 Commit: Cy Schubert CommitDate: 2021-09-13 21:12:02 +0000 [wpa] Add support for hostapd/wpa_supplicant when WITHOUT_CRYPT=YES is enabled. This builds wpa_supplicant / hostpad using internal encryption routines rather than using libcrypt. This has been supported in wpa for years now, however since we use local makefiles for this, we bitrotted dependencies and configuration options. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D27958 (cherry picked from commit 7c5a624afae43c44d8e57eb8c5073b9b07f88064) --- share/mk/src.opts.mk | 1 - usr.sbin/wpa/Makefile.crypto | 31 +++++++++++++++++++++++++++++-- usr.sbin/wpa/hostapd/Makefile | 4 ++++ usr.sbin/wpa/wpa_supplicant/Makefile | 2 +- 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 58c3ebb4cf0f..4fd16579f863 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -519,7 +519,6 @@ MK_LDNS:= no MK_PKGBOOTSTRAP:= no MK_SVN:= no MK_SVNLITE:= no -MK_WIRELESS:= no .endif .if ${MK_LDNS} == "no" diff --git a/usr.sbin/wpa/Makefile.crypto b/usr.sbin/wpa/Makefile.crypto index 8f7965d1dece..71ae76dfb0cc 100644 --- a/usr.sbin/wpa/Makefile.crypto +++ b/usr.sbin/wpa/Makefile.crypto @@ -16,9 +16,13 @@ CONFIG_INTERNAL_RC4=y CONFIG_INTERNAL_SHA1=y NEED_SHA256=y CONFIG_INTERNAL_SHA256=y +NEED_SHA384=y +CONFIG_INTERNAL_SHA384=y +NEED_SHA512=y +CONFIG_INTERNAL_SHA512=y CONFIG_INTERNAL_TLS=y +NEED_DH_GROUPS=y CONFIG_INTERNAL_DH5=y -CONFIG_INTERNAL_DH=y NEED_AES_ENC=true NEED_AES_CBC=true .endif @@ -45,6 +49,7 @@ SRCS+= asn1.c \ tlsv1_client.c \ tlsv1_client_write.c \ tlsv1_client_read.c \ + tlsv1_client_ocsp.c \ x509v3.c NEED_DES=y NEED_MD4=y @@ -123,14 +128,36 @@ SRCS+= sha256-internal.c sha256-prf.c .endif .endif +.if defined(NEED_SHA384) +CFLAGS+=-DCONFIG_SHA384 +SRCS+= sha384.c +.if defined(CONFIG_INTERNAL_SHA384) +SRCS+= sha384-internal.c sha384-prf.c +.endif +.endif + +.if defined(NEED_SHA512) +CFLAGS+=-DCONFIG_SHA512 +SRCS+= sha512.c +.if defined(CONFIG_INTERNAL_SHA512) +SRCS+= sha512-internal.c sha512-prf.c +.endif +.endif + .if defined(NEED_TLS_PRF) SRCS+= sha1-tlsprf.c .endif .if defined(CONFIG_INTERNAL_DH5) +.if defined(NEED_DH_GROUPS) SRCS+= dh_group5.c .endif +.endif -.if defined(CONFIG_INTERNAL_DH) +.if defined(NEED_DH_GROUPS) SRCS+= dh_groups.c .endif + +.if defined(NEED_DH_GROUPS_ALL) +CFLAGS+=-DALL_DH_GROUPS +.endif diff --git a/usr.sbin/wpa/hostapd/Makefile b/usr.sbin/wpa/hostapd/Makefile index f5d48a32046f..101ab80a4587 100644 --- a/usr.sbin/wpa/hostapd/Makefile +++ b/usr.sbin/wpa/hostapd/Makefile @@ -162,6 +162,10 @@ SRCS+= eap_server_gtc.c \ eapol_auth_sm.c TLS_FUNCS=y +# For WPS, EAP modes, etc +NEED_DH_GROUPS=y +NEED_DH_GROUPS_ALL=y + .if !empty(CFLAGS:M*-DCONFIG_WPS) NEED_SIM_COMMON=y .endif diff --git a/usr.sbin/wpa/wpa_supplicant/Makefile b/usr.sbin/wpa/wpa_supplicant/Makefile index 9cc49ac7fcfd..55b594d8b3e8 100644 --- a/usr.sbin/wpa/wpa_supplicant/Makefile +++ b/usr.sbin/wpa/wpa_supplicant/Makefile @@ -13,7 +13,7 @@ PROG= wpa_supplicant SRCS= base64.c bitfield.c blacklist.c bss.c cli.c common.c \ config.c config_file.c \ ctrl_iface.c ctrl_iface_common.c ctrl_iface_unix.c \ - dh_groups.c driver_bsd.c driver_common.c \ + driver_bsd.c driver_common.c \ driver_ndis.c driver_wired.c driver_wired_common.c drivers.c \ eap_register.c eloop.c \ events.c gas.c gas_query.c \ From owner-dev-commits-src-all@freebsd.org Mon Sep 13 21:13:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DBE916A9D11; Mon, 13 Sep 2021 21:13:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7fMd4jh4z3PP1; Mon, 13 Sep 2021 21:13:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71498665E; Mon, 13 Sep 2021 21:13:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DLD10I065244; Mon, 13 Sep 2021 21:13:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DLD1kv065243; Mon, 13 Sep 2021 21:13:01 GMT (envelope-from git) Date: Mon, 13 Sep 2021 21:13:01 GMT Message-Id: <202109132113.18DLD1kv065243@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 5654815fd360 - stable/12 - wpa: Restructure wpa build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5654815fd3604e024eefdcb34904d3a7c883e8c5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 21:13:02 -0000 The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=5654815fd3604e024eefdcb34904d3a7c883e8c5 commit 5654815fd3604e024eefdcb34904d3a7c883e8c5 Author: Cy Schubert AuthorDate: 2021-05-20 21:28:17 +0000 Commit: Cy Schubert CommitDate: 2021-09-13 21:12:02 +0000 wpa: Restructure wpa build The current WPA build assumes a flat namespace. However the latest sources from w1.fi now have a duplicate config.c, in two separate subdirectories. The flat namespace will overwrite config.o with the output from the most recently modified config.c, of which there are two of them. This commit resolves this problem by building each component in wpa's src subdirectory tree into its own .a archive, just as the w1.fi upstream build as used by the port does. The advantages of this approach are: 1. Duplicate source file names, i.e. config.c in the wpa_supplicant direcory and another config.c in src/utils in the next wpa will result in both compiles writing to the same .o file. 2. This restructure simplifies maintanence. A develper needs only to add new files as identified by git status in the vendor branch to the appropriate Makefile within the usr.sbin/wpa tree. This also reduces time required to prepare a new import and should reduce error. 3. The new wpa build structure more closely represents the build as performed by the upstream tarball. This is in preparation for the next wpa update from w1.fi. Reviewed by: philip Tested by: philip MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D30372 (cherry picked from commit 25ecdc7d52770caf1c9b44b5ec11f468f6b636f3) --- share/mk/src.libnames.mk | 62 +++++++++++++- usr.sbin/wpa/Makefile | 10 ++- usr.sbin/wpa/Makefile.crypto | 104 ------------------------ usr.sbin/wpa/Makefile.inc | 92 +++++++++++++++++---- usr.sbin/wpa/hostapd/Makefile | 153 ++--------------------------------- usr.sbin/wpa/hostapd_cli/Makefile | 10 +-- usr.sbin/wpa/src/Makefile | 19 +++++ usr.sbin/wpa/src/ap/Makefile | 59 ++++++++++++++ usr.sbin/wpa/src/common/Makefile | 27 +++++++ usr.sbin/wpa/src/crypto/Makefile | 63 +++++++++++++++ usr.sbin/wpa/src/drivers/Makefile | 21 +++++ usr.sbin/wpa/src/eap_common/Makefile | 25 ++++++ usr.sbin/wpa/src/eap_peer/Makefile | 33 ++++++++ usr.sbin/wpa/src/eap_server/Makefile | 34 ++++++++ usr.sbin/wpa/src/eapol_auth/Makefile | 18 +++++ usr.sbin/wpa/src/eapol_supp/Makefile | 19 +++++ usr.sbin/wpa/src/l2_packet/Makefile | 19 +++++ usr.sbin/wpa/src/radius/Makefile | 24 ++++++ usr.sbin/wpa/src/rsn_supp/Makefile | 26 ++++++ usr.sbin/wpa/src/tls/Makefile | 38 +++++++++ usr.sbin/wpa/src/utils/Makefile | 32 ++++++++ usr.sbin/wpa/src/wps/Makefile | 39 +++++++++ usr.sbin/wpa/wpa_cli/Makefile | 33 ++++---- usr.sbin/wpa/wpa_passphrase/Makefile | 7 +- usr.sbin/wpa/wpa_priv/Makefile | 9 +-- usr.sbin/wpa/wpa_supplicant/Makefile | 93 ++++++--------------- 26 files changed, 700 insertions(+), 369 deletions(-) diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk index f293d8cb3f5f..247505978cc1 100644 --- a/share/mk/src.libnames.mk +++ b/share/mk/src.libnames.mk @@ -56,7 +56,22 @@ _INTERNALLIBS= \ smdb \ smutil \ telnet \ - vers + vers \ + wpaap \ + wpacommon \ + wpacrypto \ + wpadrivers \ + wpaeap_common \ + wpaeap_peer \ + wpaeap_server \ + wpaeapol_auth \ + wpaeapol_supp \ + wpal2_packet \ + wparadius \ + wparsn_supp \ + wpatls \ + wpautils \ + wpawps _LIBRARIES= \ ${_PRIVATELIBS} \ @@ -539,6 +554,51 @@ LIBBE?= ${LIBBEDIR}/libbe${PIE_SUFFIX}.a LIBPMCSTATDIR= ${OBJTOP}/lib/libpmcstat LIBPMCSTAT?= ${LIBPMCSTATDIR}/libpmcstat${PIE_SUFFIX}.a +LIBWPAAPDIR= ${OBJTOP}/usr.sbin/wpa/src/ap +LIBWPAAP?= ${LIBWPAAPDIR}/libwpaap${PIE_SUFFIX}.a + +LIBWPACOMMONDIR= ${OBJTOP}/usr.sbin/wpa/src/common +LIBWPACOMMON?= ${LIBWPACOMMONDIR}/libwpacommon${PIE_SUFFIX}.a + +LIBWPACRYPTODIR= ${OBJTOP}/usr.sbin/wpa/src/crypto +LIBWPACRYPTO?= ${LIBWPACRYPTODIR}/libwpacrypto${PIE_SUFFIX}.a + +LIBWPADRIVERSDIR= ${OBJTOP}/usr.sbin/wpa/src/drivers +LIBWPADRIVERS?= ${LIBWPADRIVERSDIR}/libwpadrivers${PIE_SUFFIX}.a + +LIBWPAEAP_COMMONDIR= ${OBJTOP}/usr.sbin/wpa/src/eap_common +LIBWPAEAP_COMMON?= ${LIBWPAEAP_COMMONDIR}/libwpaeap_common${PIE_SUFFIX}.a + +LIBWPAEAP_PEERDIR= ${OBJTOP}/usr.sbin/wpa/src/eap_peer +LIBWPAEAP_PEER?= ${LIBWPAEAP_PEERDIR}/libwpaeap_peer${PIE_SUFFIX}.a + +LIBWPAEAP_SERVERDIR= ${OBJTOP}/usr.sbin/wpa/src/eap_server +LIBWPAEAP_SERVER?= ${LIBWPAEAP_SERVERDIR}/libwpaeap_server${PIE_SUFFIX}.a + +LIBWPAEAPOL_AUTHDIR= ${OBJTOP}/usr.sbin/wpa/src/eapol_auth +LIBWPAEAPOL_AUTH?= ${LIBWPAEAPOL_AUTHDIR}/libwpaeapol_auth${PIE_SUFFIX}.a + +LIBWPAEAPOL_SUPPDIR= ${OBJTOP}/usr.sbin/wpa/src/eapol_supp +LIBWPAEAPOL_SUPP?= ${LIBWPAEAPOL_SUPPDIR}/libwpaeapol_supp${PIE_SUFFIX}.a + +LIBWPAL2_PACKETDIR= ${OBJTOP}/usr.sbin/wpa/src/l2_packet +LIBWPAL2_PACKET?= ${LIBWPAL2_PACKETDIR}/libwpal2_packet${PIE_SUFFIX}.a + +LIBWPARADIUSDIR= ${OBJTOP}/usr.sbin/wpa/src/radius +LIBWPARADIUS?= ${LIBWPARADIUSDIR}/libwparadius${PIE_SUFFIX}.a + +LIBWPARSN_SUPPDIR= ${OBJTOP}/usr.sbin/wpa/src/rsn_supp +LIBWPARSN_SUPP?= ${LIBWPARSN_SUPPDIR}/libwparsn_supp${PIE_SUFFIX}.a + +LIBWPATLSDIR= ${OBJTOP}/usr.sbin/wpa/src/tls +LIBWPATLS?= ${LIBWPATLSDIR}/libwpatls${PIE_SUFFIX}.a + +LIBWPAUTILSDIR= ${OBJTOP}/usr.sbin/wpa/src/utils +LIBWPAUTILS?= ${LIBWPAUTILSDIR}/libwpautils${PIE_SUFFIX}.a + +LIBWPAWPSDIR= ${OBJTOP}/usr.sbin/wpa/src/wps +LIBWPAWPS?= ${LIBWPAWPSDIR}/libwpawps${PIE_SUFFIX}.a + LIBC_NOSSP_PICDIR= ${OBJTOP}/lib/libc LIBC_NOSSP_PIC?= ${LIBC_NOSSP_PICDIR}/libc_nossp_pic.a diff --git a/usr.sbin/wpa/Makefile b/usr.sbin/wpa/Makefile index ae07ec04f001..fe8fb60b1dc2 100644 --- a/usr.sbin/wpa/Makefile +++ b/usr.sbin/wpa/Makefile @@ -1,8 +1,12 @@ # $FreeBSD$ -SUBDIR= wpa_supplicant wpa_cli wpa_passphrase -SUBDIR+= hostapd hostapd_cli -SUBDIR+= ndis_events +SUBDIR= src .WAIT \ + wpa_supplicant \ + wpa_cli \ + wpa_passphrase \ + hostapd \ + hostapd_cli \ + SUBDIR_PARALLEL= .include diff --git a/usr.sbin/wpa/Makefile.crypto b/usr.sbin/wpa/Makefile.crypto index 71ae76dfb0cc..0f72f546a3ad 100644 --- a/usr.sbin/wpa/Makefile.crypto +++ b/usr.sbin/wpa/Makefile.crypto @@ -1,13 +1,10 @@ # $FreeBSD$ .if ${MK_OPENSSL} != "no" && !defined(RELEASE_CRUNCH) -SRCS+= crypto_openssl.c random.c sha1-prf.c sha256-prf.c sha256-tlsprf.c \ - sha512.c LIBADD+= ssl crypto CFLAGS+= -DCONFIG_SHA256 .else CFLAGS+=-DCONFIG_CRYPTO_INTERNAL -SRCS+= crypto_internal.c random.c CONFIG_INTERNAL_AES=y CONFIG_INTERNAL_DES=y CONFIG_INTERNAL_MD4=y @@ -33,129 +30,28 @@ NEED_TLS_PRF=y .if defined(CONFIG_INTERNAL_TLS) CFLAGS+=-DCONFIG_INTERNAL_LIBTOMMATH \ -DCONFIG_TLS_INTERNAL_CLIENT -SRCS+= asn1.c \ - bignum.c \ - crypto_internal-cipher.c \ - crypto_internal-modexp.c \ - crypto_internal-rsa.c \ - pkcs1.c \ - pkcs5.c \ - pkcs8.c \ - rsa.c \ - tls_internal.c \ - tlsv1_common.c \ - tlsv1_record.c \ - tlsv1_cred.c \ - tlsv1_client.c \ - tlsv1_client_write.c \ - tlsv1_client_read.c \ - tlsv1_client_ocsp.c \ - x509v3.c NEED_DES=y NEED_MD4=y NEED_RC4=y .else CFLAGS+=-DEAP_TLS_OPENSSL -SRCS+= tls_openssl.c tls_openssl_ocsp.c .endif .endif -.if defined(CONFIG_INTERNAL_AES) -SRCS+= aes-unwrap.c aes-wrap.c \ - aes-internal.c \ - aes-internal-dec.c \ - aes-internal-enc.c -.endif - -.if defined(NEED_AES_CBC) -SRCS+= aes-cbc.c -.endif - .if defined(NEED_AES_EAX) -SRCS+= aes-eax.c NEED_AES_CTR=y .endif -.if defined(NEED_AES_CTR) -SRCS+= aes-ctr.c -.endif - -.if defined(NEED_AES_ENCBLOCK) -SRCS+= aes-encblock.c -.endif - -.if defined(NEED_AES_OMAC1) -SRCS+= aes-omac1.c -.endif - -.if defined(NEED_DES) -.if defined(CONFIG_INTERNAL_DES) -SRCS+= des-internal.c -.endif -.endif - -.if defined(NEED_MD4) -.if defined(CONFIG_INTERNAL_MD4) -SRCS+= md4-internal.c -.endif -.endif - -.if defined(CONFIG_INTERNAL_MD5) -SRCS+= md5.c md5-internal.c -.endif - -.if defined(NEED_FIPS186_2_PRF) -.if defined(CONFIG_INTERNAL_SHA1) -SRCS+= fips_prf_internal.c -.else -SRCS+= fips_prf_openssl.c -.endif -.endif - -.if defined(CONFIG_INTERNAL_RC4) -SRCS+= rc4.c -.endif - -.if defined(CONFIG_INTERNAL_SHA1) -SRCS+= sha1-internal.c sha1-pbkdf2.c sha1.c sha1-prf.c -.endif - .if defined(NEED_SHA256) CFLAGS+=-DCONFIG_SHA256 -SRCS+= sha256.c -.if defined(CONFIG_INTERNAL_SHA256) -SRCS+= sha256-internal.c sha256-prf.c -.endif .endif .if defined(NEED_SHA384) CFLAGS+=-DCONFIG_SHA384 -SRCS+= sha384.c -.if defined(CONFIG_INTERNAL_SHA384) -SRCS+= sha384-internal.c sha384-prf.c -.endif .endif .if defined(NEED_SHA512) CFLAGS+=-DCONFIG_SHA512 -SRCS+= sha512.c -.if defined(CONFIG_INTERNAL_SHA512) -SRCS+= sha512-internal.c sha512-prf.c -.endif -.endif - -.if defined(NEED_TLS_PRF) -SRCS+= sha1-tlsprf.c -.endif - -.if defined(CONFIG_INTERNAL_DH5) -.if defined(NEED_DH_GROUPS) -SRCS+= dh_group5.c -.endif -.endif - -.if defined(NEED_DH_GROUPS) -SRCS+= dh_groups.c .endif .if defined(NEED_DH_GROUPS_ALL) diff --git a/usr.sbin/wpa/Makefile.inc b/usr.sbin/wpa/Makefile.inc index c2e216c4b6c4..4ad9b2fa6497 100644 --- a/usr.sbin/wpa/Makefile.inc +++ b/usr.sbin/wpa/Makefile.inc @@ -1,23 +1,14 @@ # $FreeBSD$ +.include + BINDIR?= /usr/sbin WPA_DISTDIR?= ${SRCTOP}/contrib/wpa/ WPA_SUPPLICANT_DISTDIR?=${WPA_DISTDIR}/wpa_supplicant HOSTAPD_DISTDIR?= ${WPA_DISTDIR}/hostapd -.PATH.c:${.CURDIR:H} \ - ${WPA_DISTDIR}/src/common \ - ${WPA_DISTDIR}/src/crypto \ - ${WPA_DISTDIR}/src/eapol_auth \ - ${WPA_DISTDIR}/src/eap_common \ - ${WPA_DISTDIR}/src/eapol_supp \ - ${WPA_DISTDIR}/src/l2_packet \ - ${WPA_DISTDIR}/src/radius \ - ${WPA_DISTDIR}/src/rsn_supp \ - ${WPA_DISTDIR}/src/tls \ - ${WPA_DISTDIR}/src/utils \ - ${WPA_DISTDIR}/src/wps +.PATH.c:${.CURDIR:H} CFLAGS+=-I${.CURDIR} CFLAGS+=-I${HOSTAPD_DISTDIR} @@ -29,9 +20,78 @@ CFLAGS+=-I${WPA_DISTDIR}/src/l2_packet CFLAGS+=-I${WPA_DISTDIR}/src/utils CFLAGS+=-I${WPA_DISTDIR}/src/wps -CFLAGS+= -DCONFIG_CTRL_IFACE -CFLAGS+= -DCONFIG_CTRL_IFACE_UNIX -CFLAGS+= -DNEED_AP_MLME -CFLAGS+= -DTLS_DEFAULT_CIPHERS=\"DEFAULT:!EXP:!LOW\" +CFLAGS+=-DCONFIG_DRIVER_BSD +CFLAGS+=-DCONFIG_DRIVER_WIRED +CFLAGS+=-DCONFIG_DRIVER_RADIUS_ACL +CFLAGS+=-DCONFIG_CTRL_IFACE +CFLAGS+=-DCONFIG_CTRL_IFACE_UNIX +CFLAGS+=-DCONFIG_IEEE80211AC +CFLAGS+=-DCONFIG_IEEE80211N +CFLAGS+=-DCONFIG_IEEE80211R +CFLAGS+=-DCONFIG_IEEE80211W +CFLAGS+=-DCONFIG_IEEE80211AX +CFLAGS+=-DNEED_AP_MLME +CFLAGS+=-DTLS_DEFAULT_CIPHERS=\"DEFAULT:!EXP:!LOW\" +CFLAGS+=-DCONFIG_DEBUG_SYSLOG +CFLAGS+=-DCONFIG_WPS +CFLAGS+=-DCONFIG_WPS2 +CFLAGS+=-DCONFIG_WPS_UPNP +CFLAGS+=-DCONFIG_WPS_OOB +CFLAGS+=-DCONFIG_INTERWORKING +CFLAGS+=-DPKCS12_FUNCS +CFLAGS+=-DCONFIG_GAS +CFLAGS+=-DCONFIG_PEERKEY +CFLAGS+=-DCONFIG_PRIVSEP +CFLAGS+=-DCONFIG_SMARTCARD +CFLAGS+=-DCONFIG_TERMINATE_ONLASTIF +CFLAGS+=-DCONFIG_TLS=openssl +CFLAGS+=-DCONFIG_MATCH_IFACE +CFLAGS+=-DEAP_SERVER +CFLAGS+=-DEAP_SERVER_GTC +CFLAGS+=-DEAP_SERVER_IDENTITY +CFLAGS+=-DEAP_SERVER_MD5 +CFLAGS+=-DEAP_SERVER_MSCHAPV2 +CFLAGS+=-DEAP_SERVER_PEAP +CFLAGS+=-DEAP_SERVER_TLS +CFLAGS+=-DEAP_SERVER_TTLS +CFLAGS+=-DEAP_SERVER_WSC +CFLAGS+=-DEAP_TLS_FUNCS + +.if ${MK_WPA_SUPPLICANT_EAPOL} != "no" +CFLAGS+=-DCONFIG_HS20 \ + -DEAP_GTC \ + -DEAP_LEAP \ + -DEAP_MD5 \ + -DEAP_MSCHAPv2 \ + -DEAP_OTP \ + -DEAP_PEAP \ + -DEAP_PSK \ + -DEAP_TLS \ + -DEAP_TTLS \ + -DEAP_WSC \ + -DIEEE8021X_EAPOL +NEED_AES_EAX=y +NEED_AES_ENCBLOCK=y +NEED_AES_OMAC1=y +.endif + +.if !empty(CFLAGS:M*-DEAP_AKA) +NEED_SIM_COMMON=y +NEED_AES_CBC=y +.endif + +.if !empty(CFLAGS:M*-DEAP_SIM) +NEED_SIM_COMMON=y +NEED_AES_CBC=y +.endif + +.if defined(NEED_SIM_COMMON) +NEED_FIPS186_2_PRF=y +.endif + +.if !empty(CFLAGS:M*-DEAP_GPSK) +CFLAGS+=-DEAP_GPSK_SHA256 +NEED_AES_OMAC1=y +.endif .include diff --git a/usr.sbin/wpa/hostapd/Makefile b/usr.sbin/wpa/hostapd/Makefile index 101ab80a4587..2cadbeb4c7c4 100644 --- a/usr.sbin/wpa/hostapd/Makefile +++ b/usr.sbin/wpa/hostapd/Makefile @@ -3,95 +3,13 @@ .include .include "../Makefile.inc" -.PATH.c:${HOSTAPD_DISTDIR} \ - ${WPA_DISTDIR}/src/ap \ - ${WPA_DISTDIR}/src/eap_server \ - ${WPA_DISTDIR}/src/eap_peer \ - ${WPA_DISTDIR}/src/drivers \ - ${WPA_DISTDIR}/wpa_supplicant +.PATH.c:${HOSTAPD_DISTDIR} PROG= hostapd -SRCS= accounting.c \ - ap_config.c \ - ap_drv_ops.c \ - ap_list.c \ - ap_mlme.c \ - authsrv.c \ - base64.c \ - beacon.c \ - bss_load.c \ - chap.c \ - common.c \ - config_file.c \ +SRCS= config_file.c \ ctrl_iface.c \ - ctrl_iface_ap.c \ - ctrl_iface_common.c \ - dfs.c \ - driver_bsd.c \ - driver_common.c \ - drivers.c \ - drv_callbacks.c \ - eloop.c \ - gas.c \ - gas_serv.c \ - http_client.c \ - http_server.c \ - httpread.c \ - hostapd.c \ - hs20.c \ - hw_features.c \ - hw_features_common.c \ - ieee802_11.c \ - ieee802_11_auth.c \ - ieee802_11_common.c \ - ieee802_11_he.c \ - ieee802_11_ht.c \ - ieee802_11_shared.c \ - ieee802_11_vht.c \ - ieee802_1x.c \ - ip_addr.c \ - l2_packet_freebsd.c \ - main.c \ - mbo_ap.c \ - ms_funcs.c \ - neighbor_db.c \ - os_unix.c \ - pmksa_cache_auth.c \ - preauth_auth.c \ - radius.c \ - radius_client.c \ - radius_das.c \ - rrm.c \ - sta_info.c \ - tkip_countermeasures.c \ - upnp_xml.c \ - utils.c \ - uuid.c \ - vlan.c \ - vlan_ifconfig.c \ - vlan_init.c \ - wmm.c \ - wpa_auth.c \ - wpa_auth_glue.c \ - wpa_auth_ie.c \ - wpa_common.c \ - wpa_ctrl.c \ - wpa_debug.c \ - wpabuf.c \ - wps.c \ - wps_attr_build.c \ - wps_attr_process.c \ - wps_attr_parse.c \ - wps_common.c \ - wps_dev_attr.c \ - wps_enrollee.c \ - wps_hostapd.c \ - wps_registrar.c \ - wps_upnp.c \ - wps_upnp_ap.c \ - wps_upnp_event.c \ - wps_upnp_ssdp.c \ - wps_upnp_web.c + eap_register.c \ + main.c MAN= hostapd.8 hostapd.conf.5 @@ -103,26 +21,17 @@ FILES= hostapd.conf hostapd.eap_user hostapd.wpa_psk CFLAGS+=-I${.CURDIR:H}/wpa_supplicant \ -I${WPA_DISTDIR}/src/eap_peer \ - -DCONFIG_DRIVER_BSD \ - -DCONFIG_DRIVER_RADIUS_ACL \ - -DCONFIG_HS20 \ -DCONFIG_MBO \ - -DCONFIG_IEEE80211N \ - -DCONFIG_IEEE80211W \ - -DCONFIG_IEEE80211AC \ - -DCONFIG_IEEE80211AX \ - -DCONFIG_INTERWORKING \ - -DCONFIG_PEERKEY \ -DCONFIG_RSN_PREAUTH \ - -DCONFIG_WPS \ - -DCONFIG_WPS2 \ - -DCONFIG_WPS_UPNP \ -DHOSTAPD .if ${MK_INET6} != "no" CFLAGS+= -DCONFIG_IPV6 .endif #CFLAGS+= -g -LIBADD+= pcap util +LIBADD+= pcap util wpaap wpacommon wpacrypto \ + wpadrivers wpal2_packet wpaeap_common wpaeap_server \ + wpaeapol_auth \ + wparadius wpatls wpautils wpawps # User customizations for wpa_supplicant/hostapd build environment CFLAGS+=${HOSTAPD_CFLAGS} @@ -130,36 +39,6 @@ CFLAGS+=${HOSTAPD_CFLAGS} LDADD+=${HOSTAPD_LDADD} #LDFLAGS+=${HOSTAPD_LDFLAGS} -CFLAGS+=-DDPKCS12_FUNCS \ - -DEAP_SERVER \ - -DEAP_SERVER_GTC \ - -DEAP_SERVER_IDENTITY \ - -DEAP_SERVER_MD5 \ - -DEAP_SERVER_MSCHAPV2 \ - -DEAP_SERVER_PEAP \ - -DEAP_SERVER_TLS \ - -DEAP_SERVER_TTLS \ - -DEAP_SERVER_WSC \ - -DEAP_TLS_FUNCS - -SRCS+= eap_server_gtc.c \ - eap_common.c \ - eap_peap_common.c \ - eap_register.c \ - eap_server.c \ - eap_server_identity.c \ - eap_server_md5.c \ - eap_server_methods.c \ - eap_server_mschapv2.c \ - eap_server_peap.c \ - eap_server_tls.c \ - eap_server_tls_common.c \ - eap_server_ttls.c \ - eap_server_wsc.c \ - eap_user_db.c \ - eap_wsc_common.c \ - eapol_auth_dump.c \ - eapol_auth_sm.c TLS_FUNCS=y # For WPS, EAP modes, etc @@ -171,38 +50,22 @@ NEED_SIM_COMMON=y .endif .if !empty(CFLAGS:M*-DEAP_SERVER_AKA) -SRCS+= eap_server_aka.c NEED_SIM_COMMON=y .endif .if !empty(CFLAGS:M*-DEAP_SERVER_SIM) -SRCS+= eap_server_sim.c NEED_SIM_COMMON=y .endif .if defined(NEED_SIM_COMMON) -SRCS+= eap_sim_common.c \ - eap_sim_db.c NEED_FIPS186_2_PRF=y .endif .if !empty(CFLAGS:M*-DEAP_SERVER_GPSK) CFLAGS+=-DEAP_GPSK_SHA256 -SRCS+= eap_server_gpsk.c \ - eap_gpsk_common.c NEED_AES_OMAC1=y .endif -.if !empty(CFLAGS:M*-DEAP_SERVER_PAX) -SRCS+= eap_server_pax.c \ - eap_pax_common.c -.endif - -.if !empty(CFLAGS:M*-DEAP_SERVER_SAKE) -SRCS+= eap_server_sake.c \ - eap_sake_common.c -.endif - .include "../Makefile.crypto" .include diff --git a/usr.sbin/wpa/hostapd_cli/Makefile b/usr.sbin/wpa/hostapd_cli/Makefile index ad652333c753..ac9745e50f84 100644 --- a/usr.sbin/wpa/hostapd_cli/Makefile +++ b/usr.sbin/wpa/hostapd_cli/Makefile @@ -5,14 +5,12 @@ .PATH.c:${HOSTAPD_DISTDIR} PROG= hostapd_cli -SRCS= cli.c common.c edit.c eloop.c hostapd_cli.c os_unix.c \ - wpa_ctrl.c wpa_debug.c +SRCS= hostapd_cli.c -CFLAGS+= -DCONFIG_CTRL_IFACE -CFLAGS+= -DCONFIG_CTRL_IFACE_UNIX - -LIBADD+= util +LIBADD+= util wpacommon wpautils MAN= hostapd_cli.8 +.include "../Makefile.crypto" + .include diff --git a/usr.sbin/wpa/src/Makefile b/usr.sbin/wpa/src/Makefile new file mode 100644 index 000000000000..f21856ad23a2 --- /dev/null +++ b/usr.sbin/wpa/src/Makefile @@ -0,0 +1,19 @@ +SUBDIR= ap \ + common \ + crypto \ + drivers \ + eap_common \ + eap_peer \ + eap_server \ + eapol_auth \ + eapol_supp \ + l2_packet \ + radius \ + rsn_supp \ + tls \ + utils \ + wps + +SUBDIR_PARALLEL= + +.include diff --git a/usr.sbin/wpa/src/ap/Makefile b/usr.sbin/wpa/src/ap/Makefile new file mode 100644 index 000000000000..edb2f1e9d089 --- /dev/null +++ b/usr.sbin/wpa/src/ap/Makefile @@ -0,0 +1,59 @@ +.include + +.include "../../Makefile.inc" + +LIB= wpaap +INTERNALLIB= + +.PATH: ${WPA_DISTDIR}/src/ap + +SRCS= accounting.c \ + ap_config.c \ + ap_drv_ops.c \ + ap_list.c \ + ap_mlme.c \ + authsrv.c \ + beacon.c \ + bss_load.c \ + ctrl_iface_ap.c \ + dfs.c \ + drv_callbacks.c \ + eap_user_db.c \ + gas_serv.c \ + hostapd.c \ + hs20.c \ + hw_features.c \ + ieee802_11.c \ + ieee802_11_auth.c \ + ieee802_11_he.c \ + ieee802_11_ht.c \ + ieee802_11_shared.c \ + ieee802_11_vht.c \ + ieee802_1x.c \ + mbo_ap.c \ + neighbor_db.c \ + pmksa_cache_auth.c \ + preauth_auth.c \ + rrm.c \ + sta_info.c \ + tkip_countermeasures.c \ + utils.c \ + vlan.c \ + vlan_ifconfig.c \ + vlan_init.c \ + wmm.c \ + wpa_auth.c \ + wpa_auth_glue.c \ + wpa_auth_ie.c \ + wps_hostapd.c + +CFLAGS+=-DCONFIG_MBO \ + -DCONFIG_RSN_PREAUTH \ + -DHOSTAPD + +.include "../../Makefile.crypto" + +# We are only interested in includes at this point. Not libraries. +LIBADD= + +.include diff --git a/usr.sbin/wpa/src/common/Makefile b/usr.sbin/wpa/src/common/Makefile new file mode 100644 index 000000000000..28c16ff9d31a --- /dev/null +++ b/usr.sbin/wpa/src/common/Makefile @@ -0,0 +1,27 @@ +.include + +.include "../../Makefile.inc" + +LIB= wpacommon +INTERNALLIB= + +.PATH: ${WPA_DISTDIR}/src/common + +SRCS= cli.c \ + ctrl_iface_common.c \ + gas.c \ + hw_features_common.c \ + ieee802_11_common.c \ + wpa_common.c \ + wpa_ctrl.c + +CFLAGS+=-DCONFIG_SAE \ + -DCONFIG_SUITE \ + -DCONFIG_SUITEB + +.include "../../Makefile.crypto" + +# We are only interested in includes at this point. Not libraries. +LIBADD= + +.include diff --git a/usr.sbin/wpa/src/crypto/Makefile b/usr.sbin/wpa/src/crypto/Makefile new file mode 100644 index 000000000000..d7e1304dc95e --- /dev/null +++ b/usr.sbin/wpa/src/crypto/Makefile @@ -0,0 +1,63 @@ +.include + +.include "../../Makefile.inc" + +LIB= wpacrypto +INTERNALLIB= + +.PATH: ${WPA_DISTDIR}/src/crypto + +SRCS= aes-cbc.c \ + aes-ctr.c \ + aes-eax.c \ + aes-encblock.c \ + aes-internal.c \ + aes-internal-dec.c \ + aes-internal-enc.c \ + aes-omac1.c \ + aes-unwrap.c \ + aes-wrap.c \ + crypto_internal.c \ + crypto_internal-cipher.c \ + crypto_internal-modexp.c \ + crypto_internal-rsa.c \ + des-internal.c \ + dh_group5.c \ + dh_groups.c \ + fips_prf_internal.c \ + md4-internal.c \ + md5.c \ + md5-internal.c \ + ms_funcs.c \ + random.c \ + rc4.c \ + sha1.c \ + sha1-internal.c \ + sha1-pbkdf2.c \ + sha1-prf.c \ + sha1-tlsprf.c \ + sha256.c \ + sha256-prf.c \ + sha256-tlsprf.c \ + sha256-internal.c \ + sha384.c \ + sha384-prf.c \ + sha384-internal.c \ + sha512-internal.c \ + tls_internal.c + +CFLAGS+=-DCONFIG_CRYPTO_INTERNAL \ + -DCONFIG_TLS_INTERNAL_CLIENT \ + -DCONFIG_TLS_INTERNAL_SERVER \ + -DCONFIG_SHA256 \ + -DCONFIG_SHA384 \ + -DCONFIG_HMAC_SHA384_KDF \ + -DCONFIG_INTERNAL_SHA384 +#CFLAGS+=-DALL_DH_GROUPS + +.include "../../Makefile.crypto" + +# We are only interested in includes at this point. Not libraries. +LIBADD= + +.include diff --git a/usr.sbin/wpa/src/drivers/Makefile b/usr.sbin/wpa/src/drivers/Makefile new file mode 100644 index 000000000000..1800b651885f --- /dev/null +++ b/usr.sbin/wpa/src/drivers/Makefile @@ -0,0 +1,21 @@ +.include + +.include "../../Makefile.inc" + +LIB= wpadrivers +INTERNALLIB= + +.PATH: ${WPA_DISTDIR}/src/drivers + +SRCS= drivers.c \ + driver_bsd.c \ + driver_common.c \ + driver_wired.c \ + driver_wired_common.c + +.include "../../Makefile.crypto" + +# We are only interested in includes at this point. Not libraries. +LIBADD= + +.include diff --git a/usr.sbin/wpa/src/eap_common/Makefile b/usr.sbin/wpa/src/eap_common/Makefile new file mode 100644 index 000000000000..4da89b221b36 --- /dev/null +++ b/usr.sbin/wpa/src/eap_common/Makefile @@ -0,0 +1,25 @@ +.include + +.include "../../Makefile.inc" + +LIB= wpaeap_common +INTERNALLIB= + +.PATH: ${WPA_DISTDIR}/src/eap_common + +SRCS= chap.c \ + eap_common.c \ + eap_gpsk_common.c \ + eap_pax_common.c \ + eap_peap_common.c \ + eap_psk_common.c \ + eap_sake_common.c \ + eap_sim_common.c \ + eap_wsc_common.c + +.include "../../Makefile.crypto" + +# We are only interested in includes at this point. Not libraries. +LIBADD= + +.include diff --git a/usr.sbin/wpa/src/eap_peer/Makefile b/usr.sbin/wpa/src/eap_peer/Makefile new file mode 100644 index 000000000000..524c7cf6c6f1 --- /dev/null +++ b/usr.sbin/wpa/src/eap_peer/Makefile @@ -0,0 +1,33 @@ +.include + +.include "../../Makefile.inc" + +LIB= wpaeap_peer +INTERNALLIB= + +.PATH: ${WPA_DISTDIR}/src/eap_peer + +SRCS= eap.c \ + eap_gtc.c \ + eap_leap.c \ + eap_md5.c \ + eap_methods.c \ + eap_mschapv2.c \ + eap_otp.c \ + eap_peap.c \ + eap_psk.c \ + eap_tls.c \ + eap_tls_common.c \ + eap_ttls.c \ + eap_wsc.c \ + eap_methods.c \ + mschapv2.c + +CFLAGS+=-DIEEE8021X_EAPOL + +.include "../../Makefile.crypto" + +# We are only interested in includes at this point. Not libraries. +LIBADD= + +.include diff --git a/usr.sbin/wpa/src/eap_server/Makefile b/usr.sbin/wpa/src/eap_server/Makefile new file mode 100644 index 000000000000..c5a4566bb444 --- /dev/null +++ b/usr.sbin/wpa/src/eap_server/Makefile @@ -0,0 +1,34 @@ +.include + +.include "../../Makefile.inc" + +LIB= wpaeap_server +INTERNALLIB= + +.PATH: ${WPA_DISTDIR}/src/eap_server + +SRCS= eap_server.c \ + eap_server_aka.c \ + eap_server_gpsk.c \ + eap_server_gtc.c \ + eap_server_identity.c \ + eap_server_md5.c \ + eap_server_methods.c \ + eap_server_mschapv2.c \ + eap_server_pax.c \ + eap_server_peap.c \ + eap_server_pwd.c \ + eap_server_sake.c \ + eap_server_sim.c \ + eap_server_tls.c \ + eap_server_tls_common.c \ + eap_server_ttls.c \ *** 502 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Mon Sep 13 21:13:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 302356A9E08; Mon, 13 Sep 2021 21:13:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7fMg6fq0z3PN1; Mon, 13 Sep 2021 21:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8C4D6342; Mon, 13 Sep 2021 21:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DLD3j8065299; Mon, 13 Sep 2021 21:13:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DLD3Mv065298; Mon, 13 Sep 2021 21:13:03 GMT (envelope-from git) Date: Mon, 13 Sep 2021 21:13:03 GMT Message-Id: <202109132113.18DLD3Mv065298@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: c7497eb7aec6 - stable/12 - wpa: Fix GCC 6 build MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: c7497eb7aec6e59270f390c1060779059ec502ba Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 21:13:04 -0000 The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=c7497eb7aec6e59270f390c1060779059ec502ba commit c7497eb7aec6e59270f390c1060779059ec502ba Author: Cy Schubert AuthorDate: 2021-06-04 01:40:55 +0000 Commit: Cy Schubert CommitDate: 2021-09-13 21:12:02 +0000 wpa: Fix GCC 6 build GCC 6 searches serially to resolve external references. MFC after: 2 months X-MFC with: 25ecdc7d52770caf1c9b44b5ec11f468f6b636f3 (cherry picked from commit 681500889424423403ace51f118b3467e09acc00) --- usr.sbin/wpa/hostapd/Makefile | 8 ++++---- usr.sbin/wpa/wpa_cli/Makefile | 4 ++-- usr.sbin/wpa/wpa_supplicant/Makefile | 7 ++++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/usr.sbin/wpa/hostapd/Makefile b/usr.sbin/wpa/hostapd/Makefile index 82591b34f2d8..613771ddd974 100644 --- a/usr.sbin/wpa/hostapd/Makefile +++ b/usr.sbin/wpa/hostapd/Makefile @@ -30,10 +30,10 @@ CFLAGS+=-I${.CURDIR:H}/wpa_supplicant \ CFLAGS+= -DCONFIG_IPV6 .endif #CFLAGS+= -g -LIBADD+= pcap util wpaap wpacommon wpacrypto \ - wpadrivers wpal2_packet wpaeap_common wpaeap_server \ - wpaeapol_auth \ - wparadius wpatls wpautils wpawps +LIBADD+= pcap util \ + wpadrivers wpaap wpal2_packet wpaeap_server \ + wpaeapol_auth wpaeap_common \ + wparadius wpatls wpawps wpacommon wpacrypto wpautils # User customizations for wpa_supplicant/hostapd build environment CFLAGS+=${HOSTAPD_CFLAGS} diff --git a/usr.sbin/wpa/wpa_cli/Makefile b/usr.sbin/wpa/wpa_cli/Makefile index 207c64827368..7f5cef6ca550 100644 --- a/usr.sbin/wpa/wpa_cli/Makefile +++ b/usr.sbin/wpa/wpa_cli/Makefile @@ -20,16 +20,16 @@ CFLAGS+= -D_DIRENT_HAVE_D_TYPE CFLAGS+= -DCONFIG_WPA_CLI_EDIT=y LIBADD+=wpaap \ wpacommon \ - wpacrypto \ - wpaeap_common \ wpaeap_peer \ wpaeap_server \ wpaeapol_auth \ wpaeapol_supp \ + wpaeap_common \ wpal2_packet \ wparadius \ wparsn_supp \ wpatls \ + wpacrypto \ wpautils LIBADD+= pcap util diff --git a/usr.sbin/wpa/wpa_supplicant/Makefile b/usr.sbin/wpa/wpa_supplicant/Makefile index 5b0b5f771de3..4a4e0334151d 100644 --- a/usr.sbin/wpa/wpa_supplicant/Makefile +++ b/usr.sbin/wpa/wpa_supplicant/Makefile @@ -40,9 +40,10 @@ FILES= wpa_supplicant.conf CFLAGS+=-DCONFIG_BACKEND_FILE #CFLAGS+= -g -LIBADD+=pcap util wpaap wpacommon wpacrypto wpadrivers wpaeapol_supp \ - wpaeap_common wpaeap_server \ - wpaeap_peer wpal2_packet wparsn_supp wpatls wpautils wpawps +LIBADD+=pcap util wpadrivers wpaap wpaeapol_supp \ + wpaeap_server \ + wpaeap_peer wpaeap_common wpal2_packet wparsn_supp wpatls wpawps \ + wpacommon wpacrypto wpautils # User customizations to the wpa_supplicant build environment CFLAGS+=${WPA_SUPPLICANT_CFLAGS} From owner-dev-commits-src-all@freebsd.org Mon Sep 13 21:13:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F3296A9B95; Mon, 13 Sep 2021 21:13:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7fMj0lW0z3P06; Mon, 13 Sep 2021 21:13:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8D986529; Mon, 13 Sep 2021 21:13:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DLD4nS065323; Mon, 13 Sep 2021 21:13:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DLD43v065322; Mon, 13 Sep 2021 21:13:04 GMT (envelope-from git) Date: Mon, 13 Sep 2021 21:13:04 GMT Message-Id: <202109132113.18DLD43v065322@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: ced9055c04ea - stable/12 - wpa: The ap library is not needed by wpa_supplicant or wpa_cli MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ced9055c04eaf50c87ed9f0d382fe30d618df87b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 21:13:05 -0000 The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=ced9055c04eaf50c87ed9f0d382fe30d618df87b commit ced9055c04eaf50c87ed9f0d382fe30d618df87b Author: Cy Schubert AuthorDate: 2021-06-12 23:51:51 +0000 Commit: Cy Schubert CommitDate: 2021-09-13 21:12:02 +0000 wpa: The ap library is not needed by wpa_supplicant or wpa_cli The ap library is not needed by wpa_supplicant or wpa_cli. It is only used by hostapd. MFC after: 2 months (cherry picked from commit dc9d54b5c1e058b4f1bb9ab9372b171ac87a0d72) --- usr.sbin/wpa/wpa_cli/Makefile | 3 +-- usr.sbin/wpa/wpa_supplicant/Makefile | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/usr.sbin/wpa/wpa_cli/Makefile b/usr.sbin/wpa/wpa_cli/Makefile index 7f5cef6ca550..060257442c39 100644 --- a/usr.sbin/wpa/wpa_cli/Makefile +++ b/usr.sbin/wpa/wpa_cli/Makefile @@ -18,8 +18,7 @@ CFLAGS+= -DCONFIG_TLS=openssl CFLAGS+= -D_DIRENT_HAVE_D_TYPE CFLAGS+= -DCONFIG_WPA_CLI_EDIT=y -LIBADD+=wpaap \ - wpacommon \ +LIBADD+=wpacommon \ wpaeap_peer \ wpaeap_server \ wpaeapol_auth \ diff --git a/usr.sbin/wpa/wpa_supplicant/Makefile b/usr.sbin/wpa/wpa_supplicant/Makefile index 4a4e0334151d..61f035f15912 100644 --- a/usr.sbin/wpa/wpa_supplicant/Makefile +++ b/usr.sbin/wpa/wpa_supplicant/Makefile @@ -40,7 +40,7 @@ FILES= wpa_supplicant.conf CFLAGS+=-DCONFIG_BACKEND_FILE #CFLAGS+= -g -LIBADD+=pcap util wpadrivers wpaap wpaeapol_supp \ +LIBADD+=pcap util wpadrivers wpaeapol_supp \ wpaeap_server \ wpaeap_peer wpaeap_common wpal2_packet wparsn_supp wpatls wpawps \ wpacommon wpacrypto wpautils From owner-dev-commits-src-all@freebsd.org Mon Sep 13 21:13:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 010BE6A97E9; Mon, 13 Sep 2021 21:13:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7fMk2zjZz3PH4; Mon, 13 Sep 2021 21:13:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07DF067A6; Mon, 13 Sep 2021 21:13:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DLD5QP065347; Mon, 13 Sep 2021 21:13:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DLD5Ob065346; Mon, 13 Sep 2021 21:13:05 GMT (envelope-from git) Date: Mon, 13 Sep 2021 21:13:05 GMT Message-Id: <202109132113.18DLD5Ob065346@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: fa6a598d732a - stable/12 - wpa: Add wpa_cli action file event MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: fa6a598d732a024dc5d8005c6e4985b53f491dad Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 21:13:07 -0000 The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=fa6a598d732a024dc5d8005c6e4985b53f491dad commit fa6a598d732a024dc5d8005c6e4985b53f491dad Author: Cy Schubert AuthorDate: 2021-08-12 13:38:21 +0000 Commit: Cy Schubert CommitDate: 2021-09-13 21:12:02 +0000 wpa: Add wpa_cli action file event Yang Zhong at FreeBSD Foundation is working on a wireless network configuratior for an experimental FreeBSD installer. The new installer requires an event to detect when connecting to a network fails due to a bad password. When this happens a WPA-EVENT-TEMP-DISABLED event is triggered. This patch passes the event to an action file provided by the new experimental installer. Submitted by: Yang Zhong Reviewed by: assumed to be reviewed by emaste (and cy) (cherry picked from commit ce92f5a91b161c85e0a7e37cc754e3c28074281a) --- contrib/wpa/wpa_supplicant/wpa_cli.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/wpa/wpa_supplicant/wpa_cli.c b/contrib/wpa/wpa_supplicant/wpa_cli.c index 43ac427203ec..9ad2e3ef2144 100644 --- a/contrib/wpa/wpa_supplicant/wpa_cli.c +++ b/contrib/wpa/wpa_supplicant/wpa_cli.c @@ -3977,6 +3977,8 @@ static void wpa_cli_action_process(const char *msg) wpa_cli_connected = 0; wpa_cli_exec(action_file, ifname, "DISCONNECTED"); } + } else if (str_starts(pos, WPA_EVENT_TEMP_DISABLED)) { + wpa_cli_exec(action_file, ifname, pos); } else if (str_starts(pos, WPA_EVENT_CHANNEL_SWITCH_STARTED)) { wpa_cli_exec(action_file, ctrl_ifname, pos); } else if (str_starts(pos, AP_EVENT_ENABLED)) { From owner-dev-commits-src-all@freebsd.org Mon Sep 13 21:13:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB2F46A9E8F; Mon, 13 Sep 2021 21:13:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7fMm38Yyz3PKS; Mon, 13 Sep 2021 21:13:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4597D665F; Mon, 13 Sep 2021 21:13:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DLD8kD065398; Mon, 13 Sep 2021 21:13:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DLD8xb065397; Mon, 13 Sep 2021 21:13:08 GMT (envelope-from git) Date: Mon, 13 Sep 2021 21:13:08 GMT Message-Id: <202109132113.18DLD8xb065397@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: e3a6462750b7 - stable/12 - wpa: Include all wpa include file search directories MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e3a6462750b7bd61da2517e644a7fab9cb2f2dad Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 21:13:09 -0000 The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=e3a6462750b7bd61da2517e644a7fab9cb2f2dad commit e3a6462750b7bd61da2517e644a7fab9cb2f2dad Author: Cy Schubert AuthorDate: 2021-08-26 23:17:11 +0000 Commit: Cy Schubert CommitDate: 2021-09-13 21:12:03 +0000 wpa: Include all wpa include file search directories Though not all include file search directories are presently needed, add them to the search list. This is required for the next update to wpa. No functional change intended. (cherry picked from commit 81b521d2c0edaab4581546af18298310e6318b5d) --- usr.sbin/wpa/Makefile.inc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/usr.sbin/wpa/Makefile.inc b/usr.sbin/wpa/Makefile.inc index 4ad9b2fa6497..461fd21924c8 100644 --- a/usr.sbin/wpa/Makefile.inc +++ b/usr.sbin/wpa/Makefile.inc @@ -13,10 +13,19 @@ HOSTAPD_DISTDIR?= ${WPA_DISTDIR}/hostapd CFLAGS+=-I${.CURDIR} CFLAGS+=-I${HOSTAPD_DISTDIR} CFLAGS+=-I${WPA_DISTDIR}/src +CFLAGS+=-I${WPA_DISTDIR}/src/ap CFLAGS+=-I${WPA_DISTDIR}/src/common CFLAGS+=-I${WPA_DISTDIR}/src/crypto CFLAGS+=-I${WPA_DISTDIR}/src/drivers +CFLAGS+=-I${WPA_DISTDIR}/src/eap_common +CFLAGS+=-I${WPA_DISTDIR}/src/eap_peer +CFLAGS+=-I${WPA_DISTDIR}/src/eap_server +CFLAGS+=-I${WPA_DISTDIR}/src/eapol_auth +CFLAGS+=-I${WPA_DISTDIR}/src/eapol_supp CFLAGS+=-I${WPA_DISTDIR}/src/l2_packet +CFLAGS+=-I${WPA_DISTDIR}/src/radius +CFLAGS+=-I${WPA_DISTDIR}/src/rsn_supp +CFLAGS+=-I${WPA_DISTDIR}/src/tls CFLAGS+=-I${WPA_DISTDIR}/src/utils CFLAGS+=-I${WPA_DISTDIR}/src/wps @@ -93,5 +102,3 @@ NEED_FIPS186_2_PRF=y CFLAGS+=-DEAP_GPSK_SHA256 NEED_AES_OMAC1=y .endif - -.include From owner-dev-commits-src-all@freebsd.org Mon Sep 13 21:13:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A3B56A97DD; Mon, 13 Sep 2021 21:13:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7fMf5Rynz3PN0; Mon, 13 Sep 2021 21:13:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9516F5EEA; Mon, 13 Sep 2021 21:13:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DLD23D065274; Mon, 13 Sep 2021 21:13:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DLD2MS065273; Mon, 13 Sep 2021 21:13:02 GMT (envelope-from git) Date: Mon, 13 Sep 2021 21:13:02 GMT Message-Id: <202109132113.18DLD2MS065273@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 2d991a11c8a6 - stable/12 - wpa: Fix a SIGBUS error in wpa_sm_set_rekey_offload MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2d991a11c8a6a1b54e88206e3a32605c55e7c0ac Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 21:13:03 -0000 The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=2d991a11c8a6a1b54e88206e3a32605c55e7c0ac commit 2d991a11c8a6a1b54e88206e3a32605c55e7c0ac Author: Cy Schubert AuthorDate: 2021-06-02 19:46:02 +0000 Commit: Cy Schubert CommitDate: 2021-09-13 21:12:02 +0000 wpa: Fix a SIGBUS error in wpa_sm_set_rekey_offload Incorrectly linked built-in wpa functions resulted in overwriting sm->ctx->set_rekey_offload with garbage. It was initialized correctly however it changed after wpa_supplicant became a daemon. No SIGBUS violations reported by dhw@ were experienced during testing of the original commit by msyelf or philip@. Reported by: dhw Tested by: dhw MFC after: 2 months X-MFC with: 25ecdc7d52770caf1c9b44b5ec11f468f6b636f3 (cherry picked from commit 9a0f82285322a338548d13fcda07e1d574301190) --- usr.sbin/wpa/Makefile.crypto | 1 + usr.sbin/wpa/hostapd/Makefile | 6 +- usr.sbin/wpa/hostapd_cli/Makefile | 4 +- usr.sbin/wpa/src/ap/Makefile | 4 +- usr.sbin/wpa/src/common/Makefile | 4 +- usr.sbin/wpa/src/crypto/Makefile | 175 ++++++++++++++++++++++++++++------- usr.sbin/wpa/src/drivers/Makefile | 4 +- usr.sbin/wpa/src/eap_common/Makefile | 4 +- usr.sbin/wpa/src/eap_peer/Makefile | 4 +- usr.sbin/wpa/src/eap_server/Makefile | 4 +- usr.sbin/wpa/src/eapol_auth/Makefile | 4 +- usr.sbin/wpa/src/eapol_supp/Makefile | 4 +- usr.sbin/wpa/src/l2_packet/Makefile | 4 +- usr.sbin/wpa/src/radius/Makefile | 4 +- usr.sbin/wpa/src/rsn_supp/Makefile | 4 +- usr.sbin/wpa/src/tls/Makefile | 15 ++- usr.sbin/wpa/src/utils/Makefile | 4 +- usr.sbin/wpa/src/wps/Makefile | 4 +- usr.sbin/wpa/wpa_cli/Makefile | 6 +- usr.sbin/wpa/wpa_passphrase/Makefile | 4 +- usr.sbin/wpa/wpa_priv/Makefile | 6 +- usr.sbin/wpa/wpa_supplicant/Makefile | 7 +- 22 files changed, 191 insertions(+), 85 deletions(-) diff --git a/usr.sbin/wpa/Makefile.crypto b/usr.sbin/wpa/Makefile.crypto index 0f72f546a3ad..d513e52a9acc 100644 --- a/usr.sbin/wpa/Makefile.crypto +++ b/usr.sbin/wpa/Makefile.crypto @@ -24,6 +24,7 @@ NEED_AES_ENC=true NEED_AES_CBC=true .endif NEED_AES_OMAC1=true +TLS_FUNCS=y .if defined(TLS_FUNCS) NEED_TLS_PRF=y diff --git a/usr.sbin/wpa/hostapd/Makefile b/usr.sbin/wpa/hostapd/Makefile index 2cadbeb4c7c4..82591b34f2d8 100644 --- a/usr.sbin/wpa/hostapd/Makefile +++ b/usr.sbin/wpa/hostapd/Makefile @@ -3,6 +3,8 @@ .include .include "../Makefile.inc" +.include "../Makefile.crypto" + .PATH.c:${HOSTAPD_DISTDIR} PROG= hostapd @@ -39,8 +41,6 @@ CFLAGS+=${HOSTAPD_CFLAGS} LDADD+=${HOSTAPD_LDADD} #LDFLAGS+=${HOSTAPD_LDFLAGS} -TLS_FUNCS=y - # For WPS, EAP modes, etc NEED_DH_GROUPS=y NEED_DH_GROUPS_ALL=y @@ -66,6 +66,4 @@ CFLAGS+=-DEAP_GPSK_SHA256 NEED_AES_OMAC1=y .endif -.include "../Makefile.crypto" - .include diff --git a/usr.sbin/wpa/hostapd_cli/Makefile b/usr.sbin/wpa/hostapd_cli/Makefile index ac9745e50f84..5d4e8f52a546 100644 --- a/usr.sbin/wpa/hostapd_cli/Makefile +++ b/usr.sbin/wpa/hostapd_cli/Makefile @@ -2,6 +2,8 @@ .include "../Makefile.inc" +.include "../Makefile.crypto" + .PATH.c:${HOSTAPD_DISTDIR} PROG= hostapd_cli @@ -11,6 +13,4 @@ LIBADD+= util wpacommon wpautils MAN= hostapd_cli.8 -.include "../Makefile.crypto" - .include diff --git a/usr.sbin/wpa/src/ap/Makefile b/usr.sbin/wpa/src/ap/Makefile index edb2f1e9d089..77caf1ed8efe 100644 --- a/usr.sbin/wpa/src/ap/Makefile +++ b/usr.sbin/wpa/src/ap/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpaap INTERNALLIB= @@ -51,8 +53,6 @@ CFLAGS+=-DCONFIG_MBO \ -DCONFIG_RSN_PREAUTH \ -DHOSTAPD -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/common/Makefile b/usr.sbin/wpa/src/common/Makefile index 28c16ff9d31a..b415b926c207 100644 --- a/usr.sbin/wpa/src/common/Makefile +++ b/usr.sbin/wpa/src/common/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpacommon INTERNALLIB= @@ -19,8 +21,6 @@ CFLAGS+=-DCONFIG_SAE \ -DCONFIG_SUITE \ -DCONFIG_SUITEB -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/crypto/Makefile b/usr.sbin/wpa/src/crypto/Makefile index d7e1304dc95e..b25489072425 100644 --- a/usr.sbin/wpa/src/crypto/Makefile +++ b/usr.sbin/wpa/src/crypto/Makefile @@ -2,49 +2,156 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpacrypto INTERNALLIB= .PATH: ${WPA_DISTDIR}/src/crypto -SRCS= aes-cbc.c \ - aes-ctr.c \ - aes-eax.c \ - aes-encblock.c \ - aes-internal.c \ - aes-internal-dec.c \ - aes-internal-enc.c \ - aes-omac1.c \ - aes-unwrap.c \ - aes-wrap.c \ - crypto_internal.c \ - crypto_internal-cipher.c \ - crypto_internal-modexp.c \ - crypto_internal-rsa.c \ - des-internal.c \ - dh_group5.c \ - dh_groups.c \ - fips_prf_internal.c \ - md4-internal.c \ - md5.c \ - md5-internal.c \ - ms_funcs.c \ +.if ${MK_OPENSSL} != "no" +SRCS= crypto_openssl.c \ random.c \ - rc4.c \ - sha1.c \ - sha1-internal.c \ - sha1-pbkdf2.c \ sha1-prf.c \ - sha1-tlsprf.c \ - sha256.c \ sha256-prf.c \ sha256-tlsprf.c \ - sha256-internal.c \ - sha384.c \ - sha384-prf.c \ - sha384-internal.c \ - sha512-internal.c \ + sha512.c +.else +SRCS= crypto_internal.c \ + random.c +.endif + +.if defined(TLS_FUNCS) +.if defined(CONFIG_INTERNAL_TLS) +SRCS+= crypto_internal-cipher.c \ + crypto_internal-modexp.c \ + crypto_internal-rsa.c \ tls_internal.c +.else +SRCS+= tls_openssl.c \ + tls_openssl_ocsp.c +.endif +.endif + +.if defined(CONFIG_INTERNAL_AES) +SRCS+= aes-unwrap.c aes-wrap.c \ + aes-internal.c \ + aes-internal-dec.c \ + aes-internal-enc.c +.else +.endif + +.if defined(NEED_AES_CBC) +SRCS+= aes-cbc.c +.endif + +.if defined(NEED_AES_EAX) +SRCS+= aes-eax.c +.endif + +.if defined(NEED_AES_CTR) +SRCS+= aes-ctr.c +.endif + +.if defined(NEED_AES_ENCBLOCK) +SRCS+= aes-encblock.c +.endif + +.if defined(NEED_AES_OMAC1) +SRCS+= aes-omac1.c +.endif + +.if defined(NEED_DES) +.if defined(CONFIG_INTERNAL_DES) +SRCS+= des-internal.c +.endif +.endif + +.if defined(NEED_MD4) +.if defined(CONFIG_INTERNAL_MD4) +SRCS+= md4-internal.c +.endif +.endif + +.if defined(CONFIG_INTERNAL_MD5) +SRCS+= md5.c \ + md5-internal.c +.endif + +.if defined(NEED_FIPS186_2_PRF) +.if defined(CONFIG_INTERNAL_SHA1) +SRCS+= fips_prf_internal.c +.else +SRCS+= fips_prf_openssl.c +.endif +.endif + +.if defined(CONFIG_INTERNAL_RC4) +SRCS+= rc4.c +.endif + +.if defined(CONFIG_INTERNAL_SHA1) +SRCS+= sha1-internal.c \ + sha1-pbkdf2.c \ + sha1.c \ + sha1-prf.c +.endif + +.if defined(NEED_SHA256) +SRCS+= sha256.c +.if defined(CONFIG_INTERNAL_SHA256) +SRCS+= sha256-internal.c \ + sha256-prf.c +.endif +.endif + +.if defined(NEED_SHA384) +SRCS+= sha384.c +.if defined(CONFIG_INTERNAL_SHA384) +SRCS+= sha384-internal.c \ + sha384-prf.c +.endif +.endif + +.if defined(NEED_SHA512) +SRCS+= sha512.c +.if defined(CONFIG_INTERNAL_SHA512) +SRCS+= sha512-internal.c \ + sha512-prf.c +.endif +.endif + +.if defined(NEED_TLS_PRF) +SRCS+= sha1-tlsprf.c +.endif + +.if defined(CONFIG_INTERNAL_DH5) +.if defined(NEED_DH_GROUPS) +SRCS+= dh_group5.c +.endif +.endif + +.if defined(NEED_DH_GROUPS) +SRCS+= dh_groups.c +.endif + +.if ${MK_WPA_SUPPLICANT_EAPOL} != "no" +CFLAGS+=-DCONFIG_WPS \ + -DCONFIG_HS20 \ + -DCONFIG_INTERWORKING \ + -DEAP_GTC \ + -DEAP_LEAP \ + -DEAP_MD5 \ + -DEAP_MSCHAPv2 \ + -DEAP_OTP \ + -DEAP_PEAP \ + -DEAP_PSK \ + -DEAP_TLS \ + -DEAP_TTLS \ + -DEAP_WSC \ + -DIEEE8021X_EAPOL +SRCS+= ms_funcs.c +.endif CFLAGS+=-DCONFIG_CRYPTO_INTERNAL \ -DCONFIG_TLS_INTERNAL_CLIENT \ @@ -55,8 +162,6 @@ CFLAGS+=-DCONFIG_CRYPTO_INTERNAL \ -DCONFIG_INTERNAL_SHA384 #CFLAGS+=-DALL_DH_GROUPS -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/drivers/Makefile b/usr.sbin/wpa/src/drivers/Makefile index 1800b651885f..0f901bdcf2fd 100644 --- a/usr.sbin/wpa/src/drivers/Makefile +++ b/usr.sbin/wpa/src/drivers/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpadrivers INTERNALLIB= @@ -13,8 +15,6 @@ SRCS= drivers.c \ driver_wired.c \ driver_wired_common.c -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/eap_common/Makefile b/usr.sbin/wpa/src/eap_common/Makefile index 4da89b221b36..7ec416c74102 100644 --- a/usr.sbin/wpa/src/eap_common/Makefile +++ b/usr.sbin/wpa/src/eap_common/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpaeap_common INTERNALLIB= @@ -17,8 +19,6 @@ SRCS= chap.c \ eap_sim_common.c \ eap_wsc_common.c -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/eap_peer/Makefile b/usr.sbin/wpa/src/eap_peer/Makefile index 524c7cf6c6f1..bab1b690f6d9 100644 --- a/usr.sbin/wpa/src/eap_peer/Makefile +++ b/usr.sbin/wpa/src/eap_peer/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpaeap_peer INTERNALLIB= @@ -25,8 +27,6 @@ SRCS= eap.c \ CFLAGS+=-DIEEE8021X_EAPOL -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/eap_server/Makefile b/usr.sbin/wpa/src/eap_server/Makefile index c5a4566bb444..795d2a9c68a0 100644 --- a/usr.sbin/wpa/src/eap_server/Makefile +++ b/usr.sbin/wpa/src/eap_server/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpaeap_server INTERNALLIB= @@ -26,8 +28,6 @@ SRCS= eap_server.c \ eap_server_wsc.c \ eap_sim_db.c -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/eapol_auth/Makefile b/usr.sbin/wpa/src/eapol_auth/Makefile index 7f05367edfb0..984b96df5c6f 100644 --- a/usr.sbin/wpa/src/eapol_auth/Makefile +++ b/usr.sbin/wpa/src/eapol_auth/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpaeapol_auth INTERNALLIB= @@ -10,8 +12,6 @@ INTERNALLIB= SRCS= eapol_auth_sm.c \ eapol_auth_dump.c -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/eapol_supp/Makefile b/usr.sbin/wpa/src/eapol_supp/Makefile index 2b3cc0179109..a4588fc23de1 100644 --- a/usr.sbin/wpa/src/eapol_supp/Makefile +++ b/usr.sbin/wpa/src/eapol_supp/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpaeapol_supp INTERNALLIB= @@ -11,8 +13,6 @@ SRCS= eapol_supp_sm.c CFLAGS+=-DIEEE8021X_EAPOL -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/l2_packet/Makefile b/usr.sbin/wpa/src/l2_packet/Makefile index 89ce771b0343..f53dc81fdf52 100644 --- a/usr.sbin/wpa/src/l2_packet/Makefile +++ b/usr.sbin/wpa/src/l2_packet/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpal2_packet INTERNALLIB= @@ -11,8 +13,6 @@ SRCS= l2_packet_freebsd.c CFLAGS+=-DIEEE8021X_EAPOL -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/radius/Makefile b/usr.sbin/wpa/src/radius/Makefile index 1ef986a799ae..a37d60be6f7d 100644 --- a/usr.sbin/wpa/src/radius/Makefile +++ b/usr.sbin/wpa/src/radius/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wparadius INTERNALLIB= @@ -16,8 +18,6 @@ SRCS= radius.c \ CFLAGS+= -DCONFIG_IPV6 .endif -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/rsn_supp/Makefile b/usr.sbin/wpa/src/rsn_supp/Makefile index 1b50689e6960..4d952c2204c4 100644 --- a/usr.sbin/wpa/src/rsn_supp/Makefile +++ b/usr.sbin/wpa/src/rsn_supp/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wparsn_supp INTERNALLIB= @@ -18,8 +20,6 @@ CFLAGS+=-DCONFIG_TDLS \ -DCONFIG_WNM \ -DIEEE8021X_EAPOL -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/tls/Makefile b/usr.sbin/wpa/src/tls/Makefile index defe9b0faf6e..e5fdf96444d6 100644 --- a/usr.sbin/wpa/src/tls/Makefile +++ b/usr.sbin/wpa/src/tls/Makefile @@ -2,36 +2,41 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpatls INTERNALLIB= .PATH: ${WPA_DISTDIR}/src/tls -SRCS= asn1.c \ +SRCS= tlsv1_server.c + +.if defined(TLS_FUNCS) +.if defined(CONFIG_INTERNAL_TLS) +SRCS+= asn1.c \ bignum.c \ pkcs1.c \ pkcs5.c \ pkcs8.c \ rsa.c \ tlsv1_client.c \ + tlsv1_client_ocsp.c \ tlsv1_client_read.c \ tlsv1_client_write.c \ - tlsv1_client_ocsp.c \ tlsv1_common.c \ tlsv1_cred.c \ tlsv1_record.c \ - tlsv1_server.c \ tlsv1_server_read.c \ tlsv1_server_write.c \ x509v3.c +.endif +.endif CFLAGS+=-DCONFIG_INTERNAL_LIBTOMMATH \ -DCONFIG_CRYPTO_INTERNAL \ -DCONFIG_TLSV11 \ -DCONFIG_TLSV12 -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/utils/Makefile b/usr.sbin/wpa/src/utils/Makefile index f08a2d78fced..22ec732a2b3b 100644 --- a/usr.sbin/wpa/src/utils/Makefile +++ b/usr.sbin/wpa/src/utils/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpautils INTERNALLIB= @@ -24,8 +26,6 @@ CFLAGS+=-DCONFIG_DEBUG_FILE CFLAGS+= -DCONFIG_IPV6 .endif -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/src/wps/Makefile b/usr.sbin/wpa/src/wps/Makefile index ddb40b682c27..5f5485d69bce 100644 --- a/usr.sbin/wpa/src/wps/Makefile +++ b/usr.sbin/wpa/src/wps/Makefile @@ -2,6 +2,8 @@ .include "../../Makefile.inc" +.include "../../Makefile.crypto" + LIB= wpawps INTERNALLIB= @@ -31,8 +33,6 @@ CFLAGS+=-DCONFIG_P2P CFLAGS+= -DCONFIG_IPV6 .endif -.include "../../Makefile.crypto" - # We are only interested in includes at this point. Not libraries. LIBADD= diff --git a/usr.sbin/wpa/wpa_cli/Makefile b/usr.sbin/wpa/wpa_cli/Makefile index 024960ef4a38..207c64827368 100644 --- a/usr.sbin/wpa/wpa_cli/Makefile +++ b/usr.sbin/wpa/wpa_cli/Makefile @@ -4,6 +4,8 @@ .include "../Makefile.inc" +.include "../Makefile.crypto" + .PATH.c:${WPA_SUPPLICANT_DISTDIR} PROG= wpa_cli @@ -31,8 +33,4 @@ LIBADD+=wpaap \ wpautils LIBADD+= pcap util -TLS_FUNCS=y - -.include "../Makefile.crypto" - .include diff --git a/usr.sbin/wpa/wpa_passphrase/Makefile b/usr.sbin/wpa/wpa_passphrase/Makefile index 8597da98f4ac..885c068f28f8 100644 --- a/usr.sbin/wpa/wpa_passphrase/Makefile +++ b/usr.sbin/wpa/wpa_passphrase/Makefile @@ -2,6 +2,8 @@ .include "../Makefile.inc" +.include "../Makefile.crypto" + .PATH.c:${WPA_SUPPLICANT_DISTDIR} PROG= wpa_passphrase @@ -13,6 +15,4 @@ LIBADD+= util wpacrypto wpautils MAN= wpa_passphrase.8 -.include "../Makefile.crypto" - .include diff --git a/usr.sbin/wpa/wpa_priv/Makefile b/usr.sbin/wpa/wpa_priv/Makefile index 57bf641976e3..e185c11eb746 100644 --- a/usr.sbin/wpa/wpa_priv/Makefile +++ b/usr.sbin/wpa/wpa_priv/Makefile @@ -2,14 +2,14 @@ .include "../Makefile.inc" +.include "../Makefile.crypto" + .PATH.c:${WPA_SUPPLICANT_DISTDIR} PROG= wpa_priv SRCS= os_unix.c eloop.c common.c wpa_debug.c wpabuf.c wpa_priv.c \ l2_packet_freebsd.c -LIBADD= pcap wpadrivers - -.include "../Makefile.crypto" +LIBADD+=pcap wpadrivers .include diff --git a/usr.sbin/wpa/wpa_supplicant/Makefile b/usr.sbin/wpa/wpa_supplicant/Makefile index 8b3e4a029835..5b0b5f771de3 100644 --- a/usr.sbin/wpa/wpa_supplicant/Makefile +++ b/usr.sbin/wpa/wpa_supplicant/Makefile @@ -4,6 +4,8 @@ .include "../Makefile.inc" +.include "../Makefile.crypto" + .PATH.c:${WPA_SUPPLICANT_DISTDIR} \ ${WPA_DISTDIR}/src/drivers @@ -38,7 +40,7 @@ FILES= wpa_supplicant.conf CFLAGS+=-DCONFIG_BACKEND_FILE #CFLAGS+= -g -LIBADD= pcap util wpaap wpacommon wpacrypto wpadrivers wpaeapol_supp \ +LIBADD+=pcap util wpaap wpacommon wpacrypto wpadrivers wpaeapol_supp \ wpaeap_common wpaeap_server \ wpaeap_peer wpal2_packet wparsn_supp wpatls wpautils wpawps @@ -67,7 +69,6 @@ NEED_AES_EAX=y NEED_AES_ENCBLOCK=y NEED_AES_OMAC1=y .endif -TLS_FUNCS=y .if !empty(CFLAGS:M*-DEAP_AKA) SRCS+= eap_aka.c @@ -115,6 +116,4 @@ SRCS+= eap_sake.c \ eap_sake_common.c .endif -.include "../Makefile.crypto" - .include From owner-dev-commits-src-all@freebsd.org Mon Sep 13 21:13:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5D4BC6A9D97; Mon, 13 Sep 2021 21:13:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7fMl1qqvz3PKM; Mon, 13 Sep 2021 21:13:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17ABC6343; Mon, 13 Sep 2021 21:13:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DLD7Zs065371; Mon, 13 Sep 2021 21:13:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DLD7wm065370; Mon, 13 Sep 2021 21:13:07 GMT (envelope-from git) Date: Mon, 13 Sep 2021 21:13:07 GMT Message-Id: <202109132113.18DLD7wm065370@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 7aed82ab023a - stable/12 - wpa: Correctly build the hostapd BSD driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7aed82ab023aeb3d1304161944633ba75c6ab5f6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 21:13:07 -0000 The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=7aed82ab023aeb3d1304161944633ba75c6ab5f6 commit 7aed82ab023aeb3d1304161944633ba75c6ab5f6 Author: Cy Schubert AuthorDate: 2021-08-26 22:59:03 +0000 Commit: Cy Schubert CommitDate: 2021-09-13 21:12:03 +0000 wpa: Correctly build the hostapd BSD driver driver.bsd.c initializes itself differently when built for hostapd than it does when built for wpa_supplicant. (cherry picked from commit a0f2aa9318a21f401a0aef2cde666edc56a92b46) --- usr.sbin/wpa/hostapd/Makefile | 4 +++- usr.sbin/wpa/src/drivers/Makefile | 1 - usr.sbin/wpa/wpa_supplicant/Makefile | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.sbin/wpa/hostapd/Makefile b/usr.sbin/wpa/hostapd/Makefile index 613771ddd974..57b218c99e14 100644 --- a/usr.sbin/wpa/hostapd/Makefile +++ b/usr.sbin/wpa/hostapd/Makefile @@ -5,11 +5,13 @@ .include "../Makefile.crypto" -.PATH.c:${HOSTAPD_DISTDIR} +.PATH.c:${HOSTAPD_DISTDIR} \ + ${WPA_DISTDIR}/src/drivers PROG= hostapd SRCS= config_file.c \ ctrl_iface.c \ + driver_bsd.c \ eap_register.c \ main.c diff --git a/usr.sbin/wpa/src/drivers/Makefile b/usr.sbin/wpa/src/drivers/Makefile index 0f901bdcf2fd..a984a9c1807a 100644 --- a/usr.sbin/wpa/src/drivers/Makefile +++ b/usr.sbin/wpa/src/drivers/Makefile @@ -10,7 +10,6 @@ INTERNALLIB= .PATH: ${WPA_DISTDIR}/src/drivers SRCS= drivers.c \ - driver_bsd.c \ driver_common.c \ driver_wired.c \ driver_wired_common.c diff --git a/usr.sbin/wpa/wpa_supplicant/Makefile b/usr.sbin/wpa/wpa_supplicant/Makefile index 61f035f15912..9706d0e4b644 100644 --- a/usr.sbin/wpa/wpa_supplicant/Makefile +++ b/usr.sbin/wpa/wpa_supplicant/Makefile @@ -17,6 +17,7 @@ SRCS= blacklist.c \ config_file.c \ ctrl_iface.c \ ctrl_iface_unix.c \ + driver_bsd.c \ eap_register.c \ events.c \ gas_query.c \ From owner-dev-commits-src-all@freebsd.org Mon Sep 13 21:13:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E8A336A9E94; Mon, 13 Sep 2021 21:13:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7fMn50Xfz3PRk; Mon, 13 Sep 2021 21:13:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74CAF67A7; Mon, 13 Sep 2021 21:13:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DLD9Kc065425; Mon, 13 Sep 2021 21:13:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DLD9OC065424; Mon, 13 Sep 2021 21:13:09 GMT (envelope-from git) Date: Mon, 13 Sep 2021 21:13:09 GMT Message-Id: <202109132113.18DLD9OC065424@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 0cae6ba39388 - stable/12 - wpa: Enclose FreeBSD specific defines MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 0cae6ba3938893482981e2cf3e5389e082a3ec17 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 21:13:10 -0000 The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=0cae6ba3938893482981e2cf3e5389e082a3ec17 commit 0cae6ba3938893482981e2cf3e5389e082a3ec17 Author: Cy Schubert AuthorDate: 2021-08-26 23:28:40 +0000 Commit: Cy Schubert CommitDate: 2021-09-13 21:12:03 +0000 wpa: Enclose FreeBSD specific defines FreeBSD only defines are specific only to FreeBSD. Document them as such. It is our intention to push this change to w1.fi. (cherry picked from commit 213ceba977def36470df3abfe1fac47f689130c1) --- contrib/wpa/src/common/dhcp.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/wpa/src/common/dhcp.h b/contrib/wpa/src/common/dhcp.h index d28445e7cbd7..ff52483b12eb 100644 --- a/contrib/wpa/src/common/dhcp.h +++ b/contrib/wpa/src/common/dhcp.h @@ -9,6 +9,7 @@ #ifndef DHCP_H #define DHCP_H +#if defined(__FreeBSD__) /* * Translate Linux to FreeBSD */ @@ -24,6 +25,7 @@ #define check ip_sum #define saddr ip_src #define daddr ip_dst +#endif #include #if __FAVOR_BSD From owner-dev-commits-src-all@freebsd.org Mon Sep 13 21:23:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C792B6AA28A; Mon, 13 Sep 2021 21:23:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7fbz5C4Dz3hV9; Mon, 13 Sep 2021 21:23:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93AA06903; Mon, 13 Sep 2021 21:23:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DLNhJI078583; Mon, 13 Sep 2021 21:23:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DLNhjE078582; Mon, 13 Sep 2021 21:23:43 GMT (envelope-from git) Date: Mon, 13 Sep 2021 21:23:43 GMT Message-Id: <202109132123.18DLNhjE078582@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 2b6eec531a1b - main - x86: duplicate acpi_wakeup.c per i386 and amd64 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2b6eec531a1b52621223316f7c2940ed1e293886 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 21:23:43 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2b6eec531a1b52621223316f7c2940ed1e293886 commit 2b6eec531a1b52621223316f7c2940ed1e293886 Author: Konstantin Belousov AuthorDate: 2021-09-12 19:24:33 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-13 21:23:14 +0000 x86: duplicate acpi_wakeup.c per i386 and amd64 The file as is is the maze of #ifdef passages, all slightly different. Divorcing i386 and amd64 version actually makes changing the code easier, also no changes for i386 are planned. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31931 --- sys/{x86 => amd64}/acpica/acpi_wakeup.c | 87 +------ sys/conf/files.amd64 | 1 + sys/conf/files.i386 | 1 + sys/conf/files.x86 | 1 - sys/i386/acpica/acpi_wakeup.c | 391 ++++++++++++++++++++++++++++++++ 5 files changed, 394 insertions(+), 87 deletions(-) diff --git a/sys/x86/acpica/acpi_wakeup.c b/sys/amd64/acpica/acpi_wakeup.c similarity index 86% rename from sys/x86/acpica/acpi_wakeup.c rename to sys/amd64/acpica/acpi_wakeup.c index 68e0892a31e6..fba9532e9a64 100644 --- a/sys/x86/acpica/acpi_wakeup.c +++ b/sys/amd64/acpica/acpi_wakeup.c @@ -32,12 +32,6 @@ #include __FBSDID("$FreeBSD$"); -#if defined(__amd64__) -#define DEV_APIC -#else -#include "opt_apic.h" -#endif - #include #include #include @@ -60,10 +54,8 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef DEV_APIC #include #include -#endif #ifdef SMP #include #include @@ -98,11 +90,7 @@ static int acpi_wakeup_ap(struct acpi_softc *, int); static void acpi_wakeup_cpus(struct acpi_softc *); #endif -#ifdef __amd64__ #define ACPI_WAKEPAGES 8 -#else -#define ACPI_WAKEPAGES 1 -#endif #define WAKECODE_FIXUP(offset, type, val) do { \ type *addr; \ @@ -144,13 +132,8 @@ acpi_wakeup_ap(struct acpi_softc *sc, int cpu) } #define WARMBOOT_TARGET 0 -#ifdef __amd64__ #define WARMBOOT_OFF (KERNBASE + 0x0467) #define WARMBOOT_SEG (KERNBASE + 0x0469) -#else /* __i386__ */ -#define WARMBOOT_OFF (PMAP_MAP_LOW + 0x0467) -#define WARMBOOT_SEG (PMAP_MAP_LOW + 0x0469) -#endif #define CMOS_REG (0x70) #define CMOS_DATA (0x71) @@ -164,9 +147,7 @@ acpi_wakeup_cpus(struct acpi_softc *sc) int cpu; u_char mpbiosreason; -#ifdef __amd64__ if (!efi_boot) { -#endif /* save the current value of the warm-start vector */ mpbioswarmvec = *((uint32_t *)WARMBOOT_OFF); outb(CMOS_REG, BIOS_RESET); @@ -177,9 +158,7 @@ acpi_wakeup_cpus(struct acpi_softc *sc) *((volatile u_short *)WARMBOOT_SEG) = sc->acpi_wakephys >> 4; outb(CMOS_REG, BIOS_RESET); outb(CMOS_DATA, BIOS_WARM); /* 'warm-start' */ -#ifdef __amd64__ } -#endif /* Wake up each AP. */ for (cpu = 1; cpu < mp_ncpus; cpu++) { @@ -193,27 +172,13 @@ acpi_wakeup_cpus(struct acpi_softc *sc) } } -#ifdef __i386__ - /* - * Remove the identity mapping of low memory for all CPUs and sync - * the TLB for the BSP. The APs are now spinning in - * cpususpend_handler() and we will release them soon. Then each - * will invalidate its TLB. - */ - pmap_remap_lowptdi(false); -#endif - -#ifdef __amd64__ if (!efi_boot) { -#endif /* restore the warmstart vector */ *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; outb(CMOS_REG, BIOS_RESET); outb(CMOS_DATA, mpbiosreason); -#ifdef __amd64__ } -#endif } #endif @@ -222,10 +187,8 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) { ACPI_STATUS status; struct pcb *pcb; -#ifdef __amd64__ struct pcpu *pc; int i; -#endif if (sc->acpi_wakeaddr == 0ul) return (-1); /* couldn't alloc wake memory */ @@ -244,18 +207,13 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) pcb = &susppcbs[0]->sp_pcb; if (savectx(pcb)) { -#ifdef __amd64__ fpususpend(susppcbs[0]->sp_fpususpend); -#else - npxsuspend(susppcbs[0]->sp_fpususpend); -#endif #ifdef SMP if (!CPU_EMPTY(&suspcpus) && suspend_cpus(suspcpus) == 0) { device_printf(sc->acpi_dev, "Failed to suspend APs\n"); return (0); /* couldn't sleep */ } #endif -#ifdef __amd64__ hw_ibrs_ibpb_active = 0; hw_ssb_active = 0; cpu_stdext_feature3 = 0; @@ -263,36 +221,16 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) pc = pcpu_find(i); pc->pc_ibpb_set = 0; } -#endif WAKECODE_FIXUP(resume_beep, uint8_t, (acpi_resume_beep != 0)); WAKECODE_FIXUP(reset_video, uint8_t, (acpi_reset_video != 0)); -#ifdef __amd64__ WAKECODE_FIXUP(wakeup_efer, uint64_t, rdmsr(MSR_EFER) & ~(EFER_LMA)); -#else - if ((amd_feature & AMDID_NX) != 0) - WAKECODE_FIXUP(wakeup_efer, uint64_t, rdmsr(MSR_EFER)); - WAKECODE_FIXUP(wakeup_cr4, register_t, pcb->pcb_cr4); -#endif WAKECODE_FIXUP(wakeup_pcb, struct pcb *, pcb); WAKECODE_FIXUP(wakeup_gdt, uint16_t, pcb->pcb_gdt.rd_limit); WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, pcb->pcb_gdt.rd_base); -#ifdef __i386__ - /* - * Map some low memory with virt == phys for ACPI wakecode - * to use to jump to high memory after enabling paging. This - * is the same as for similar jump in locore, except the - * jump is a single instruction, and we know its address - * more precisely so only need a single PTD, and we have to - * be careful to use the kernel map (PTD[0] is for curthread - * which may be a user thread in deprecated APIs). - */ - pmap_remap_lowptdi(true); -#endif - /* Call ACPICA to enter the desired sleep state */ if (state == ACPI_STATE_S4 && sc->acpi_s4bios) status = AcpiEnterSleepStateS4bios(); @@ -317,11 +255,7 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) * this point. */ cnresume(); -#ifdef __amd64__ fpuresume(susppcbs[0]->sp_fpususpend); -#else - npxresume(susppcbs[0]->sp_fpususpend); -#endif } return (1); /* wakeup successfully */ @@ -343,9 +277,7 @@ acpi_wakeup_machdep(struct acpi_softc *sc, int state, int sleep_result, initializecpu(); PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); -#ifdef DEV_APIC lapic_xapic_mode(); -#endif #ifdef SMP if (!CPU_EMPTY(&suspcpus)) acpi_wakeup_cpus(sc); @@ -357,10 +289,8 @@ acpi_wakeup_machdep(struct acpi_softc *sc, int state, int sleep_result, resume_cpus(suspcpus); #endif mca_resume(); -#ifdef __amd64__ if (vmm_resume_p != NULL) vmm_resume_p(); -#endif intr_resume(/*suspend_cancelled*/false); AcpiSetFirmwareWakingVector(0, 0); @@ -390,11 +320,7 @@ acpi_alloc_wakeup_handler(void *wakepages[ACPI_WAKEPAGES]) */ for (i = 0; i < ACPI_WAKEPAGES; i++) { wakepages[i] = contigmalloc(PAGE_SIZE, M_DEVBUF, - M_NOWAIT -#ifdef __i386__ - | M_EXEC -#endif - , 0x500, 0xa0000, PAGE_SIZE, 0ul); + M_NOWAIT, 0x500, 0xa0000, PAGE_SIZE, 0ul); if (wakepages[i] == NULL) { printf("%s: can't alloc wake memory\n", __func__); goto freepages; @@ -425,11 +351,9 @@ acpi_install_wakeup_handler(struct acpi_softc *sc) { static void *wakeaddr; void *wakepages[ACPI_WAKEPAGES]; -#ifdef __amd64__ uint64_t *pt5, *pt4, *pt3, *pt2_0, *pt2_1, *pt2_2, *pt2_3; vm_paddr_t pt5pa, pt4pa, pt3pa, pt2_0pa, pt2_1pa, pt2_2pa, pt2_3pa; int i; -#endif if (wakeaddr != NULL) return; @@ -441,7 +365,6 @@ acpi_install_wakeup_handler(struct acpi_softc *sc) sc->acpi_wakeaddr = (vm_offset_t)wakeaddr; sc->acpi_wakephys = vtophys(wakeaddr); -#ifdef __amd64__ if (la57) { pt5 = wakepages[7]; pt5pa = vtophys(pt5); @@ -458,7 +381,6 @@ acpi_install_wakeup_handler(struct acpi_softc *sc) pt2_1pa = vtophys(pt2_1); pt2_2pa = vtophys(pt2_2); pt2_3pa = vtophys(pt2_3); -#endif bcopy(wakecode, (void *)sc->acpi_wakeaddr, sizeof(wakecode)); @@ -467,18 +389,13 @@ acpi_install_wakeup_handler(struct acpi_softc *sc) sc->acpi_wakephys + bootgdt); WAKECODE_FIXUP((wakeup_sw32 + 2), uint32_t, sc->acpi_wakephys + wakeup_32); -#ifdef __amd64__ WAKECODE_FIXUP((wakeup_sw64 + 1), uint32_t, sc->acpi_wakephys + wakeup_64); WAKECODE_FIXUP(wakeup_pagetables, uint32_t, la57 ? (pt5pa | 0x1) : pt4pa); -#endif /* Save pointers to some global data. */ WAKECODE_FIXUP(wakeup_ret, void *, resumectx); -#ifndef __amd64__ - WAKECODE_FIXUP(wakeup_cr3, register_t, pmap_get_kcr3()); -#else /* __amd64__ */ /* Create 1:1 mapping for the low 4G */ if (la57) { bcopy(kernel_pmap->pm_pmltop, pt5, PAGE_SIZE); @@ -517,8 +434,6 @@ acpi_install_wakeup_handler(struct acpi_softc *sc) pt2_3[i] |= PG_V | PG_RW | PG_PS | PG_U; } -#endif /* !__amd64__ */ - if (bootverbose) device_printf(sc->acpi_dev, "wakeup code va %#jx pa %#jx\n", (uintmax_t)sc->acpi_wakeaddr, (uintmax_t)sc->acpi_wakephys); diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64 index 564e40564677..b50034f38d96 100644 --- a/sys/conf/files.amd64 +++ b/sys/conf/files.amd64 @@ -49,6 +49,7 @@ ia32_assym.h standard \ clean "ia32_assym.h" # amd64/acpica/acpi_machdep.c optional acpi +amd64/acpica/acpi_wakeup.c optional acpi acpi_wakecode.o optional acpi \ dependency "$S/amd64/acpica/acpi_wakecode.S assym.inc" \ compile-with "${NORMAL_S}" \ diff --git a/sys/conf/files.i386 b/sys/conf/files.i386 index f8320e710e98..af53a1ad7a8a 100644 --- a/sys/conf/files.i386 +++ b/sys/conf/files.i386 @@ -83,6 +83,7 @@ dev/vmd/vmd.c optional vmd dev/acpi_support/acpi_wmi_if.m standard dev/wbwd/wbwd.c optional wbwd i386/acpica/acpi_machdep.c optional acpi +i386/acpica/acpi_wakeup.c optional acpi acpi_wakecode.o optional acpi \ dependency "$S/i386/acpica/acpi_wakecode.S assym.inc" \ compile-with "${NORMAL_S}" \ diff --git a/sys/conf/files.x86 b/sys/conf/files.x86 index 925a3c5fe889..19c7dabd6001 100644 --- a/sys/conf/files.x86 +++ b/sys/conf/files.x86 @@ -285,7 +285,6 @@ libkern/x86/crc32_sse42.c standard # x86/acpica/OsdEnvironment.c optional acpi x86/acpica/acpi_apm.c optional acpi -x86/acpica/acpi_wakeup.c optional acpi x86/acpica/srat.c optional acpi x86/bios/vpd.c optional vpd x86/cpufreq/est.c optional cpufreq diff --git a/sys/i386/acpica/acpi_wakeup.c b/sys/i386/acpica/acpi_wakeup.c new file mode 100644 index 000000000000..682e9613962f --- /dev/null +++ b/sys/i386/acpica/acpi_wakeup.c @@ -0,0 +1,391 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2001 Takanori Watanabe + * Copyright (c) 2001-2012 Mitsuru IWASAKI + * Copyright (c) 2003 Peter Wemm + * Copyright (c) 2008-2012 Jung-uk Kim + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_apic.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef DEV_APIC +#include +#include +#endif +#ifdef SMP +#include +#include +#endif + +#include + +#include + +#include "acpi_wakecode.h" +#include "acpi_wakedata.h" + +/* Make sure the code is less than a page and leave room for the stack. */ +CTASSERT(sizeof(wakecode) < PAGE_SIZE - 1024); + +extern int acpi_resume_beep; +extern int acpi_reset_video; +extern int acpi_susp_bounce; + +#ifdef SMP +extern struct susppcb **susppcbs; +static cpuset_t suspcpus; +#else +static struct susppcb **susppcbs; +#endif + +static void *acpi_alloc_wakeup_handler(void **); +static void acpi_stop_beep(void *); + +#ifdef SMP +static int acpi_wakeup_ap(struct acpi_softc *, int); +static void acpi_wakeup_cpus(struct acpi_softc *); +#endif + +#define ACPI_WAKEPAGES 1 + +#define WAKECODE_FIXUP(offset, type, val) do { \ + type *addr; \ + addr = (type *)(sc->acpi_wakeaddr + (offset)); \ + *addr = val; \ +} while (0) + +static void +acpi_stop_beep(void *arg) +{ + + if (acpi_resume_beep != 0) + timer_spkr_release(); +} + +#ifdef SMP +static int +acpi_wakeup_ap(struct acpi_softc *sc, int cpu) +{ + struct pcb *pcb; + int vector = (sc->acpi_wakephys >> 12) & 0xff; + int apic_id = cpu_apic_ids[cpu]; + int ms; + + pcb = &susppcbs[cpu]->sp_pcb; + WAKECODE_FIXUP(wakeup_pcb, struct pcb *, pcb); + WAKECODE_FIXUP(wakeup_gdt, uint16_t, pcb->pcb_gdt.rd_limit); + WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, pcb->pcb_gdt.rd_base); + + ipi_startup(apic_id, vector); + + /* Wait up to 5 seconds for it to resume. */ + for (ms = 0; ms < 5000; ms++) { + if (!CPU_ISSET(cpu, &suspended_cpus)) + return (1); /* return SUCCESS */ + DELAY(1000); + } + return (0); /* return FAILURE */ +} + +#define WARMBOOT_TARGET 0 +#define WARMBOOT_OFF (PMAP_MAP_LOW + 0x0467) +#define WARMBOOT_SEG (PMAP_MAP_LOW + 0x0469) + +#define CMOS_REG (0x70) +#define CMOS_DATA (0x71) +#define BIOS_RESET (0x0f) +#define BIOS_WARM (0x0a) + +static void +acpi_wakeup_cpus(struct acpi_softc *sc) +{ + uint32_t mpbioswarmvec; + int cpu; + u_char mpbiosreason; + + /* save the current value of the warm-start vector */ + mpbioswarmvec = *((uint32_t *)WARMBOOT_OFF); + outb(CMOS_REG, BIOS_RESET); + mpbiosreason = inb(CMOS_DATA); + + /* setup a vector to our boot code */ + *((volatile u_short *)WARMBOOT_OFF) = WARMBOOT_TARGET; + *((volatile u_short *)WARMBOOT_SEG) = sc->acpi_wakephys >> 4; + outb(CMOS_REG, BIOS_RESET); + outb(CMOS_DATA, BIOS_WARM); /* 'warm-start' */ + + /* Wake up each AP. */ + for (cpu = 1; cpu < mp_ncpus; cpu++) { + if (!CPU_ISSET(cpu, &suspcpus)) + continue; + if (acpi_wakeup_ap(sc, cpu) == 0) { + /* restore the warmstart vector */ + *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; + panic("acpi_wakeup: failed to resume AP #%d (PHY #%d)", + cpu, cpu_apic_ids[cpu]); + } + } + + /* + * Remove the identity mapping of low memory for all CPUs and sync + * the TLB for the BSP. The APs are now spinning in + * cpususpend_handler() and we will release them soon. Then each + * will invalidate its TLB. + */ + pmap_remap_lowptdi(false); + + /* restore the warmstart vector */ + *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; + + outb(CMOS_REG, BIOS_RESET); + outb(CMOS_DATA, mpbiosreason); +} +#endif + +int +acpi_sleep_machdep(struct acpi_softc *sc, int state) +{ + ACPI_STATUS status; + struct pcb *pcb; + + if (sc->acpi_wakeaddr == 0ul) + return (-1); /* couldn't alloc wake memory */ + +#ifdef SMP + suspcpus = all_cpus; + CPU_CLR(PCPU_GET(cpuid), &suspcpus); +#endif + + if (acpi_resume_beep != 0) + timer_spkr_acquire(); + + AcpiSetFirmwareWakingVector(sc->acpi_wakephys, 0); + + intr_suspend(); + + pcb = &susppcbs[0]->sp_pcb; + if (savectx(pcb)) { + npxsuspend(susppcbs[0]->sp_fpususpend); +#ifdef SMP + if (!CPU_EMPTY(&suspcpus) && suspend_cpus(suspcpus) == 0) { + device_printf(sc->acpi_dev, "Failed to suspend APs\n"); + return (0); /* couldn't sleep */ + } +#endif + + WAKECODE_FIXUP(resume_beep, uint8_t, (acpi_resume_beep != 0)); + WAKECODE_FIXUP(reset_video, uint8_t, (acpi_reset_video != 0)); + + if ((amd_feature & AMDID_NX) != 0) + WAKECODE_FIXUP(wakeup_efer, uint64_t, rdmsr(MSR_EFER)); + WAKECODE_FIXUP(wakeup_cr4, register_t, pcb->pcb_cr4); + WAKECODE_FIXUP(wakeup_pcb, struct pcb *, pcb); + WAKECODE_FIXUP(wakeup_gdt, uint16_t, pcb->pcb_gdt.rd_limit); + WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, pcb->pcb_gdt.rd_base); + + /* + * Map some low memory with virt == phys for ACPI wakecode + * to use to jump to high memory after enabling paging. This + * is the same as for similar jump in locore, except the + * jump is a single instruction, and we know its address + * more precisely so only need a single PTD, and we have to + * be careful to use the kernel map (PTD[0] is for curthread + * which may be a user thread in deprecated APIs). + */ + pmap_remap_lowptdi(true); + + /* Call ACPICA to enter the desired sleep state */ + if (state == ACPI_STATE_S4 && sc->acpi_s4bios) + status = AcpiEnterSleepStateS4bios(); + else + status = AcpiEnterSleepState(state); + if (ACPI_FAILURE(status)) { + device_printf(sc->acpi_dev, + "AcpiEnterSleepState failed - %s\n", + AcpiFormatException(status)); + return (0); /* couldn't sleep */ + } + + if (acpi_susp_bounce) + resumectx(pcb); + + for (;;) + ia32_pause(); + } else { + /* + * Re-initialize console hardware as soon as possibe. + * No console output (e.g. printf) is allowed before + * this point. + */ + cnresume(); + npxresume(susppcbs[0]->sp_fpususpend); + } + + return (1); /* wakeup successfully */ +} + +int +acpi_wakeup_machdep(struct acpi_softc *sc, int state, int sleep_result, + int intr_enabled) +{ + + if (sleep_result == -1) + return (sleep_result); + + if (!intr_enabled) { + /* Wakeup MD procedures in interrupt disabled context */ + if (sleep_result == 1) { + ucode_reload(); + pmap_init_pat(); + initializecpu(); + PCPU_SET(switchtime, 0); + PCPU_SET(switchticks, ticks); +#ifdef DEV_APIC + lapic_xapic_mode(); +#endif +#ifdef SMP + if (!CPU_EMPTY(&suspcpus)) + acpi_wakeup_cpus(sc); +#endif + } + +#ifdef SMP + if (!CPU_EMPTY(&suspcpus)) + resume_cpus(suspcpus); +#endif + mca_resume(); + intr_resume(/*suspend_cancelled*/false); + + AcpiSetFirmwareWakingVector(0, 0); + } else { + /* Wakeup MD procedures in interrupt enabled context */ + if (sleep_result == 1 && mem_range_softc.mr_op != NULL && + mem_range_softc.mr_op->reinit != NULL) + mem_range_softc.mr_op->reinit(&mem_range_softc); + } + + return (sleep_result); +} + +static void * +acpi_alloc_wakeup_handler(void *wakepages[ACPI_WAKEPAGES]) +{ + int i; + + memset(wakepages, 0, ACPI_WAKEPAGES * sizeof(*wakepages)); + + /* + * Specify the region for our wakeup code. We want it in the low 1 MB + * region, excluding real mode IVT (0-0x3ff), BDA (0x400-0x4ff), EBDA + * (less than 128KB, below 0xa0000, must be excluded by SMAP and DSDT), + * and ROM area (0xa0000 and above). The temporary page tables must be + * page-aligned. + */ + for (i = 0; i < ACPI_WAKEPAGES; i++) { + wakepages[i] = contigmalloc(PAGE_SIZE, M_DEVBUF, + M_NOWAIT | M_EXEC, 0x500, 0xa0000, PAGE_SIZE, 0ul); + if (wakepages[i] == NULL) { + printf("%s: can't alloc wake memory\n", __func__); + goto freepages; + } + } + if (EVENTHANDLER_REGISTER(power_resume, acpi_stop_beep, NULL, + EVENTHANDLER_PRI_LAST) == NULL) { + printf("%s: can't register event handler\n", __func__); + goto freepages; + } + susppcbs = malloc(mp_ncpus * sizeof(*susppcbs), M_DEVBUF, M_WAITOK); + for (i = 0; i < mp_ncpus; i++) { + susppcbs[i] = malloc(sizeof(**susppcbs), M_DEVBUF, M_WAITOK); + susppcbs[i]->sp_fpususpend = alloc_fpusave(M_WAITOK); + } + + return (wakepages); + +freepages: + for (i = 0; i < ACPI_WAKEPAGES; i++) + if (wakepages[i] != NULL) + contigfree(wakepages[i], PAGE_SIZE, M_DEVBUF); + return (NULL); +} + +void +acpi_install_wakeup_handler(struct acpi_softc *sc) +{ + static void *wakeaddr; + void *wakepages[ACPI_WAKEPAGES]; + + if (wakeaddr != NULL) + return; + + if (acpi_alloc_wakeup_handler(wakepages) == NULL) + return; + + wakeaddr = wakepages[0]; + sc->acpi_wakeaddr = (vm_offset_t)wakeaddr; + sc->acpi_wakephys = vtophys(wakeaddr); + + bcopy(wakecode, (void *)sc->acpi_wakeaddr, sizeof(wakecode)); + + /* Patch GDT base address, ljmp targets. */ + WAKECODE_FIXUP((bootgdtdesc + 2), uint32_t, + sc->acpi_wakephys + bootgdt); + WAKECODE_FIXUP((wakeup_sw32 + 2), uint32_t, + sc->acpi_wakephys + wakeup_32); + + /* Save pointers to some global data. */ + WAKECODE_FIXUP(wakeup_ret, void *, resumectx); + WAKECODE_FIXUP(wakeup_cr3, register_t, pmap_get_kcr3()); + + if (bootverbose) + device_printf(sc->acpi_dev, "wakeup code va %#jx pa %#jx\n", + (uintmax_t)sc->acpi_wakeaddr, (uintmax_t)sc->acpi_wakephys); +} From owner-dev-commits-src-all@freebsd.org Mon Sep 13 21:23:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9FD196A9FC2; Mon, 13 Sep 2021 21:23:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7fc06rCKz3hRL; Mon, 13 Sep 2021 21:23:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B41DD6904; Mon, 13 Sep 2021 21:23:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18DLNi4i078608; Mon, 13 Sep 2021 21:23:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18DLNiYd078607; Mon, 13 Sep 2021 21:23:44 GMT (envelope-from git) Date: Mon, 13 Sep 2021 21:23:44 GMT Message-Id: <202109132123.18DLNiYd078607@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 1c56781cc915 - main - amd64 wakeup: rework trampoline page allocation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1c56781cc915d1d2957e5b53717513193476d777 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2021 21:23:45 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1c56781cc915d1d2957e5b53717513193476d777 commit 1c56781cc915d1d2957e5b53717513193476d777 Author: Konstantin Belousov AuthorDate: 2021-09-12 19:41:51 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-13 21:23:15 +0000 amd64 wakeup: rework trampoline page allocation There is no need to restrict trampoline page table to low 1M, it should work with any pages below 4G. Only wakeup code itself should be below 1M. Do not waste level 5 page when LA48 mode is used. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31931 --- sys/amd64/acpica/acpi_wakeup.c | 79 +++++++++++++++++++++++------------------- 1 file changed, 44 insertions(+), 35 deletions(-) diff --git a/sys/amd64/acpica/acpi_wakeup.c b/sys/amd64/acpica/acpi_wakeup.c index fba9532e9a64..0f04ccb6f2fc 100644 --- a/sys/amd64/acpica/acpi_wakeup.c +++ b/sys/amd64/acpica/acpi_wakeup.c @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -82,7 +83,6 @@ static cpuset_t suspcpus; static struct susppcb **susppcbs; #endif -static void *acpi_alloc_wakeup_handler(void **); static void acpi_stop_beep(void *); #ifdef SMP @@ -90,7 +90,7 @@ static int acpi_wakeup_ap(struct acpi_softc *, int); static void acpi_wakeup_cpus(struct acpi_softc *); #endif -#define ACPI_WAKEPAGES 8 +#define ACPI_WAKEPT_PAGES 7 #define WAKECODE_FIXUP(offset, type, val) do { \ type *addr; \ @@ -304,27 +304,35 @@ acpi_wakeup_machdep(struct acpi_softc *sc, int state, int sleep_result, return (sleep_result); } -static void * -acpi_alloc_wakeup_handler(void *wakepages[ACPI_WAKEPAGES]) +static void +acpi_alloc_wakeup_handler(void **wakeaddr, + void *wakept_pages[ACPI_WAKEPT_PAGES]) { - int i; + vm_page_t wakept_m[ACPI_WAKEPT_PAGES]; + int i; - memset(wakepages, 0, ACPI_WAKEPAGES * sizeof(*wakepages)); + *wakeaddr = NULL; + memset(wakept_pages, 0, ACPI_WAKEPT_PAGES * sizeof(*wakept_pages)); + memset(wakept_m, 0, ACPI_WAKEPT_PAGES * sizeof(*wakept_m)); /* - * Specify the region for our wakeup code. We want it in the low 1 MB - * region, excluding real mode IVT (0-0x3ff), BDA (0x400-0x4ff), EBDA - * (less than 128KB, below 0xa0000, must be excluded by SMAP and DSDT), - * and ROM area (0xa0000 and above). The temporary page tables must be - * page-aligned. + * Specify the region for our wakeup code. We want it in the + * low 1 MB region, excluding real mode IVT (0-0x3ff), BDA + * (0x400-0x4ff), EBDA (less than 128KB, below 0xa0000, must + * be excluded by SMAP and DSDT), and ROM area (0xa0000 and + * above). */ - for (i = 0; i < ACPI_WAKEPAGES; i++) { - wakepages[i] = contigmalloc(PAGE_SIZE, M_DEVBUF, - M_NOWAIT, 0x500, 0xa0000, PAGE_SIZE, 0ul); - if (wakepages[i] == NULL) { - printf("%s: can't alloc wake memory\n", __func__); - goto freepages; - } + *wakeaddr = contigmalloc(PAGE_SIZE, M_DEVBUF, + M_NOWAIT, 0x500, 0xa0000, PAGE_SIZE, 0ul); + if (*wakeaddr == NULL) { + printf("%s: can't alloc wake memory\n", __func__); + goto freepages; + } + + for (i = 0; i < ACPI_WAKEPT_PAGES - (la57 ? 0 : 1); i++) { + wakept_m[i] = pmap_page_alloc_below_4g(true); + wakept_pages[i] = (void *)PHYS_TO_DMAP(VM_PAGE_TO_PHYS( + wakept_m[i])); } if (EVENTHANDLER_REGISTER(power_resume, acpi_stop_beep, NULL, EVENTHANDLER_PRI_LAST) == NULL) { @@ -336,45 +344,46 @@ acpi_alloc_wakeup_handler(void *wakepages[ACPI_WAKEPAGES]) susppcbs[i] = malloc(sizeof(**susppcbs), M_DEVBUF, M_WAITOK); susppcbs[i]->sp_fpususpend = alloc_fpusave(M_WAITOK); } - - return (wakepages); + return; freepages: - for (i = 0; i < ACPI_WAKEPAGES; i++) - if (wakepages[i] != NULL) - contigfree(wakepages[i], PAGE_SIZE, M_DEVBUF); - return (NULL); + if (*wakeaddr != NULL) + contigfree(*wakeaddr, PAGE_SIZE, M_DEVBUF); + for (i = 0; i < ACPI_WAKEPT_PAGES; i++) { + if (wakept_m[i] != NULL) + vm_page_free(wakept_m[i]); + } + *wakeaddr = NULL; } void acpi_install_wakeup_handler(struct acpi_softc *sc) { static void *wakeaddr; - void *wakepages[ACPI_WAKEPAGES]; + void *wakept_pages[ACPI_WAKEPT_PAGES]; uint64_t *pt5, *pt4, *pt3, *pt2_0, *pt2_1, *pt2_2, *pt2_3; vm_paddr_t pt5pa, pt4pa, pt3pa, pt2_0pa, pt2_1pa, pt2_2pa, pt2_3pa; int i; if (wakeaddr != NULL) return; - - if (acpi_alloc_wakeup_handler(wakepages) == NULL) + acpi_alloc_wakeup_handler(&wakeaddr, wakept_pages); + if (wakeaddr == NULL) return; - wakeaddr = wakepages[0]; sc->acpi_wakeaddr = (vm_offset_t)wakeaddr; sc->acpi_wakephys = vtophys(wakeaddr); if (la57) { - pt5 = wakepages[7]; + pt5 = wakept_pages[6]; pt5pa = vtophys(pt5); } - pt4 = wakepages[1]; - pt3 = wakepages[2]; - pt2_0 = wakepages[3]; - pt2_1 = wakepages[4]; - pt2_2 = wakepages[5]; - pt2_3 = wakepages[6]; + pt4 = wakept_pages[0]; + pt3 = wakept_pages[1]; + pt2_0 = wakept_pages[2]; + pt2_1 = wakept_pages[3]; + pt2_2 = wakept_pages[4]; + pt2_3 = wakept_pages[5]; pt4pa = vtophys(pt4); pt3pa = vtophys(pt3); pt2_0pa = vtophys(pt2_0); From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E64046ABFC8; Tue, 14 Sep 2021 00:41:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7kzh5lD6z3PBD; Tue, 14 Sep 2021 00:41:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A693911408; Tue, 14 Sep 2021 00:41:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0f4pW039541; Tue, 14 Sep 2021 00:41:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0f4gv039540; Tue, 14 Sep 2021 00:41:04 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:04 GMT Message-Id: <202109140041.18E0f4gv039540@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: df57aa230c7f - stable/13 - ixgbe: clear all queues on VF reset MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: df57aa230c7fe67c5c72217d8e19ed5aef72d626 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:05 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=df57aa230c7fe67c5c72217d8e19ed5aef72d626 commit df57aa230c7fe67c5c72217d8e19ed5aef72d626 Author: Simon Ellmann AuthorDate: 2020-12-17 17:14:52 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:35:47 +0000 ixgbe: clear all queues on VF reset ixgbe devices support up to 8 Rx and Tx queues per virtual function. Currently, the registers of only seven queues are set to default when resetting a VF. Signed-off-by: Simon Ellmann Acked-by: Haiyue Wang Approved by: imp Obtained from: DPDK (d2565b347915def3a0f3c68bde6824acf096a0e6) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 7165504a17682dc8c96d44c65319bf73c89f7f10) --- sys/dev/ixgbe/ixgbe_vf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_vf.c b/sys/dev/ixgbe/ixgbe_vf.c index 5dfd28f7bf4f..e692f12ebb0d 100644 --- a/sys/dev/ixgbe/ixgbe_vf.c +++ b/sys/dev/ixgbe/ixgbe_vf.c @@ -117,7 +117,7 @@ static void ixgbe_virt_clr_reg(struct ixgbe_hw *hw) IXGBE_WRITE_REG(hw, IXGBE_VFPSRTYPE, 0); - for (i = 0; i < 7; i++) { + for (i = 0; i < 8; i++) { IXGBE_WRITE_REG(hw, IXGBE_VFRDH(i), 0); IXGBE_WRITE_REG(hw, IXGBE_VFRDT(i), 0); IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(i), 0); From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 122F76ABE72; Tue, 14 Sep 2021 00:41:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7kzj71vJz3PRX; Tue, 14 Sep 2021 00:41:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB8F611486; Tue, 14 Sep 2021 00:41:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0f5lP039565; Tue, 14 Sep 2021 00:41:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0f51x039564; Tue, 14 Sep 2021 00:41:05 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:05 GMT Message-Id: <202109140041.18E0f51x039564@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: d357a27643af - stable/13 - ixgbe: fix infinite recursion on PCIe link down MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d357a27643af01bd39056ffc77a745568dbf5035 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:06 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=d357a27643af01bd39056ffc77a745568dbf5035 commit d357a27643af01bd39056ffc77a745568dbf5035 Author: Guinan Sun AuthorDate: 2020-07-09 08:00:31 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:36:41 +0000 ixgbe: fix infinite recursion on PCIe link down In some corner cases the functions ixgbe_clear_rar_generic and ixgbe_clear_vmdq_generic may call one another leading to infinite recursion. When ixgbe_clear_vmdq_generic is called with IXGBE_CLEAR_VMDQ_ALL flag, it's going to clear MPSAR registers, and proceed to call ixgbe_clear_rar_generic, which in turn will clear the RAR registers, and recursively call back ixgbe_clear_vmdq_generic. Normally, the latter would detect that MPSAR registers have already been cleared and terminate the recursion. However, when PCIe link is down, and before the driver has had the opportunity to shut itself down, all register reads return 0xFFFFFFFF, and all register writes fail silently. In such case, because ixgbe_clear_vmdq_generic blindly assumes that clearing MPSAR registers succeeded, it's going to always call ixgbe_clear_rar_generic, which in turn will always call back ixgbe_clear_vmdq_generic, creating infinite recursion. This patch re-reads MPSAR register values after they had been cleared. In case of PCIe link failure, the values read will be non-zero, which will terminate the recursion. On the other hand, under normal circumstances the value read from MPSAR registers is going to be equal to the value previously written, so this patch is expected not to cause any regressions. Signed-off-by: Robert Konklewski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (2d04b9e856125197ec8e967471426d56ab7efcf0) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 8270b7174c48417a4d5f3effa4a4f4588205e687) --- sys/dev/ixgbe/ixgbe_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index d7da9f81fbf8..92db7c14da45 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -3813,11 +3813,11 @@ s32 ixgbe_clear_vmdq_generic(struct ixgbe_hw *hw, u32 rar, u32 vmdq) if (vmdq == IXGBE_CLEAR_VMDQ_ALL) { if (mpsar_lo) { IXGBE_WRITE_REG(hw, IXGBE_MPSAR_LO(rar), 0); - mpsar_lo = 0; + mpsar_lo = IXGBE_READ_REG(hw, IXGBE_MPSAR_LO(rar)); } if (mpsar_hi) { IXGBE_WRITE_REG(hw, IXGBE_MPSAR_HI(rar), 0); - mpsar_hi = 0; + mpsar_hi = IXGBE_READ_REG(hw, IXGBE_MPSAR_HI(rar)); } } else if (vmdq < 32) { mpsar_lo &= ~(1 << vmdq); From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 859196AC492; Tue, 14 Sep 2021 00:41:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7kzm2TPjz3PPV; Tue, 14 Sep 2021 00:41:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BCC811248; Tue, 14 Sep 2021 00:41:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0f8hn039620; Tue, 14 Sep 2021 00:41:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0f8qt039619; Tue, 14 Sep 2021 00:41:08 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:08 GMT Message-Id: <202109140041.18E0f8qt039619@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 6bf001dfe549 - stable/13 - ixgbe: improve log about autoneg being disabled MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6bf001dfe549e3838a15e2f01a5e649b6a0be41d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:08 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=6bf001dfe549e3838a15e2f01a5e649b6a0be41d commit 6bf001dfe549e3838a15e2f01a5e649b6a0be41d Author: Guinan Sun AuthorDate: 2020-07-09 08:00:41 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:36:47 +0000 ixgbe: improve log about autoneg being disabled On ESXi OS, when user disables auto negotiation, the following log appears: "(unsupported) Flow control autoneg is disabled". It is true that auto negotiation is disabled but it is not necessarily true that it is not supported. Signed-off-by: Jakub Chylkowski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (ab6ac48d483ef7f906b90f45182f2ddf3254d876) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit f511cd22586a9c0358b86334a51e3db60ca2db01) --- sys/dev/ixgbe/ixgbe_common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 92db7c14da45..34c0f128aae4 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -3118,8 +3118,9 @@ void ixgbe_fc_autoneg(struct ixgbe_hw *hw) * - link is not up. */ if (hw->fc.disable_fc_autoneg) { - ERROR_REPORT1(IXGBE_ERROR_UNSUPPORTED, - "Flow control autoneg is disabled"); + /* TODO: This should be just an informative log */ + ERROR_REPORT1(IXGBE_ERROR_CAUTION, + "Flow control autoneg is disabled"); goto out; } From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 438F36AC423; Tue, 14 Sep 2021 00:41:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7kzn4qxHz3PRv; Tue, 14 Sep 2021 00:41:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E51D1148C; Tue, 14 Sep 2021 00:41:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0f9gU039644; Tue, 14 Sep 2021 00:41:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0f9X0039643; Tue, 14 Sep 2021 00:41:09 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:09 GMT Message-Id: <202109140041.18E0f9X0039643@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 388fa55dcf89 - stable/13 - ixgbe: fix response to apply-update command MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 388fa55dcf892ce83ce0c9a88f0373fe022df197 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:10 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=388fa55dcf892ce83ce0c9a88f0373fe022df197 commit 388fa55dcf892ce83ce0c9a88f0373fe022df197 Author: Guinan Sun AuthorDate: 2020-07-09 08:00:29 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:36:51 +0000 ixgbe: fix response to apply-update command For the "Apply Update" command the firmware does not given an response. For this command, success should be return. Signed-off-by: Mateusz Kowalski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (03b09c71c0c6c516ce05cad8e8aa75e8b9e14fba) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit c966c431c764c493fafbe65b717243a3c0b291be) --- sys/dev/ixgbe/ixgbe_common.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 34c0f128aae4..6ee71dec4fda 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -4557,11 +4557,18 @@ s32 ixgbe_hic_unlocked(struct ixgbe_hw *hw, u32 *buffer, u32 length, msec_delay(1); } + /* For each command except "Apply Update" perform + * status checks in the HICR registry. + */ + if ((buffer[0] & IXGBE_HOST_INTERFACE_MASK_CMD) == + IXGBE_HOST_INTERFACE_APPLY_UPDATE_CMD) + return IXGBE_SUCCESS; + /* Check command completion */ if ((timeout && i == timeout) || !(IXGBE_READ_REG(hw, IXGBE_HICR) & IXGBE_HICR_SV)) { ERROR_REPORT1(IXGBE_ERROR_CAUTION, - "Command has failed with no status valid.\n"); + "Command has failed with no status valid.\n"); return IXGBE_ERR_HOST_INTERFACE_COMMAND; } From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4BD06AC2E9; Tue, 14 Sep 2021 00:41:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7kzq34MGz3PKQ; Tue, 14 Sep 2021 00:41:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 670EB10E5B; Tue, 14 Sep 2021 00:41:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0fAwx039668; Tue, 14 Sep 2021 00:41:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0fAZq039667; Tue, 14 Sep 2021 00:41:10 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:10 GMT Message-Id: <202109140041.18E0fAZq039667@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: ba1995e65ce1 - stable/13 - ixgbe: fix host interface shadow RAM read MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ba1995e65ce13186a12587256993c1e83af6c74b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:12 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ba1995e65ce13186a12587256993c1e83af6c74b commit ba1995e65ce13186a12587256993c1e83af6c74b Author: Guinan Sun AuthorDate: 2020-07-09 08:00:28 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:36:54 +0000 ixgbe: fix host interface shadow RAM read Host interface Shadow RAM Read (0x31) command response buffer length should be stored in two bytes, instead of one byte. This patch fixes it. Signed-off-by: Mateusz Kowalski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (713fc4dd340e5eadd3bfa9a468446afaa5188624) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 31a23e3eb5314a6b5929e980a0810803adfaad1f) --- sys/dev/ixgbe/ixgbe_common.c | 3 ++- sys/dev/ixgbe/ixgbe_type.h | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 6ee71dec4fda..2b9f8a0ca110 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -4636,7 +4636,8 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer, * Read Flash command requires reading buffer length from * two byes instead of one byte */ - if (resp->cmd == 0x30) { + if (resp->cmd == IXGBE_HOST_INTERFACE_FLASH_READ_CMD || + resp->cmd == IXGBE_HOST_INTERFACE_SHADOW_RAM_READ_CMD) { for (; bi < dword_len + 2; bi++) { buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi); diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h index 1d00eadc890a..9619b771ea89 100644 --- a/sys/dev/ixgbe/ixgbe_type.h +++ b/sys/dev/ixgbe/ixgbe_type.h @@ -2426,6 +2426,16 @@ enum { #define IXGBE_FW_LESM_PARAMETERS_PTR 0x2 #define IXGBE_FW_LESM_STATE_1 0x1 #define IXGBE_FW_LESM_STATE_ENABLED 0x8000 /* LESM Enable bit */ +#define IXGBE_FW_LESM_2_STATES_ENABLED_MASK 0x1F +#define IXGBE_FW_LESM_2_STATES_ENABLED 0x12 +#define IXGBE_FW_LESM_STATE0_10G_ENABLED 0x6FFF +#define IXGBE_FW_LESM_STATE1_10G_ENABLED 0x4FFF +#define IXGBE_FW_LESM_STATE0_10G_DISABLED 0x0FFF +#define IXGBE_FW_LESM_STATE1_10G_DISABLED 0x2FFF +#define IXGBE_FW_LESM_PORT0_STATE0_OFFSET 0x2 +#define IXGBE_FW_LESM_PORT0_STATE1_OFFSET 0x3 +#define IXGBE_FW_LESM_PORT1_STATE0_OFFSET 0x6 +#define IXGBE_FW_LESM_PORT1_STATE1_OFFSET 0x7 #define IXGBE_FW_PASSTHROUGH_PATCH_CONFIG_PTR 0x4 #define IXGBE_FW_PATCH_VERSION_4 0x7 #define IXGBE_FCOE_IBA_CAPS_BLK_PTR 0x33 /* iSCSI/FCOE block */ @@ -4427,6 +4437,18 @@ struct ixgbe_bypass_eeprom { #define IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD \ (0x1F << IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD_SHIFT) +/* Code Command (Flash I/F Interface) */ +#define IXGBE_HOST_INTERFACE_FLASH_READ_CMD 0x30 +#define IXGBE_HOST_INTERFACE_SHADOW_RAM_READ_CMD 0x31 +#define IXGBE_HOST_INTERFACE_FLASH_WRITE_CMD 0x32 +#define IXGBE_HOST_INTERFACE_SHADOW_RAM_WRITE_CMD 0x33 +#define IXGBE_HOST_INTERFACE_FLASH_MODULE_UPDATE_CMD 0x34 +#define IXGBE_HOST_INTERFACE_FLASH_BLOCK_EREASE_CMD 0x35 +#define IXGBE_HOST_INTERFACE_SHADOW_RAM_DUMP_CMD 0x36 +#define IXGBE_HOST_INTERFACE_FLASH_INFO_CMD 0x37 +#define IXGBE_HOST_INTERFACE_APPLY_UPDATE_CMD 0x38 +#define IXGBE_HOST_INTERFACE_MASK_CMD 0x000000FF + #define IXGBE_REQUEST_TASK_MOD 0x01 #define IXGBE_REQUEST_TASK_MSF 0x02 #define IXGBE_REQUEST_TASK_MBX 0x04 From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 936B76ABE74; Tue, 14 Sep 2021 00:41:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7kzl0wFzz3PHd; Tue, 14 Sep 2021 00:41:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7BDE11409; Tue, 14 Sep 2021 00:41:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0f6ER039596; Tue, 14 Sep 2021 00:41:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0f6e3039595; Tue, 14 Sep 2021 00:41:06 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:06 GMT Message-Id: <202109140041.18E0f6e3039595@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 5755b5594be5 - stable/13 - ixgbe: add IPv6 mask for flow director MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5755b5594be56143595a68afa0dc071f02bb57ae Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:07 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5755b5594be56143595a68afa0dc071f02bb57ae commit 5755b5594be56143595a68afa0dc071f02bb57ae Author: Guinan Sun AuthorDate: 2020-07-09 08:00:42 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:36:44 +0000 ixgbe: add IPv6 mask for flow director Write FDIRIP6M register to allow flow director filter to set ipv6 rules without setting ipv6 source/destination address. Signed-off-by: Piotr Skajewski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (21feefa2fcd5899ee26a10be405c17c0a1109860) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit c4f73d5d6a6c0117e08a03920cce69202865ba13) --- sys/dev/ixgbe/ixgbe_82599.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c index e92fb1292da2..15febd08352e 100644 --- a/sys/dev/ixgbe/ixgbe_82599.c +++ b/sys/dev/ixgbe/ixgbe_82599.c @@ -1868,6 +1868,7 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw, ~input_mask->formatted.src_ip[0]); IXGBE_WRITE_REG_BE32(hw, IXGBE_FDIRDIP4M, ~input_mask->formatted.dst_ip[0]); + IXGBE_WRITE_REG_BE32(hw, IXGBE_FDIRIP6M, 0xFFFFFFFF); } return IXGBE_SUCCESS; } From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F161A6AC3BF; Tue, 14 Sep 2021 00:41:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7kzq4zlNz3PZp; Tue, 14 Sep 2021 00:41:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 854D211507; Tue, 14 Sep 2021 00:41:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0fBvO039692; Tue, 14 Sep 2021 00:41:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0fB3k039691; Tue, 14 Sep 2021 00:41:11 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:11 GMT Message-Id: <202109140041.18E0fB3k039691@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 038c4f3f3fcc - stable/13 - ixgbe: wait longer for link after fiber MAC setup MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 038c4f3f3fccae5257cf167914045215621c401c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:12 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=038c4f3f3fccae5257cf167914045215621c401c commit 038c4f3f3fccae5257cf167914045215621c401c Author: Matthew Smith AuthorDate: 2018-07-16 16:36:04 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:36:57 +0000 ixgbe: wait longer for link after fiber MAC setup After setting up the link on a fiber port, the maximum wait time for the link to come up is 500 ms in ixgbe_setup_mac_link_multispeed_fiber(). On an x550 SFP+ port, this is often not sufficiently long for the link to come up. This can result in never being able to retrieve accurate link status for the port using rte_eth_link_get_nowait(). Increase the maximum wait time in ixgbe_setup_mac_link_multispeed_fiber() to 1 s. Signed-off-by: Matthew Smith Acked-by: Qi Zhang Approved by: imp Obtained from: DPDK (64f1c8539c8ce99214b9eb1fb728a2c6745f3300) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit aaa3af802f90d93fdffb99100fe56f0bc3dda119) --- sys/dev/ixgbe/ixgbe_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 2b9f8a0ca110..fdb371637d8c 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -5380,7 +5380,7 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, * Section 73.10.2, we may have to wait up to 500ms if KR is * attempted. 82599 uses the same timing for 10g SFI. */ - for (i = 0; i < 5; i++) { + for (i = 0; i < 10; i++) { /* Wait for the link partner to also set speed */ msec_delay(100); From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EAC7D6AC1D5; Tue, 14 Sep 2021 00:41:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7kzv4Gd2z3Pb3; Tue, 14 Sep 2021 00:41:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E14B01124A; Tue, 14 Sep 2021 00:41:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0fEDN039770; Tue, 14 Sep 2021 00:41:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0fEYj039769; Tue, 14 Sep 2021 00:41:14 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:14 GMT Message-Id: <202109140041.18E0fEYj039769@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: ee690406343d - stable/13 - ixgbe: initialize data field in struct buffer MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ee690406343dc8bd34992f6d4e0871726ee42279 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:16 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ee690406343dc8bd34992f6d4e0871726ee42279 commit ee690406343dc8bd34992f6d4e0871726ee42279 Author: Guinan Sun AuthorDate: 2020-07-09 08:00:40 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:37:05 +0000 ixgbe: initialize data field in struct buffer While sending request using ixgbe_hic_unlocked() the data field in buffer struct is not used. It is set when the struct is overwritten by FW to deliver the response. To not pass random data to FW the whole structure should be zeroed before use. Signed-off-by: Krzysztof Galazka Signed-off-by: Piotr Pietruszewski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (40543be5376ca415b2a7e196315d0555725b8bdf) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit b3ebe337ffa06b0f1f460bf8f1e42fb55db77d0b) --- sys/dev/ixgbe/ixgbe_x550.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index 03904c026cae..02db10b61673 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -3137,6 +3137,7 @@ s32 ixgbe_read_ee_hostif_X550(struct ixgbe_hw *hw, u16 offset, u16 *data) /* one word */ buffer.length = IXGBE_CPU_TO_BE16(sizeof(u16)); buffer.pad2 = 0; + buffer.data = 0; buffer.pad3 = 0; status = hw->mac.ops.acquire_swfw_sync(hw, mask); @@ -3197,6 +3198,7 @@ s32 ixgbe_read_ee_hostif_buffer_X550(struct ixgbe_hw *hw, buffer.address = IXGBE_CPU_TO_BE32((offset + current_word) * 2); buffer.length = IXGBE_CPU_TO_BE16(words_to_read * 2); buffer.pad2 = 0; + buffer.data = 0; buffer.pad3 = 0; status = ixgbe_hic_unlocked(hw, (u32 *)&buffer, sizeof(buffer), From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D94026AC2F2; Tue, 14 Sep 2021 00:41:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7kzs33xKz3PQ5; Tue, 14 Sep 2021 00:41:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A048111508; Tue, 14 Sep 2021 00:41:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0fC3n039722; Tue, 14 Sep 2021 00:41:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0fCgK039721; Tue, 14 Sep 2021 00:41:12 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:12 GMT Message-Id: <202109140041.18E0fCgK039721@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 2e6fe4187335 - stable/13 - ixgbe: fix maximum wait time in comment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2e6fe4187335454e888d9c11b8054279a561ac78 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:14 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=2e6fe4187335454e888d9c11b8054279a561ac78 commit 2e6fe4187335454e888d9c11b8054279a561ac78 Author: Xiaolong Ye AuthorDate: 2018-11-15 07:20:05 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:36:59 +0000 ixgbe: fix maximum wait time in comment As the code has changed the max wait time to 1000ms, the comment should be changed accordingly. Signed-off-by: Xiaolong Ye Acked-by: Qi Zhang Approved by: imp Obtained from: DPDK (73247f1ced303c16987bb366d38a2d8a0fc40db4) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 96ef6eb3ae9d622906fb838c82ede3074f864cdc) --- sys/dev/ixgbe/ixgbe_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index fdb371637d8c..7f32c112f74c 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -5377,7 +5377,7 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, ixgbe_flap_tx_laser(hw); /* Wait for the controller to acquire link. Per IEEE 802.3ap, - * Section 73.10.2, we may have to wait up to 500ms if KR is + * Section 73.10.2, we may have to wait up to 1000ms if KR is * attempted. 82599 uses the same timing for 10g SFI. */ for (i = 0; i < 10; i++) { From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B13016AC527; Tue, 14 Sep 2021 00:41:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7kzv0Wffz3PdK; Tue, 14 Sep 2021 00:41:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CABDB1148F; Tue, 14 Sep 2021 00:41:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0fDfo039746; Tue, 14 Sep 2021 00:41:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0fD1j039745; Tue, 14 Sep 2021 00:41:13 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:13 GMT Message-Id: <202109140041.18E0fD1j039745@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 6cd58ec39351 - stable/13 - ixgbe: fix x550em 10G NIC link status MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6cd58ec393513b77225579fdd83dd39bb32fe9bd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:16 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=6cd58ec393513b77225579fdd83dd39bb32fe9bd commit 6cd58ec393513b77225579fdd83dd39bb32fe9bd Author: Guinan Sun AuthorDate: 2020-07-09 08:00:30 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:37:02 +0000 ixgbe: fix x550em 10G NIC link status With the NVM image for x550em XFI will not report the auto-negotiation feature correctly. The auto-negotiation should be "No" for supports and advertised items. At the same time update speed makes it support 1G and 10G. Signed-off-by: Piotr Skajewski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (fb03b51da940f1d56d701776fd85a0dfc1ace098) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 8e9f1b239dc00a2375af87c48321f85a1e37c14e) --- sys/dev/ixgbe/ixgbe_x550.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index 868b5cdc2e70..03904c026cae 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -1912,7 +1912,14 @@ s32 ixgbe_get_link_capabilities_X550em(struct ixgbe_hw *hw, else *speed = IXGBE_LINK_SPEED_10GB_FULL; } else { + *autoneg = true; + switch (hw->phy.type) { + case ixgbe_phy_x550em_xfi: + *speed = IXGBE_LINK_SPEED_1GB_FULL | + IXGBE_LINK_SPEED_10GB_FULL; + *autoneg = false; + break; case ixgbe_phy_ext_1g_t: case ixgbe_phy_sgmii: *speed = IXGBE_LINK_SPEED_1GB_FULL; @@ -1936,7 +1943,6 @@ s32 ixgbe_get_link_capabilities_X550em(struct ixgbe_hw *hw, IXGBE_LINK_SPEED_1GB_FULL; break; } - *autoneg = TRUE; } return IXGBE_SUCCESS; From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 608676AC1E1; Tue, 14 Sep 2021 00:41:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7kzz3Rh5z3PVq; Tue, 14 Sep 2021 00:41:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6EB9810E61; Tue, 14 Sep 2021 00:41:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0fIU8039848; Tue, 14 Sep 2021 00:41:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0fIKQ039847; Tue, 14 Sep 2021 00:41:18 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:18 GMT Message-Id: <202109140041.18E0fIKQ039847@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: f554c144fbaf - stable/13 - ixgbe: add typecast for type mismatch MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f554c144fbafa92961e3d68c6b2b91fa2171a21d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:20 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=f554c144fbafa92961e3d68c6b2b91fa2171a21d commit f554c144fbafa92961e3d68c6b2b91fa2171a21d Author: Guinan Sun AuthorDate: 2020-07-09 08:00:37 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:37:12 +0000 ixgbe: add typecast for type mismatch Add typecast for type mismatch. Signed-off-by: Jakub Chylkowski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (d8e52b2cf771c31b523b46852fd86225b5a2c721) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 994dd6328c66fc277438ad51ed074f3c52096147) --- sys/dev/ixgbe/ixgbe_82599.c | 8 ++++---- sys/dev/ixgbe/ixgbe_common.c | 2 +- sys/dev/ixgbe/ixgbe_dcb_82598.c | 2 +- sys/dev/ixgbe/ixgbe_dcb_82599.c | 2 +- sys/dev/ixgbe/ixgbe_x550.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c index 15febd08352e..1f81f6109f1b 100644 --- a/sys/dev/ixgbe/ixgbe_82599.c +++ b/sys/dev/ixgbe/ixgbe_82599.c @@ -1583,7 +1583,7 @@ void ixgbe_fdir_add_signature_filter_82599(struct ixgbe_hw *hw, * is for FDIRCMD. Then do a 64-bit register write from FDIRHASH. */ fdirhashcmd = (u64)fdircmd << 32; - fdirhashcmd |= ixgbe_atr_compute_sig_hash_82599(input, common); + fdirhashcmd |= (u64)ixgbe_atr_compute_sig_hash_82599(input, common); IXGBE_WRITE_REG64(hw, IXGBE_FDIRHASH, fdirhashcmd); DEBUGOUT2("Tx Queue=%x hash=%x\n", queue, (u32)fdirhashcmd); @@ -1672,7 +1672,7 @@ static u32 ixgbe_get_fdirtcpm_82599(union ixgbe_atr_input *input_mask) { u32 mask = IXGBE_NTOHS(input_mask->formatted.dst_port); mask <<= IXGBE_FDIRTCPM_DPORTM_SHIFT; - mask |= IXGBE_NTOHS(input_mask->formatted.src_port); + mask |= (u32)IXGBE_NTOHS(input_mask->formatted.src_port); mask = ((mask & 0x55555555) << 1) | ((mask & 0xAAAAAAAA) >> 1); mask = ((mask & 0x33333333) << 2) | ((mask & 0xCCCCCCCC) >> 2); mask = ((mask & 0x0F0F0F0F) << 4) | ((mask & 0xF0F0F0F0) >> 4); @@ -1905,14 +1905,14 @@ s32 ixgbe_fdir_write_perfect_filter_82599(struct ixgbe_hw *hw, /* record source and destination port (little-endian)*/ fdirport = IXGBE_NTOHS(input->formatted.dst_port); fdirport <<= IXGBE_FDIRPORT_DESTINATION_SHIFT; - fdirport |= IXGBE_NTOHS(input->formatted.src_port); + fdirport |= (u32)IXGBE_NTOHS(input->formatted.src_port); IXGBE_WRITE_REG(hw, IXGBE_FDIRPORT, fdirport); } /* record VLAN (little-endian) and flex_bytes(big-endian) */ fdirvlan = IXGBE_STORE_AS_BE16(input->formatted.flex_bytes); fdirvlan <<= IXGBE_FDIRVLAN_FLEX_SHIFT; - fdirvlan |= IXGBE_NTOHS(input->formatted.vlan_id); + fdirvlan |= (u32)IXGBE_NTOHS(input->formatted.vlan_id); IXGBE_WRITE_REG(hw, IXGBE_FDIRVLAN, fdirvlan); if (cloud_mode) { diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 7f32c112f74c..573f7684e959 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -774,7 +774,7 @@ s32 ixgbe_read_pba_num_generic(struct ixgbe_hw *hw, u32 *pba_num) DEBUGOUT("NVM Read Error\n"); return ret_val; } - *pba_num |= data; + *pba_num |= (u32)data; return IXGBE_SUCCESS; } diff --git a/sys/dev/ixgbe/ixgbe_dcb_82598.c b/sys/dev/ixgbe/ixgbe_dcb_82598.c index 0845ba872a1d..37744462bc07 100644 --- a/sys/dev/ixgbe/ixgbe_dcb_82598.c +++ b/sys/dev/ixgbe/ixgbe_dcb_82598.c @@ -198,7 +198,7 @@ s32 ixgbe_dcb_config_tx_desc_arbiter_82598(struct ixgbe_hw *hw, for (i = 0; i < IXGBE_DCB_MAX_TRAFFIC_CLASS; i++) { max_credits = max[i]; reg = max_credits << IXGBE_TDTQ2TCCR_MCL_SHIFT; - reg |= refill[i]; + reg |= (u32)(refill[i]); reg |= (u32)(bwg_id[i]) << IXGBE_TDTQ2TCCR_BWG_SHIFT; if (tsa[i] == ixgbe_dcb_tsa_group_strict_cee) diff --git a/sys/dev/ixgbe/ixgbe_dcb_82599.c b/sys/dev/ixgbe/ixgbe_dcb_82599.c index 4799fe1d943a..3056cbf5c2f3 100644 --- a/sys/dev/ixgbe/ixgbe_dcb_82599.c +++ b/sys/dev/ixgbe/ixgbe_dcb_82599.c @@ -197,7 +197,7 @@ s32 ixgbe_dcb_config_tx_desc_arbiter_82599(struct ixgbe_hw *hw, u16 *refill, for (i = 0; i < IXGBE_DCB_MAX_TRAFFIC_CLASS; i++) { max_credits = max[i]; reg = max_credits << IXGBE_RTTDT2C_MCL_SHIFT; - reg |= refill[i]; + reg |= (u32)(refill[i]); reg |= (u32)(bwg_id[i]) << IXGBE_RTTDT2C_BWG_SHIFT; if (tsa[i] == ixgbe_dcb_tsa_group_strict_cee) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index a7759117f5b5..6edeeb178289 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -730,7 +730,7 @@ static s32 ixgbe_setup_fw_link(struct ixgbe_hw *hw) for (i = 0; i < sizeof(ixgbe_fw_map) / sizeof(ixgbe_fw_map[0]); ++i) { if (hw->phy.autoneg_advertised & ixgbe_fw_map[i].phy_speed) - setup[0] |= ixgbe_fw_map[i].fw_speed; + setup[0] |= (u32)(ixgbe_fw_map[i].fw_speed); } setup[0] |= FW_PHY_ACT_SETUP_LINK_HP | FW_PHY_ACT_SETUP_LINK_AN; From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 399A46AC4AA; Tue, 14 Sep 2021 00:41:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7kzw46NMz3PQN; Tue, 14 Sep 2021 00:41:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1278C1164E; Tue, 14 Sep 2021 00:41:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0fFEn039794; Tue, 14 Sep 2021 00:41:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0fFJU039793; Tue, 14 Sep 2021 00:41:15 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:15 GMT Message-Id: <202109140041.18E0fFJU039793@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 31b67f9a10df - stable/13 - ixgbe: check host interface return status MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 31b67f9a10dfd3e2cd2405d87a069ea8959d9824 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:17 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=31b67f9a10dfd3e2cd2405d87a069ea8959d9824 commit 31b67f9a10dfd3e2cd2405d87a069ea8959d9824 Author: Guinan Sun AuthorDate: 2020-07-09 08:00:44 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:37:07 +0000 ixgbe: check host interface return status Writing to read-only fields returns a non-OK Return Status for shadow RAM write command for X550. This information was previously discarded. Signed-off-by: Stanislaw Grzeszczak Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (db18e37090a3b9af47d6a6886248520f6b220bf9) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit c1a56b6f5ffd6f3180a654d058c1783ccb808e8b) --- sys/dev/ixgbe/ixgbe_x550.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index 02db10b61673..7b120f841d85 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -3259,7 +3259,18 @@ s32 ixgbe_write_ee_hostif_data_X550(struct ixgbe_hw *hw, u16 offset, status = ixgbe_host_interface_command(hw, (u32 *)&buffer, sizeof(buffer), - IXGBE_HI_COMMAND_TIMEOUT, FALSE); + IXGBE_HI_COMMAND_TIMEOUT, TRUE); + if (status != IXGBE_SUCCESS) { + DEBUGOUT2("for offset %04x failed with status %d\n", + offset, status); + return status; + } + + if (buffer.hdr.rsp.buf_lenh_status != FW_CEM_RESP_STATUS_SUCCESS) { + DEBUGOUT2("for offset %04x host interface return status %02x\n", + offset, buffer.hdr.rsp.buf_lenh_status); + return IXGBE_ERR_HOST_INTERFACE_COMMAND; + } return status; } From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B8C56AC4BA; Tue, 14 Sep 2021 00:41:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l013KRZz3PbZ; Tue, 14 Sep 2021 00:41:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4F4111654; Tue, 14 Sep 2021 00:41:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0fKkZ039896; Tue, 14 Sep 2021 00:41:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0fK8x039895; Tue, 14 Sep 2021 00:41:20 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:20 GMT Message-Id: <202109140041.18E0fK8x039895@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 163e29cec622 - stable/13 - ixgbe: Use C99 bool types MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 163e29cec62291619f5f02d36e0160b660178a04 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:22 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=163e29cec62291619f5f02d36e0160b660178a04 commit 163e29cec62291619f5f02d36e0160b660178a04 Author: Kevin Bowling AuthorDate: 2021-09-07 02:54:22 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:37:17 +0000 ixgbe: Use C99 bool types Approved by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 79b36ec91decc18d062fc428e2fd34d41aba0630) --- sys/dev/ixgbe/if_ix.c | 86 +++++++++++++------------- sys/dev/ixgbe/if_ixv.c | 30 +++++----- sys/dev/ixgbe/if_sriov.c | 24 ++++---- sys/dev/ixgbe/ix_txrx.c | 12 ++-- sys/dev/ixgbe/ixgbe.h | 4 +- sys/dev/ixgbe/ixgbe_82598.c | 48 +++++++-------- sys/dev/ixgbe/ixgbe_82599.c | 104 ++++++++++++++++---------------- sys/dev/ixgbe/ixgbe_api.c | 14 ++--- sys/dev/ixgbe/ixgbe_common.c | 130 ++++++++++++++++++++-------------------- sys/dev/ixgbe/ixgbe_dcb.c | 2 +- sys/dev/ixgbe/ixgbe_dcb_82599.c | 10 ++-- sys/dev/ixgbe/ixgbe_mbx.c | 2 +- sys/dev/ixgbe/ixgbe_mbx.h | 2 +- sys/dev/ixgbe/ixgbe_osdep.h | 4 -- sys/dev/ixgbe/ixgbe_phy.c | 84 +++++++++++++------------- sys/dev/ixgbe/ixgbe_vf.c | 18 +++--- sys/dev/ixgbe/ixgbe_x540.c | 8 +-- sys/dev/ixgbe/ixgbe_x550.c | 98 +++++++++++++++--------------- 18 files changed, 338 insertions(+), 342 deletions(-) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 91bf7e4dd218..42523f82cc01 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -332,7 +332,7 @@ SYSCTL_INT(_hw_ix, OID_AUTO, enable_msix, CTLFLAG_RDTUN, &ixgbe_enable_msix, 0, * of unsupported SFP+ modules, note that * doing so you are on your own :) */ -static int allow_unsupported_sfp = FALSE; +static int allow_unsupported_sfp = false; SYSCTL_INT(_hw_ix, OID_AUTO, unsupported_sfp, CTLFLAG_RDTUN, &allow_unsupported_sfp, 0, "Allow unsupported SFP modules...use at your own risk"); @@ -356,7 +356,7 @@ SYSCTL_INT(_hw_ix, OID_AUTO, enable_rss, CTLFLAG_RDTUN, &ixgbe_enable_rss, 0, * is varied over time based on the * traffic for that interrupt vector */ -static int ixgbe_enable_aim = FALSE; +static int ixgbe_enable_aim = false; SYSCTL_INT(_hw_ix, OID_AUTO, enable_aim, CTLFLAG_RWTUN, &ixgbe_enable_aim, 0, "Enable adaptive interrupt moderation"); @@ -943,7 +943,7 @@ ixgbe_if_attach_pre(if_ctx_t ctx) /* Verify adapter fan is still functional (if applicable) */ if (adapter->feat_en & IXGBE_FEATURE_FAN_FAIL) { u32 esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); - ixgbe_check_fan_failure(adapter, esdp, FALSE); + ixgbe_check_fan_failure(adapter, esdp, false); } /* Ensure SW/FW semaphore is free */ @@ -952,16 +952,16 @@ ixgbe_if_attach_pre(if_ctx_t ctx) /* Set an initial default flow control value */ hw->fc.requested_mode = ixgbe_flow_control; - hw->phy.reset_if_overtemp = TRUE; + hw->phy.reset_if_overtemp = true; error = ixgbe_reset_hw(hw); - hw->phy.reset_if_overtemp = FALSE; + hw->phy.reset_if_overtemp = false; if (error == IXGBE_ERR_SFP_NOT_PRESENT) { /* * No optics in this port, set up * so the timer routine will probe * for later insertion. */ - adapter->sfp_probe = TRUE; + adapter->sfp_probe = true; error = 0; } else if (error == IXGBE_ERR_SFP_NOT_SUPPORTED) { device_printf(dev, "Unsupported SFP+ module detected!\n"); @@ -1097,7 +1097,7 @@ ixgbe_if_attach_post(if_ctx_t ctx) ixgbe_enable_tx_laser(hw); /* Enable power to the phy. */ - ixgbe_set_phy_power(hw, TRUE); + ixgbe_set_phy_power(hw, true); ixgbe_initialize_iov(adapter); @@ -1366,23 +1366,23 @@ ixgbe_is_sfp(struct ixgbe_hw *hw) switch (hw->mac.type) { case ixgbe_mac_82598EB: if (hw->phy.type == ixgbe_phy_nl) - return (TRUE); - return (FALSE); + return (true); + return (false); case ixgbe_mac_82599EB: switch (hw->mac.ops.get_media_type(hw)) { case ixgbe_media_type_fiber: case ixgbe_media_type_fiber_qsfp: - return (TRUE); + return (true); default: - return (FALSE); + return (false); } case ixgbe_mac_X550EM_x: case ixgbe_mac_X550EM_a: if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) - return (TRUE); - return (FALSE); + return (true); + return (false); default: - return (FALSE); + return (false); } } /* ixgbe_is_sfp */ @@ -1405,7 +1405,7 @@ ixgbe_config_link(if_ctx_t ctx) } else { if (hw->mac.ops.check_link) err = ixgbe_check_link(hw, &adapter->link_speed, - &adapter->link_up, FALSE); + &adapter->link_up, false); if (err) return; autoneg = hw->phy.autoneg_advertised; @@ -1911,7 +1911,7 @@ ixgbe_setup_vlan_hw_support(if_ctx_t ctx) ctrl |= IXGBE_RXDCTL_VME; IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(rxr->me), ctrl); } - rxr->vtag_strip = TRUE; + rxr->vtag_strip = true; } } @@ -1948,7 +1948,7 @@ ixgbe_get_slot_info(struct adapter *adapter) { device_t dev = iflib_get_dev(adapter->ctx); struct ixgbe_hw *hw = &adapter->hw; - int bus_info_valid = TRUE; + int bus_info_valid = true; u32 offset; u16 link; @@ -1997,7 +1997,7 @@ get_parent_info: * Hmm...can't get PCI-Express capabilities. * Falling back to default method. */ - bus_info_valid = FALSE; + bus_info_valid = false; ixgbe_get_bus_info(hw); goto display; } @@ -2423,8 +2423,8 @@ ixgbe_if_media_change(if_ctx_t ctx) goto invalid; } - hw->mac.autotry_restart = TRUE; - hw->mac.ops.setup_link(hw, speed, TRUE); + hw->mac.autotry_restart = true; + hw->mac.ops.setup_link(hw, speed, true); adapter->advertise = ((speed & IXGBE_LINK_SPEED_10GB_FULL) ? 4 : 0) | ((speed & IXGBE_LINK_SPEED_1GB_FULL) ? 2 : 0) | @@ -2578,7 +2578,7 @@ ixgbe_msix_link(void *arg) /* Check for fan failure */ if (adapter->feat_en & IXGBE_FEATURE_FAN_FAIL) { - ixgbe_check_fan_failure(adapter, eicr, TRUE); + ixgbe_check_fan_failure(adapter, eicr, true); IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1_BY_MAC(hw)); } @@ -2795,7 +2795,7 @@ ixgbe_setup_low_power_mode(if_ctx_t ctx) s32 error = 0; if (!hw->wol_enabled) - ixgbe_set_phy_power(hw, FALSE); + ixgbe_set_phy_power(hw, false); /* Limit power management flow to X550EM baseT */ if (hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T && @@ -2821,12 +2821,12 @@ ixgbe_setup_low_power_mode(if_ctx_t ctx) IXGBE_WUC_WKEN | IXGBE_WUC_PME_EN); /* X550EM baseT adapters need a special LPLU flow */ - hw->phy.reset_disable = TRUE; + hw->phy.reset_disable = true; ixgbe_if_stop(ctx); error = hw->phy.ops.enter_lplu(hw); if (error) device_printf(dev, "Error entering LPLU: %d\n", error); - hw->phy.reset_disable = FALSE; + hw->phy.reset_disable = false; } else { /* Just stop for other adapters */ ixgbe_if_stop(ctx); @@ -3127,7 +3127,7 @@ ixgbe_if_init(if_ctx_t ctx) IXGBE_WRITE_REG(hw, IXGBE_EITR(adapter->vector), IXGBE_LINK_ITR); /* Enable power to the phy. */ - ixgbe_set_phy_power(hw, TRUE); + ixgbe_set_phy_power(hw, true); /* Config/Enable Link */ ixgbe_config_link(ctx); @@ -3336,7 +3336,7 @@ ixgbe_config_delay_values(struct adapter *adapter) hw->fc.low_water[0] = IXGBE_BT2KB(tmp); hw->fc.pause_time = IXGBE_FC_PAUSE; - hw->fc.send_xon = TRUE; + hw->fc.send_xon = true; } /* ixgbe_config_delay_values */ /************************************************************************ @@ -3392,7 +3392,7 @@ ixgbe_if_multi_set(if_ctx_t ctx) if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) { update_ptr = (u8 *)mta; ixgbe_update_mc_addr_list(&adapter->hw, update_ptr, mcnt, - ixgbe_mc_array_itr, TRUE); + ixgbe_mc_array_itr, true); } } /* ixgbe_if_multi_set */ @@ -3455,7 +3455,7 @@ ixgbe_sfp_probe(if_ctx_t ctx) struct adapter *adapter = iflib_get_softc(ctx); struct ixgbe_hw *hw = &adapter->hw; device_t dev = iflib_get_dev(ctx); - bool result = FALSE; + bool result = false; if ((hw->phy.type == ixgbe_phy_nl) && (hw->phy.sfp_type == ixgbe_sfp_type_not_present)) { @@ -3463,7 +3463,7 @@ ixgbe_sfp_probe(if_ctx_t ctx) if (ret) goto out; ret = hw->phy.ops.reset(hw); - adapter->sfp_probe = FALSE; + adapter->sfp_probe = false; if (ret == IXGBE_ERR_SFP_NOT_SUPPORTED) { device_printf(dev, "Unsupported SFP+ module detected!"); device_printf(dev, @@ -3472,7 +3472,7 @@ ixgbe_sfp_probe(if_ctx_t ctx) } else device_printf(dev, "SFP+ module detected!\n"); /* We now have supported optics */ - result = TRUE; + result = true; } out: @@ -3554,7 +3554,7 @@ ixgbe_handle_msf(void *context) if ((!autoneg) && (hw->mac.ops.get_link_capabilities)) hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiate); if (hw->mac.ops.setup_link) - hw->mac.ops.setup_link(hw, autoneg, TRUE); + hw->mac.ops.setup_link(hw, autoneg, true); /* Adjust media types shown in ifconfig */ ifmedia_removeall(adapter->media); @@ -3596,7 +3596,7 @@ ixgbe_if_stop(if_ctx_t ctx) INIT_DEBUGOUT("ixgbe_if_stop: begin\n"); ixgbe_reset_hw(hw); - hw->adapter_stopped = FALSE; + hw->adapter_stopped = false; ixgbe_stop_adapter(hw); if (hw->mac.type == ixgbe_mac_82599EB) ixgbe_stop_mac_link_on_d3_82599(hw); @@ -3604,7 +3604,7 @@ ixgbe_if_stop(if_ctx_t ctx) ixgbe_disable_tx_laser(hw); /* Update the stack */ - adapter->link_up = FALSE; + adapter->link_up = false; ixgbe_if_update_admin_status(ctx); /* reprogram the RAR[0] in case user changed it. */ @@ -3627,12 +3627,12 @@ ixgbe_if_update_admin_status(if_ctx_t ctx) device_t dev = iflib_get_dev(ctx); if (adapter->link_up) { - if (adapter->link_active == FALSE) { + if (adapter->link_active == false) { if (bootverbose) device_printf(dev, "Link is up %d Gbps %s \n", ((adapter->link_speed == 128) ? 10 : 1), "Full Duplex"); - adapter->link_active = TRUE; + adapter->link_active = true; /* Update any Flow Control changes */ ixgbe_fc_enable(&adapter->hw); /* Update DMA coalescing config */ @@ -3644,11 +3644,11 @@ ixgbe_if_update_admin_status(if_ctx_t ctx) ixgbe_ping_all_vfs(adapter); } } else { /* Link down */ - if (adapter->link_active == TRUE) { + if (adapter->link_active == true) { if (bootverbose) device_printf(dev, "Link is Down\n"); iflib_link_state_change(ctx, LINK_STATE_DOWN, 0); - adapter->link_active = FALSE; + adapter->link_active = false; if (adapter->feat_en & IXGBE_FEATURE_SRIOV) ixgbe_ping_all_vfs(adapter); } @@ -3685,7 +3685,7 @@ ixgbe_config_dmac(struct adapter *adapter) if (dcfg->watchdog_timer ^ adapter->dmac || dcfg->link_speed ^ adapter->link_speed) { dcfg->watchdog_timer = adapter->dmac; - dcfg->fcoe_en = FALSE; + dcfg->fcoe_en = false; dcfg->link_speed = adapter->link_speed; dcfg->num_tcs = 1; @@ -4016,7 +4016,7 @@ ixgbe_set_flowcntl(struct adapter *adapter, int fc) } /* Don't autoneg if forcing a value */ - adapter->hw.fc.disable_fc_autoneg = TRUE; + adapter->hw.fc.disable_fc_autoneg = true; ixgbe_fc_enable(&adapter->hw); return (0); @@ -4115,7 +4115,7 @@ ixgbe_set_advertise(struct adapter *adapter, int advertise) ixgbe_link_speed speed = 0; ixgbe_link_speed link_caps = 0; s32 err = IXGBE_NOT_IMPLEMENTED; - bool negotiate = FALSE; + bool negotiate = false; /* Checks to validate new value */ if (adapter->advertise == advertise) /* no change */ @@ -4177,8 +4177,8 @@ ixgbe_set_advertise(struct adapter *adapter, int advertise) speed |= IXGBE_LINK_SPEED_10_FULL; } - hw->mac.autotry_restart = TRUE; - hw->mac.ops.setup_link(hw, speed, TRUE); + hw->mac.autotry_restart = true; + hw->mac.ops.setup_link(hw, speed, true); adapter->advertise = advertise; return (0); @@ -4201,7 +4201,7 @@ ixgbe_get_advertise(struct adapter *adapter) int speed; ixgbe_link_speed link_caps = 0; s32 err; - bool negotiate = FALSE; + bool negotiate = false; /* * Advertised speed means nothing unless it's copper or diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c index 301d3c0368ae..acebf0a65e12 100644 --- a/sys/dev/ixgbe/if_ixv.c +++ b/sys/dev/ixgbe/if_ixv.c @@ -195,7 +195,7 @@ TUNABLE_INT("hw.ixv.flow_control", &ixv_flow_control); * it can be a performance win in some workloads, but * in others it actually hurts, its off by default. */ -static int ixv_header_split = FALSE; +static int ixv_header_split = false; TUNABLE_INT("hw.ixv.hdr_split", &ixv_header_split); /* @@ -602,7 +602,7 @@ ixv_if_init(if_ctx_t ctx) int error = 0; INIT_DEBUGOUT("ixv_if_init: begin"); - hw->adapter_stopped = FALSE; + hw->adapter_stopped = false; hw->mac.ops.stop_adapter(hw); /* reprogram the RAR[0] in case user changed it. */ @@ -649,7 +649,7 @@ ixv_if_init(if_ctx_t ctx) /* Config/Enable Link */ hw->mac.ops.check_link(hw, &adapter->link_speed, &adapter->link_up, - FALSE); + false); /* And now turn on interrupts */ ixv_if_enable_intr(ctx); @@ -849,7 +849,7 @@ ixv_if_multi_set(if_ctx_t ctx) update_ptr = mta; adapter->hw.mac.ops.update_mc_addr_list(&adapter->hw, update_ptr, mcnt, - ixv_mc_array_itr, TRUE); + ixv_mc_array_itr, true); } /* ixv_if_multi_set */ /************************************************************************ @@ -903,33 +903,33 @@ ixv_if_update_admin_status(if_ctx_t ctx) device_t dev = iflib_get_dev(ctx); s32 status; - adapter->hw.mac.get_link_status = TRUE; + adapter->hw.mac.get_link_status = true; status = ixgbe_check_link(&adapter->hw, &adapter->link_speed, - &adapter->link_up, FALSE); + &adapter->link_up, false); - if (status != IXGBE_SUCCESS && adapter->hw.adapter_stopped == FALSE) { + if (status != IXGBE_SUCCESS && adapter->hw.adapter_stopped == false) { /* Mailbox's Clear To Send status is lost or timeout occurred. * We need reinitialization. */ iflib_get_ifp(ctx)->if_init(ctx); } if (adapter->link_up) { - if (adapter->link_active == FALSE) { + if (adapter->link_active == false) { if (bootverbose) device_printf(dev, "Link is up %d Gbps %s \n", ((adapter->link_speed == 128) ? 10 : 1), "Full Duplex"); - adapter->link_active = TRUE; + adapter->link_active = true; iflib_link_state_change(ctx, LINK_STATE_UP, IF_Gbps(10)); } } else { /* Link down */ - if (adapter->link_active == TRUE) { + if (adapter->link_active == true) { if (bootverbose) device_printf(dev, "Link is Down\n"); iflib_link_state_change(ctx, LINK_STATE_DOWN, 0); - adapter->link_active = FALSE; + adapter->link_active = false; } } @@ -955,11 +955,11 @@ ixv_if_stop(if_ctx_t ctx) ixv_if_disable_intr(ctx); hw->mac.ops.reset_hw(hw); - adapter->hw.adapter_stopped = FALSE; + adapter->hw.adapter_stopped = false; hw->mac.ops.stop_adapter(hw); /* Update the stack */ - adapter->link_up = FALSE; + adapter->link_up = false; ixv_if_update_admin_status(ctx); /* reprogram the RAR[0] in case user changed it. */ @@ -1510,7 +1510,7 @@ ixv_setup_vlan_support(if_ctx_t ctx) * Let Rx path know that it needs to store VLAN tag * as part of extra mbuf info. */ - adapter->rx_queues[i].rxr.vtag_strip = TRUE; + adapter->rx_queues[i].rxr.vtag_strip = true; } } @@ -1540,7 +1540,7 @@ ixv_setup_vlan_support(if_ctx_t ctx) continue; vid = (i * 32) + j; /* Call the shared code mailbox routine */ - while (hw->mac.ops.set_vfta(hw, vid, 0, TRUE, FALSE)) { + while (hw->mac.ops.set_vfta(hw, vid, 0, true, false)) { if (++retry > 5) break; } diff --git a/sys/dev/ixgbe/if_sriov.c b/sys/dev/ixgbe/if_sriov.c index 9a7d73a69d2d..3cc4d788ecd4 100644 --- a/sys/dev/ixgbe/if_sriov.c +++ b/sys/dev/ixgbe/if_sriov.c @@ -62,11 +62,11 @@ ixgbe_define_iov_schemas(device_t dev, int *error) vf_schema = pci_iov_schema_alloc_node(); pci_iov_schema_add_unicast_mac(vf_schema, "mac-addr", 0, NULL); pci_iov_schema_add_bool(vf_schema, "mac-anti-spoof", - IOV_SCHEMA_HASDEFAULT, TRUE); + IOV_SCHEMA_HASDEFAULT, true); pci_iov_schema_add_bool(vf_schema, "allow-set-mac", - IOV_SCHEMA_HASDEFAULT, FALSE); + IOV_SCHEMA_HASDEFAULT, false); pci_iov_schema_add_bool(vf_schema, "allow-promisc", - IOV_SCHEMA_HASDEFAULT, FALSE); + IOV_SCHEMA_HASDEFAULT, false); *error = pci_iov_attach(dev, pf_schema, vf_schema); if (*error != 0) { device_printf(dev, @@ -266,7 +266,7 @@ ixgbe_vf_frame_size_compatible(struct adapter *adapter, struct ixgbe_vf *vf) * frames on PFs and VFs. */ if (adapter->hw.mac.type != ixgbe_mac_82599EB) - return (TRUE); + return (true); switch (vf->api_ver) { case IXGBE_API_VER_1_0: @@ -277,9 +277,9 @@ ixgbe_vf_frame_size_compatible(struct adapter *adapter, struct ixgbe_vf *vf) */ if (adapter->max_frame_size > ETHER_MAX_LEN || vf->maximum_frame_size > ETHER_MAX_LEN) - return (FALSE); + return (false); - return (TRUE); + return (true); break; case IXGBE_API_VER_1_1: @@ -289,16 +289,16 @@ ixgbe_vf_frame_size_compatible(struct adapter *adapter, struct ixgbe_vf *vf) * jumbo frames. */ if (vf->maximum_frame_size <= ETHER_MAX_LEN) - return (TRUE); + return (true); /* * Jumbo frames only work with VFs if the PF is also using jumbo * frames. */ if (adapter->max_frame_size <= ETHER_MAX_LEN) - return (TRUE); + return (true); - return (FALSE); + return (false); } } /* ixgbe_vf_frame_size_compatible */ @@ -362,7 +362,7 @@ ixgbe_vf_reset_msg(struct adapter *adapter, struct ixgbe_vf *vf, uint32_t *msg) if (ixgbe_validate_mac_addr(vf->ether_addr) == 0) { ixgbe_set_rar(&adapter->hw, vf->rar_index, vf->ether_addr, - vf->pool, TRUE); + vf->pool, true); ack = IXGBE_VT_MSGTYPE_ACK; } else ack = IXGBE_VT_MSGTYPE_NACK; @@ -400,7 +400,7 @@ ixgbe_vf_set_mac(struct adapter *adapter, struct ixgbe_vf *vf, uint32_t *msg) bcopy(mac, vf->ether_addr, ETHER_ADDR_LEN); ixgbe_set_rar(&adapter->hw, vf->rar_index, vf->ether_addr, vf->pool, - TRUE); + true); ixgbe_send_vf_ack(adapter, vf, msg[0]); } /* ixgbe_vf_set_mac */ @@ -764,7 +764,7 @@ ixgbe_init_vf(struct adapter *adapter, struct ixgbe_vf *vf) if (ixgbe_validate_mac_addr(vf->ether_addr) == 0) { ixgbe_set_rar(&adapter->hw, vf->rar_index, - vf->ether_addr, vf->pool, TRUE); + vf->ether_addr, vf->pool, true); } ixgbe_vf_enable_transmit(adapter, vf); diff --git a/sys/dev/ixgbe/ix_txrx.c b/sys/dev/ixgbe/ix_txrx.c index fe38919fc594..2cecf79b3422 100644 --- a/sys/dev/ixgbe/ix_txrx.c +++ b/sys/dev/ixgbe/ix_txrx.c @@ -88,7 +88,7 @@ ixgbe_tx_ctx_setup(struct ixgbe_adv_tx_context_desc *TXD, if_pkt_info_t pi) uint32_t olinfo_status, mss_l4len_idx, pktlen, offload; u8 ehdrlen; - offload = TRUE; + offload = true; olinfo_status = mss_l4len_idx = vlan_macip_lens = type_tucmd_mlhl = 0; /* VLAN MACLEN IPLEN */ vlan_macip_lens |= (htole16(pi->ipi_vtag) << IXGBE_ADVTXD_VLAN_SHIFT); @@ -126,7 +126,7 @@ ixgbe_tx_ctx_setup(struct ixgbe_adv_tx_context_desc *TXD, if_pkt_info_t pi) } else if (pi->ipi_flags & IPI_TX_IPV6) type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV6; else - offload = FALSE; + offload = false; vlan_macip_lens |= pi->ipi_ip_hlen; @@ -135,22 +135,22 @@ ixgbe_tx_ctx_setup(struct ixgbe_adv_tx_context_desc *TXD, if_pkt_info_t pi) if (pi->ipi_csum_flags & (CSUM_IP_TCP | CSUM_IP6_TCP | CSUM_TSO)) type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_TCP; else - offload = FALSE; + offload = false; break; case IPPROTO_UDP: if (pi->ipi_csum_flags & (CSUM_IP_UDP | CSUM_IP6_UDP)) type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_UDP; else - offload = FALSE; + offload = false; break; case IPPROTO_SCTP: if (pi->ipi_csum_flags & (CSUM_IP_SCTP | CSUM_IP6_SCTP)) type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_SCTP; else - offload = FALSE; + offload = false; break; default: - offload = FALSE; + offload = false; break; } /* Insert L4 checksum into data descriptors */ diff --git a/sys/dev/ixgbe/ixgbe.h b/sys/dev/ixgbe/ixgbe.h index 31d5cc41c066..93bfff427a27 100644 --- a/sys/dev/ixgbe/ixgbe.h +++ b/sys/dev/ixgbe/ixgbe.h @@ -569,11 +569,11 @@ drbr_needs_enqueue(struct ifnet *ifp, struct buf_ring *br) static inline bool ixv_check_ether_addr(u8 *addr) { - bool status = TRUE; + bool status = true; if ((addr[0] == 0 && addr[1]== 0 && addr[2] == 0 && addr[3] == 0 && addr[4]== 0 && addr[5] == 0)) - status = FALSE; + status = false; return (status); } diff --git a/sys/dev/ixgbe/ixgbe_82598.c b/sys/dev/ixgbe/ixgbe_82598.c index 7c821aea2d03..885dfbf869bc 100644 --- a/sys/dev/ixgbe/ixgbe_82598.c +++ b/sys/dev/ixgbe/ixgbe_82598.c @@ -316,17 +316,17 @@ static s32 ixgbe_get_link_capabilities_82598(struct ixgbe_hw *hw, switch (autoc & IXGBE_AUTOC_LMS_MASK) { case IXGBE_AUTOC_LMS_1G_LINK_NO_AN: *speed = IXGBE_LINK_SPEED_1GB_FULL; - *autoneg = FALSE; + *autoneg = false; break; case IXGBE_AUTOC_LMS_10G_LINK_NO_AN: *speed = IXGBE_LINK_SPEED_10GB_FULL; - *autoneg = FALSE; + *autoneg = false; break; case IXGBE_AUTOC_LMS_1G_AN: *speed = IXGBE_LINK_SPEED_1GB_FULL; - *autoneg = TRUE; + *autoneg = true; break; case IXGBE_AUTOC_LMS_KX4_AN: @@ -336,7 +336,7 @@ static s32 ixgbe_get_link_capabilities_82598(struct ixgbe_hw *hw, *speed |= IXGBE_LINK_SPEED_10GB_FULL; if (autoc & IXGBE_AUTOC_KX_SUPP) *speed |= IXGBE_LINK_SPEED_1GB_FULL; - *autoneg = TRUE; + *autoneg = true; break; default: @@ -443,7 +443,7 @@ s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw) * so if it's on turn it off once we know link_speed. For * more details see 82598 Specification update. */ - hw->mac.ops.check_link(hw, &link_speed, &link_up, FALSE); + hw->mac.ops.check_link(hw, &link_speed, &link_up, false); if (link_up && link_speed == IXGBE_LINK_SPEED_1GB_FULL) { switch (hw->fc.requested_mode) { case ixgbe_fc_full: @@ -550,7 +550,7 @@ out: /** * ixgbe_start_mac_link_82598 - Configures MAC link settings * @hw: pointer to hardware structure - * @autoneg_wait_to_complete: TRUE when waiting for completion is needed + * @autoneg_wait_to_complete: true when waiting for completion is needed * * Configures link settings based on values in the ixgbe_hw struct. * Restarts the link. Performs autonegotiation if needed. @@ -635,7 +635,7 @@ static s32 ixgbe_validate_link_ready(struct ixgbe_hw *hw) * ixgbe_check_mac_link_82598 - Get link/speed status * @hw: pointer to hardware structure * @speed: pointer to link speed - * @link_up: TRUE is link is up, FALSE otherwise + * @link_up: true is link is up, false otherwise * @link_up_wait_to_complete: bool used to wait for link up or not * * Reads the links register to determine if link is up and the current speed @@ -665,10 +665,10 @@ static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, for (i = 0; i < hw->mac.max_link_up_time; i++) { if ((link_reg & 1) && ((adapt_comp_reg & 1) == 0)) { - *link_up = TRUE; + *link_up = true; break; } else { - *link_up = FALSE; + *link_up = false; } msec_delay(100); hw->phy.ops.read_reg(hw, 0xC79F, @@ -680,12 +680,12 @@ static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, } } else { if ((link_reg & 1) && ((adapt_comp_reg & 1) == 0)) - *link_up = TRUE; + *link_up = true; else - *link_up = FALSE; + *link_up = false; } - if (*link_up == FALSE) + if (*link_up == false) goto out; } @@ -693,19 +693,19 @@ static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, if (link_up_wait_to_complete) { for (i = 0; i < hw->mac.max_link_up_time; i++) { if (links_reg & IXGBE_LINKS_UP) { - *link_up = TRUE; + *link_up = true; break; } else { - *link_up = FALSE; + *link_up = false; } msec_delay(100); links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS); } } else { if (links_reg & IXGBE_LINKS_UP) - *link_up = TRUE; + *link_up = true; else - *link_up = FALSE; + *link_up = false; } if (links_reg & IXGBE_LINKS_SPEED) @@ -713,9 +713,9 @@ static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, else *speed = IXGBE_LINK_SPEED_1GB_FULL; - if ((hw->device_id == IXGBE_DEV_ID_82598AT2) && (*link_up == TRUE) && + if ((hw->device_id == IXGBE_DEV_ID_82598AT2) && (*link_up == true) && (ixgbe_validate_link_ready(hw) != IXGBE_SUCCESS)) - *link_up = FALSE; + *link_up = false; out: return IXGBE_SUCCESS; @@ -725,7 +725,7 @@ out: * ixgbe_setup_mac_link_82598 - Set MAC link speed * @hw: pointer to hardware structure * @speed: new link speed - * @autoneg_wait_to_complete: TRUE when waiting for completion is needed + * @autoneg_wait_to_complete: true when waiting for completion is needed * * Set the link speed in the AUTOC register and restarts link. **/ @@ -733,7 +733,7 @@ static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw, ixgbe_link_speed speed, bool autoneg_wait_to_complete) { - bool autoneg = FALSE; + bool autoneg = false; s32 status = IXGBE_SUCCESS; ixgbe_link_speed link_capabilities = IXGBE_LINK_SPEED_UNKNOWN; u32 curr_autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); @@ -779,7 +779,7 @@ static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw, * ixgbe_setup_copper_link_82598 - Set the PHY autoneg advertised field * @hw: pointer to hardware structure * @speed: new link speed - * @autoneg_wait_to_complete: TRUE if waiting is needed to complete + * @autoneg_wait_to_complete: true if waiting is needed to complete * * Sets the link speed in the AUTOC register in the MAC and restarts link. **/ @@ -859,7 +859,7 @@ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw) } /* Reset PHY */ - if (hw->phy.reset_disable == FALSE) { + if (hw->phy.reset_disable == false) { /* PHY ops must be identified and initialized prior to reset */ /* Init PHY and function pointers, perform SFP setup */ @@ -915,9 +915,9 @@ mac_reset_top: * AUTOC value since the reset operation sets back to deaults. */ autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); - if (hw->mac.orig_link_settings_stored == FALSE) { + if (hw->mac.orig_link_settings_stored == false) { hw->mac.orig_autoc = autoc; - hw->mac.orig_link_settings_stored = TRUE; + hw->mac.orig_link_settings_stored = true; } else if (autoc != hw->mac.orig_autoc) { IXGBE_WRITE_REG(hw, IXGBE_AUTOC, hw->mac.orig_autoc); } diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c index 1f81f6109f1b..d682dfbc9ab8 100644 --- a/sys/dev/ixgbe/ixgbe_82599.c +++ b/sys/dev/ixgbe/ixgbe_82599.c @@ -124,7 +124,7 @@ s32 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw) if (hw->device_id == IXGBE_DEV_ID_82599_QSFP_SF_QP) { /* Store flag indicating I2C bus access control unit. */ - hw->phy.qsfp_shared_i2c_bus = TRUE; + hw->phy.qsfp_shared_i2c_bus = true; /* Initialize access to QSFP+ I2C bus */ esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); @@ -215,7 +215,7 @@ s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw) /* Restart DSP and set SFI mode */ ret_val = hw->mac.ops.prot_autoc_write(hw, hw->mac.orig_autoc | IXGBE_AUTOC_LMS_10G_SERIAL, - FALSE); + false); if (ret_val) { DEBUGOUT("sfp module setup not complete\n"); @@ -252,7 +252,7 @@ s32 prot_autoc_read_82599(struct ixgbe_hw *hw, bool *locked, u32 *reg_val) { s32 ret_val; - *locked = FALSE; + *locked = false; /* If LESM is on then we need to hold the SW/FW semaphore. */ if (ixgbe_verify_lesm_fw_enabled_82599(hw)) { ret_val = hw->mac.ops.acquire_swfw_sync(hw, @@ -260,7 +260,7 @@ s32 prot_autoc_read_82599(struct ixgbe_hw *hw, bool *locked, u32 *reg_val) if (ret_val != IXGBE_SUCCESS) return IXGBE_ERR_SWFW_SYNC; - *locked = TRUE; + *locked = true; } *reg_val = IXGBE_READ_REG(hw, IXGBE_AUTOC); @@ -295,7 +295,7 @@ s32 prot_autoc_write_82599(struct ixgbe_hw *hw, u32 autoc, bool locked) if (ret_val != IXGBE_SUCCESS) return IXGBE_ERR_SWFW_SYNC; - locked = TRUE; + locked = true; } IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc); @@ -409,7 +409,7 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw *hw) * ixgbe_get_link_capabilities_82599 - Determines link capabilities * @hw: pointer to hardware structure * @speed: pointer to link speed - * @autoneg: TRUE when autoneg or autotry is enabled + * @autoneg: true when autoneg or autotry is enabled * * Determines the link capabilities by reading the AUTOC register. **/ @@ -431,7 +431,7 @@ s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 || hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1) { *speed = IXGBE_LINK_SPEED_1GB_FULL; - *autoneg = TRUE; + *autoneg = true; goto out; } @@ -448,22 +448,22 @@ s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, switch (autoc & IXGBE_AUTOC_LMS_MASK) { case IXGBE_AUTOC_LMS_1G_LINK_NO_AN: *speed = IXGBE_LINK_SPEED_1GB_FULL; - *autoneg = FALSE; + *autoneg = false; break; case IXGBE_AUTOC_LMS_10G_LINK_NO_AN: *speed = IXGBE_LINK_SPEED_10GB_FULL; - *autoneg = FALSE; + *autoneg = false; break; case IXGBE_AUTOC_LMS_1G_AN: *speed = IXGBE_LINK_SPEED_1GB_FULL; - *autoneg = TRUE; + *autoneg = true; break; case IXGBE_AUTOC_LMS_10G_SERIAL: *speed = IXGBE_LINK_SPEED_10GB_FULL; - *autoneg = FALSE; + *autoneg = false; break; case IXGBE_AUTOC_LMS_KX4_KX_KR: @@ -475,7 +475,7 @@ s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, *speed |= IXGBE_LINK_SPEED_10GB_FULL; if (autoc & IXGBE_AUTOC_KX_SUPP) *speed |= IXGBE_LINK_SPEED_1GB_FULL; - *autoneg = TRUE; + *autoneg = true; break; case IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII: @@ -486,12 +486,12 @@ s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, *speed |= IXGBE_LINK_SPEED_10GB_FULL; if (autoc & IXGBE_AUTOC_KX_SUPP) *speed |= IXGBE_LINK_SPEED_1GB_FULL; - *autoneg = TRUE; + *autoneg = true; break; case IXGBE_AUTOC_LMS_SGMII_1G_100M: *speed = IXGBE_LINK_SPEED_1GB_FULL | IXGBE_LINK_SPEED_100_FULL; - *autoneg = FALSE; + *autoneg = false; break; default: @@ -508,9 +508,9 @@ s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, * Limited autoneg is enabled at 1G */ if (hw->phy.media_type == ixgbe_media_type_fiber_qsfp) - *autoneg = FALSE; + *autoneg = false; else - *autoneg = TRUE; + *autoneg = true; } out: @@ -568,7 +568,7 @@ enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw) break; case IXGBE_DEV_ID_82599_BYPASS: media_type = ixgbe_media_type_fiber_fixed; - hw->phy.multispeed_fiber = TRUE; + hw->phy.multispeed_fiber = true; break; default: media_type = ixgbe_media_type_unknown; @@ -604,7 +604,7 @@ void ixgbe_stop_mac_link_on_d3_82599(struct ixgbe_hw *hw) /** * ixgbe_start_mac_link_82599 - Setup MAC link settings * @hw: pointer to hardware structure - * @autoneg_wait_to_complete: TRUE when waiting for completion is needed + * @autoneg_wait_to_complete: true when waiting for completion is needed * * Configures link settings based on values in the ixgbe_hw struct. * Restarts the link. Performs autonegotiation if needed. @@ -616,7 +616,7 @@ s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw, u32 links_reg; u32 i; s32 status = IXGBE_SUCCESS; - bool got_lock = FALSE; + bool got_lock = false; DEBUGFUNC("ixgbe_start_mac_link_82599"); @@ -630,7 +630,7 @@ s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw, if (status != IXGBE_SUCCESS) goto out; - got_lock = TRUE; + got_lock = true; } /* Restart link */ @@ -716,11 +716,11 @@ void ixgbe_enable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) * @hw: pointer to hardware structure * * When the driver changes the link speeds that it can support, - * it sets autotry_restart to TRUE to indicate that we need to + * it sets autotry_restart to true to indicate that we need to * initiate a new autotry session with the link partner. To do * so, we set the speed then disable and re-enable the Tx laser, to * alert the link partner that it also needs to restart autotry on its - * end. This is consistent with TRUE clause 37 autoneg, which also + * end. This is consistent with true clause 37 autoneg, which also * involves a loss of signal. **/ void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) *** 1760 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F2C016AC539; Tue, 14 Sep 2021 00:41:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l032fQSz3PSr; Tue, 14 Sep 2021 00:41:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CF7A0112D1; Tue, 14 Sep 2021 00:41:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0fL4k039920; Tue, 14 Sep 2021 00:41:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0fL2c039919; Tue, 14 Sep 2021 00:41:21 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:21 GMT Message-Id: <202109140041.18E0fL2c039919@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 1fe6bec929a1 - stable/13 - ixgbe: replace an operation in X550 setup MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1fe6bec929a10995186d15da460767703fba5b98 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:24 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=1fe6bec929a10995186d15da460767703fba5b98 commit 1fe6bec929a10995186d15da460767703fba5b98 Author: Xiaoyun Li AuthorDate: 2018-09-17 09:28:11 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:37:19 +0000 ixgbe: replace an operation in X550 setup Replace "=" operation with "|=" operation to only set the intended register bits. Signed-off-by: Xiaoyun Li Acked-by: Qi Zhang Approved by: imp Obtained from: DPDK (1b665ccd9cd73499e934b807bec2fd77193912ef) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit c85b6f2901e7804105ca1d6d41cc5eb9a60474b8) --- sys/dev/ixgbe/ixgbe_x550.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index bcfbe14b30d2..b5f1bc4f6ef8 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -2802,9 +2802,9 @@ s32 ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, (IXGBE_CS4227_EDC_MODE_SR << 1)); if (setup_linear) - reg_phy_ext = (IXGBE_CS4227_EDC_MODE_CX1 << 1) | 0x1; + reg_phy_ext |= (IXGBE_CS4227_EDC_MODE_CX1 << 1) | 0x1; else - reg_phy_ext = (IXGBE_CS4227_EDC_MODE_SR << 1) | 0x1; + reg_phy_ext |= (IXGBE_CS4227_EDC_MODE_SR << 1) | 0x1; ret_val = hw->phy.ops.write_reg(hw, reg_slice, IXGBE_MDIO_ZERO_DEV_TYPE, reg_phy_ext); From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FCBA6AC53B; Tue, 14 Sep 2021 00:41:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l0622g0z3PcC; Tue, 14 Sep 2021 00:41:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B31710E65; Tue, 14 Sep 2021 00:41:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0fOZU039974; Tue, 14 Sep 2021 00:41:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0fOvO039973; Tue, 14 Sep 2021 00:41:24 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:24 GMT Message-Id: <202109140041.18E0fOvO039973@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 329dce3d69f3 - stable/13 - ixgbe: Update copyright to 2020 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 329dce3d69f3b9dd8eaad6bc281e640c8e78da71 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:27 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=329dce3d69f3b9dd8eaad6bc281e640c8e78da71 commit 329dce3d69f3b9dd8eaad6bc281e640c8e78da71 Author: Kevin Bowling AuthorDate: 2021-09-07 03:11:44 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:37:24 +0000 ixgbe: Update copyright to 2020 Synced to the ixgbe shared code with DPDK shared code which has local fixes on top of "not-released-cid-ixgbe.2020.06.09.tar.gz" Approved by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 8455e365f77f5b66ac9521dbcd690f79345ce147) --- sys/dev/ixgbe/ixgbe_82598.c | 2 +- sys/dev/ixgbe/ixgbe_82598.h | 2 +- sys/dev/ixgbe/ixgbe_82599.c | 2 +- sys/dev/ixgbe/ixgbe_82599.h | 2 +- sys/dev/ixgbe/ixgbe_api.c | 2 +- sys/dev/ixgbe/ixgbe_api.h | 2 +- sys/dev/ixgbe/ixgbe_bypass.h | 2 +- sys/dev/ixgbe/ixgbe_common.c | 2 +- sys/dev/ixgbe/ixgbe_common.h | 2 +- sys/dev/ixgbe/ixgbe_dcb.c | 2 +- sys/dev/ixgbe/ixgbe_dcb.h | 2 +- sys/dev/ixgbe/ixgbe_dcb_82598.c | 2 +- sys/dev/ixgbe/ixgbe_dcb_82598.h | 2 +- sys/dev/ixgbe/ixgbe_dcb_82599.c | 2 +- sys/dev/ixgbe/ixgbe_dcb_82599.h | 2 +- sys/dev/ixgbe/ixgbe_fdir.h | 2 +- sys/dev/ixgbe/ixgbe_features.h | 2 +- sys/dev/ixgbe/ixgbe_mbx.c | 2 +- sys/dev/ixgbe/ixgbe_mbx.h | 2 +- sys/dev/ixgbe/ixgbe_osdep.c | 2 +- sys/dev/ixgbe/ixgbe_osdep.h | 2 +- sys/dev/ixgbe/ixgbe_phy.c | 2 +- sys/dev/ixgbe/ixgbe_phy.h | 2 +- sys/dev/ixgbe/ixgbe_rss.h | 2 +- sys/dev/ixgbe/ixgbe_sriov.h | 2 +- sys/dev/ixgbe/ixgbe_type.h | 2 +- sys/dev/ixgbe/ixgbe_vf.c | 2 +- sys/dev/ixgbe/ixgbe_vf.h | 2 +- sys/dev/ixgbe/ixgbe_x540.c | 2 +- sys/dev/ixgbe/ixgbe_x540.h | 2 +- sys/dev/ixgbe/ixgbe_x550.c | 2 +- sys/dev/ixgbe/ixgbe_x550.h | 2 +- 32 files changed, 32 insertions(+), 32 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_82598.c b/sys/dev/ixgbe/ixgbe_82598.c index 885dfbf869bc..c1d657afb6f5 100644 --- a/sys/dev/ixgbe/ixgbe_82598.c +++ b/sys/dev/ixgbe/ixgbe_82598.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_82598.h b/sys/dev/ixgbe/ixgbe_82598.h index dc69c026423c..09b8c6054109 100644 --- a/sys/dev/ixgbe/ixgbe_82598.h +++ b/sys/dev/ixgbe/ixgbe_82598.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c index d682dfbc9ab8..f692c19dc979 100644 --- a/sys/dev/ixgbe/ixgbe_82599.c +++ b/sys/dev/ixgbe/ixgbe_82599.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_82599.h b/sys/dev/ixgbe/ixgbe_82599.h index ee9a33667e62..2e9a0407a610 100644 --- a/sys/dev/ixgbe/ixgbe_82599.h +++ b/sys/dev/ixgbe/ixgbe_82599.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_api.c b/sys/dev/ixgbe/ixgbe_api.c index 2ae2db78d0ed..5bb5d196e2c0 100644 --- a/sys/dev/ixgbe/ixgbe_api.c +++ b/sys/dev/ixgbe/ixgbe_api.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_api.h b/sys/dev/ixgbe/ixgbe_api.h index aabe573127f3..c70f27c6aa2c 100644 --- a/sys/dev/ixgbe/ixgbe_api.h +++ b/sys/dev/ixgbe/ixgbe_api.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_bypass.h b/sys/dev/ixgbe/ixgbe_bypass.h index 9a8d6d259cae..42a8eeb72e71 100644 --- a/sys/dev/ixgbe/ixgbe_bypass.h +++ b/sys/dev/ixgbe/ixgbe_bypass.h @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index be631552babe..6a86445c80e5 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_common.h b/sys/dev/ixgbe/ixgbe_common.h index af0db6e4c7dd..b072770acafa 100644 --- a/sys/dev/ixgbe/ixgbe_common.h +++ b/sys/dev/ixgbe/ixgbe_common.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_dcb.c b/sys/dev/ixgbe/ixgbe_dcb.c index d0ae965bc6ac..5e1f5e44b379 100644 --- a/sys/dev/ixgbe/ixgbe_dcb.c +++ b/sys/dev/ixgbe/ixgbe_dcb.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_dcb.h b/sys/dev/ixgbe/ixgbe_dcb.h index 92baad807c30..7dfe8547112f 100644 --- a/sys/dev/ixgbe/ixgbe_dcb.h +++ b/sys/dev/ixgbe/ixgbe_dcb.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_dcb_82598.c b/sys/dev/ixgbe/ixgbe_dcb_82598.c index 20a350716289..eb39bfb38b57 100644 --- a/sys/dev/ixgbe/ixgbe_dcb_82598.c +++ b/sys/dev/ixgbe/ixgbe_dcb_82598.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_dcb_82598.h b/sys/dev/ixgbe/ixgbe_dcb_82598.h index d16471bc395a..74cf2760cc6d 100644 --- a/sys/dev/ixgbe/ixgbe_dcb_82598.h +++ b/sys/dev/ixgbe/ixgbe_dcb_82598.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_dcb_82599.c b/sys/dev/ixgbe/ixgbe_dcb_82599.c index c5fc42e23649..591c705aba08 100644 --- a/sys/dev/ixgbe/ixgbe_dcb_82599.c +++ b/sys/dev/ixgbe/ixgbe_dcb_82599.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_dcb_82599.h b/sys/dev/ixgbe/ixgbe_dcb_82599.h index faa2ac00f9d3..892a384b4c19 100644 --- a/sys/dev/ixgbe/ixgbe_dcb_82599.h +++ b/sys/dev/ixgbe/ixgbe_dcb_82599.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_fdir.h b/sys/dev/ixgbe/ixgbe_fdir.h index f5e1593072a5..5baafa458470 100644 --- a/sys/dev/ixgbe/ixgbe_fdir.h +++ b/sys/dev/ixgbe/ixgbe_fdir.h @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_features.h b/sys/dev/ixgbe/ixgbe_features.h index bb05885497dd..a9b3c8e41e6b 100644 --- a/sys/dev/ixgbe/ixgbe_features.h +++ b/sys/dev/ixgbe/ixgbe_features.h @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_mbx.c b/sys/dev/ixgbe/ixgbe_mbx.c index 26e7e5deaf05..385b8e5354f2 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.c +++ b/sys/dev/ixgbe/ixgbe_mbx.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_mbx.h b/sys/dev/ixgbe/ixgbe_mbx.h index 44ccc071f311..9b3deb28f149 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.h +++ b/sys/dev/ixgbe/ixgbe_mbx.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_osdep.c b/sys/dev/ixgbe/ixgbe_osdep.c index e45531ea8c3f..61617b69ff04 100644 --- a/sys/dev/ixgbe/ixgbe_osdep.c +++ b/sys/dev/ixgbe/ixgbe_osdep.c @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_osdep.h b/sys/dev/ixgbe/ixgbe_osdep.h index 281c221b59f0..b7eaa788c99e 100644 --- a/sys/dev/ixgbe/ixgbe_osdep.h +++ b/sys/dev/ixgbe/ixgbe_osdep.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_phy.c b/sys/dev/ixgbe/ixgbe_phy.c index 28930ca3267d..3868ed4fc0ea 100644 --- a/sys/dev/ixgbe/ixgbe_phy.c +++ b/sys/dev/ixgbe/ixgbe_phy.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_phy.h b/sys/dev/ixgbe/ixgbe_phy.h index ea0cd4fca196..9fd3f6d2163e 100644 --- a/sys/dev/ixgbe/ixgbe_phy.h +++ b/sys/dev/ixgbe/ixgbe_phy.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_rss.h b/sys/dev/ixgbe/ixgbe_rss.h index 7e7620be63f4..7eda43ec1609 100644 --- a/sys/dev/ixgbe/ixgbe_rss.h +++ b/sys/dev/ixgbe/ixgbe_rss.h @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_sriov.h b/sys/dev/ixgbe/ixgbe_sriov.h index 36ca7cacc853..f80d5e9dacf9 100644 --- a/sys/dev/ixgbe/ixgbe_sriov.h +++ b/sys/dev/ixgbe/ixgbe_sriov.h @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h index c3c29dbdba52..a538af5d3569 100644 --- a/sys/dev/ixgbe/ixgbe_type.h +++ b/sys/dev/ixgbe/ixgbe_type.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_vf.c b/sys/dev/ixgbe/ixgbe_vf.c index a125bcbb8386..f01fd99eb4c0 100644 --- a/sys/dev/ixgbe/ixgbe_vf.c +++ b/sys/dev/ixgbe/ixgbe_vf.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_vf.h b/sys/dev/ixgbe/ixgbe_vf.h index cdc59704dcaf..5cdb241ec2aa 100644 --- a/sys/dev/ixgbe/ixgbe_vf.h +++ b/sys/dev/ixgbe/ixgbe_vf.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_x540.c b/sys/dev/ixgbe/ixgbe_x540.c index db2d90e1230e..ace1ec8a33d3 100644 --- a/sys/dev/ixgbe/ixgbe_x540.c +++ b/sys/dev/ixgbe/ixgbe_x540.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_x540.h b/sys/dev/ixgbe/ixgbe_x540.h index 6f630602567b..e48ef52f576c 100644 --- a/sys/dev/ixgbe/ixgbe_x540.h +++ b/sys/dev/ixgbe/ixgbe_x540.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index b5f1bc4f6ef8..df19c4c65201 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_x550.h b/sys/dev/ixgbe/ixgbe_x550.h index ac2de750cfb7..7a24e50e1b5a 100644 --- a/sys/dev/ixgbe/ixgbe_x550.h +++ b/sys/dev/ixgbe/ixgbe_x550.h @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 271206ABFE2; Tue, 14 Sep 2021 00:41:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l054myRz3PWF; Tue, 14 Sep 2021 00:41:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 07F88112D3; Tue, 14 Sep 2021 00:41:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0fMVF039944; Tue, 14 Sep 2021 00:41:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0fMPx039943; Tue, 14 Sep 2021 00:41:22 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:22 GMT Message-Id: <202109140041.18E0fMPx039943@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 3d6eccd7211a - stable/13 - ixgbe: remove dead code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 3d6eccd7211ab9d8258286806fbad36984fcd272 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:27 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=3d6eccd7211ab9d8258286806fbad36984fcd272 commit 3d6eccd7211ab9d8258286806fbad36984fcd272 Author: Ferruh Yigit AuthorDate: 2020-06-30 14:45:54 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:37:22 +0000 ixgbe: remove dead code The question around getting rid of the assignments seems lived long enough, if they are not needed until now, we can drop them. Signed-off-by: Ferruh Yigit Acked-by: Qi Zhang Approved by: imp Obtained from: DPDK (a6395d471e14e5a7432875dad8fb3533238c5167) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 0b487fb4547ad1a939be0d523e555557c94b7cd1) --- sys/dev/ixgbe/ixgbe_dcb_82598.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_dcb_82598.c b/sys/dev/ixgbe/ixgbe_dcb_82598.c index 37744462bc07..20a350716289 100644 --- a/sys/dev/ixgbe/ixgbe_dcb_82598.c +++ b/sys/dev/ixgbe/ixgbe_dcb_82598.c @@ -67,14 +67,6 @@ s32 ixgbe_dcb_get_tc_stats_82598(struct ixgbe_hw *hw, stats->qprc[tc] += IXGBE_READ_REG(hw, IXGBE_QPRC(tc)); /* Received Bytes */ stats->qbrc[tc] += IXGBE_READ_REG(hw, IXGBE_QBRC(tc)); - -#if 0 - /* Can we get rid of these?? Consequently, getting rid - * of the tc_stats structure. - */ - tc_stats_array[up]->in_overflow_discards = 0; - tc_stats_array[up]->out_overflow_discards = 0; -#endif } return IXGBE_SUCCESS; From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 09CBC6ABFD3; Tue, 14 Sep 2021 00:41:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7kzy34nvz3PbG; Tue, 14 Sep 2021 00:41:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40D381150F; Tue, 14 Sep 2021 00:41:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0fHen039818; Tue, 14 Sep 2021 00:41:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0fHTf039817; Tue, 14 Sep 2021 00:41:17 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:17 GMT Message-Id: <202109140041.18E0fHTf039817@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: b8f2ff6a43e3 - stable/13 - ixgbe: wait for link after copper MAC setup MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b8f2ff6a43e33473b213b618fafde8c1d07fb60b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:19 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=b8f2ff6a43e33473b213b618fafde8c1d07fb60b commit b8f2ff6a43e33473b213b618fafde8c1d07fb60b Author: Ashijeet Acharya AuthorDate: 2019-05-24 09:30:15 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:37:10 +0000 ixgbe: wait for link after copper MAC setup After setting up the link on x552/X557-AT 10GBASE-T NICs, sometimes the link does not get set up properly and as a result all the subsequent calls to ixgbe_check_link() from ixgbe_dev_link_update_share() fail. Introduce a delay time of 1s in ixgbe_setup_mac_link_t_X550em() before beginning to set up the external PHY link speed to ensure that the controller can acquire the link. Signed-off-by: Ashijeet Acharya Acked-by: Qi Zhang Approved by: imp Obtained from: DPDK (d31b95860d8e9dd7c6e242bd08baaac00a9714f0) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit d5bbb5500cf2ebeae078cb6ae38ecd4b15ec7f6d) --- sys/dev/ixgbe/ixgbe_x550.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index 7b120f841d85..a7759117f5b5 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -4464,6 +4464,8 @@ s32 ixgbe_setup_mac_link_t_X550em(struct ixgbe_hw *hw, { s32 status; ixgbe_link_speed force_speed; + u32 i; + bool link_up = false; DEBUGFUNC("ixgbe_setup_mac_link_t_X550em"); @@ -4483,6 +4485,19 @@ s32 ixgbe_setup_mac_link_t_X550em(struct ixgbe_hw *hw, if (status != IXGBE_SUCCESS) return status; + + /* Wait for the controller to acquire link */ + for (i = 0; i < 10; i++) { + msec_delay(100); + + status = ixgbe_check_link(hw, &force_speed, &link_up, + false); + if (status != IXGBE_SUCCESS) + return status; + + if (link_up) + break; + } } return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait_to_complete); From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 730156AC602; Tue, 14 Sep 2021 00:41:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l01081sz3PZ3; Tue, 14 Sep 2021 00:41:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8746B11495; Tue, 14 Sep 2021 00:41:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0fJqn039872; Tue, 14 Sep 2021 00:41:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0fJJ9039871; Tue, 14 Sep 2021 00:41:19 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:19 GMT Message-Id: <202109140041.18E0fJJ9039871@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: de5fcf118ace - stable/13 - ixgbe: add FW recovery mode check MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: de5fcf118ace07f020904865b3a6148978d256a5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:21 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=de5fcf118ace07f020904865b3a6148978d256a5 commit de5fcf118ace07f020904865b3a6148978d256a5 Author: Xiaoyun Li AuthorDate: 2018-09-17 09:28:10 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:37:15 +0000 ixgbe: add FW recovery mode check Add FM NVM recovery mode check. Allow the software to detect this. Signed-off-by: Xiaoyun Li Acked-by: Qi Zhang Approved by: imp Obtained from: DPDK (5fb0a9acbb844b21691568c0014866e0e887bd19) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit b622bdb4ebdfc6dfe1a332fcc912426559c829f3) --- sys/dev/ixgbe/ixgbe_api.c | 12 ++++++++++++ sys/dev/ixgbe/ixgbe_api.h | 1 + sys/dev/ixgbe/ixgbe_type.h | 4 ++++ sys/dev/ixgbe/ixgbe_x550.c | 16 ++++++++++++++++ sys/dev/ixgbe/ixgbe_x550.h | 1 + 5 files changed, 34 insertions(+) diff --git a/sys/dev/ixgbe/ixgbe_api.c b/sys/dev/ixgbe/ixgbe_api.c index c71afcb0df67..5e662dac93f9 100644 --- a/sys/dev/ixgbe/ixgbe_api.c +++ b/sys/dev/ixgbe/ixgbe_api.c @@ -1306,6 +1306,18 @@ void ixgbe_restore_mdd_vf(struct ixgbe_hw *hw, u32 vf) hw->mac.ops.restore_mdd_vf(hw, vf); } +/** + * ixgbe_fw_recovery_mode - Check if in FW NVM recovery mode + * @hw: pointer to hardware structure + * + **/ +bool ixgbe_fw_recovery_mode(struct ixgbe_hw *hw) +{ + if (hw->mac.ops.fw_recovery_mode) + return hw->mac.ops.fw_recovery_mode(hw); + return false; +} + /** * ixgbe_enter_lplu - Transition to low power states * @hw: pointer to hardware structure diff --git a/sys/dev/ixgbe/ixgbe_api.h b/sys/dev/ixgbe/ixgbe_api.h index c59b3a2dea9c..aabe573127f3 100644 --- a/sys/dev/ixgbe/ixgbe_api.h +++ b/sys/dev/ixgbe/ixgbe_api.h @@ -217,6 +217,7 @@ void ixgbe_disable_mdd(struct ixgbe_hw *hw); void ixgbe_enable_mdd(struct ixgbe_hw *hw); void ixgbe_mdd_event(struct ixgbe_hw *hw, u32 *vf_bitmap); void ixgbe_restore_mdd_vf(struct ixgbe_hw *hw, u32 vf); +bool ixgbe_fw_recovery_mode(struct ixgbe_hw *hw); s32 ixgbe_enter_lplu(struct ixgbe_hw *hw); s32 ixgbe_handle_lasi(struct ixgbe_hw *hw); void ixgbe_set_rate_select_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed); diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h index 9619b771ea89..c3c29dbdba52 100644 --- a/sys/dev/ixgbe/ixgbe_type.h +++ b/sys/dev/ixgbe/ixgbe_type.h @@ -1080,6 +1080,9 @@ struct ixgbe_dmac_config { #define IXGBE_FWSM_MODE_MASK 0xE #define IXGBE_FWSM_TS_ENABLED 0x1 #define IXGBE_FWSM_FW_MODE_PT 0x4 +#define IXGBE_FWSM_FW_NVM_RECOVERY_MODE (1 << 5) +#define IXGBE_FWSM_EXT_ERR_IND_MASK 0x01F80000 +#define IXGBE_FWSM_FW_VAL_BIT (1 << 15) /* ARC Subsystem registers */ #define IXGBE_HICR 0x15F00 @@ -4010,6 +4013,7 @@ struct ixgbe_mac_operations { void (*enable_mdd)(struct ixgbe_hw *hw); void (*mdd_event)(struct ixgbe_hw *hw, u32 *vf_bitmap); void (*restore_mdd_vf)(struct ixgbe_hw *hw, u32 vf); + bool (*fw_recovery_mode)(struct ixgbe_hw *hw); }; struct ixgbe_phy_operations { diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index 6edeeb178289..aa91c4da7019 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -83,6 +83,7 @@ s32 ixgbe_init_ops_X550(struct ixgbe_hw *hw) mac->ops.enable_mdd = ixgbe_enable_mdd_X550; mac->ops.mdd_event = ixgbe_mdd_event_X550; mac->ops.restore_mdd_vf = ixgbe_restore_mdd_vf_X550; + mac->ops.fw_recovery_mode = ixgbe_fw_recovery_mode_X550; mac->ops.disable_rx = ixgbe_disable_rx_x550; /* Manageability interface */ mac->ops.set_fw_drv_ver = ixgbe_set_fw_drv_ver_x550; @@ -4676,3 +4677,18 @@ s32 ixgbe_set_fw_drv_ver_x550(struct ixgbe_hw *hw, u8 maj, u8 min, return ret_val; } + +/** + * ixgbe_fw_recovery_mode_X550 - Check FW NVM recovery mode + * @hw: pointer t hardware structure + * + * Returns true if in FW NVM recovery mode. + **/ +bool ixgbe_fw_recovery_mode_X550(struct ixgbe_hw *hw) +{ + u32 fwsm; + + fwsm = IXGBE_READ_REG(hw, IXGBE_FWSM_BY_MAC(hw)); + + return !!(fwsm & IXGBE_FWSM_FW_NVM_RECOVERY_MODE); +} diff --git a/sys/dev/ixgbe/ixgbe_x550.h b/sys/dev/ixgbe/ixgbe_x550.h index 44c9d06a42d9..ac2de750cfb7 100644 --- a/sys/dev/ixgbe/ixgbe_x550.h +++ b/sys/dev/ixgbe/ixgbe_x550.h @@ -122,4 +122,5 @@ s32 ixgbe_reset_phy_t_X550em(struct ixgbe_hw *hw); s32 ixgbe_identify_sfp_module_X550em(struct ixgbe_hw *hw); s32 ixgbe_led_on_t_X550em(struct ixgbe_hw *hw, u32 led_idx); s32 ixgbe_led_off_t_X550em(struct ixgbe_hw *hw, u32 led_idx); +bool ixgbe_fw_recovery_mode_X550(struct ixgbe_hw *hw); #endif /* _IXGBE_X550_H_ */ From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD9E16AC3ED; Tue, 14 Sep 2021 00:41:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l0B4KRYz3PTL; Tue, 14 Sep 2021 00:41:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E752112D5; Tue, 14 Sep 2021 00:41:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0fQLh040022; Tue, 14 Sep 2021 00:41:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0fQ3l040021; Tue, 14 Sep 2021 00:41:26 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:26 GMT Message-Id: <202109140041.18E0fQ3l040021@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 32a190803cc7 - stable/13 - ixgbe: support DCB registers dump MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 32a190803cc77ae983415c4478bf5eafb8f63315 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:31 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=32a190803cc77ae983415c4478bf5eafb8f63315 commit 32a190803cc77ae983415c4478bf5eafb8f63315 Author: Xiaoyun Li AuthorDate: 2018-09-17 09:28:13 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:37:29 +0000 ixgbe: support DCB registers dump Add support for DCB registers dump. Signed-off-by: Xiaoyun Li Acked-by: Qi Zhang Approved by: imp Obtained from: DPDK (36a036bc6fdd0da74576a39ab74e50954598ba82) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 9e65ae746da23e1affdf66adb8944656a9da003c) --- sys/dev/ixgbe/ixgbe_type.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h index a538af5d3569..48751e7386bb 100644 --- a/sys/dev/ixgbe/ixgbe_type.h +++ b/sys/dev/ixgbe/ixgbe_type.h @@ -863,6 +863,10 @@ struct ixgbe_dmac_config { #define IXGBE_RTTDQSEL 0x04904 #define IXGBE_RTTDT1C 0x04908 #define IXGBE_RTTDT1S 0x0490C +#define IXGBE_RTTQCNCR 0x08B00 +#define IXGBE_RTTQCNTG 0x04A90 +#define IXGBE_RTTBCNRD 0x0498C +#define IXGBE_RTTQCNRR 0x0498C #define IXGBE_RTTDTECC 0x04990 #define IXGBE_RTTDTECC_NO_BCN 0x00000100 @@ -873,6 +877,7 @@ struct ixgbe_dmac_config { #define IXGBE_RTTBCNRC_RF_INT_MASK \ (IXGBE_RTTBCNRC_RF_DEC_MASK << IXGBE_RTTBCNRC_RF_INT_SHIFT) #define IXGBE_RTTBCNRM 0x04980 +#define IXGBE_RTTQCNRM 0x04980 /* BCN (for DCB) Registers */ #define IXGBE_RTTBCNRS 0x04988 From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC9DB6AC3EE; Tue, 14 Sep 2021 00:41:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l0D0Dn4z3Pkk; Tue, 14 Sep 2021 00:41:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AD117112D6; Tue, 14 Sep 2021 00:41:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0fROh040046; Tue, 14 Sep 2021 00:41:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0fR9f040045; Tue, 14 Sep 2021 00:41:27 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:27 GMT Message-Id: <202109140041.18E0fR9f040045@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 48a64ffc0dc4 - stable/13 - ixgbe: remove whitespace in function comments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 48a64ffc0dc45930210c77e134e8011b013c4864 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:33 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=48a64ffc0dc45930210c77e134e8011b013c4864 commit 48a64ffc0dc45930210c77e134e8011b013c4864 Author: Kevin Bowling AuthorDate: 2021-09-07 03:26:44 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:37:31 +0000 ixgbe: remove whitespace in function comments Remove unnecessary extra whitespace on all function comments, replacing ' * ' with ' * '. This was done automatically via sed using the following transformation: sed 's/^ \* / * /' Signed-off-by: Jacob Keller Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (40023f73c76579e58a859dab87b4c30278eb2e48) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 4cdc5e12a849871e4e8062a62a31f28545901d84) --- sys/dev/ixgbe/ixgbe_82598.c | 238 +++++----- sys/dev/ixgbe/ixgbe_82599.c | 384 ++++++++-------- sys/dev/ixgbe/ixgbe_api.c | 890 ++++++++++++++++++------------------ sys/dev/ixgbe/ixgbe_common.c | 1030 +++++++++++++++++++++--------------------- sys/dev/ixgbe/ixgbe_dcb.c | 6 +- sys/dev/ixgbe/ixgbe_fdir.h | 2 +- sys/dev/ixgbe/ixgbe_mbx.c | 194 ++++---- sys/dev/ixgbe/ixgbe_phy.c | 394 ++++++++-------- sys/dev/ixgbe/ixgbe_vf.c | 166 +++---- sys/dev/ixgbe/ixgbe_x540.c | 188 ++++---- sys/dev/ixgbe/ixgbe_x550.c | 480 ++++++++++---------- 11 files changed, 1986 insertions(+), 1986 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_82598.c b/sys/dev/ixgbe/ixgbe_82598.c index c1d657afb6f5..1bfdcae6da55 100644 --- a/sys/dev/ixgbe/ixgbe_82598.c +++ b/sys/dev/ixgbe/ixgbe_82598.c @@ -69,14 +69,14 @@ static void ixgbe_set_rxpba_82598(struct ixgbe_hw *hw, int num_pb, static s32 ixgbe_read_i2c_sff8472_82598(struct ixgbe_hw *hw, u8 byte_offset, u8 *sff8472_data); /** - * ixgbe_set_pcie_completion_timeout - set pci-e completion timeout - * @hw: pointer to the HW structure + * ixgbe_set_pcie_completion_timeout - set pci-e completion timeout + * @hw: pointer to the HW structure * - * The defaults for 82598 should be in the range of 50us to 50ms, - * however the hardware default for these parts is 500us to 1ms which is less - * than the 10ms recommended by the pci-e spec. To address this we need to - * increase the value to either 10ms to 250ms for capability version 1 config, - * or 16ms to 55ms for version 2. + * The defaults for 82598 should be in the range of 50us to 50ms, + * however the hardware default for these parts is 500us to 1ms which is less + * than the 10ms recommended by the pci-e spec. To address this we need to + * increase the value to either 10ms to 250ms for capability version 1 config, + * or 16ms to 55ms for version 2. **/ void ixgbe_set_pcie_completion_timeout(struct ixgbe_hw *hw) { @@ -111,11 +111,11 @@ out: } /** - * ixgbe_init_ops_82598 - Inits func ptrs and MAC type - * @hw: pointer to hardware structure + * ixgbe_init_ops_82598 - Inits func ptrs and MAC type + * @hw: pointer to hardware structure * - * Initialize the function pointers and assign the MAC type for 82598. - * Does not touch the hardware. + * Initialize the function pointers and assign the MAC type for 82598. + * Does not touch the hardware. **/ s32 ixgbe_init_ops_82598(struct ixgbe_hw *hw) { @@ -181,12 +181,12 @@ s32 ixgbe_init_ops_82598(struct ixgbe_hw *hw) } /** - * ixgbe_init_phy_ops_82598 - PHY/SFP specific init - * @hw: pointer to hardware structure + * ixgbe_init_phy_ops_82598 - PHY/SFP specific init + * @hw: pointer to hardware structure * - * Initialize any function pointers that were not able to be - * set during init_shared_code because the PHY/SFP type was - * not known. Perform the SFP init if necessary. + * Initialize any function pointers that were not able to be + * set during init_shared_code because the PHY/SFP type was + * not known. Perform the SFP init if necessary. * **/ s32 ixgbe_init_phy_ops_82598(struct ixgbe_hw *hw) @@ -245,11 +245,11 @@ out: } /** - * ixgbe_start_hw_82598 - Prepare hardware for Tx/Rx - * @hw: pointer to hardware structure + * ixgbe_start_hw_82598 - Prepare hardware for Tx/Rx + * @hw: pointer to hardware structure * - * Starts the hardware using the generic start_hw function. - * Disables relaxed ordering Then set pcie completion timeout + * Starts the hardware using the generic start_hw function. + * Disables relaxed ordering Then set pcie completion timeout * **/ s32 ixgbe_start_hw_82598(struct ixgbe_hw *hw) @@ -287,12 +287,12 @@ s32 ixgbe_start_hw_82598(struct ixgbe_hw *hw) } /** - * ixgbe_get_link_capabilities_82598 - Determines link capabilities - * @hw: pointer to hardware structure - * @speed: pointer to link speed - * @autoneg: boolean auto-negotiation value + * ixgbe_get_link_capabilities_82598 - Determines link capabilities + * @hw: pointer to hardware structure + * @speed: pointer to link speed + * @autoneg: boolean auto-negotiation value * - * Determines the link capabilities by reading the AUTOC register. + * Determines the link capabilities by reading the AUTOC register. **/ static s32 ixgbe_get_link_capabilities_82598(struct ixgbe_hw *hw, ixgbe_link_speed *speed, @@ -348,10 +348,10 @@ static s32 ixgbe_get_link_capabilities_82598(struct ixgbe_hw *hw, } /** - * ixgbe_get_media_type_82598 - Determines media type - * @hw: pointer to hardware structure + * ixgbe_get_media_type_82598 - Determines media type + * @hw: pointer to hardware structure * - * Returns the media type (fiber, copper, backplane) + * Returns the media type (fiber, copper, backplane) **/ static enum ixgbe_media_type ixgbe_get_media_type_82598(struct ixgbe_hw *hw) { @@ -401,10 +401,10 @@ out: } /** - * ixgbe_fc_enable_82598 - Enable flow control - * @hw: pointer to hardware structure + * ixgbe_fc_enable_82598 - Enable flow control + * @hw: pointer to hardware structure * - * Enable flow control according to the current settings. + * Enable flow control according to the current settings. **/ s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw) { @@ -548,12 +548,12 @@ out: } /** - * ixgbe_start_mac_link_82598 - Configures MAC link settings - * @hw: pointer to hardware structure - * @autoneg_wait_to_complete: true when waiting for completion is needed + * ixgbe_start_mac_link_82598 - Configures MAC link settings + * @hw: pointer to hardware structure + * @autoneg_wait_to_complete: true when waiting for completion is needed * - * Configures link settings based on values in the ixgbe_hw struct. - * Restarts the link. Performs autonegotiation if needed. + * Configures link settings based on values in the ixgbe_hw struct. + * Restarts the link. Performs autonegotiation if needed. **/ static s32 ixgbe_start_mac_link_82598(struct ixgbe_hw *hw, bool autoneg_wait_to_complete) @@ -597,11 +597,11 @@ static s32 ixgbe_start_mac_link_82598(struct ixgbe_hw *hw, } /** - * ixgbe_validate_link_ready - Function looks for phy link - * @hw: pointer to hardware structure + * ixgbe_validate_link_ready - Function looks for phy link + * @hw: pointer to hardware structure * - * Function indicates success when phy link is available. If phy is not ready - * within 5 seconds of MAC indicating link, the function returns error. + * Function indicates success when phy link is available. If phy is not ready + * within 5 seconds of MAC indicating link, the function returns error. **/ static s32 ixgbe_validate_link_ready(struct ixgbe_hw *hw) { @@ -632,13 +632,13 @@ static s32 ixgbe_validate_link_ready(struct ixgbe_hw *hw) } /** - * ixgbe_check_mac_link_82598 - Get link/speed status - * @hw: pointer to hardware structure - * @speed: pointer to link speed - * @link_up: true is link is up, false otherwise - * @link_up_wait_to_complete: bool used to wait for link up or not + * ixgbe_check_mac_link_82598 - Get link/speed status + * @hw: pointer to hardware structure + * @speed: pointer to link speed + * @link_up: true is link is up, false otherwise + * @link_up_wait_to_complete: bool used to wait for link up or not * - * Reads the links register to determine if link is up and the current speed + * Reads the links register to determine if link is up and the current speed **/ static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, ixgbe_link_speed *speed, bool *link_up, @@ -722,12 +722,12 @@ out: } /** - * ixgbe_setup_mac_link_82598 - Set MAC link speed - * @hw: pointer to hardware structure - * @speed: new link speed - * @autoneg_wait_to_complete: true when waiting for completion is needed + * ixgbe_setup_mac_link_82598 - Set MAC link speed + * @hw: pointer to hardware structure + * @speed: new link speed + * @autoneg_wait_to_complete: true when waiting for completion is needed * - * Set the link speed in the AUTOC register and restarts link. + * Set the link speed in the AUTOC register and restarts link. **/ static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw, ixgbe_link_speed speed, @@ -776,12 +776,12 @@ static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw, /** - * ixgbe_setup_copper_link_82598 - Set the PHY autoneg advertised field - * @hw: pointer to hardware structure - * @speed: new link speed - * @autoneg_wait_to_complete: true if waiting is needed to complete + * ixgbe_setup_copper_link_82598 - Set the PHY autoneg advertised field + * @hw: pointer to hardware structure + * @speed: new link speed + * @autoneg_wait_to_complete: true if waiting is needed to complete * - * Sets the link speed in the AUTOC register in the MAC and restarts link. + * Sets the link speed in the AUTOC register in the MAC and restarts link. **/ static s32 ixgbe_setup_copper_link_82598(struct ixgbe_hw *hw, ixgbe_link_speed speed, @@ -801,12 +801,12 @@ static s32 ixgbe_setup_copper_link_82598(struct ixgbe_hw *hw, } /** - * ixgbe_reset_hw_82598 - Performs hardware reset - * @hw: pointer to hardware structure + * ixgbe_reset_hw_82598 - Performs hardware reset + * @hw: pointer to hardware structure * - * Resets the hardware by resetting the transmit and receive units, masks and - * clears all interrupts, performing a PHY reset, and performing a link (MAC) - * reset. + * Resets the hardware by resetting the transmit and receive units, masks and + * clears all interrupts, performing a PHY reset, and performing a link (MAC) + * reset. **/ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw) { @@ -939,10 +939,10 @@ reset_hw_out: } /** - * ixgbe_set_vmdq_82598 - Associate a VMDq set index with a rx address - * @hw: pointer to hardware struct - * @rar: receive address register index to associate with a VMDq index - * @vmdq: VMDq set index + * ixgbe_set_vmdq_82598 - Associate a VMDq set index with a rx address + * @hw: pointer to hardware struct + * @rar: receive address register index to associate with a VMDq index + * @vmdq: VMDq set index **/ s32 ixgbe_set_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq) { @@ -965,10 +965,10 @@ s32 ixgbe_set_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq) } /** - * ixgbe_clear_vmdq_82598 - Disassociate a VMDq set index from an rx address - * @hw: pointer to hardware struct - * @rar: receive address register index to associate with a VMDq index - * @vmdq: VMDq clear index (not used in 82598, but elsewhere) + * ixgbe_clear_vmdq_82598 - Disassociate a VMDq set index from an rx address + * @hw: pointer to hardware struct + * @rar: receive address register index to associate with a VMDq index + * @vmdq: VMDq clear index (not used in 82598, but elsewhere) **/ static s32 ixgbe_clear_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq) { @@ -993,14 +993,14 @@ static s32 ixgbe_clear_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq) } /** - * ixgbe_set_vfta_82598 - Set VLAN filter table - * @hw: pointer to hardware structure - * @vlan: VLAN id to write to VLAN filter - * @vind: VMDq output index that maps queue to VLAN id in VFTA - * @vlan_on: boolean flag to turn on/off VLAN in VFTA - * @vlvf_bypass: boolean flag - unused + * ixgbe_set_vfta_82598 - Set VLAN filter table + * @hw: pointer to hardware structure + * @vlan: VLAN id to write to VLAN filter + * @vind: VMDq output index that maps queue to VLAN id in VFTA + * @vlan_on: boolean flag to turn on/off VLAN in VFTA + * @vlvf_bypass: boolean flag - unused * - * Turn on/off specified VLAN in the VLAN filter table. + * Turn on/off specified VLAN in the VLAN filter table. **/ s32 ixgbe_set_vfta_82598(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on, bool vlvf_bypass) @@ -1046,10 +1046,10 @@ s32 ixgbe_set_vfta_82598(struct ixgbe_hw *hw, u32 vlan, u32 vind, } /** - * ixgbe_clear_vfta_82598 - Clear VLAN filter table - * @hw: pointer to hardware structure + * ixgbe_clear_vfta_82598 - Clear VLAN filter table + * @hw: pointer to hardware structure * - * Clears the VLAN filer table, and the VMDq index associated with the filter + * Clears the VLAN filer table, and the VMDq index associated with the filter **/ static s32 ixgbe_clear_vfta_82598(struct ixgbe_hw *hw) { @@ -1070,12 +1070,12 @@ static s32 ixgbe_clear_vfta_82598(struct ixgbe_hw *hw) } /** - * ixgbe_read_analog_reg8_82598 - Reads 8 bit Atlas analog register - * @hw: pointer to hardware structure - * @reg: analog register to read - * @val: read value + * ixgbe_read_analog_reg8_82598 - Reads 8 bit Atlas analog register + * @hw: pointer to hardware structure + * @reg: analog register to read + * @val: read value * - * Performs read operation to Atlas analog register specified. + * Performs read operation to Atlas analog register specified. **/ s32 ixgbe_read_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 *val) { @@ -1094,12 +1094,12 @@ s32 ixgbe_read_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 *val) } /** - * ixgbe_write_analog_reg8_82598 - Writes 8 bit Atlas analog register - * @hw: pointer to hardware structure - * @reg: atlas register to write - * @val: value to write + * ixgbe_write_analog_reg8_82598 - Writes 8 bit Atlas analog register + * @hw: pointer to hardware structure + * @reg: atlas register to write + * @val: value to write * - * Performs write operation to Atlas analog register specified. + * Performs write operation to Atlas analog register specified. **/ s32 ixgbe_write_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 val) { @@ -1116,13 +1116,13 @@ s32 ixgbe_write_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 val) } /** - * ixgbe_read_i2c_phy_82598 - Reads 8 bit word over I2C interface. - * @hw: pointer to hardware structure - * @dev_addr: address to read from - * @byte_offset: byte offset to read from dev_addr - * @eeprom_data: value read + * ixgbe_read_i2c_phy_82598 - Reads 8 bit word over I2C interface. + * @hw: pointer to hardware structure + * @dev_addr: address to read from + * @byte_offset: byte offset to read from dev_addr + * @eeprom_data: value read * - * Performs 8 byte read operation to SFP module's EEPROM over I2C interface. + * Performs 8 byte read operation to SFP module's EEPROM over I2C interface. **/ static s32 ixgbe_read_i2c_phy_82598(struct ixgbe_hw *hw, u8 dev_addr, u8 byte_offset, u8 *eeprom_data) @@ -1190,12 +1190,12 @@ out: } /** - * ixgbe_read_i2c_eeprom_82598 - Reads 8 bit word over I2C interface. - * @hw: pointer to hardware structure - * @byte_offset: EEPROM byte offset to read - * @eeprom_data: value read + * ixgbe_read_i2c_eeprom_82598 - Reads 8 bit word over I2C interface. + * @hw: pointer to hardware structure + * @byte_offset: EEPROM byte offset to read + * @eeprom_data: value read * - * Performs 8 byte read operation to SFP module's EEPROM over I2C interface. + * Performs 8 byte read operation to SFP module's EEPROM over I2C interface. **/ s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset, u8 *eeprom_data) @@ -1205,12 +1205,12 @@ s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset, } /** - * ixgbe_read_i2c_sff8472_82598 - Reads 8 bit word over I2C interface. - * @hw: pointer to hardware structure - * @byte_offset: byte offset at address 0xA2 - * @sff8472_data: value read + * ixgbe_read_i2c_sff8472_82598 - Reads 8 bit word over I2C interface. + * @hw: pointer to hardware structure + * @byte_offset: byte offset at address 0xA2 + * @sff8472_data: value read * - * Performs 8 byte read operation to SFP module's SFF-8472 data over I2C + * Performs 8 byte read operation to SFP module's SFF-8472 data over I2C **/ static s32 ixgbe_read_i2c_sff8472_82598(struct ixgbe_hw *hw, u8 byte_offset, u8 *sff8472_data) @@ -1220,10 +1220,10 @@ static s32 ixgbe_read_i2c_sff8472_82598(struct ixgbe_hw *hw, u8 byte_offset, } /** - * ixgbe_get_supported_physical_layer_82598 - Returns physical layer type - * @hw: pointer to hardware structure + * ixgbe_get_supported_physical_layer_82598 - Returns physical layer type + * @hw: pointer to hardware structure * - * Determines physical layer capabilities of the current configuration. + * Determines physical layer capabilities of the current configuration. **/ u64 ixgbe_get_supported_physical_layer_82598(struct ixgbe_hw *hw) { @@ -1322,12 +1322,12 @@ out: } /** - * ixgbe_set_lan_id_multi_port_pcie_82598 - Set LAN id for PCIe multiple - * port devices. - * @hw: pointer to the HW structure + * ixgbe_set_lan_id_multi_port_pcie_82598 - Set LAN id for PCIe multiple + * port devices. + * @hw: pointer to the HW structure * - * Calls common function and corrects issue with some single port devices - * that enable LAN1 but not LAN0. + * Calls common function and corrects issue with some single port devices + * that enable LAN1 but not LAN0. **/ void ixgbe_set_lan_id_multi_port_pcie_82598(struct ixgbe_hw *hw) { @@ -1356,8 +1356,8 @@ void ixgbe_set_lan_id_multi_port_pcie_82598(struct ixgbe_hw *hw) } /** - * ixgbe_enable_relaxed_ordering_82598 - enable relaxed ordering - * @hw: pointer to hardware structure + * ixgbe_enable_relaxed_ordering_82598 - enable relaxed ordering + * @hw: pointer to hardware structure * **/ void ixgbe_enable_relaxed_ordering_82598(struct ixgbe_hw *hw) @@ -1426,11 +1426,11 @@ static void ixgbe_set_rxpba_82598(struct ixgbe_hw *hw, int num_pb, } /** - * ixgbe_enable_rx_dma_82598 - Enable the Rx DMA unit - * @hw: pointer to hardware structure - * @regval: register value to write to RXCTRL + * ixgbe_enable_rx_dma_82598 - Enable the Rx DMA unit + * @hw: pointer to hardware structure + * @regval: register value to write to RXCTRL * - * Enables the Rx DMA unit + * Enables the Rx DMA unit **/ s32 ixgbe_enable_rx_dma_82598(struct ixgbe_hw *hw, u32 regval) { diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c index f692c19dc979..0222acd2f0d5 100644 --- a/sys/dev/ixgbe/ixgbe_82599.c +++ b/sys/dev/ixgbe/ixgbe_82599.c @@ -105,12 +105,12 @@ void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) } /** - * ixgbe_init_phy_ops_82599 - PHY/SFP specific init - * @hw: pointer to hardware structure + * ixgbe_init_phy_ops_82599 - PHY/SFP specific init + * @hw: pointer to hardware structure * - * Initialize any function pointers that were not able to be - * set during init_shared_code because the PHY/SFP type was - * not known. Perform the SFP init if necessary. + * Initialize any function pointers that were not able to be + * set during init_shared_code because the PHY/SFP type was + * not known. Perform the SFP init if necessary. * **/ s32 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw) @@ -239,14 +239,14 @@ setup_sfp_err: } /** - * prot_autoc_read_82599 - Hides MAC differences needed for AUTOC read - * @hw: pointer to hardware structure - * @locked: Return the if we locked for this read. - * @reg_val: Value we read from AUTOC + * prot_autoc_read_82599 - Hides MAC differences needed for AUTOC read + * @hw: pointer to hardware structure + * @locked: Return the if we locked for this read. + * @reg_val: Value we read from AUTOC * - * For this part (82599) we need to wrap read-modify-writes with a possible - * FW/SW lock. It is assumed this lock will be freed with the next - * prot_autoc_write_82599(). + * For this part (82599) we need to wrap read-modify-writes with a possible + * FW/SW lock. It is assumed this lock will be freed with the next + * prot_autoc_write_82599(). */ s32 prot_autoc_read_82599(struct ixgbe_hw *hw, bool *locked, u32 *reg_val) { @@ -272,7 +272,7 @@ s32 prot_autoc_read_82599(struct ixgbe_hw *hw, bool *locked, u32 *reg_val) * @hw: pointer to hardware structure * @autoc: value to write to AUTOC * @locked: bool to indicate whether the SW/FW lock was already taken by - * previous proc_autoc_read_82599. + * previous proc_autoc_read_82599. * * This part (82599) may need to hold the SW/FW lock around all writes to * AUTOC. Likewise after a write we need to do a pipeline reset. @@ -312,11 +312,11 @@ out: } /** - * ixgbe_init_ops_82599 - Inits func ptrs and MAC type - * @hw: pointer to hardware structure + * ixgbe_init_ops_82599 - Inits func ptrs and MAC type + * @hw: pointer to hardware structure * - * Initialize the function pointers and assign the MAC type for 82599. - * Does not touch the hardware. + * Initialize the function pointers and assign the MAC type for 82599. + * Does not touch the hardware. **/ s32 ixgbe_init_ops_82599(struct ixgbe_hw *hw) @@ -406,12 +406,12 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw *hw) } /** - * ixgbe_get_link_capabilities_82599 - Determines link capabilities - * @hw: pointer to hardware structure - * @speed: pointer to link speed - * @autoneg: true when autoneg or autotry is enabled + * ixgbe_get_link_capabilities_82599 - Determines link capabilities + * @hw: pointer to hardware structure + * @speed: pointer to link speed + * @autoneg: true when autoneg or autotry is enabled * - * Determines the link capabilities by reading the AUTOC register. + * Determines the link capabilities by reading the AUTOC register. **/ s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, ixgbe_link_speed *speed, @@ -518,10 +518,10 @@ out: } /** - * ixgbe_get_media_type_82599 - Get media type - * @hw: pointer to hardware structure + * ixgbe_get_media_type_82599 - Get media type + * @hw: pointer to hardware structure * - * Returns the media type (fiber, copper, backplane) + * Returns the media type (fiber, copper, backplane) **/ enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw) { @@ -579,10 +579,10 @@ out: } /** - * ixgbe_stop_mac_link_on_d3_82599 - Disables link on D3 - * @hw: pointer to hardware structure + * ixgbe_stop_mac_link_on_d3_82599 - Disables link on D3 + * @hw: pointer to hardware structure * - * Disables link during D3 power down sequence. + * Disables link during D3 power down sequence. * **/ void ixgbe_stop_mac_link_on_d3_82599(struct ixgbe_hw *hw) @@ -602,12 +602,12 @@ void ixgbe_stop_mac_link_on_d3_82599(struct ixgbe_hw *hw) } /** - * ixgbe_start_mac_link_82599 - Setup MAC link settings - * @hw: pointer to hardware structure - * @autoneg_wait_to_complete: true when waiting for completion is needed + * ixgbe_start_mac_link_82599 - Setup MAC link settings + * @hw: pointer to hardware structure + * @autoneg_wait_to_complete: true when waiting for completion is needed * - * Configures link settings based on values in the ixgbe_hw struct. - * Restarts the link. Performs autonegotiation if needed. + * Configures link settings based on values in the ixgbe_hw struct. + * Restarts the link. Performs autonegotiation if needed. **/ s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw, bool autoneg_wait_to_complete) @@ -670,12 +670,12 @@ out: } /** - * ixgbe_disable_tx_laser_multispeed_fiber - Disable Tx laser - * @hw: pointer to hardware structure + * ixgbe_disable_tx_laser_multispeed_fiber - Disable Tx laser + * @hw: pointer to hardware structure * - * The base drivers may require better control over SFP+ module - * PHY states. This includes selectively shutting down the Tx - * laser on the PHY, effectively halting physical link. + * The base drivers may require better control over SFP+ module + * PHY states. This includes selectively shutting down the Tx + * laser on the PHY, effectively halting physical link. **/ void ixgbe_disable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) { @@ -693,12 +693,12 @@ void ixgbe_disable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) } /** - * ixgbe_enable_tx_laser_multispeed_fiber - Enable Tx laser - * @hw: pointer to hardware structure + * ixgbe_enable_tx_laser_multispeed_fiber - Enable Tx laser + * @hw: pointer to hardware structure * - * The base drivers may require better control over SFP+ module - * PHY states. This includes selectively turning on the Tx - * laser on the PHY, effectively starting physical link. + * The base drivers may require better control over SFP+ module + * PHY states. This includes selectively turning on the Tx + * laser on the PHY, effectively starting physical link. **/ void ixgbe_enable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) { @@ -712,16 +712,16 @@ void ixgbe_enable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) } /** - * ixgbe_flap_tx_laser_multispeed_fiber - Flap Tx laser - * @hw: pointer to hardware structure + * ixgbe_flap_tx_laser_multispeed_fiber - Flap Tx laser + * @hw: pointer to hardware structure * - * When the driver changes the link speeds that it can support, - * it sets autotry_restart to true to indicate that we need to - * initiate a new autotry session with the link partner. To do - * so, we set the speed then disable and re-enable the Tx laser, to - * alert the link partner that it also needs to restart autotry on its - * end. This is consistent with true clause 37 autoneg, which also - * involves a loss of signal. + * When the driver changes the link speeds that it can support, + * it sets autotry_restart to true to indicate that we need to + * initiate a new autotry session with the link partner. To do + * so, we set the speed then disable and re-enable the Tx laser, to + * alert the link partner that it also needs to restart autotry on its + * end. This is consistent with true clause 37 autoneg, which also + * involves a loss of signal. **/ void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) { @@ -739,11 +739,11 @@ void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) } /** - * ixgbe_set_hard_rate_select_speed - Set module link speed - * @hw: pointer to hardware structure - * @speed: link speed to set + * ixgbe_set_hard_rate_select_speed - Set module link speed + * @hw: pointer to hardware structure + * @speed: link speed to set * - * Set module link speed via RS0/RS1 rate select pins. + * Set module link speed via RS0/RS1 rate select pins. */ void ixgbe_set_hard_rate_select_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed) @@ -768,12 +768,12 @@ void ixgbe_set_hard_rate_select_speed(struct ixgbe_hw *hw, } /** - * ixgbe_setup_mac_link_smartspeed - Set MAC link speed using SmartSpeed - * @hw: pointer to hardware structure - * @speed: new link speed - * @autoneg_wait_to_complete: true when waiting for completion is needed + * ixgbe_setup_mac_link_smartspeed - Set MAC link speed using SmartSpeed + * @hw: pointer to hardware structure + * @speed: new link speed + * @autoneg_wait_to_complete: true when waiting for completion is needed * - * Implements the Intel SmartSpeed algorithm. + * Implements the Intel SmartSpeed algorithm. **/ s32 ixgbe_setup_mac_link_smartspeed(struct ixgbe_hw *hw, ixgbe_link_speed speed, @@ -880,12 +880,12 @@ out: } /** - * ixgbe_setup_mac_link_82599 - Set MAC link speed - * @hw: pointer to hardware structure - * @speed: new link speed - * @autoneg_wait_to_complete: true when waiting for completion is needed + * ixgbe_setup_mac_link_82599 - Set MAC link speed + * @hw: pointer to hardware structure + * @speed: new link speed + * @autoneg_wait_to_complete: true when waiting for completion is needed * - * Set the link speed in the AUTOC register and restarts link. + * Set the link speed in the AUTOC register and restarts link. **/ s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw, ixgbe_link_speed speed, @@ -998,12 +998,12 @@ out: } /** - * ixgbe_setup_copper_link_82599 - Set the PHY autoneg advertised field - * @hw: pointer to hardware structure - * @speed: new link speed - * @autoneg_wait_to_complete: true if waiting is needed to complete + * ixgbe_setup_copper_link_82599 - Set the PHY autoneg advertised field + * @hw: pointer to hardware structure + * @speed: new link speed + * @autoneg_wait_to_complete: true if waiting is needed to complete * - * Restarts link on PHY and MAC based on settings passed in. + * Restarts link on PHY and MAC based on settings passed in. **/ static s32 ixgbe_setup_copper_link_82599(struct ixgbe_hw *hw, ixgbe_link_speed speed, @@ -1023,12 +1023,12 @@ static s32 ixgbe_setup_copper_link_82599(struct ixgbe_hw *hw, } /** - * ixgbe_reset_hw_82599 - Perform hardware reset - * @hw: pointer to hardware structure + * ixgbe_reset_hw_82599 - Perform hardware reset + * @hw: pointer to hardware structure * - * Resets the hardware by resetting the transmit and receive units, masks - * and clears all interrupts, perform a PHY reset, and perform a link (MAC) - * reset. + * Resets the hardware by resetting the transmit and receive units, masks + * and clears all interrupts, perform a PHY reset, and perform a link (MAC) + * reset. **/ s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw) { @@ -1224,8 +1224,8 @@ static s32 ixgbe_fdir_check_cmd_complete(struct ixgbe_hw *hw, u32 *fdircmd) } /** - * ixgbe_reinit_fdir_tables_82599 - Reinitialize Flow Director tables. - * @hw: pointer to hardware structure + * ixgbe_reinit_fdir_tables_82599 - Reinitialize Flow Director tables. + * @hw: pointer to hardware structure **/ s32 ixgbe_reinit_fdir_tables_82599(struct ixgbe_hw *hw) { @@ -1297,9 +1297,9 @@ s32 ixgbe_reinit_fdir_tables_82599(struct ixgbe_hw *hw) } /** - * ixgbe_fdir_enable_82599 - Initialize Flow Director control registers - * @hw: pointer to hardware structure - * @fdirctrl: value to write to flow director control register + * ixgbe_fdir_enable_82599 - Initialize Flow Director control registers + * @hw: pointer to hardware structure + * @fdirctrl: value to write to flow director control register **/ static void ixgbe_fdir_enable_82599(struct ixgbe_hw *hw, u32 fdirctrl) { @@ -1338,9 +1338,9 @@ static void ixgbe_fdir_enable_82599(struct ixgbe_hw *hw, u32 fdirctrl) } /** - * ixgbe_init_fdir_signature_82599 - Initialize Flow Director signature filters - * @hw: pointer to hardware structure - * @fdirctrl: value to write to flow director control register, initially + * ixgbe_init_fdir_signature_82599 - Initialize Flow Director signature filters + * @hw: pointer to hardware structure + * @fdirctrl: value to write to flow director control register, initially * contains just the value of the Rx packet buffer allocation **/ s32 ixgbe_init_fdir_signature_82599(struct ixgbe_hw *hw, u32 fdirctrl) @@ -1364,11 +1364,11 @@ s32 ixgbe_init_fdir_signature_82599(struct ixgbe_hw *hw, u32 fdirctrl) } /** - * ixgbe_init_fdir_perfect_82599 - Initialize Flow Director perfect filters - * @hw: pointer to hardware structure - * @fdirctrl: value to write to flow director control register, initially + * ixgbe_init_fdir_perfect_82599 - Initialize Flow Director perfect filters + * @hw: pointer to hardware structure + * @fdirctrl: value to write to flow director control register, initially * contains just the value of the Rx packet buffer allocation - * @cloud_mode: true - cloud mode, false - other mode + * @cloud_mode: true - cloud mode, false - other mode **/ s32 ixgbe_init_fdir_perfect_82599(struct ixgbe_hw *hw, u32 fdirctrl, bool cloud_mode) @@ -1403,9 +1403,9 @@ s32 ixgbe_init_fdir_perfect_82599(struct ixgbe_hw *hw, u32 fdirctrl, } /** - * ixgbe_set_fdir_drop_queue_82599 - Set Flow Director drop queue - * @hw: pointer to hardware structure - * @dropqueue: Rx queue index used for the dropped packets + * ixgbe_set_fdir_drop_queue_82599 - Set Flow Director drop queue + * @hw: pointer to hardware structure + * @dropqueue: Rx queue index used for the dropped packets **/ void ixgbe_set_fdir_drop_queue_82599(struct ixgbe_hw *hw, u8 dropqueue) { @@ -1461,15 +1461,15 @@ do { \ } while (0) /** - * ixgbe_atr_compute_sig_hash_82599 - Compute the signature hash - * @input: input bitstream to compute the hash on - * @common: compressed common input dword + * ixgbe_atr_compute_sig_hash_82599 - Compute the signature hash + * @input: input bitstream to compute the hash on + * @common: compressed common input dword * - * This function is almost identical to the function above but contains - * several optimizations such as unwinding all of the loops, letting the - * compiler work out all of the conditional ifs since the keys are static - * defines, and computing two keys at once since the hashed dword stream - * will be the same for both keys. + * This function is almost identical to the function above but contains + * several optimizations such as unwinding all of the loops, letting the + * compiler work out all of the conditional ifs since the keys are static + * defines, and computing two keys at once since the hashed dword stream + * will be the same for both keys. **/ u32 ixgbe_atr_compute_sig_hash_82599(union ixgbe_atr_hash_dword input, union ixgbe_atr_hash_dword common) @@ -1528,11 +1528,11 @@ u32 ixgbe_atr_compute_sig_hash_82599(union ixgbe_atr_hash_dword input, } /** - * ixgbe_atr_add_signature_filter_82599 - Adds a signature hash filter - * @hw: pointer to hardware structure - * @input: unique input dword - * @common: compressed common input dword - * @queue: queue index to direct traffic to + * ixgbe_atr_add_signature_filter_82599 - Adds a signature hash filter + * @hw: pointer to hardware structure + * @input: unique input dword + * @common: compressed common input dword + * @queue: queue index to direct traffic to * * Note that the tunnel bit in input must not be set when the hardware * tunneling support does not exist. @@ -1601,15 +1601,15 @@ do { \ } while (0) /** - * ixgbe_atr_compute_perfect_hash_82599 - Compute the perfect filter hash - * @input: input bitstream to compute the hash on - * @input_mask: mask for the input bitstream + * ixgbe_atr_compute_perfect_hash_82599 - Compute the perfect filter hash + * @input: input bitstream to compute the hash on + * @input_mask: mask for the input bitstream * - * This function serves two main purposes. First it applies the input_mask - * to the atr_input resulting in a cleaned up atr_input data stream. - * Secondly it computes the hash and stores it in the bkt_hash field at - * the end of the input byte stream. This way it will be available for - * future use without needing to recompute the hash. + * This function serves two main purposes. First it applies the input_mask + * to the atr_input resulting in a cleaned up atr_input data stream. + * Secondly it computes the hash and stores it in the bkt_hash field at + * the end of the input byte stream. This way it will be available for + * future use without needing to recompute the hash. **/ void ixgbe_atr_compute_perfect_hash_82599(union ixgbe_atr_input *input, union ixgbe_atr_input *input_mask) @@ -1660,13 +1660,13 @@ void ixgbe_atr_compute_perfect_hash_82599(union ixgbe_atr_input *input, } /** - * ixgbe_get_fdirtcpm_82599 - generate a TCP port from atr_input_masks - * @input_mask: mask to be bit swapped + * ixgbe_get_fdirtcpm_82599 - generate a TCP port from atr_input_masks + * @input_mask: mask to be bit swapped * - * The source and destination port masks for flow director are bit swapped - * in that bit 15 effects bit 0, 14 effects 1, 13, 2 etc. In order to - * generate a correctly swapped value we need to bit swap the mask and that - * is what is accomplished by this function. + * The source and destination port masks for flow director are bit swapped + * in that bit 15 effects bit 0, 14 effects 1, 13, 2 etc. In order to + * generate a correctly swapped value we need to bit swap the mask and that + * is what is accomplished by this function. **/ static u32 ixgbe_get_fdirtcpm_82599(union ixgbe_atr_input *input_mask) { @@ -2000,16 +2000,16 @@ s32 ixgbe_fdir_erase_perfect_filter_82599(struct ixgbe_hw *hw, } /** - * ixgbe_fdir_add_perfect_filter_82599 - Adds a perfect filter - * @hw: pointer to hardware structure - * @input: input bitstream - * @input_mask: mask for the input bitstream - * @soft_id: software index for the filters - * @queue: queue index to direct traffic to - * @cloud_mode: unused + * ixgbe_fdir_add_perfect_filter_82599 - Adds a perfect filter + * @hw: pointer to hardware structure + * @input: input bitstream + * @input_mask: mask for the input bitstream + * @soft_id: software index for the filters + * @queue: queue index to direct traffic to + * @cloud_mode: unused * - * Note that the caller to this function must lock before calling, since the - * hardware writes must be protected from one another. + * Note that the caller to this function must lock before calling, since the + * hardware writes must be protected from one another. **/ s32 ixgbe_fdir_add_perfect_filter_82599(struct ixgbe_hw *hw, union ixgbe_atr_input *input, @@ -2067,12 +2067,12 @@ s32 ixgbe_fdir_add_perfect_filter_82599(struct ixgbe_hw *hw, } /** - * ixgbe_read_analog_reg8_82599 - Reads 8 bit Omer analog register - * @hw: pointer to hardware structure - * @reg: analog register to read - * @val: read value + * ixgbe_read_analog_reg8_82599 - Reads 8 bit Omer analog register + * @hw: pointer to hardware structure + * @reg: analog register to read + * @val: read value * - * Performs read operation to Omer analog register specified. + * Performs read operation to Omer analog register specified. **/ s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val) { @@ -2091,12 +2091,12 @@ s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val) } /** - * ixgbe_write_analog_reg8_82599 - Writes 8 bit Omer analog register - * @hw: pointer to hardware structure - * @reg: atlas register to write - * @val: value to write + * ixgbe_write_analog_reg8_82599 - Writes 8 bit Omer analog register + * @hw: pointer to hardware structure + * @reg: atlas register to write + * @val: value to write * - * Performs write operation to Omer analog register specified. + * Performs write operation to Omer analog register specified. **/ s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val) { @@ -2113,12 +2113,12 @@ s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val) *** 6480 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF1FB6AC3E8; Tue, 14 Sep 2021 00:41:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l084DG8z3PkZ; Tue, 14 Sep 2021 00:41:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CA281140C; Tue, 14 Sep 2021 00:41:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0fP0t039998; Tue, 14 Sep 2021 00:41:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0fPmw039997; Tue, 14 Sep 2021 00:41:25 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:25 GMT Message-Id: <202109140041.18E0fPmw039997@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: d255eb15652b - stable/13 - ixgbe: update X550 SFP identification MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d255eb15652b27d8007e6cf7171da8b256948c7a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:29 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=d255eb15652b27d8007e6cf7171da8b256948c7a commit d255eb15652b27d8007e6cf7171da8b256948c7a Author: Xiaoyun Li AuthorDate: 2018-09-17 09:28:12 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:37:27 +0000 ixgbe: update X550 SFP identification Use ixgbe_identify_sfp_module_X550em to update SFP identification flow. ixgbe_identify_sfp_module_X550em includes specific checks for X550 about supported SFP modules. Signed-off-by: Xiaoyun Li Acked-by: Qi Zhang Approved by: imp Obtained from: DPDK (175bedb0cc8f801be3050fa35b8d8d0971cea7cc) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 0a4f0befab9d3a048232b00bea77bf3da20cfdd0) --- sys/dev/ixgbe/ixgbe_x550.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index df19c4c65201..1c79dda6c235 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -351,7 +351,7 @@ static s32 ixgbe_identify_phy_x550em(struct ixgbe_hw *hw) switch (hw->device_id) { case IXGBE_DEV_ID_X550EM_A_SFP: - return ixgbe_identify_module_generic(hw); + return ixgbe_identify_sfp_module_X550em(hw); case IXGBE_DEV_ID_X550EM_X_SFP: /* set up for CS4227 usage */ ixgbe_setup_mux_ctl(hw); @@ -359,7 +359,7 @@ static s32 ixgbe_identify_phy_x550em(struct ixgbe_hw *hw) /* Fallthrough */ case IXGBE_DEV_ID_X550EM_A_SFP_N: - return ixgbe_identify_module_generic(hw); + return ixgbe_identify_sfp_module_X550em(hw); break; case IXGBE_DEV_ID_X550EM_X_KX4: hw->phy.type = ixgbe_phy_x550em_kx4; From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 02CCE6AC700; Tue, 14 Sep 2021 00:41:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l0G2jg5z3PcZ; Tue, 14 Sep 2021 00:41:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D041F11498; Tue, 14 Sep 2021 00:41:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0fSk9040070; Tue, 14 Sep 2021 00:41:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0fSfb040069; Tue, 14 Sep 2021 00:41:28 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:28 GMT Message-Id: <202109140041.18E0fSfb040069@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 815ff2d81d0f - stable/13 - ixgbe: move increments after evaluations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 815ff2d81d0f855bfe08a3834951675ef23f84f3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:35 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=815ff2d81d0f855bfe08a3834951675ef23f84f3 commit 815ff2d81d0f855bfe08a3834951675ef23f84f3 Author: Guinan Sun AuthorDate: 2020-07-09 08:00:35 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:37:34 +0000 ixgbe: move increments after evaluations The retry variable was being incremented before it was evaluated by the subsequent conditional against the maximum retries to figure out which message to print. So we'll move the increment op to the end. Signed-off-by: Jeb Cramer Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (390445ec30b4c52a3d2887c3d2a202d9cf37ea8e) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit dc11ba4eb3fe5cce615f361de83e85e07005ca24) --- sys/dev/ixgbe/ixgbe_phy.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_phy.c b/sys/dev/ixgbe/ixgbe_phy.c index 236d6685f8a9..c1cbc282c790 100644 --- a/sys/dev/ixgbe/ixgbe_phy.c +++ b/sys/dev/ixgbe/ixgbe_phy.c @@ -169,12 +169,12 @@ fail: ixgbe_i2c_bus_clear(hw); if (lock) hw->mac.ops.release_swfw_sync(hw, swfw_mask); - retry++; if (retry < max_retry) DEBUGOUT("I2C byte read combined error - Retrying.\n"); else DEBUGOUT("I2C byte read combined error.\n"); - } while (retry < max_retry); + retry++; + } while (retry <= max_retry); return IXGBE_ERR_I2C; } @@ -234,12 +234,12 @@ fail: ixgbe_i2c_bus_clear(hw); if (lock) hw->mac.ops.release_swfw_sync(hw, swfw_mask); - retry++; if (retry < max_retry) DEBUGOUT("I2C byte write combined error - Retrying.\n"); else DEBUGOUT("I2C byte write combined error.\n"); - } while (retry < max_retry); + retry++; + } while (retry <= max_retry); return IXGBE_ERR_I2C; } @@ -2066,13 +2066,12 @@ fail: hw->mac.ops.release_swfw_sync(hw, swfw_mask); msec_delay(100); } - retry++; if (retry < max_retry) DEBUGOUT("I2C byte read error - Retrying.\n"); else DEBUGOUT("I2C byte read error.\n"); - - } while (retry < max_retry); + retry++; + } while (retry <= max_retry); return status; } @@ -2170,12 +2169,12 @@ static s32 ixgbe_write_i2c_byte_generic_int(struct ixgbe_hw *hw, u8 byte_offset, fail: ixgbe_i2c_bus_clear(hw); - retry++; if (retry < max_retry) DEBUGOUT("I2C byte write error - Retrying.\n"); else DEBUGOUT("I2C byte write error.\n"); - } while (retry < max_retry); + retry++; + } while (retry <= max_retry); if (lock) hw->mac.ops.release_swfw_sync(hw, swfw_mask); From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 237056AC628; Tue, 14 Sep 2021 00:41:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l0K4KXNz3Pqf; Tue, 14 Sep 2021 00:41:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E0F011254; Tue, 14 Sep 2021 00:41:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0fWvm040148; Tue, 14 Sep 2021 00:41:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0fWdl040147; Tue, 14 Sep 2021 00:41:32 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:32 GMT Message-Id: <202109140041.18E0fWdl040147@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 04e5691087aa - stable/13 - ixgbe: remove unnecessary return value check MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 04e5691087aa5cb3455f070566ca8b7a6e73747c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:38 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=04e5691087aa5cb3455f070566ca8b7a6e73747c commit 04e5691087aa5cb3455f070566ca8b7a6e73747c Author: Guinan Sun AuthorDate: 2020-07-09 08:00:38 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:37:41 +0000 ixgbe: remove unnecessary return value check Remove unnecessary return value check. Signed-off-by: Jakub Chylkowski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (4b0ee6529b7897c2a08dd56669f07ac1f46a8474) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 3a89005394bc5d82ce9b6baa9e7f8dee362354ae) --- sys/dev/ixgbe/ixgbe_82599.c | 4 +--- sys/dev/ixgbe/ixgbe_common.c | 4 +--- sys/dev/ixgbe/ixgbe_common.h | 2 +- sys/dev/ixgbe/ixgbe_phy.c | 25 +++++++------------------ sys/dev/ixgbe/ixgbe_x540.c | 2 +- 5 files changed, 11 insertions(+), 26 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c index 0222acd2f0d5..9eb3904a30f9 100644 --- a/sys/dev/ixgbe/ixgbe_82599.c +++ b/sys/dev/ixgbe/ixgbe_82599.c @@ -2130,9 +2130,7 @@ s32 ixgbe_start_hw_82599(struct ixgbe_hw *hw) if (ret_val != IXGBE_SUCCESS) goto out; - ret_val = ixgbe_start_hw_gen2(hw); - if (ret_val != IXGBE_SUCCESS) - goto out; + ixgbe_start_hw_gen2(hw); /* We need to run link autotry after the driver loads */ hw->mac.autotry_restart = true; diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 97a392829538..d049b7c6d9cd 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -457,7 +457,7 @@ s32 ixgbe_start_hw_generic(struct ixgbe_hw *hw) * 82599 * X540 **/ -s32 ixgbe_start_hw_gen2(struct ixgbe_hw *hw) +void ixgbe_start_hw_gen2(struct ixgbe_hw *hw) { u32 i; u32 regval; @@ -482,8 +482,6 @@ s32 ixgbe_start_hw_gen2(struct ixgbe_hw *hw) IXGBE_DCA_RXCTRL_HEAD_WRO_EN); IXGBE_WRITE_REG(hw, IXGBE_DCA_RXCTRL(i), regval); } - - return IXGBE_SUCCESS; } /** diff --git a/sys/dev/ixgbe/ixgbe_common.h b/sys/dev/ixgbe/ixgbe_common.h index b072770acafa..051af213b628 100644 --- a/sys/dev/ixgbe/ixgbe_common.h +++ b/sys/dev/ixgbe/ixgbe_common.h @@ -56,7 +56,7 @@ u16 ixgbe_get_pcie_msix_count_generic(struct ixgbe_hw *hw); s32 ixgbe_init_ops_generic(struct ixgbe_hw *hw); s32 ixgbe_init_hw_generic(struct ixgbe_hw *hw); s32 ixgbe_start_hw_generic(struct ixgbe_hw *hw); -s32 ixgbe_start_hw_gen2(struct ixgbe_hw *hw); +void ixgbe_start_hw_gen2(struct ixgbe_hw *hw); s32 ixgbe_clear_hw_cntrs_generic(struct ixgbe_hw *hw); s32 ixgbe_read_pba_num_generic(struct ixgbe_hw *hw, u32 *pba_num); s32 ixgbe_read_pba_string_generic(struct ixgbe_hw *hw, u8 *pba_num, diff --git a/sys/dev/ixgbe/ixgbe_phy.c b/sys/dev/ixgbe/ixgbe_phy.c index e9e1dd2d8c1c..5a2f49e9ebac 100644 --- a/sys/dev/ixgbe/ixgbe_phy.c +++ b/sys/dev/ixgbe/ixgbe_phy.c @@ -39,10 +39,10 @@ static void ixgbe_i2c_start(struct ixgbe_hw *hw); static void ixgbe_i2c_stop(struct ixgbe_hw *hw); -static s32 ixgbe_clock_in_i2c_byte(struct ixgbe_hw *hw, u8 *data); +static void ixgbe_clock_in_i2c_byte(struct ixgbe_hw *hw, u8 *data); static s32 ixgbe_clock_out_i2c_byte(struct ixgbe_hw *hw, u8 data); static s32 ixgbe_get_i2c_ack(struct ixgbe_hw *hw); -static s32 ixgbe_clock_in_i2c_bit(struct ixgbe_hw *hw, bool *data); +static void ixgbe_clock_in_i2c_bit(struct ixgbe_hw *hw, bool *data); static s32 ixgbe_clock_out_i2c_bit(struct ixgbe_hw *hw, bool data); static void ixgbe_raise_i2c_clk(struct ixgbe_hw *hw, u32 *i2cctl); static void ixgbe_lower_i2c_clk(struct ixgbe_hw *hw, u32 *i2cctl); @@ -77,11 +77,7 @@ static s32 ixgbe_out_i2c_byte_ack(struct ixgbe_hw *hw, u8 byte) */ static s32 ixgbe_in_i2c_byte_ack(struct ixgbe_hw *hw, u8 *byte) { - s32 status; - - status = ixgbe_clock_in_i2c_byte(hw, byte); - if (status) - return status; + ixgbe_clock_in_i2c_byte(hw, byte); /* ACK */ return ixgbe_clock_out_i2c_bit(hw, false); } @@ -154,8 +150,7 @@ s32 ixgbe_read_i2c_combined_generic_int(struct ixgbe_hw *hw, u8 addr, u16 reg, if (ixgbe_in_i2c_byte_ack(hw, &low_bits)) goto fail; /* Get csum */ - if (ixgbe_clock_in_i2c_byte(hw, &csum_byte)) - goto fail; + ixgbe_clock_in_i2c_byte(hw, &csum_byte); /* NACK */ if (ixgbe_clock_out_i2c_bit(hw, false)) goto fail; @@ -2043,9 +2038,7 @@ static s32 ixgbe_read_i2c_byte_generic_int(struct ixgbe_hw *hw, u8 byte_offset, if (status != IXGBE_SUCCESS) goto fail; - status = ixgbe_clock_in_i2c_byte(hw, data); - if (status != IXGBE_SUCCESS) - goto fail; + ixgbe_clock_in_i2c_byte(hw, data); status = ixgbe_clock_out_i2c_bit(hw, nack); if (status != IXGBE_SUCCESS) @@ -2290,7 +2283,7 @@ static void ixgbe_i2c_stop(struct ixgbe_hw *hw) * * Clocks in one byte data via I2C data/clock **/ -static s32 ixgbe_clock_in_i2c_byte(struct ixgbe_hw *hw, u8 *data) +static void ixgbe_clock_in_i2c_byte(struct ixgbe_hw *hw, u8 *data) { s32 i; bool bit = 0; @@ -2302,8 +2295,6 @@ static s32 ixgbe_clock_in_i2c_byte(struct ixgbe_hw *hw, u8 *data) ixgbe_clock_in_i2c_bit(hw, &bit); *data |= bit << i; } - - return IXGBE_SUCCESS; } /** @@ -2399,7 +2390,7 @@ static s32 ixgbe_get_i2c_ack(struct ixgbe_hw *hw) * * Clocks in one bit via I2C data/clock **/ -static s32 ixgbe_clock_in_i2c_bit(struct ixgbe_hw *hw, bool *data) +static void ixgbe_clock_in_i2c_bit(struct ixgbe_hw *hw, bool *data) { u32 i2cctl = IXGBE_READ_REG(hw, IXGBE_I2CCTL_BY_MAC(hw)); u32 data_oe_bit = IXGBE_I2C_DATA_OE_N_EN_BY_MAC(hw); @@ -2424,8 +2415,6 @@ static s32 ixgbe_clock_in_i2c_bit(struct ixgbe_hw *hw, bool *data) /* Minimum low period of clock is 4.7 us */ usec_delay(IXGBE_I2C_T_LOW); - - return IXGBE_SUCCESS; } /** diff --git a/sys/dev/ixgbe/ixgbe_x540.c b/sys/dev/ixgbe/ixgbe_x540.c index 4ba256ede44a..d03b34ee8135 100644 --- a/sys/dev/ixgbe/ixgbe_x540.c +++ b/sys/dev/ixgbe/ixgbe_x540.c @@ -323,7 +323,7 @@ s32 ixgbe_start_hw_X540(struct ixgbe_hw *hw) if (ret_val != IXGBE_SUCCESS) goto out; - ret_val = ixgbe_start_hw_gen2(hw); + ixgbe_start_hw_gen2(hw); out: return ret_val; From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 297666AC62A; Tue, 14 Sep 2021 00:41:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l0L6MTqz3Pfm; Tue, 14 Sep 2021 00:41:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E2891149C; Tue, 14 Sep 2021 00:41:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0fYED040196; Tue, 14 Sep 2021 00:41:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0fYdK040195; Tue, 14 Sep 2021 00:41:34 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:34 GMT Message-Id: <202109140041.18E0fYdK040195@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 538d7e8b1acb - stable/13 - ixgbe: increase the timeout MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 538d7e8b1acb0c749002ccdff560b680f33c30d8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:40 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=538d7e8b1acb0c749002ccdff560b680f33c30d8 commit 538d7e8b1acb0c749002ccdff560b680f33c30d8 Author: Qiming Yang AuthorDate: 2018-01-10 16:04:33 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:37:46 +0000 ixgbe: increase the timeout Increase SECRX_RDY polling frequency and semaphore timeout which fixes the FWSW.PT check in ixgbe_mng_present(). Signed-off-by: Qiming Yang Acked-by: Wenzhuo Lu Approved by: imp Obtained from: DPDK (6175260d12cc22852cecf2fb7ecd95cdb07611b5) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 5fd1f4be8d81a0019c632103121d68e2f20bc238) --- sys/dev/ixgbe/ixgbe_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index d049b7c6d9cd..50e18bcba997 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -3356,7 +3356,7 @@ void ixgbe_release_swfw_sync(struct ixgbe_hw *hw, u32 mask) **/ s32 ixgbe_disable_sec_rx_path_generic(struct ixgbe_hw *hw) { -#define IXGBE_MAX_SECRX_POLL 40 +#define IXGBE_MAX_SECRX_POLL 4000 int i; int secrxreg; @@ -3373,7 +3373,7 @@ s32 ixgbe_disable_sec_rx_path_generic(struct ixgbe_hw *hw) break; else /* Use interrupt-safe sleep just in case */ - usec_delay(1000); + usec_delay(10); } /* For informational purposes only */ From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0FC386ABFFC; Tue, 14 Sep 2021 00:41:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l0H3cFXz3PWw; Tue, 14 Sep 2021 00:41:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC1A91140E; Tue, 14 Sep 2021 00:41:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0fTvJ040100; Tue, 14 Sep 2021 00:41:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0fTu1040099; Tue, 14 Sep 2021 00:41:29 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:29 GMT Message-Id: <202109140041.18E0fTu1040099@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: b469839bfdd0 - stable/13 - ixgbe: add register definitions for NVM update MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b469839bfdd0353e4727cea8adc6900f4908f1ab Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:36 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=b469839bfdd0353e4727cea8adc6900f4908f1ab commit b469839bfdd0353e4727cea8adc6900f4908f1ab Author: Guinan Sun AuthorDate: 2020-07-09 08:00:32 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:37:36 +0000 ixgbe: add register definitions for NVM update Added additional register for X550 and above device family. Signed-off-by: Piotr Skajewski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (4a6847d78814b1c3df896efe31562643d419317d) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit ff8db817abbd348f0a7518ce32f0e52c6ab8e06e) --- sys/dev/ixgbe/ixgbe_type.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h index 48751e7386bb..1c04f09df77c 100644 --- a/sys/dev/ixgbe/ixgbe_type.h +++ b/sys/dev/ixgbe/ixgbe_type.h @@ -1095,8 +1095,10 @@ struct ixgbe_dmac_config { #define IXGBE_HSMC0R 0x15F04 #define IXGBE_HSMC1R 0x15F08 #define IXGBE_SWSR 0x15F10 +#define IXGBE_FWRESETCNT 0x15F40 #define IXGBE_HFDR 0x15FE8 #define IXGBE_FLEX_MNG 0x15800 /* 0x15800 - 0x15EFC */ +#define IXGBE_FLEX_MNG_PTR(_i) (IXGBE_FLEX_MNG + ((_i) * 4)) #define IXGBE_HICR_EN 0x01 /* Enable bit - RO */ /* Driver sets this bit when done to put command in RAM */ From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:41:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0C626ABFFF; Tue, 14 Sep 2021 00:41:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l0J3nlYz3PWy; Tue, 14 Sep 2021 00:41:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DBD711253; Tue, 14 Sep 2021 00:41:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0fU3P040124; Tue, 14 Sep 2021 00:41:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0fU5C040123; Tue, 14 Sep 2021 00:41:30 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:30 GMT Message-Id: <202109140041.18E0fU5C040123@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: ae1d4986a529 - stable/13 - ixgbe: create function to restart autoneg MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ae1d4986a529d265cd577264700f7a833b064171 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:37 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ae1d4986a529d265cd577264700f7a833b064171 commit ae1d4986a529d265cd577264700f7a833b064171 Author: Guinan Sun AuthorDate: 2020-07-09 08:00:36 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:37:39 +0000 ixgbe: create function to restart autoneg This patch is for restarting auto negotiation on PHY. Signed-off-by: Jakub Chylkowski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (664ea2614eafbec8eda5c86764ff047475a1e5c6) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 80a39a2bda8208c716f614f792c8d9a3628d6c26) --- sys/dev/ixgbe/ixgbe_phy.c | 48 ++++++++++++++++++++++------------------------- sys/dev/ixgbe/ixgbe_phy.h | 1 + 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_phy.c b/sys/dev/ixgbe/ixgbe_phy.c index c1cbc282c790..e9e1dd2d8c1c 100644 --- a/sys/dev/ixgbe/ixgbe_phy.c +++ b/sys/dev/ixgbe/ixgbe_phy.c @@ -573,6 +573,26 @@ out: return status; } +/** + * ixgbe_restart_auto_neg - Restart auto negotiation on the PHY + * @hw: pointer to hardware structure + **/ +void ixgbe_restart_auto_neg(struct ixgbe_hw *hw) +{ + u16 autoneg_reg; + + /* Check if PHY reset is blocked by MNG FW */ + if (ixgbe_check_reset_blocked(hw)) + return; + + /* Restart PHY auto-negotiation. */ + hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL, + IXGBE_MDIO_AUTO_NEG_DEV_TYPE, &autoneg_reg); + autoneg_reg |= IXGBE_MII_RESTART; + hw->phy.ops.write_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL, + IXGBE_MDIO_AUTO_NEG_DEV_TYPE, autoneg_reg); +} + /** * ixgbe_read_phy_mdi - Reads a value from a specified PHY register without * the SWFW lock @@ -857,19 +877,7 @@ s32 ixgbe_setup_phy_link_generic(struct ixgbe_hw *hw) IXGBE_MDIO_AUTO_NEG_DEV_TYPE, autoneg_reg); - /* Blocked by MNG FW so don't reset PHY */ - if (ixgbe_check_reset_blocked(hw)) - return status; - - /* Restart PHY auto-negotiation. */ - hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL, - IXGBE_MDIO_AUTO_NEG_DEV_TYPE, &autoneg_reg); - - autoneg_reg |= IXGBE_MII_RESTART; - - hw->phy.ops.write_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL, - IXGBE_MDIO_AUTO_NEG_DEV_TYPE, autoneg_reg); - + ixgbe_restart_auto_neg(hw); return status; } @@ -1093,19 +1101,7 @@ s32 ixgbe_setup_phy_link_tnx(struct ixgbe_hw *hw) autoneg_reg); } - /* Blocked by MNG FW so don't reset PHY */ - if (ixgbe_check_reset_blocked(hw)) - return status; - - /* Restart PHY auto-negotiation. */ - hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL, - IXGBE_MDIO_AUTO_NEG_DEV_TYPE, &autoneg_reg); - - autoneg_reg |= IXGBE_MII_RESTART; - - hw->phy.ops.write_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL, - IXGBE_MDIO_AUTO_NEG_DEV_TYPE, autoneg_reg); - + ixgbe_restart_auto_neg(hw); return status; } diff --git a/sys/dev/ixgbe/ixgbe_phy.h b/sys/dev/ixgbe/ixgbe_phy.h index 9fd3f6d2163e..7f51ccc1dd2c 100644 --- a/sys/dev/ixgbe/ixgbe_phy.h +++ b/sys/dev/ixgbe/ixgbe_phy.h @@ -163,6 +163,7 @@ enum ixgbe_phy_type ixgbe_get_phy_type_from_id(u32 phy_id); s32 ixgbe_get_phy_id(struct ixgbe_hw *hw); s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw); s32 ixgbe_reset_phy_generic(struct ixgbe_hw *hw); +void ixgbe_restart_auto_neg(struct ixgbe_hw *hw); s32 ixgbe_read_phy_reg_mdi(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, u16 *phy_data); s32 ixgbe_write_phy_reg_mdi(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 20D536AD2BB; Tue, 14 Sep 2021 00:48:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l7h0Txlz3R8J; Tue, 14 Sep 2021 00:48:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDD641126A; Tue, 14 Sep 2021 00:47:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0lxiv044942; Tue, 14 Sep 2021 00:47:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0lxUU044941; Tue, 14 Sep 2021 00:47:59 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:47:59 GMT Message-Id: <202109140047.18E0lxUU044941@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: fa82c3b5ce38 - stable/12 - ixgbe: clear all queues on VF reset MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: fa82c3b5ce38a512c60c15f2d174ec979a933e37 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:00 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=fa82c3b5ce38a512c60c15f2d174ec979a933e37 commit fa82c3b5ce38a512c60c15f2d174ec979a933e37 Author: Simon Ellmann AuthorDate: 2020-12-17 17:14:52 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:42:30 +0000 ixgbe: clear all queues on VF reset ixgbe devices support up to 8 Rx and Tx queues per virtual function. Currently, the registers of only seven queues are set to default when resetting a VF. Signed-off-by: Simon Ellmann Acked-by: Haiyue Wang Approved by: imp Obtained from: DPDK (d2565b347915def3a0f3c68bde6824acf096a0e6) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 7165504a17682dc8c96d44c65319bf73c89f7f10) --- sys/dev/ixgbe/ixgbe_vf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_vf.c b/sys/dev/ixgbe/ixgbe_vf.c index 5dfd28f7bf4f..e692f12ebb0d 100644 --- a/sys/dev/ixgbe/ixgbe_vf.c +++ b/sys/dev/ixgbe/ixgbe_vf.c @@ -117,7 +117,7 @@ static void ixgbe_virt_clr_reg(struct ixgbe_hw *hw) IXGBE_WRITE_REG(hw, IXGBE_VFPSRTYPE, 0); - for (i = 0; i < 7; i++) { + for (i = 0; i < 8; i++) { IXGBE_WRITE_REG(hw, IXGBE_VFRDH(i), 0); IXGBE_WRITE_REG(hw, IXGBE_VFRDT(i), 0); IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(i), 0); From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 275C76AD168; Tue, 14 Sep 2021 00:48:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l7j0fKsz3RFL; Tue, 14 Sep 2021 00:48:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EACD11152D; Tue, 14 Sep 2021 00:48:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0m0wQ044966; Tue, 14 Sep 2021 00:48:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0m0le044965; Tue, 14 Sep 2021 00:48:00 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:00 GMT Message-Id: <202109140048.18E0m0le044965@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 71d226bbd9f4 - stable/12 - ixgbe: fix infinite recursion on PCIe link down MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 71d226bbd9f426f7bbc67d0b775eafce7dd7317b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:01 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=71d226bbd9f426f7bbc67d0b775eafce7dd7317b commit 71d226bbd9f426f7bbc67d0b775eafce7dd7317b Author: Guinan Sun AuthorDate: 2020-07-09 08:00:31 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:42:36 +0000 ixgbe: fix infinite recursion on PCIe link down In some corner cases the functions ixgbe_clear_rar_generic and ixgbe_clear_vmdq_generic may call one another leading to infinite recursion. When ixgbe_clear_vmdq_generic is called with IXGBE_CLEAR_VMDQ_ALL flag, it's going to clear MPSAR registers, and proceed to call ixgbe_clear_rar_generic, which in turn will clear the RAR registers, and recursively call back ixgbe_clear_vmdq_generic. Normally, the latter would detect that MPSAR registers have already been cleared and terminate the recursion. However, when PCIe link is down, and before the driver has had the opportunity to shut itself down, all register reads return 0xFFFFFFFF, and all register writes fail silently. In such case, because ixgbe_clear_vmdq_generic blindly assumes that clearing MPSAR registers succeeded, it's going to always call ixgbe_clear_rar_generic, which in turn will always call back ixgbe_clear_vmdq_generic, creating infinite recursion. This patch re-reads MPSAR register values after they had been cleared. In case of PCIe link failure, the values read will be non-zero, which will terminate the recursion. On the other hand, under normal circumstances the value read from MPSAR registers is going to be equal to the value previously written, so this patch is expected not to cause any regressions. Signed-off-by: Robert Konklewski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (2d04b9e856125197ec8e967471426d56ab7efcf0) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 8270b7174c48417a4d5f3effa4a4f4588205e687) --- sys/dev/ixgbe/ixgbe_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 7a39efa7787d..509d592cca3b 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -3813,11 +3813,11 @@ s32 ixgbe_clear_vmdq_generic(struct ixgbe_hw *hw, u32 rar, u32 vmdq) if (vmdq == IXGBE_CLEAR_VMDQ_ALL) { if (mpsar_lo) { IXGBE_WRITE_REG(hw, IXGBE_MPSAR_LO(rar), 0); - mpsar_lo = 0; + mpsar_lo = IXGBE_READ_REG(hw, IXGBE_MPSAR_LO(rar)); } if (mpsar_hi) { IXGBE_WRITE_REG(hw, IXGBE_MPSAR_HI(rar), 0); - mpsar_hi = 0; + mpsar_hi = IXGBE_READ_REG(hw, IXGBE_MPSAR_HI(rar)); } } else if (vmdq < 32) { mpsar_lo &= ~(1 << vmdq); From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8DDB66AD320; Tue, 14 Sep 2021 00:48:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l7k3WS6z3RFT; Tue, 14 Sep 2021 00:48:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21BF8112EA; Tue, 14 Sep 2021 00:48:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0m2Oi044990; Tue, 14 Sep 2021 00:48:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0m2px044989; Tue, 14 Sep 2021 00:48:02 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:02 GMT Message-Id: <202109140048.18E0m2px044989@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 0a1ea6cebe9e - stable/12 - ixgbe: add IPv6 mask for flow director MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 0a1ea6cebe9e1ae4ad64b2dd9e507e4dabaa2a5f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:02 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=0a1ea6cebe9e1ae4ad64b2dd9e507e4dabaa2a5f commit 0a1ea6cebe9e1ae4ad64b2dd9e507e4dabaa2a5f Author: Guinan Sun AuthorDate: 2020-07-09 08:00:42 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:42:42 +0000 ixgbe: add IPv6 mask for flow director Write FDIRIP6M register to allow flow director filter to set ipv6 rules without setting ipv6 source/destination address. Signed-off-by: Piotr Skajewski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (21feefa2fcd5899ee26a10be405c17c0a1109860) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit c4f73d5d6a6c0117e08a03920cce69202865ba13) --- sys/dev/ixgbe/ixgbe_82599.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c index e92fb1292da2..15febd08352e 100644 --- a/sys/dev/ixgbe/ixgbe_82599.c +++ b/sys/dev/ixgbe/ixgbe_82599.c @@ -1868,6 +1868,7 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw, ~input_mask->formatted.src_ip[0]); IXGBE_WRITE_REG_BE32(hw, IXGBE_FDIRDIP4M, ~input_mask->formatted.dst_ip[0]); + IXGBE_WRITE_REG_BE32(hw, IXGBE_FDIRIP6M, 0xFFFFFFFF); } return IXGBE_SUCCESS; } From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 95A876AD322; Tue, 14 Sep 2021 00:48:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l7l3YLyz3RH7; Tue, 14 Sep 2021 00:48:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 585F1114B4; Tue, 14 Sep 2021 00:48:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0m3ML045014; Tue, 14 Sep 2021 00:48:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0m3LS045013; Tue, 14 Sep 2021 00:48:03 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:03 GMT Message-Id: <202109140048.18E0m3LS045013@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 925f00e23ea7 - stable/12 - ixgbe: improve log about autoneg being disabled MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 925f00e23ea797ad29e13fc471c139f47648c6d2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:04 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=925f00e23ea797ad29e13fc471c139f47648c6d2 commit 925f00e23ea797ad29e13fc471c139f47648c6d2 Author: Guinan Sun AuthorDate: 2020-07-09 08:00:41 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:42:49 +0000 ixgbe: improve log about autoneg being disabled On ESXi OS, when user disables auto negotiation, the following log appears: "(unsupported) Flow control autoneg is disabled". It is true that auto negotiation is disabled but it is not necessarily true that it is not supported. Signed-off-by: Jakub Chylkowski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (ab6ac48d483ef7f906b90f45182f2ddf3254d876) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit f511cd22586a9c0358b86334a51e3db60ca2db01) --- sys/dev/ixgbe/ixgbe_common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 509d592cca3b..85228c82061c 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -3118,8 +3118,9 @@ void ixgbe_fc_autoneg(struct ixgbe_hw *hw) * - link is not up. */ if (hw->fc.disable_fc_autoneg) { - ERROR_REPORT1(IXGBE_ERROR_UNSUPPORTED, - "Flow control autoneg is disabled"); + /* TODO: This should be just an informative log */ + ERROR_REPORT1(IXGBE_ERROR_CAUTION, + "Flow control autoneg is disabled"); goto out; } From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F4546AD2CD; Tue, 14 Sep 2021 00:48:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l7n5cqrz3RBl; Tue, 14 Sep 2021 00:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8ED46114B5; Tue, 14 Sep 2021 00:48:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0m5dB045068; Tue, 14 Sep 2021 00:48:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0m5di045067; Tue, 14 Sep 2021 00:48:05 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:05 GMT Message-Id: <202109140048.18E0m5di045067@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 722894a2049e - stable/12 - ixgbe: fix host interface shadow RAM read MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 722894a2049e35278b19e6d54511edee2fda56c7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:06 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=722894a2049e35278b19e6d54511edee2fda56c7 commit 722894a2049e35278b19e6d54511edee2fda56c7 Author: Guinan Sun AuthorDate: 2020-07-09 08:00:28 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:43:02 +0000 ixgbe: fix host interface shadow RAM read Host interface Shadow RAM Read (0x31) command response buffer length should be stored in two bytes, instead of one byte. This patch fixes it. Signed-off-by: Mateusz Kowalski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (713fc4dd340e5eadd3bfa9a468446afaa5188624) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 31a23e3eb5314a6b5929e980a0810803adfaad1f) --- sys/dev/ixgbe/ixgbe_common.c | 3 ++- sys/dev/ixgbe/ixgbe_type.h | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index f14b745f3115..833aaff8b691 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -4636,7 +4636,8 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer, * Read Flash command requires reading buffer length from * two byes instead of one byte */ - if (resp->cmd == 0x30) { + if (resp->cmd == IXGBE_HOST_INTERFACE_FLASH_READ_CMD || + resp->cmd == IXGBE_HOST_INTERFACE_SHADOW_RAM_READ_CMD) { for (; bi < dword_len + 2; bi++) { buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi); diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h index 1d00eadc890a..9619b771ea89 100644 --- a/sys/dev/ixgbe/ixgbe_type.h +++ b/sys/dev/ixgbe/ixgbe_type.h @@ -2426,6 +2426,16 @@ enum { #define IXGBE_FW_LESM_PARAMETERS_PTR 0x2 #define IXGBE_FW_LESM_STATE_1 0x1 #define IXGBE_FW_LESM_STATE_ENABLED 0x8000 /* LESM Enable bit */ +#define IXGBE_FW_LESM_2_STATES_ENABLED_MASK 0x1F +#define IXGBE_FW_LESM_2_STATES_ENABLED 0x12 +#define IXGBE_FW_LESM_STATE0_10G_ENABLED 0x6FFF +#define IXGBE_FW_LESM_STATE1_10G_ENABLED 0x4FFF +#define IXGBE_FW_LESM_STATE0_10G_DISABLED 0x0FFF +#define IXGBE_FW_LESM_STATE1_10G_DISABLED 0x2FFF +#define IXGBE_FW_LESM_PORT0_STATE0_OFFSET 0x2 +#define IXGBE_FW_LESM_PORT0_STATE1_OFFSET 0x3 +#define IXGBE_FW_LESM_PORT1_STATE0_OFFSET 0x6 +#define IXGBE_FW_LESM_PORT1_STATE1_OFFSET 0x7 #define IXGBE_FW_PASSTHROUGH_PATCH_CONFIG_PTR 0x4 #define IXGBE_FW_PATCH_VERSION_4 0x7 #define IXGBE_FCOE_IBA_CAPS_BLK_PTR 0x33 /* iSCSI/FCOE block */ @@ -4427,6 +4437,18 @@ struct ixgbe_bypass_eeprom { #define IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD \ (0x1F << IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD_SHIFT) +/* Code Command (Flash I/F Interface) */ +#define IXGBE_HOST_INTERFACE_FLASH_READ_CMD 0x30 +#define IXGBE_HOST_INTERFACE_SHADOW_RAM_READ_CMD 0x31 +#define IXGBE_HOST_INTERFACE_FLASH_WRITE_CMD 0x32 +#define IXGBE_HOST_INTERFACE_SHADOW_RAM_WRITE_CMD 0x33 +#define IXGBE_HOST_INTERFACE_FLASH_MODULE_UPDATE_CMD 0x34 +#define IXGBE_HOST_INTERFACE_FLASH_BLOCK_EREASE_CMD 0x35 +#define IXGBE_HOST_INTERFACE_SHADOW_RAM_DUMP_CMD 0x36 +#define IXGBE_HOST_INTERFACE_FLASH_INFO_CMD 0x37 +#define IXGBE_HOST_INTERFACE_APPLY_UPDATE_CMD 0x38 +#define IXGBE_HOST_INTERFACE_MASK_CMD 0x000000FF + #define IXGBE_REQUEST_TASK_MOD 0x01 #define IXGBE_REQUEST_TASK_MSF 0x02 #define IXGBE_REQUEST_TASK_MBX 0x04 From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A8A326AD2C8; Tue, 14 Sep 2021 00:48:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l7m40jnz3R8Z; Tue, 14 Sep 2021 00:48:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 68BC7112EB; Tue, 14 Sep 2021 00:48:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0m4Vh045038; Tue, 14 Sep 2021 00:48:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0m4n2045037; Tue, 14 Sep 2021 00:48:04 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:04 GMT Message-Id: <202109140048.18E0m4n2045037@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 5da82378ecce - stable/12 - ixgbe: fix response to apply-update command MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5da82378eccec7bde2617e7591932e4c67431c40 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:04 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5da82378eccec7bde2617e7591932e4c67431c40 commit 5da82378eccec7bde2617e7591932e4c67431c40 Author: Guinan Sun AuthorDate: 2020-07-09 08:00:29 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:42:57 +0000 ixgbe: fix response to apply-update command For the "Apply Update" command the firmware does not given an response. For this command, success should be return. Signed-off-by: Mateusz Kowalski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (03b09c71c0c6c516ce05cad8e8aa75e8b9e14fba) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit c966c431c764c493fafbe65b717243a3c0b291be) --- sys/dev/ixgbe/ixgbe_common.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 85228c82061c..f14b745f3115 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -4557,11 +4557,18 @@ s32 ixgbe_hic_unlocked(struct ixgbe_hw *hw, u32 *buffer, u32 length, msec_delay(1); } + /* For each command except "Apply Update" perform + * status checks in the HICR registry. + */ + if ((buffer[0] & IXGBE_HOST_INTERFACE_MASK_CMD) == + IXGBE_HOST_INTERFACE_APPLY_UPDATE_CMD) + return IXGBE_SUCCESS; + /* Check command completion */ if ((timeout && i == timeout) || !(IXGBE_READ_REG(hw, IXGBE_HICR) & IXGBE_HICR_SV)) { ERROR_REPORT1(IXGBE_ERROR_CAUTION, - "Command has failed with no status valid.\n"); + "Command has failed with no status valid.\n"); return IXGBE_ERR_HOST_INTERFACE_COMMAND; } From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7EB506AD50A; Tue, 14 Sep 2021 00:48:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l7p6Y5Vz3RBn; Tue, 14 Sep 2021 00:48:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A13E911667; Tue, 14 Sep 2021 00:48:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0m6q2045093; Tue, 14 Sep 2021 00:48:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0m6N7045092; Tue, 14 Sep 2021 00:48:06 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:06 GMT Message-Id: <202109140048.18E0m6N7045092@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: b41dfee36aea - stable/12 - ixgbe: wait longer for link after fiber MAC setup MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: b41dfee36aea83b860e8ceec1075796353174132 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:07 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=b41dfee36aea83b860e8ceec1075796353174132 commit b41dfee36aea83b860e8ceec1075796353174132 Author: Matthew Smith AuthorDate: 2018-07-16 16:36:04 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:43:08 +0000 ixgbe: wait longer for link after fiber MAC setup After setting up the link on a fiber port, the maximum wait time for the link to come up is 500 ms in ixgbe_setup_mac_link_multispeed_fiber(). On an x550 SFP+ port, this is often not sufficiently long for the link to come up. This can result in never being able to retrieve accurate link status for the port using rte_eth_link_get_nowait(). Increase the maximum wait time in ixgbe_setup_mac_link_multispeed_fiber() to 1 s. Signed-off-by: Matthew Smith Acked-by: Qi Zhang Approved by: imp Obtained from: DPDK (64f1c8539c8ce99214b9eb1fb728a2c6745f3300) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit aaa3af802f90d93fdffb99100fe56f0bc3dda119) --- sys/dev/ixgbe/ixgbe_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 833aaff8b691..3720e6af66c0 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -5380,7 +5380,7 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, * Section 73.10.2, we may have to wait up to 500ms if KR is * attempted. 82599 uses the same timing for 10g SFI. */ - for (i = 0; i < 5; i++) { + for (i = 0; i < 10; i++) { /* Wait for the link partner to also set speed */ msec_delay(100); From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6239F6AD4A6; Tue, 14 Sep 2021 00:48:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l7r0g21z3h49; Tue, 14 Sep 2021 00:48:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3467114B6; Tue, 14 Sep 2021 00:48:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0m7ED045117; Tue, 14 Sep 2021 00:48:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0m7te045116; Tue, 14 Sep 2021 00:48:07 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:07 GMT Message-Id: <202109140048.18E0m7te045116@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 4cb3405226c4 - stable/12 - ixgbe: fix maximum wait time in comment MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 4cb3405226c4f14c75b555b328faf2be3ff2efd8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:08 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=4cb3405226c4f14c75b555b328faf2be3ff2efd8 commit 4cb3405226c4f14c75b555b328faf2be3ff2efd8 Author: Xiaolong Ye AuthorDate: 2018-11-15 07:20:05 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:43:13 +0000 ixgbe: fix maximum wait time in comment As the code has changed the max wait time to 1000ms, the comment should be changed accordingly. Signed-off-by: Xiaolong Ye Acked-by: Qi Zhang Approved by: imp Obtained from: DPDK (73247f1ced303c16987bb366d38a2d8a0fc40db4) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 96ef6eb3ae9d622906fb838c82ede3074f864cdc) --- sys/dev/ixgbe/ixgbe_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 3720e6af66c0..43e1736d0037 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -5377,7 +5377,7 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, ixgbe_flap_tx_laser(hw); /* Wait for the controller to acquire link. Per IEEE 802.3ap, - * Section 73.10.2, we may have to wait up to 500ms if KR is + * Section 73.10.2, we may have to wait up to 1000ms if KR is * attempted. 82599 uses the same timing for 10g SFI. */ for (i = 0; i < 10; i++) { From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53F926AD52C; Tue, 14 Sep 2021 00:48:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l7x5SGMz3h4W; Tue, 14 Sep 2021 00:48:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73DD2114B7; Tue, 14 Sep 2021 00:48:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0mDmf045243; Tue, 14 Sep 2021 00:48:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0mDpT045242; Tue, 14 Sep 2021 00:48:13 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:13 GMT Message-Id: <202109140048.18E0mDpT045242@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: ec3b6870a3f1 - stable/12 - ixgbe: add typecast for type mismatch MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ec3b6870a3f1cfa8280c19519e67a74d59a39415 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:14 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ec3b6870a3f1cfa8280c19519e67a74d59a39415 commit ec3b6870a3f1cfa8280c19519e67a74d59a39415 Author: Guinan Sun AuthorDate: 2020-07-09 08:00:37 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:43:44 +0000 ixgbe: add typecast for type mismatch Add typecast for type mismatch. Signed-off-by: Jakub Chylkowski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (d8e52b2cf771c31b523b46852fd86225b5a2c721) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 994dd6328c66fc277438ad51ed074f3c52096147) --- sys/dev/ixgbe/ixgbe_82599.c | 8 ++++---- sys/dev/ixgbe/ixgbe_common.c | 2 +- sys/dev/ixgbe/ixgbe_dcb_82598.c | 2 +- sys/dev/ixgbe/ixgbe_dcb_82599.c | 2 +- sys/dev/ixgbe/ixgbe_x550.c | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c index 15febd08352e..1f81f6109f1b 100644 --- a/sys/dev/ixgbe/ixgbe_82599.c +++ b/sys/dev/ixgbe/ixgbe_82599.c @@ -1583,7 +1583,7 @@ void ixgbe_fdir_add_signature_filter_82599(struct ixgbe_hw *hw, * is for FDIRCMD. Then do a 64-bit register write from FDIRHASH. */ fdirhashcmd = (u64)fdircmd << 32; - fdirhashcmd |= ixgbe_atr_compute_sig_hash_82599(input, common); + fdirhashcmd |= (u64)ixgbe_atr_compute_sig_hash_82599(input, common); IXGBE_WRITE_REG64(hw, IXGBE_FDIRHASH, fdirhashcmd); DEBUGOUT2("Tx Queue=%x hash=%x\n", queue, (u32)fdirhashcmd); @@ -1672,7 +1672,7 @@ static u32 ixgbe_get_fdirtcpm_82599(union ixgbe_atr_input *input_mask) { u32 mask = IXGBE_NTOHS(input_mask->formatted.dst_port); mask <<= IXGBE_FDIRTCPM_DPORTM_SHIFT; - mask |= IXGBE_NTOHS(input_mask->formatted.src_port); + mask |= (u32)IXGBE_NTOHS(input_mask->formatted.src_port); mask = ((mask & 0x55555555) << 1) | ((mask & 0xAAAAAAAA) >> 1); mask = ((mask & 0x33333333) << 2) | ((mask & 0xCCCCCCCC) >> 2); mask = ((mask & 0x0F0F0F0F) << 4) | ((mask & 0xF0F0F0F0) >> 4); @@ -1905,14 +1905,14 @@ s32 ixgbe_fdir_write_perfect_filter_82599(struct ixgbe_hw *hw, /* record source and destination port (little-endian)*/ fdirport = IXGBE_NTOHS(input->formatted.dst_port); fdirport <<= IXGBE_FDIRPORT_DESTINATION_SHIFT; - fdirport |= IXGBE_NTOHS(input->formatted.src_port); + fdirport |= (u32)IXGBE_NTOHS(input->formatted.src_port); IXGBE_WRITE_REG(hw, IXGBE_FDIRPORT, fdirport); } /* record VLAN (little-endian) and flex_bytes(big-endian) */ fdirvlan = IXGBE_STORE_AS_BE16(input->formatted.flex_bytes); fdirvlan <<= IXGBE_FDIRVLAN_FLEX_SHIFT; - fdirvlan |= IXGBE_NTOHS(input->formatted.vlan_id); + fdirvlan |= (u32)IXGBE_NTOHS(input->formatted.vlan_id); IXGBE_WRITE_REG(hw, IXGBE_FDIRVLAN, fdirvlan); if (cloud_mode) { diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 43e1736d0037..28461b587e6e 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -774,7 +774,7 @@ s32 ixgbe_read_pba_num_generic(struct ixgbe_hw *hw, u32 *pba_num) DEBUGOUT("NVM Read Error\n"); return ret_val; } - *pba_num |= data; + *pba_num |= (u32)data; return IXGBE_SUCCESS; } diff --git a/sys/dev/ixgbe/ixgbe_dcb_82598.c b/sys/dev/ixgbe/ixgbe_dcb_82598.c index 0845ba872a1d..37744462bc07 100644 --- a/sys/dev/ixgbe/ixgbe_dcb_82598.c +++ b/sys/dev/ixgbe/ixgbe_dcb_82598.c @@ -198,7 +198,7 @@ s32 ixgbe_dcb_config_tx_desc_arbiter_82598(struct ixgbe_hw *hw, for (i = 0; i < IXGBE_DCB_MAX_TRAFFIC_CLASS; i++) { max_credits = max[i]; reg = max_credits << IXGBE_TDTQ2TCCR_MCL_SHIFT; - reg |= refill[i]; + reg |= (u32)(refill[i]); reg |= (u32)(bwg_id[i]) << IXGBE_TDTQ2TCCR_BWG_SHIFT; if (tsa[i] == ixgbe_dcb_tsa_group_strict_cee) diff --git a/sys/dev/ixgbe/ixgbe_dcb_82599.c b/sys/dev/ixgbe/ixgbe_dcb_82599.c index 4799fe1d943a..3056cbf5c2f3 100644 --- a/sys/dev/ixgbe/ixgbe_dcb_82599.c +++ b/sys/dev/ixgbe/ixgbe_dcb_82599.c @@ -197,7 +197,7 @@ s32 ixgbe_dcb_config_tx_desc_arbiter_82599(struct ixgbe_hw *hw, u16 *refill, for (i = 0; i < IXGBE_DCB_MAX_TRAFFIC_CLASS; i++) { max_credits = max[i]; reg = max_credits << IXGBE_RTTDT2C_MCL_SHIFT; - reg |= refill[i]; + reg |= (u32)(refill[i]); reg |= (u32)(bwg_id[i]) << IXGBE_RTTDT2C_BWG_SHIFT; if (tsa[i] == ixgbe_dcb_tsa_group_strict_cee) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index a7759117f5b5..6edeeb178289 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -730,7 +730,7 @@ static s32 ixgbe_setup_fw_link(struct ixgbe_hw *hw) for (i = 0; i < sizeof(ixgbe_fw_map) / sizeof(ixgbe_fw_map[0]); ++i) { if (hw->phy.autoneg_advertised & ixgbe_fw_map[i].phy_speed) - setup[0] |= ixgbe_fw_map[i].fw_speed; + setup[0] |= (u32)(ixgbe_fw_map[i].fw_speed); } setup[0] |= FW_PHY_ACT_SETUP_LINK_HP | FW_PHY_ACT_SETUP_LINK_AN; From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 686336AD331; Tue, 14 Sep 2021 00:48:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l7s1QK7z3h1m; Tue, 14 Sep 2021 00:48:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB6881141D; Tue, 14 Sep 2021 00:48:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0m8O3045141; Tue, 14 Sep 2021 00:48:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0m87t045140; Tue, 14 Sep 2021 00:48:08 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:08 GMT Message-Id: <202109140048.18E0m87t045140@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 8b6d4eea1b52 - stable/12 - ixgbe: fix x550em 10G NIC link status MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 8b6d4eea1b5269dc8968b0c24ab866b494d0a5a0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:09 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=8b6d4eea1b5269dc8968b0c24ab866b494d0a5a0 commit 8b6d4eea1b5269dc8968b0c24ab866b494d0a5a0 Author: Guinan Sun AuthorDate: 2020-07-09 08:00:30 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:43:19 +0000 ixgbe: fix x550em 10G NIC link status With the NVM image for x550em XFI will not report the auto-negotiation feature correctly. The auto-negotiation should be "No" for supports and advertised items. At the same time update speed makes it support 1G and 10G. Signed-off-by: Piotr Skajewski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (fb03b51da940f1d56d701776fd85a0dfc1ace098) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 8e9f1b239dc00a2375af87c48321f85a1e37c14e) --- sys/dev/ixgbe/ixgbe_x550.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index 868b5cdc2e70..03904c026cae 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -1912,7 +1912,14 @@ s32 ixgbe_get_link_capabilities_X550em(struct ixgbe_hw *hw, else *speed = IXGBE_LINK_SPEED_10GB_FULL; } else { + *autoneg = true; + switch (hw->phy.type) { + case ixgbe_phy_x550em_xfi: + *speed = IXGBE_LINK_SPEED_1GB_FULL | + IXGBE_LINK_SPEED_10GB_FULL; + *autoneg = false; + break; case ixgbe_phy_ext_1g_t: case ixgbe_phy_sgmii: *speed = IXGBE_LINK_SPEED_1GB_FULL; @@ -1936,7 +1943,6 @@ s32 ixgbe_get_link_capabilities_X550em(struct ixgbe_hw *hw, IXGBE_LINK_SPEED_1GB_FULL; break; } - *autoneg = TRUE; } return IXGBE_SUCCESS; From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1E7D6AD1EC; Tue, 14 Sep 2021 00:48:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l7t3b26z3gy3; Tue, 14 Sep 2021 00:48:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21958112EC; Tue, 14 Sep 2021 00:48:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0m9ZI045165; Tue, 14 Sep 2021 00:48:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0m9MG045164; Tue, 14 Sep 2021 00:48:09 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:09 GMT Message-Id: <202109140048.18E0m9MG045164@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 9e971c3f9ad4 - stable/12 - ixgbe: initialize data field in struct buffer MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 9e971c3f9ad415f41954d96b38b59d8bb795bac3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:10 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=9e971c3f9ad415f41954d96b38b59d8bb795bac3 commit 9e971c3f9ad415f41954d96b38b59d8bb795bac3 Author: Guinan Sun AuthorDate: 2020-07-09 08:00:40 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:43:25 +0000 ixgbe: initialize data field in struct buffer While sending request using ixgbe_hic_unlocked() the data field in buffer struct is not used. It is set when the struct is overwritten by FW to deliver the response. To not pass random data to FW the whole structure should be zeroed before use. Signed-off-by: Krzysztof Galazka Signed-off-by: Piotr Pietruszewski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (40543be5376ca415b2a7e196315d0555725b8bdf) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit b3ebe337ffa06b0f1f460bf8f1e42fb55db77d0b) --- sys/dev/ixgbe/ixgbe_x550.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index 03904c026cae..02db10b61673 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -3137,6 +3137,7 @@ s32 ixgbe_read_ee_hostif_X550(struct ixgbe_hw *hw, u16 offset, u16 *data) /* one word */ buffer.length = IXGBE_CPU_TO_BE16(sizeof(u16)); buffer.pad2 = 0; + buffer.data = 0; buffer.pad3 = 0; status = hw->mac.ops.acquire_swfw_sync(hw, mask); @@ -3197,6 +3198,7 @@ s32 ixgbe_read_ee_hostif_buffer_X550(struct ixgbe_hw *hw, buffer.address = IXGBE_CPU_TO_BE32((offset + current_word) * 2); buffer.length = IXGBE_CPU_TO_BE16(words_to_read * 2); buffer.pad2 = 0; + buffer.data = 0; buffer.pad3 = 0; status = ixgbe_hic_unlocked(hw, (u32 *)&buffer, sizeof(buffer), From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1FF0F6AD334; Tue, 14 Sep 2021 00:48:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l7v42FWz3RKp; Tue, 14 Sep 2021 00:48:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D2DC1141E; Tue, 14 Sep 2021 00:48:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0mBI3045193; Tue, 14 Sep 2021 00:48:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0mBXf045192; Tue, 14 Sep 2021 00:48:11 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:11 GMT Message-Id: <202109140048.18E0mBXf045192@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 6d034e061a96 - stable/12 - ixgbe: check host interface return status MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6d034e061a965f28426981af1314da48d25af06b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:12 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=6d034e061a965f28426981af1314da48d25af06b commit 6d034e061a965f28426981af1314da48d25af06b Author: Guinan Sun AuthorDate: 2020-07-09 08:00:44 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:43:31 +0000 ixgbe: check host interface return status Writing to read-only fields returns a non-OK Return Status for shadow RAM write command for X550. This information was previously discarded. Signed-off-by: Stanislaw Grzeszczak Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (db18e37090a3b9af47d6a6886248520f6b220bf9) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit c1a56b6f5ffd6f3180a654d058c1783ccb808e8b) --- sys/dev/ixgbe/ixgbe_x550.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index 02db10b61673..7b120f841d85 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -3259,7 +3259,18 @@ s32 ixgbe_write_ee_hostif_data_X550(struct ixgbe_hw *hw, u16 offset, status = ixgbe_host_interface_command(hw, (u32 *)&buffer, sizeof(buffer), - IXGBE_HI_COMMAND_TIMEOUT, FALSE); + IXGBE_HI_COMMAND_TIMEOUT, TRUE); + if (status != IXGBE_SUCCESS) { + DEBUGOUT2("for offset %04x failed with status %d\n", + offset, status); + return status; + } + + if (buffer.hdr.rsp.buf_lenh_status != FW_CEM_RESP_STATUS_SUCCESS) { + DEBUGOUT2("for offset %04x host interface return status %02x\n", + offset, buffer.hdr.rsp.buf_lenh_status); + return IXGBE_ERR_HOST_INTERFACE_COMMAND; + } return status; } From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 937136AD4C1; Tue, 14 Sep 2021 00:48:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l812T5cz3gyS; Tue, 14 Sep 2021 00:48:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C0C0114B8; Tue, 14 Sep 2021 00:48:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0mGIn045317; Tue, 14 Sep 2021 00:48:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0mGMR045316; Tue, 14 Sep 2021 00:48:16 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:16 GMT Message-Id: <202109140048.18E0mGMR045316@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 321343a8b6bb - stable/12 - ixgbe: replace an operation in X550 setup MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 321343a8b6bbc71bc47aa9c32f5f9679bbbb7807 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:18 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=321343a8b6bbc71bc47aa9c32f5f9679bbbb7807 commit 321343a8b6bbc71bc47aa9c32f5f9679bbbb7807 Author: Xiaoyun Li AuthorDate: 2018-09-17 09:28:11 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:45:22 +0000 ixgbe: replace an operation in X550 setup Replace "=" operation with "|=" operation to only set the intended register bits. Signed-off-by: Xiaoyun Li Acked-by: Qi Zhang Approved by: imp Obtained from: DPDK (1b665ccd9cd73499e934b807bec2fd77193912ef) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit c85b6f2901e7804105ca1d6d41cc5eb9a60474b8) --- sys/dev/ixgbe/ixgbe_x550.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index bcfbe14b30d2..b5f1bc4f6ef8 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -2802,9 +2802,9 @@ s32 ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, (IXGBE_CS4227_EDC_MODE_SR << 1)); if (setup_linear) - reg_phy_ext = (IXGBE_CS4227_EDC_MODE_CX1 << 1) | 0x1; + reg_phy_ext |= (IXGBE_CS4227_EDC_MODE_CX1 << 1) | 0x1; else - reg_phy_ext = (IXGBE_CS4227_EDC_MODE_SR << 1) | 0x1; + reg_phy_ext |= (IXGBE_CS4227_EDC_MODE_SR << 1) | 0x1; ret_val = hw->phy.ops.write_reg(hw, reg_slice, IXGBE_MDIO_ZERO_DEV_TYPE, reg_phy_ext); From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:18 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D553B6AD428; Tue, 14 Sep 2021 00:48:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l822t1Gz3hCL; Tue, 14 Sep 2021 00:48:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 103B91141F; Tue, 14 Sep 2021 00:48:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0mHBX045345; Tue, 14 Sep 2021 00:48:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0mHeb045344; Tue, 14 Sep 2021 00:48:17 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:17 GMT Message-Id: <202109140048.18E0mHeb045344@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 461f788cc7e0 - stable/12 - ixgbe: remove dead code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 461f788cc7e0fb2e5bd1d72849c73d0652627290 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:19 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=461f788cc7e0fb2e5bd1d72849c73d0652627290 commit 461f788cc7e0fb2e5bd1d72849c73d0652627290 Author: Ferruh Yigit AuthorDate: 2020-06-30 14:45:54 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:45:28 +0000 ixgbe: remove dead code The question around getting rid of the assignments seems lived long enough, if they are not needed until now, we can drop them. Signed-off-by: Ferruh Yigit Acked-by: Qi Zhang Approved by: imp Obtained from: DPDK (a6395d471e14e5a7432875dad8fb3533238c5167) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 0b487fb4547ad1a939be0d523e555557c94b7cd1) --- sys/dev/ixgbe/ixgbe_dcb_82598.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_dcb_82598.c b/sys/dev/ixgbe/ixgbe_dcb_82598.c index 37744462bc07..20a350716289 100644 --- a/sys/dev/ixgbe/ixgbe_dcb_82598.c +++ b/sys/dev/ixgbe/ixgbe_dcb_82598.c @@ -67,14 +67,6 @@ s32 ixgbe_dcb_get_tc_stats_82598(struct ixgbe_hw *hw, stats->qprc[tc] += IXGBE_READ_REG(hw, IXGBE_QPRC(tc)); /* Received Bytes */ stats->qbrc[tc] += IXGBE_READ_REG(hw, IXGBE_QBRC(tc)); - -#if 0 - /* Can we get rid of these?? Consequently, getting rid - * of the tc_stats structure. - */ - tc_stats_array[up]->in_overflow_discards = 0; - tc_stats_array[up]->out_overflow_discards = 0; -#endif } return IXGBE_SUCCESS; From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1FE16AD2DF; Tue, 14 Sep 2021 00:48:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l7w4MJXz3RJ3; Tue, 14 Sep 2021 00:48:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E12111668; Tue, 14 Sep 2021 00:48:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0mC5r045219; Tue, 14 Sep 2021 00:48:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0mC1K045218; Tue, 14 Sep 2021 00:48:12 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:12 GMT Message-Id: <202109140048.18E0mC1K045218@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 419dafe93aac - stable/12 - ixgbe: wait for link after copper MAC setup MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 419dafe93aacf36d3a6d2a5da94d9ecf993f46f1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:13 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=419dafe93aacf36d3a6d2a5da94d9ecf993f46f1 commit 419dafe93aacf36d3a6d2a5da94d9ecf993f46f1 Author: Ashijeet Acharya AuthorDate: 2019-05-24 09:30:15 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:43:37 +0000 ixgbe: wait for link after copper MAC setup After setting up the link on x552/X557-AT 10GBASE-T NICs, sometimes the link does not get set up properly and as a result all the subsequent calls to ixgbe_check_link() from ixgbe_dev_link_update_share() fail. Introduce a delay time of 1s in ixgbe_setup_mac_link_t_X550em() before beginning to set up the external PHY link speed to ensure that the controller can acquire the link. Signed-off-by: Ashijeet Acharya Acked-by: Qi Zhang Approved by: imp Obtained from: DPDK (d31b95860d8e9dd7c6e242bd08baaac00a9714f0) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit d5bbb5500cf2ebeae078cb6ae38ecd4b15ec7f6d) --- sys/dev/ixgbe/ixgbe_x550.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index 7b120f841d85..a7759117f5b5 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -4464,6 +4464,8 @@ s32 ixgbe_setup_mac_link_t_X550em(struct ixgbe_hw *hw, { s32 status; ixgbe_link_speed force_speed; + u32 i; + bool link_up = false; DEBUGFUNC("ixgbe_setup_mac_link_t_X550em"); @@ -4483,6 +4485,19 @@ s32 ixgbe_setup_mac_link_t_X550em(struct ixgbe_hw *hw, if (status != IXGBE_SUCCESS) return status; + + /* Wait for the controller to acquire link */ + for (i = 0; i < 10; i++) { + msec_delay(100); + + status = ixgbe_check_link(hw, &force_speed, &link_up, + false); + if (status != IXGBE_SUCCESS) + return status; + + if (link_up) + break; + } } return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait_to_complete); From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 51D1E6AD2E0; Tue, 14 Sep 2021 00:48:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l7z09Rpz3RJN; Tue, 14 Sep 2021 00:48:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C93E711669; Tue, 14 Sep 2021 00:48:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0mEIi045267; Tue, 14 Sep 2021 00:48:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0mEqk045266; Tue, 14 Sep 2021 00:48:14 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:14 GMT Message-Id: <202109140048.18E0mEqk045266@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 834bb5a365ec - stable/12 - ixgbe: add FW recovery mode check MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 834bb5a365ecec3f2bcdb90cf53b3b181bc157a4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:15 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=834bb5a365ecec3f2bcdb90cf53b3b181bc157a4 commit 834bb5a365ecec3f2bcdb90cf53b3b181bc157a4 Author: Xiaoyun Li AuthorDate: 2018-09-17 09:28:10 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:43:50 +0000 ixgbe: add FW recovery mode check Add FM NVM recovery mode check. Allow the software to detect this. Signed-off-by: Xiaoyun Li Acked-by: Qi Zhang Approved by: imp Obtained from: DPDK (5fb0a9acbb844b21691568c0014866e0e887bd19) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit b622bdb4ebdfc6dfe1a332fcc912426559c829f3) --- sys/dev/ixgbe/ixgbe_api.c | 12 ++++++++++++ sys/dev/ixgbe/ixgbe_api.h | 1 + sys/dev/ixgbe/ixgbe_type.h | 4 ++++ sys/dev/ixgbe/ixgbe_x550.c | 16 ++++++++++++++++ sys/dev/ixgbe/ixgbe_x550.h | 1 + 5 files changed, 34 insertions(+) diff --git a/sys/dev/ixgbe/ixgbe_api.c b/sys/dev/ixgbe/ixgbe_api.c index c71afcb0df67..5e662dac93f9 100644 --- a/sys/dev/ixgbe/ixgbe_api.c +++ b/sys/dev/ixgbe/ixgbe_api.c @@ -1306,6 +1306,18 @@ void ixgbe_restore_mdd_vf(struct ixgbe_hw *hw, u32 vf) hw->mac.ops.restore_mdd_vf(hw, vf); } +/** + * ixgbe_fw_recovery_mode - Check if in FW NVM recovery mode + * @hw: pointer to hardware structure + * + **/ +bool ixgbe_fw_recovery_mode(struct ixgbe_hw *hw) +{ + if (hw->mac.ops.fw_recovery_mode) + return hw->mac.ops.fw_recovery_mode(hw); + return false; +} + /** * ixgbe_enter_lplu - Transition to low power states * @hw: pointer to hardware structure diff --git a/sys/dev/ixgbe/ixgbe_api.h b/sys/dev/ixgbe/ixgbe_api.h index c59b3a2dea9c..aabe573127f3 100644 --- a/sys/dev/ixgbe/ixgbe_api.h +++ b/sys/dev/ixgbe/ixgbe_api.h @@ -217,6 +217,7 @@ void ixgbe_disable_mdd(struct ixgbe_hw *hw); void ixgbe_enable_mdd(struct ixgbe_hw *hw); void ixgbe_mdd_event(struct ixgbe_hw *hw, u32 *vf_bitmap); void ixgbe_restore_mdd_vf(struct ixgbe_hw *hw, u32 vf); +bool ixgbe_fw_recovery_mode(struct ixgbe_hw *hw); s32 ixgbe_enter_lplu(struct ixgbe_hw *hw); s32 ixgbe_handle_lasi(struct ixgbe_hw *hw); void ixgbe_set_rate_select_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed); diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h index 9619b771ea89..c3c29dbdba52 100644 --- a/sys/dev/ixgbe/ixgbe_type.h +++ b/sys/dev/ixgbe/ixgbe_type.h @@ -1080,6 +1080,9 @@ struct ixgbe_dmac_config { #define IXGBE_FWSM_MODE_MASK 0xE #define IXGBE_FWSM_TS_ENABLED 0x1 #define IXGBE_FWSM_FW_MODE_PT 0x4 +#define IXGBE_FWSM_FW_NVM_RECOVERY_MODE (1 << 5) +#define IXGBE_FWSM_EXT_ERR_IND_MASK 0x01F80000 +#define IXGBE_FWSM_FW_VAL_BIT (1 << 15) /* ARC Subsystem registers */ #define IXGBE_HICR 0x15F00 @@ -4010,6 +4013,7 @@ struct ixgbe_mac_operations { void (*enable_mdd)(struct ixgbe_hw *hw); void (*mdd_event)(struct ixgbe_hw *hw, u32 *vf_bitmap); void (*restore_mdd_vf)(struct ixgbe_hw *hw, u32 vf); + bool (*fw_recovery_mode)(struct ixgbe_hw *hw); }; struct ixgbe_phy_operations { diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index 6edeeb178289..aa91c4da7019 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -83,6 +83,7 @@ s32 ixgbe_init_ops_X550(struct ixgbe_hw *hw) mac->ops.enable_mdd = ixgbe_enable_mdd_X550; mac->ops.mdd_event = ixgbe_mdd_event_X550; mac->ops.restore_mdd_vf = ixgbe_restore_mdd_vf_X550; + mac->ops.fw_recovery_mode = ixgbe_fw_recovery_mode_X550; mac->ops.disable_rx = ixgbe_disable_rx_x550; /* Manageability interface */ mac->ops.set_fw_drv_ver = ixgbe_set_fw_drv_ver_x550; @@ -4676,3 +4677,18 @@ s32 ixgbe_set_fw_drv_ver_x550(struct ixgbe_hw *hw, u8 maj, u8 min, return ret_val; } + +/** + * ixgbe_fw_recovery_mode_X550 - Check FW NVM recovery mode + * @hw: pointer t hardware structure + * + * Returns true if in FW NVM recovery mode. + **/ +bool ixgbe_fw_recovery_mode_X550(struct ixgbe_hw *hw) +{ + u32 fwsm; + + fwsm = IXGBE_READ_REG(hw, IXGBE_FWSM_BY_MAC(hw)); + + return !!(fwsm & IXGBE_FWSM_FW_NVM_RECOVERY_MODE); +} diff --git a/sys/dev/ixgbe/ixgbe_x550.h b/sys/dev/ixgbe/ixgbe_x550.h index 44c9d06a42d9..ac2de750cfb7 100644 --- a/sys/dev/ixgbe/ixgbe_x550.h +++ b/sys/dev/ixgbe/ixgbe_x550.h @@ -122,4 +122,5 @@ s32 ixgbe_reset_phy_t_X550em(struct ixgbe_hw *hw); s32 ixgbe_identify_sfp_module_X550em(struct ixgbe_hw *hw); s32 ixgbe_led_on_t_X550em(struct ixgbe_hw *hw, u32 led_idx); s32 ixgbe_led_off_t_X550em(struct ixgbe_hw *hw, u32 led_idx); +bool ixgbe_fw_recovery_mode_X550(struct ixgbe_hw *hw); #endif /* _IXGBE_X550_H_ */ From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A18E36AD2FD; Tue, 14 Sep 2021 00:48:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l860NkQz3h4w; Tue, 14 Sep 2021 00:48:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8044E1152E; Tue, 14 Sep 2021 00:48:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0mLSe045417; Tue, 14 Sep 2021 00:48:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0mL8R045416; Tue, 14 Sep 2021 00:48:21 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:21 GMT Message-Id: <202109140048.18E0mL8R045416@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: cf5be37b79fc - stable/12 - ixgbe: support DCB registers dump MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: cf5be37b79fcccb5d06871e729e24cd502be3d26 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:23 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=cf5be37b79fcccb5d06871e729e24cd502be3d26 commit cf5be37b79fcccb5d06871e729e24cd502be3d26 Author: Xiaoyun Li AuthorDate: 2018-09-17 09:28:13 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:45:51 +0000 ixgbe: support DCB registers dump Add support for DCB registers dump. Signed-off-by: Xiaoyun Li Acked-by: Qi Zhang Approved by: imp Obtained from: DPDK (36a036bc6fdd0da74576a39ab74e50954598ba82) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 9e65ae746da23e1affdf66adb8944656a9da003c) --- sys/dev/ixgbe/ixgbe_type.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h index a538af5d3569..48751e7386bb 100644 --- a/sys/dev/ixgbe/ixgbe_type.h +++ b/sys/dev/ixgbe/ixgbe_type.h @@ -863,6 +863,10 @@ struct ixgbe_dmac_config { #define IXGBE_RTTDQSEL 0x04904 #define IXGBE_RTTDT1C 0x04908 #define IXGBE_RTTDT1S 0x0490C +#define IXGBE_RTTQCNCR 0x08B00 +#define IXGBE_RTTQCNTG 0x04A90 +#define IXGBE_RTTBCNRD 0x0498C +#define IXGBE_RTTQCNRR 0x0498C #define IXGBE_RTTDTECC 0x04990 #define IXGBE_RTTDTECC_NO_BCN 0x00000100 @@ -873,6 +877,7 @@ struct ixgbe_dmac_config { #define IXGBE_RTTBCNRC_RF_INT_MASK \ (IXGBE_RTTBCNRC_RF_DEC_MASK << IXGBE_RTTBCNRC_RF_INT_SHIFT) #define IXGBE_RTTBCNRM 0x04980 +#define IXGBE_RTTQCNRM 0x04980 /* BCN (for DCB) Registers */ #define IXGBE_RTTBCNRS 0x04988 From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CFCB36AD261; Tue, 14 Sep 2021 00:48:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l7z75lJz3h8l; Tue, 14 Sep 2021 00:48:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD2EC112ED; Tue, 14 Sep 2021 00:48:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0mFWZ045291; Tue, 14 Sep 2021 00:48:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0mF9G045290; Tue, 14 Sep 2021 00:48:15 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:15 GMT Message-Id: <202109140048.18E0mF9G045290@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: e713db6b8ec7 - stable/12 - ixgbe: Use C99 bool types MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e713db6b8ec77c5eeb6943aa5ed46b1aa2c6f41e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:17 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=e713db6b8ec77c5eeb6943aa5ed46b1aa2c6f41e commit e713db6b8ec77c5eeb6943aa5ed46b1aa2c6f41e Author: Kevin Bowling AuthorDate: 2021-09-07 02:54:22 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:45:05 +0000 ixgbe: Use C99 bool types Approved by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 79b36ec91decc18d062fc428e2fd34d41aba0630) --- sys/dev/ixgbe/if_ix.c | 84 +++++++++++++------------- sys/dev/ixgbe/if_ixv.c | 30 +++++----- sys/dev/ixgbe/if_sriov.c | 24 ++++---- sys/dev/ixgbe/ix_txrx.c | 12 ++-- sys/dev/ixgbe/ixgbe.h | 4 +- sys/dev/ixgbe/ixgbe_82598.c | 48 +++++++-------- sys/dev/ixgbe/ixgbe_82599.c | 104 ++++++++++++++++---------------- sys/dev/ixgbe/ixgbe_api.c | 14 ++--- sys/dev/ixgbe/ixgbe_common.c | 130 ++++++++++++++++++++-------------------- sys/dev/ixgbe/ixgbe_dcb.c | 2 +- sys/dev/ixgbe/ixgbe_dcb_82599.c | 10 ++-- sys/dev/ixgbe/ixgbe_mbx.c | 2 +- sys/dev/ixgbe/ixgbe_mbx.h | 2 +- sys/dev/ixgbe/ixgbe_osdep.h | 4 -- sys/dev/ixgbe/ixgbe_phy.c | 84 +++++++++++++------------- sys/dev/ixgbe/ixgbe_vf.c | 18 +++--- sys/dev/ixgbe/ixgbe_x540.c | 8 +-- sys/dev/ixgbe/ixgbe_x550.c | 98 +++++++++++++++--------------- 18 files changed, 337 insertions(+), 341 deletions(-) diff --git a/sys/dev/ixgbe/if_ix.c b/sys/dev/ixgbe/if_ix.c index 0a64c4ffe595..655f9a0b52b4 100644 --- a/sys/dev/ixgbe/if_ix.c +++ b/sys/dev/ixgbe/if_ix.c @@ -331,7 +331,7 @@ SYSCTL_INT(_hw_ix, OID_AUTO, enable_msix, CTLFLAG_RDTUN, &ixgbe_enable_msix, 0, * of unsupported SFP+ modules, note that * doing so you are on your own :) */ -static int allow_unsupported_sfp = FALSE; +static int allow_unsupported_sfp = false; SYSCTL_INT(_hw_ix, OID_AUTO, unsupported_sfp, CTLFLAG_RDTUN, &allow_unsupported_sfp, 0, "Allow unsupported SFP modules...use at your own risk"); @@ -933,7 +933,7 @@ ixgbe_if_attach_pre(if_ctx_t ctx) /* Verify adapter fan is still functional (if applicable) */ if (adapter->feat_en & IXGBE_FEATURE_FAN_FAIL) { u32 esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); - ixgbe_check_fan_failure(adapter, esdp, FALSE); + ixgbe_check_fan_failure(adapter, esdp, false); } /* Ensure SW/FW semaphore is free */ @@ -942,16 +942,16 @@ ixgbe_if_attach_pre(if_ctx_t ctx) /* Set an initial default flow control value */ hw->fc.requested_mode = ixgbe_flow_control; - hw->phy.reset_if_overtemp = TRUE; + hw->phy.reset_if_overtemp = true; error = ixgbe_reset_hw(hw); - hw->phy.reset_if_overtemp = FALSE; + hw->phy.reset_if_overtemp = false; if (error == IXGBE_ERR_SFP_NOT_PRESENT) { /* * No optics in this port, set up * so the timer routine will probe * for later insertion. */ - adapter->sfp_probe = TRUE; + adapter->sfp_probe = true; error = 0; } else if (error == IXGBE_ERR_SFP_NOT_SUPPORTED) { device_printf(dev, "Unsupported SFP+ module detected!\n"); @@ -1087,7 +1087,7 @@ ixgbe_if_attach_post(if_ctx_t ctx) ixgbe_enable_tx_laser(hw); /* Enable power to the phy. */ - ixgbe_set_phy_power(hw, TRUE); + ixgbe_set_phy_power(hw, true); ixgbe_initialize_iov(adapter); @@ -1356,23 +1356,23 @@ ixgbe_is_sfp(struct ixgbe_hw *hw) switch (hw->mac.type) { case ixgbe_mac_82598EB: if (hw->phy.type == ixgbe_phy_nl) - return (TRUE); - return (FALSE); + return (true); + return (false); case ixgbe_mac_82599EB: switch (hw->mac.ops.get_media_type(hw)) { case ixgbe_media_type_fiber: case ixgbe_media_type_fiber_qsfp: - return (TRUE); + return (true); default: - return (FALSE); + return (false); } case ixgbe_mac_X550EM_x: case ixgbe_mac_X550EM_a: if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) - return (TRUE); - return (FALSE); + return (true); + return (false); default: - return (FALSE); + return (false); } } /* ixgbe_is_sfp */ @@ -1395,7 +1395,7 @@ ixgbe_config_link(if_ctx_t ctx) } else { if (hw->mac.ops.check_link) err = ixgbe_check_link(hw, &adapter->link_speed, - &adapter->link_up, FALSE); + &adapter->link_up, false); if (err) return; autoneg = hw->phy.autoneg_advertised; @@ -1884,7 +1884,7 @@ ixgbe_setup_vlan_hw_support(if_ctx_t ctx) ctrl |= IXGBE_RXDCTL_VME; IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(rxr->me), ctrl); } - rxr->vtag_strip = TRUE; + rxr->vtag_strip = true; } } @@ -1921,7 +1921,7 @@ ixgbe_get_slot_info(struct adapter *adapter) { device_t dev = iflib_get_dev(adapter->ctx); struct ixgbe_hw *hw = &adapter->hw; - int bus_info_valid = TRUE; + int bus_info_valid = true; u32 offset; u16 link; @@ -1970,7 +1970,7 @@ get_parent_info: * Hmm...can't get PCI-Express capabilities. * Falling back to default method. */ - bus_info_valid = FALSE; + bus_info_valid = false; ixgbe_get_bus_info(hw); goto display; } @@ -2338,8 +2338,8 @@ ixgbe_if_media_change(if_ctx_t ctx) goto invalid; } - hw->mac.autotry_restart = TRUE; - hw->mac.ops.setup_link(hw, speed, TRUE); + hw->mac.autotry_restart = true; + hw->mac.ops.setup_link(hw, speed, true); adapter->advertise = ((speed & IXGBE_LINK_SPEED_10GB_FULL) ? 4 : 0) | ((speed & IXGBE_LINK_SPEED_1GB_FULL) ? 2 : 0) | @@ -2493,7 +2493,7 @@ ixgbe_msix_link(void *arg) /* Check for fan failure */ if (adapter->feat_en & IXGBE_FEATURE_FAN_FAIL) { - ixgbe_check_fan_failure(adapter, eicr, TRUE); + ixgbe_check_fan_failure(adapter, eicr, true); IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP1_BY_MAC(hw)); } @@ -2699,7 +2699,7 @@ ixgbe_setup_low_power_mode(if_ctx_t ctx) s32 error = 0; if (!hw->wol_enabled) - ixgbe_set_phy_power(hw, FALSE); + ixgbe_set_phy_power(hw, false); /* Limit power management flow to X550EM baseT */ if (hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T && @@ -2725,12 +2725,12 @@ ixgbe_setup_low_power_mode(if_ctx_t ctx) IXGBE_WUC_WKEN | IXGBE_WUC_PME_EN); /* X550EM baseT adapters need a special LPLU flow */ - hw->phy.reset_disable = TRUE; + hw->phy.reset_disable = true; ixgbe_if_stop(ctx); error = hw->phy.ops.enter_lplu(hw); if (error) device_printf(dev, "Error entering LPLU: %d\n", error); - hw->phy.reset_disable = FALSE; + hw->phy.reset_disable = false; } else { /* Just stop for other adapters */ ixgbe_if_stop(ctx); @@ -3031,7 +3031,7 @@ ixgbe_if_init(if_ctx_t ctx) IXGBE_WRITE_REG(hw, IXGBE_EITR(adapter->vector), IXGBE_LINK_ITR); /* Enable power to the phy. */ - ixgbe_set_phy_power(hw, TRUE); + ixgbe_set_phy_power(hw, true); /* Config/Enable Link */ ixgbe_config_link(ctx); @@ -3240,7 +3240,7 @@ ixgbe_config_delay_values(struct adapter *adapter) hw->fc.low_water[0] = IXGBE_BT2KB(tmp); hw->fc.pause_time = IXGBE_FC_PAUSE; - hw->fc.send_xon = TRUE; + hw->fc.send_xon = true; } /* ixgbe_config_delay_values */ /************************************************************************ @@ -3298,7 +3298,7 @@ ixgbe_if_multi_set(if_ctx_t ctx) if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) { update_ptr = (u8 *)mta; ixgbe_update_mc_addr_list(&adapter->hw, update_ptr, mcnt, - ixgbe_mc_array_itr, TRUE); + ixgbe_mc_array_itr, true); } } /* ixgbe_if_multi_set */ @@ -3361,7 +3361,7 @@ ixgbe_sfp_probe(if_ctx_t ctx) struct adapter *adapter = iflib_get_softc(ctx); struct ixgbe_hw *hw = &adapter->hw; device_t dev = iflib_get_dev(ctx); - bool result = FALSE; + bool result = false; if ((hw->phy.type == ixgbe_phy_nl) && (hw->phy.sfp_type == ixgbe_sfp_type_not_present)) { @@ -3369,7 +3369,7 @@ ixgbe_sfp_probe(if_ctx_t ctx) if (ret) goto out; ret = hw->phy.ops.reset(hw); - adapter->sfp_probe = FALSE; + adapter->sfp_probe = false; if (ret == IXGBE_ERR_SFP_NOT_SUPPORTED) { device_printf(dev, "Unsupported SFP+ module detected!"); device_printf(dev, @@ -3378,7 +3378,7 @@ ixgbe_sfp_probe(if_ctx_t ctx) } else device_printf(dev, "SFP+ module detected!\n"); /* We now have supported optics */ - result = TRUE; + result = true; } out: @@ -3460,7 +3460,7 @@ ixgbe_handle_msf(void *context) if ((!autoneg) && (hw->mac.ops.get_link_capabilities)) hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiate); if (hw->mac.ops.setup_link) - hw->mac.ops.setup_link(hw, autoneg, TRUE); + hw->mac.ops.setup_link(hw, autoneg, true); /* Adjust media types shown in ifconfig */ ifmedia_removeall(adapter->media); @@ -3502,7 +3502,7 @@ ixgbe_if_stop(if_ctx_t ctx) INIT_DEBUGOUT("ixgbe_if_stop: begin\n"); ixgbe_reset_hw(hw); - hw->adapter_stopped = FALSE; + hw->adapter_stopped = false; ixgbe_stop_adapter(hw); if (hw->mac.type == ixgbe_mac_82599EB) ixgbe_stop_mac_link_on_d3_82599(hw); @@ -3510,7 +3510,7 @@ ixgbe_if_stop(if_ctx_t ctx) ixgbe_disable_tx_laser(hw); /* Update the stack */ - adapter->link_up = FALSE; + adapter->link_up = false; ixgbe_if_update_admin_status(ctx); /* reprogram the RAR[0] in case user changed it. */ @@ -3533,12 +3533,12 @@ ixgbe_if_update_admin_status(if_ctx_t ctx) device_t dev = iflib_get_dev(ctx); if (adapter->link_up) { - if (adapter->link_active == FALSE) { + if (adapter->link_active == false) { if (bootverbose) device_printf(dev, "Link is up %d Gbps %s \n", ((adapter->link_speed == 128) ? 10 : 1), "Full Duplex"); - adapter->link_active = TRUE; + adapter->link_active = true; /* Update any Flow Control changes */ ixgbe_fc_enable(&adapter->hw); /* Update DMA coalescing config */ @@ -3550,11 +3550,11 @@ ixgbe_if_update_admin_status(if_ctx_t ctx) ixgbe_ping_all_vfs(adapter); } } else { /* Link down */ - if (adapter->link_active == TRUE) { + if (adapter->link_active == true) { if (bootverbose) device_printf(dev, "Link is Down\n"); iflib_link_state_change(ctx, LINK_STATE_DOWN, 0); - adapter->link_active = FALSE; + adapter->link_active = false; if (adapter->feat_en & IXGBE_FEATURE_SRIOV) ixgbe_ping_all_vfs(adapter); } @@ -3591,7 +3591,7 @@ ixgbe_config_dmac(struct adapter *adapter) if (dcfg->watchdog_timer ^ adapter->dmac || dcfg->link_speed ^ adapter->link_speed) { dcfg->watchdog_timer = adapter->dmac; - dcfg->fcoe_en = FALSE; + dcfg->fcoe_en = false; dcfg->link_speed = adapter->link_speed; dcfg->num_tcs = 1; @@ -3922,7 +3922,7 @@ ixgbe_set_flowcntl(struct adapter *adapter, int fc) } /* Don't autoneg if forcing a value */ - adapter->hw.fc.disable_fc_autoneg = TRUE; + adapter->hw.fc.disable_fc_autoneg = true; ixgbe_fc_enable(&adapter->hw); return (0); @@ -4021,7 +4021,7 @@ ixgbe_set_advertise(struct adapter *adapter, int advertise) ixgbe_link_speed speed = 0; ixgbe_link_speed link_caps = 0; s32 err = IXGBE_NOT_IMPLEMENTED; - bool negotiate = FALSE; + bool negotiate = false; /* Checks to validate new value */ if (adapter->advertise == advertise) /* no change */ @@ -4083,8 +4083,8 @@ ixgbe_set_advertise(struct adapter *adapter, int advertise) speed |= IXGBE_LINK_SPEED_10_FULL; } - hw->mac.autotry_restart = TRUE; - hw->mac.ops.setup_link(hw, speed, TRUE); + hw->mac.autotry_restart = true; + hw->mac.ops.setup_link(hw, speed, true); adapter->advertise = advertise; return (0); @@ -4107,7 +4107,7 @@ ixgbe_get_advertise(struct adapter *adapter) int speed; ixgbe_link_speed link_caps = 0; s32 err; - bool negotiate = FALSE; + bool negotiate = false; /* * Advertised speed means nothing unless it's copper or diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c index ca69275928a5..bbbebcb166ba 100644 --- a/sys/dev/ixgbe/if_ixv.c +++ b/sys/dev/ixgbe/if_ixv.c @@ -195,7 +195,7 @@ TUNABLE_INT("hw.ixv.flow_control", &ixv_flow_control); * it can be a performance win in some workloads, but * in others it actually hurts, its off by default. */ -static int ixv_header_split = FALSE; +static int ixv_header_split = false; TUNABLE_INT("hw.ixv.hdr_split", &ixv_header_split); /* @@ -605,7 +605,7 @@ ixv_if_init(if_ctx_t ctx) int error = 0; INIT_DEBUGOUT("ixv_if_init: begin"); - hw->adapter_stopped = FALSE; + hw->adapter_stopped = false; hw->mac.ops.stop_adapter(hw); /* reprogram the RAR[0] in case user changed it. */ @@ -652,7 +652,7 @@ ixv_if_init(if_ctx_t ctx) /* Config/Enable Link */ hw->mac.ops.check_link(hw, &adapter->link_speed, &adapter->link_up, - FALSE); + false); /* And now turn on interrupts */ ixv_if_enable_intr(ctx); @@ -852,7 +852,7 @@ ixv_if_multi_set(if_ctx_t ctx) update_ptr = mta; adapter->hw.mac.ops.update_mc_addr_list(&adapter->hw, update_ptr, mcnt, - ixv_mc_array_itr, TRUE); + ixv_mc_array_itr, true); } /* ixv_if_multi_set */ /************************************************************************ @@ -906,33 +906,33 @@ ixv_if_update_admin_status(if_ctx_t ctx) device_t dev = iflib_get_dev(ctx); s32 status; - adapter->hw.mac.get_link_status = TRUE; + adapter->hw.mac.get_link_status = true; status = ixgbe_check_link(&adapter->hw, &adapter->link_speed, - &adapter->link_up, FALSE); + &adapter->link_up, false); - if (status != IXGBE_SUCCESS && adapter->hw.adapter_stopped == FALSE) { + if (status != IXGBE_SUCCESS && adapter->hw.adapter_stopped == false) { /* Mailbox's Clear To Send status is lost or timeout occurred. * We need reinitialization. */ iflib_get_ifp(ctx)->if_init(ctx); } if (adapter->link_up) { - if (adapter->link_active == FALSE) { + if (adapter->link_active == false) { if (bootverbose) device_printf(dev, "Link is up %d Gbps %s \n", ((adapter->link_speed == 128) ? 10 : 1), "Full Duplex"); - adapter->link_active = TRUE; + adapter->link_active = true; iflib_link_state_change(ctx, LINK_STATE_UP, IF_Gbps(10)); } } else { /* Link down */ - if (adapter->link_active == TRUE) { + if (adapter->link_active == true) { if (bootverbose) device_printf(dev, "Link is Down\n"); iflib_link_state_change(ctx, LINK_STATE_DOWN, 0); - adapter->link_active = FALSE; + adapter->link_active = false; } } @@ -958,11 +958,11 @@ ixv_if_stop(if_ctx_t ctx) ixv_if_disable_intr(ctx); hw->mac.ops.reset_hw(hw); - adapter->hw.adapter_stopped = FALSE; + adapter->hw.adapter_stopped = false; hw->mac.ops.stop_adapter(hw); /* Update the stack */ - adapter->link_up = FALSE; + adapter->link_up = false; ixv_if_update_admin_status(ctx); /* reprogram the RAR[0] in case user changed it. */ @@ -1515,7 +1515,7 @@ ixv_setup_vlan_support(if_ctx_t ctx) * Let Rx path know that it needs to store VLAN tag * as part of extra mbuf info. */ - adapter->rx_queues[i].rxr.vtag_strip = TRUE; + adapter->rx_queues[i].rxr.vtag_strip = true; } } @@ -1545,7 +1545,7 @@ ixv_setup_vlan_support(if_ctx_t ctx) continue; vid = (i * 32) + j; /* Call the shared code mailbox routine */ - while (hw->mac.ops.set_vfta(hw, vid, 0, TRUE, FALSE)) { + while (hw->mac.ops.set_vfta(hw, vid, 0, true, false)) { if (++retry > 5) break; } diff --git a/sys/dev/ixgbe/if_sriov.c b/sys/dev/ixgbe/if_sriov.c index 6d013e80d2f5..34a8b9a8c645 100644 --- a/sys/dev/ixgbe/if_sriov.c +++ b/sys/dev/ixgbe/if_sriov.c @@ -60,11 +60,11 @@ ixgbe_define_iov_schemas(device_t dev, int *error) vf_schema = pci_iov_schema_alloc_node(); pci_iov_schema_add_unicast_mac(vf_schema, "mac-addr", 0, NULL); pci_iov_schema_add_bool(vf_schema, "mac-anti-spoof", - IOV_SCHEMA_HASDEFAULT, TRUE); + IOV_SCHEMA_HASDEFAULT, true); pci_iov_schema_add_bool(vf_schema, "allow-set-mac", - IOV_SCHEMA_HASDEFAULT, FALSE); + IOV_SCHEMA_HASDEFAULT, false); pci_iov_schema_add_bool(vf_schema, "allow-promisc", - IOV_SCHEMA_HASDEFAULT, FALSE); + IOV_SCHEMA_HASDEFAULT, false); *error = pci_iov_attach(dev, pf_schema, vf_schema); if (*error != 0) { device_printf(dev, @@ -264,7 +264,7 @@ ixgbe_vf_frame_size_compatible(struct adapter *adapter, struct ixgbe_vf *vf) * frames on PFs and VFs. */ if (adapter->hw.mac.type != ixgbe_mac_82599EB) - return (TRUE); + return (true); switch (vf->api_ver) { case IXGBE_API_VER_1_0: @@ -275,9 +275,9 @@ ixgbe_vf_frame_size_compatible(struct adapter *adapter, struct ixgbe_vf *vf) */ if (adapter->max_frame_size > ETHER_MAX_LEN || vf->maximum_frame_size > ETHER_MAX_LEN) - return (FALSE); + return (false); - return (TRUE); + return (true); break; case IXGBE_API_VER_1_1: @@ -287,16 +287,16 @@ ixgbe_vf_frame_size_compatible(struct adapter *adapter, struct ixgbe_vf *vf) * jumbo frames. */ if (vf->maximum_frame_size <= ETHER_MAX_LEN) - return (TRUE); + return (true); /* * Jumbo frames only work with VFs if the PF is also using jumbo * frames. */ if (adapter->max_frame_size <= ETHER_MAX_LEN) - return (TRUE); + return (true); - return (FALSE); + return (false); } } /* ixgbe_vf_frame_size_compatible */ @@ -360,7 +360,7 @@ ixgbe_vf_reset_msg(struct adapter *adapter, struct ixgbe_vf *vf, uint32_t *msg) if (ixgbe_validate_mac_addr(vf->ether_addr) == 0) { ixgbe_set_rar(&adapter->hw, vf->rar_index, vf->ether_addr, - vf->pool, TRUE); + vf->pool, true); ack = IXGBE_VT_MSGTYPE_ACK; } else ack = IXGBE_VT_MSGTYPE_NACK; @@ -398,7 +398,7 @@ ixgbe_vf_set_mac(struct adapter *adapter, struct ixgbe_vf *vf, uint32_t *msg) bcopy(mac, vf->ether_addr, ETHER_ADDR_LEN); ixgbe_set_rar(&adapter->hw, vf->rar_index, vf->ether_addr, vf->pool, - TRUE); + true); ixgbe_send_vf_ack(adapter, vf, msg[0]); } /* ixgbe_vf_set_mac */ @@ -762,7 +762,7 @@ ixgbe_init_vf(struct adapter *adapter, struct ixgbe_vf *vf) if (ixgbe_validate_mac_addr(vf->ether_addr) == 0) { ixgbe_set_rar(&adapter->hw, vf->rar_index, - vf->ether_addr, vf->pool, TRUE); + vf->ether_addr, vf->pool, true); } ixgbe_vf_enable_transmit(adapter, vf); diff --git a/sys/dev/ixgbe/ix_txrx.c b/sys/dev/ixgbe/ix_txrx.c index b566bce3d7c7..abbd563be4ce 100644 --- a/sys/dev/ixgbe/ix_txrx.c +++ b/sys/dev/ixgbe/ix_txrx.c @@ -90,7 +90,7 @@ ixgbe_tx_ctx_setup(struct ixgbe_adv_tx_context_desc *TXD, if_pkt_info_t pi) uint32_t olinfo_status, mss_l4len_idx, pktlen, offload; u8 ehdrlen; - offload = TRUE; + offload = true; olinfo_status = mss_l4len_idx = vlan_macip_lens = type_tucmd_mlhl = 0; /* VLAN MACLEN IPLEN */ vlan_macip_lens |= (htole16(pi->ipi_vtag) << IXGBE_ADVTXD_VLAN_SHIFT); @@ -128,7 +128,7 @@ ixgbe_tx_ctx_setup(struct ixgbe_adv_tx_context_desc *TXD, if_pkt_info_t pi) } else if (pi->ipi_flags & IPI_TX_IPV6) type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_IPV6; else - offload = FALSE; + offload = false; vlan_macip_lens |= pi->ipi_ip_hlen; @@ -137,22 +137,22 @@ ixgbe_tx_ctx_setup(struct ixgbe_adv_tx_context_desc *TXD, if_pkt_info_t pi) if (pi->ipi_csum_flags & (CSUM_IP_TCP | CSUM_IP6_TCP | CSUM_TSO)) type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_TCP; else - offload = FALSE; + offload = false; break; case IPPROTO_UDP: if (pi->ipi_csum_flags & (CSUM_IP_UDP | CSUM_IP6_UDP)) type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_UDP; else - offload = FALSE; + offload = false; break; case IPPROTO_SCTP: if (pi->ipi_csum_flags & (CSUM_IP_SCTP | CSUM_IP6_SCTP)) type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_SCTP; else - offload = FALSE; + offload = false; break; default: - offload = FALSE; + offload = false; break; } /* Insert L4 checksum into data descriptors */ diff --git a/sys/dev/ixgbe/ixgbe.h b/sys/dev/ixgbe/ixgbe.h index 459853ccf04c..63aa2047cc1e 100644 --- a/sys/dev/ixgbe/ixgbe.h +++ b/sys/dev/ixgbe/ixgbe.h @@ -558,11 +558,11 @@ drbr_needs_enqueue(struct ifnet *ifp, struct buf_ring *br) static inline bool ixv_check_ether_addr(u8 *addr) { - bool status = TRUE; + bool status = true; if ((addr[0] == 0 && addr[1]== 0 && addr[2] == 0 && addr[3] == 0 && addr[4]== 0 && addr[5] == 0)) - status = FALSE; + status = false; return (status); } diff --git a/sys/dev/ixgbe/ixgbe_82598.c b/sys/dev/ixgbe/ixgbe_82598.c index 7c821aea2d03..885dfbf869bc 100644 --- a/sys/dev/ixgbe/ixgbe_82598.c +++ b/sys/dev/ixgbe/ixgbe_82598.c @@ -316,17 +316,17 @@ static s32 ixgbe_get_link_capabilities_82598(struct ixgbe_hw *hw, switch (autoc & IXGBE_AUTOC_LMS_MASK) { case IXGBE_AUTOC_LMS_1G_LINK_NO_AN: *speed = IXGBE_LINK_SPEED_1GB_FULL; - *autoneg = FALSE; + *autoneg = false; break; case IXGBE_AUTOC_LMS_10G_LINK_NO_AN: *speed = IXGBE_LINK_SPEED_10GB_FULL; - *autoneg = FALSE; + *autoneg = false; break; case IXGBE_AUTOC_LMS_1G_AN: *speed = IXGBE_LINK_SPEED_1GB_FULL; - *autoneg = TRUE; + *autoneg = true; break; case IXGBE_AUTOC_LMS_KX4_AN: @@ -336,7 +336,7 @@ static s32 ixgbe_get_link_capabilities_82598(struct ixgbe_hw *hw, *speed |= IXGBE_LINK_SPEED_10GB_FULL; if (autoc & IXGBE_AUTOC_KX_SUPP) *speed |= IXGBE_LINK_SPEED_1GB_FULL; - *autoneg = TRUE; + *autoneg = true; break; default: @@ -443,7 +443,7 @@ s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw) * so if it's on turn it off once we know link_speed. For * more details see 82598 Specification update. */ - hw->mac.ops.check_link(hw, &link_speed, &link_up, FALSE); + hw->mac.ops.check_link(hw, &link_speed, &link_up, false); if (link_up && link_speed == IXGBE_LINK_SPEED_1GB_FULL) { switch (hw->fc.requested_mode) { case ixgbe_fc_full: @@ -550,7 +550,7 @@ out: /** * ixgbe_start_mac_link_82598 - Configures MAC link settings * @hw: pointer to hardware structure - * @autoneg_wait_to_complete: TRUE when waiting for completion is needed + * @autoneg_wait_to_complete: true when waiting for completion is needed * * Configures link settings based on values in the ixgbe_hw struct. * Restarts the link. Performs autonegotiation if needed. @@ -635,7 +635,7 @@ static s32 ixgbe_validate_link_ready(struct ixgbe_hw *hw) * ixgbe_check_mac_link_82598 - Get link/speed status * @hw: pointer to hardware structure * @speed: pointer to link speed - * @link_up: TRUE is link is up, FALSE otherwise + * @link_up: true is link is up, false otherwise * @link_up_wait_to_complete: bool used to wait for link up or not * * Reads the links register to determine if link is up and the current speed @@ -665,10 +665,10 @@ static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, for (i = 0; i < hw->mac.max_link_up_time; i++) { if ((link_reg & 1) && ((adapt_comp_reg & 1) == 0)) { - *link_up = TRUE; + *link_up = true; break; } else { - *link_up = FALSE; + *link_up = false; } msec_delay(100); hw->phy.ops.read_reg(hw, 0xC79F, @@ -680,12 +680,12 @@ static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, } } else { if ((link_reg & 1) && ((adapt_comp_reg & 1) == 0)) - *link_up = TRUE; + *link_up = true; else - *link_up = FALSE; + *link_up = false; } - if (*link_up == FALSE) + if (*link_up == false) goto out; } @@ -693,19 +693,19 @@ static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, if (link_up_wait_to_complete) { for (i = 0; i < hw->mac.max_link_up_time; i++) { if (links_reg & IXGBE_LINKS_UP) { - *link_up = TRUE; + *link_up = true; break; } else { - *link_up = FALSE; + *link_up = false; } msec_delay(100); links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS); } } else { if (links_reg & IXGBE_LINKS_UP) - *link_up = TRUE; + *link_up = true; else - *link_up = FALSE; + *link_up = false; } if (links_reg & IXGBE_LINKS_SPEED) @@ -713,9 +713,9 @@ static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, else *speed = IXGBE_LINK_SPEED_1GB_FULL; - if ((hw->device_id == IXGBE_DEV_ID_82598AT2) && (*link_up == TRUE) && + if ((hw->device_id == IXGBE_DEV_ID_82598AT2) && (*link_up == true) && (ixgbe_validate_link_ready(hw) != IXGBE_SUCCESS)) - *link_up = FALSE; + *link_up = false; out: return IXGBE_SUCCESS; @@ -725,7 +725,7 @@ out: * ixgbe_setup_mac_link_82598 - Set MAC link speed * @hw: pointer to hardware structure * @speed: new link speed - * @autoneg_wait_to_complete: TRUE when waiting for completion is needed + * @autoneg_wait_to_complete: true when waiting for completion is needed * * Set the link speed in the AUTOC register and restarts link. **/ @@ -733,7 +733,7 @@ static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw, ixgbe_link_speed speed, bool autoneg_wait_to_complete) { - bool autoneg = FALSE; + bool autoneg = false; s32 status = IXGBE_SUCCESS; ixgbe_link_speed link_capabilities = IXGBE_LINK_SPEED_UNKNOWN; u32 curr_autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); @@ -779,7 +779,7 @@ static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw, * ixgbe_setup_copper_link_82598 - Set the PHY autoneg advertised field * @hw: pointer to hardware structure * @speed: new link speed - * @autoneg_wait_to_complete: TRUE if waiting is needed to complete + * @autoneg_wait_to_complete: true if waiting is needed to complete * * Sets the link speed in the AUTOC register in the MAC and restarts link. **/ @@ -859,7 +859,7 @@ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw) } /* Reset PHY */ - if (hw->phy.reset_disable == FALSE) { + if (hw->phy.reset_disable == false) { /* PHY ops must be identified and initialized prior to reset */ /* Init PHY and function pointers, perform SFP setup */ @@ -915,9 +915,9 @@ mac_reset_top: * AUTOC value since the reset operation sets back to deaults. */ autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); - if (hw->mac.orig_link_settings_stored == FALSE) { + if (hw->mac.orig_link_settings_stored == false) { hw->mac.orig_autoc = autoc; - hw->mac.orig_link_settings_stored = TRUE; + hw->mac.orig_link_settings_stored = true; } else if (autoc != hw->mac.orig_autoc) { IXGBE_WRITE_REG(hw, IXGBE_AUTOC, hw->mac.orig_autoc); } diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c index 1f81f6109f1b..d682dfbc9ab8 100644 --- a/sys/dev/ixgbe/ixgbe_82599.c +++ b/sys/dev/ixgbe/ixgbe_82599.c @@ -124,7 +124,7 @@ s32 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw) if (hw->device_id == IXGBE_DEV_ID_82599_QSFP_SF_QP) { /* Store flag indicating I2C bus access control unit. */ - hw->phy.qsfp_shared_i2c_bus = TRUE; + hw->phy.qsfp_shared_i2c_bus = true; /* Initialize access to QSFP+ I2C bus */ esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); @@ -215,7 +215,7 @@ s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw) /* Restart DSP and set SFI mode */ ret_val = hw->mac.ops.prot_autoc_write(hw, hw->mac.orig_autoc | IXGBE_AUTOC_LMS_10G_SERIAL, - FALSE); + false); if (ret_val) { DEBUGOUT("sfp module setup not complete\n"); @@ -252,7 +252,7 @@ s32 prot_autoc_read_82599(struct ixgbe_hw *hw, bool *locked, u32 *reg_val) { s32 ret_val; - *locked = FALSE; + *locked = false; /* If LESM is on then we need to hold the SW/FW semaphore. */ if (ixgbe_verify_lesm_fw_enabled_82599(hw)) { ret_val = hw->mac.ops.acquire_swfw_sync(hw, @@ -260,7 +260,7 @@ s32 prot_autoc_read_82599(struct ixgbe_hw *hw, bool *locked, u32 *reg_val) if (ret_val != IXGBE_SUCCESS) return IXGBE_ERR_SWFW_SYNC; - *locked = TRUE; + *locked = true; } *reg_val = IXGBE_READ_REG(hw, IXGBE_AUTOC); @@ -295,7 +295,7 @@ s32 prot_autoc_write_82599(struct ixgbe_hw *hw, u32 autoc, bool locked) if (ret_val != IXGBE_SUCCESS) return IXGBE_ERR_SWFW_SYNC; - locked = TRUE; + locked = true; } IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc); @@ -409,7 +409,7 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw *hw) * ixgbe_get_link_capabilities_82599 - Determines link capabilities * @hw: pointer to hardware structure * @speed: pointer to link speed - * @autoneg: TRUE when autoneg or autotry is enabled + * @autoneg: true when autoneg or autotry is enabled * * Determines the link capabilities by reading the AUTOC register. **/ @@ -431,7 +431,7 @@ s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 || hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1) { *speed = IXGBE_LINK_SPEED_1GB_FULL; - *autoneg = TRUE; + *autoneg = true; goto out; } @@ -448,22 +448,22 @@ s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, switch (autoc & IXGBE_AUTOC_LMS_MASK) { case IXGBE_AUTOC_LMS_1G_LINK_NO_AN: *speed = IXGBE_LINK_SPEED_1GB_FULL; - *autoneg = FALSE; + *autoneg = false; break; case IXGBE_AUTOC_LMS_10G_LINK_NO_AN: *speed = IXGBE_LINK_SPEED_10GB_FULL; - *autoneg = FALSE; + *autoneg = false; break; case IXGBE_AUTOC_LMS_1G_AN: *speed = IXGBE_LINK_SPEED_1GB_FULL; - *autoneg = TRUE; + *autoneg = true; break; case IXGBE_AUTOC_LMS_10G_SERIAL: *speed = IXGBE_LINK_SPEED_10GB_FULL; - *autoneg = FALSE; + *autoneg = false; break; case IXGBE_AUTOC_LMS_KX4_KX_KR: @@ -475,7 +475,7 @@ s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, *speed |= IXGBE_LINK_SPEED_10GB_FULL; if (autoc & IXGBE_AUTOC_KX_SUPP) *speed |= IXGBE_LINK_SPEED_1GB_FULL; - *autoneg = TRUE; + *autoneg = true; break; case IXGBE_AUTOC_LMS_KX4_KX_KR_SGMII: @@ -486,12 +486,12 @@ s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, *speed |= IXGBE_LINK_SPEED_10GB_FULL; if (autoc & IXGBE_AUTOC_KX_SUPP) *speed |= IXGBE_LINK_SPEED_1GB_FULL; - *autoneg = TRUE; + *autoneg = true; break; case IXGBE_AUTOC_LMS_SGMII_1G_100M: *speed = IXGBE_LINK_SPEED_1GB_FULL | IXGBE_LINK_SPEED_100_FULL; - *autoneg = FALSE; + *autoneg = false; break; default: @@ -508,9 +508,9 @@ s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, * Limited autoneg is enabled at 1G */ if (hw->phy.media_type == ixgbe_media_type_fiber_qsfp) - *autoneg = FALSE; + *autoneg = false; else - *autoneg = TRUE; + *autoneg = true; } out: @@ -568,7 +568,7 @@ enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw) break; case IXGBE_DEV_ID_82599_BYPASS: media_type = ixgbe_media_type_fiber_fixed; - hw->phy.multispeed_fiber = TRUE; + hw->phy.multispeed_fiber = true; break; default: media_type = ixgbe_media_type_unknown; @@ -604,7 +604,7 @@ void ixgbe_stop_mac_link_on_d3_82599(struct ixgbe_hw *hw) /** * ixgbe_start_mac_link_82599 - Setup MAC link settings * @hw: pointer to hardware structure - * @autoneg_wait_to_complete: TRUE when waiting for completion is needed + * @autoneg_wait_to_complete: true when waiting for completion is needed * * Configures link settings based on values in the ixgbe_hw struct. * Restarts the link. Performs autonegotiation if needed. @@ -616,7 +616,7 @@ s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw, u32 links_reg; u32 i; s32 status = IXGBE_SUCCESS; - bool got_lock = FALSE; + bool got_lock = false; DEBUGFUNC("ixgbe_start_mac_link_82599"); @@ -630,7 +630,7 @@ s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw, if (status != IXGBE_SUCCESS) goto out; - got_lock = TRUE; + got_lock = true; } /* Restart link */ @@ -716,11 +716,11 @@ void ixgbe_enable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) * @hw: pointer to hardware structure * * When the driver changes the link speeds that it can support, - * it sets autotry_restart to TRUE to indicate that we need to + * it sets autotry_restart to true to indicate that we need to * initiate a new autotry session with the link partner. To do * so, we set the speed then disable and re-enable the Tx laser, to * alert the link partner that it also needs to restart autotry on its - * end. This is consistent with TRUE clause 37 autoneg, which also + * end. This is consistent with true clause 37 autoneg, which also * involves a loss of signal. **/ void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) @@ -734,7 +734,7 @@ void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) if (hw->mac.autotry_restart) { ixgbe_disable_tx_laser_multispeed_fiber(hw); ixgbe_enable_tx_laser_multispeed_fiber(hw); - hw->mac.autotry_restart = FALSE; + hw->mac.autotry_restart = false; } } *** 1751 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 219F66AD2FA; Tue, 14 Sep 2021 00:48:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l835y1Fz3h4l; Tue, 14 Sep 2021 00:48:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2DFD71126B; Tue, 14 Sep 2021 00:48:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0mJJA045369; Tue, 14 Sep 2021 00:48:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0mJkd045368; Tue, 14 Sep 2021 00:48:19 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:19 GMT Message-Id: <202109140048.18E0mJkd045368@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 19902306444a - stable/12 - ixgbe: Update copyright to 2020 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 19902306444ace62ed95d1c6e4c2cae67123d81b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:21 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=19902306444ace62ed95d1c6e4c2cae67123d81b commit 19902306444ace62ed95d1c6e4c2cae67123d81b Author: Kevin Bowling AuthorDate: 2021-09-07 03:11:44 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:45:39 +0000 ixgbe: Update copyright to 2020 Synced to the ixgbe shared code with DPDK shared code which has local fixes on top of "not-released-cid-ixgbe.2020.06.09.tar.gz" Approved by: imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 8455e365f77f5b66ac9521dbcd690f79345ce147) --- sys/dev/ixgbe/ixgbe_82598.c | 2 +- sys/dev/ixgbe/ixgbe_82598.h | 2 +- sys/dev/ixgbe/ixgbe_82599.c | 2 +- sys/dev/ixgbe/ixgbe_82599.h | 2 +- sys/dev/ixgbe/ixgbe_api.c | 2 +- sys/dev/ixgbe/ixgbe_api.h | 2 +- sys/dev/ixgbe/ixgbe_bypass.h | 2 +- sys/dev/ixgbe/ixgbe_common.c | 2 +- sys/dev/ixgbe/ixgbe_common.h | 2 +- sys/dev/ixgbe/ixgbe_dcb.c | 2 +- sys/dev/ixgbe/ixgbe_dcb.h | 2 +- sys/dev/ixgbe/ixgbe_dcb_82598.c | 2 +- sys/dev/ixgbe/ixgbe_dcb_82598.h | 2 +- sys/dev/ixgbe/ixgbe_dcb_82599.c | 2 +- sys/dev/ixgbe/ixgbe_dcb_82599.h | 2 +- sys/dev/ixgbe/ixgbe_fdir.h | 2 +- sys/dev/ixgbe/ixgbe_features.h | 2 +- sys/dev/ixgbe/ixgbe_mbx.c | 2 +- sys/dev/ixgbe/ixgbe_mbx.h | 2 +- sys/dev/ixgbe/ixgbe_osdep.c | 2 +- sys/dev/ixgbe/ixgbe_osdep.h | 2 +- sys/dev/ixgbe/ixgbe_phy.c | 2 +- sys/dev/ixgbe/ixgbe_phy.h | 2 +- sys/dev/ixgbe/ixgbe_rss.h | 2 +- sys/dev/ixgbe/ixgbe_sriov.h | 2 +- sys/dev/ixgbe/ixgbe_type.h | 2 +- sys/dev/ixgbe/ixgbe_vf.c | 2 +- sys/dev/ixgbe/ixgbe_vf.h | 2 +- sys/dev/ixgbe/ixgbe_x540.c | 2 +- sys/dev/ixgbe/ixgbe_x540.h | 2 +- sys/dev/ixgbe/ixgbe_x550.c | 2 +- sys/dev/ixgbe/ixgbe_x550.h | 2 +- 32 files changed, 32 insertions(+), 32 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_82598.c b/sys/dev/ixgbe/ixgbe_82598.c index 885dfbf869bc..c1d657afb6f5 100644 --- a/sys/dev/ixgbe/ixgbe_82598.c +++ b/sys/dev/ixgbe/ixgbe_82598.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_82598.h b/sys/dev/ixgbe/ixgbe_82598.h index dc69c026423c..09b8c6054109 100644 --- a/sys/dev/ixgbe/ixgbe_82598.h +++ b/sys/dev/ixgbe/ixgbe_82598.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c index d682dfbc9ab8..f692c19dc979 100644 --- a/sys/dev/ixgbe/ixgbe_82599.c +++ b/sys/dev/ixgbe/ixgbe_82599.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_82599.h b/sys/dev/ixgbe/ixgbe_82599.h index ee9a33667e62..2e9a0407a610 100644 --- a/sys/dev/ixgbe/ixgbe_82599.h +++ b/sys/dev/ixgbe/ixgbe_82599.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_api.c b/sys/dev/ixgbe/ixgbe_api.c index 2ae2db78d0ed..5bb5d196e2c0 100644 --- a/sys/dev/ixgbe/ixgbe_api.c +++ b/sys/dev/ixgbe/ixgbe_api.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_api.h b/sys/dev/ixgbe/ixgbe_api.h index aabe573127f3..c70f27c6aa2c 100644 --- a/sys/dev/ixgbe/ixgbe_api.h +++ b/sys/dev/ixgbe/ixgbe_api.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_bypass.h b/sys/dev/ixgbe/ixgbe_bypass.h index 9a8d6d259cae..42a8eeb72e71 100644 --- a/sys/dev/ixgbe/ixgbe_bypass.h +++ b/sys/dev/ixgbe/ixgbe_bypass.h @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 237deda74833..c78474bf6f58 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_common.h b/sys/dev/ixgbe/ixgbe_common.h index af0db6e4c7dd..b072770acafa 100644 --- a/sys/dev/ixgbe/ixgbe_common.h +++ b/sys/dev/ixgbe/ixgbe_common.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_dcb.c b/sys/dev/ixgbe/ixgbe_dcb.c index d0ae965bc6ac..5e1f5e44b379 100644 --- a/sys/dev/ixgbe/ixgbe_dcb.c +++ b/sys/dev/ixgbe/ixgbe_dcb.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_dcb.h b/sys/dev/ixgbe/ixgbe_dcb.h index 92baad807c30..7dfe8547112f 100644 --- a/sys/dev/ixgbe/ixgbe_dcb.h +++ b/sys/dev/ixgbe/ixgbe_dcb.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_dcb_82598.c b/sys/dev/ixgbe/ixgbe_dcb_82598.c index 20a350716289..eb39bfb38b57 100644 --- a/sys/dev/ixgbe/ixgbe_dcb_82598.c +++ b/sys/dev/ixgbe/ixgbe_dcb_82598.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_dcb_82598.h b/sys/dev/ixgbe/ixgbe_dcb_82598.h index d16471bc395a..74cf2760cc6d 100644 --- a/sys/dev/ixgbe/ixgbe_dcb_82598.h +++ b/sys/dev/ixgbe/ixgbe_dcb_82598.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_dcb_82599.c b/sys/dev/ixgbe/ixgbe_dcb_82599.c index c5fc42e23649..591c705aba08 100644 --- a/sys/dev/ixgbe/ixgbe_dcb_82599.c +++ b/sys/dev/ixgbe/ixgbe_dcb_82599.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_dcb_82599.h b/sys/dev/ixgbe/ixgbe_dcb_82599.h index faa2ac00f9d3..892a384b4c19 100644 --- a/sys/dev/ixgbe/ixgbe_dcb_82599.h +++ b/sys/dev/ixgbe/ixgbe_dcb_82599.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_fdir.h b/sys/dev/ixgbe/ixgbe_fdir.h index f5e1593072a5..5baafa458470 100644 --- a/sys/dev/ixgbe/ixgbe_fdir.h +++ b/sys/dev/ixgbe/ixgbe_fdir.h @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_features.h b/sys/dev/ixgbe/ixgbe_features.h index bb05885497dd..a9b3c8e41e6b 100644 --- a/sys/dev/ixgbe/ixgbe_features.h +++ b/sys/dev/ixgbe/ixgbe_features.h @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_mbx.c b/sys/dev/ixgbe/ixgbe_mbx.c index 26e7e5deaf05..385b8e5354f2 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.c +++ b/sys/dev/ixgbe/ixgbe_mbx.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_mbx.h b/sys/dev/ixgbe/ixgbe_mbx.h index 44ccc071f311..9b3deb28f149 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.h +++ b/sys/dev/ixgbe/ixgbe_mbx.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_osdep.c b/sys/dev/ixgbe/ixgbe_osdep.c index e45531ea8c3f..61617b69ff04 100644 --- a/sys/dev/ixgbe/ixgbe_osdep.c +++ b/sys/dev/ixgbe/ixgbe_osdep.c @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_osdep.h b/sys/dev/ixgbe/ixgbe_osdep.h index 281c221b59f0..b7eaa788c99e 100644 --- a/sys/dev/ixgbe/ixgbe_osdep.h +++ b/sys/dev/ixgbe/ixgbe_osdep.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_phy.c b/sys/dev/ixgbe/ixgbe_phy.c index 28930ca3267d..3868ed4fc0ea 100644 --- a/sys/dev/ixgbe/ixgbe_phy.c +++ b/sys/dev/ixgbe/ixgbe_phy.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_phy.h b/sys/dev/ixgbe/ixgbe_phy.h index ea0cd4fca196..9fd3f6d2163e 100644 --- a/sys/dev/ixgbe/ixgbe_phy.h +++ b/sys/dev/ixgbe/ixgbe_phy.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_rss.h b/sys/dev/ixgbe/ixgbe_rss.h index 7e7620be63f4..7eda43ec1609 100644 --- a/sys/dev/ixgbe/ixgbe_rss.h +++ b/sys/dev/ixgbe/ixgbe_rss.h @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_sriov.h b/sys/dev/ixgbe/ixgbe_sriov.h index 36ca7cacc853..f80d5e9dacf9 100644 --- a/sys/dev/ixgbe/ixgbe_sriov.h +++ b/sys/dev/ixgbe/ixgbe_sriov.h @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h index c3c29dbdba52..a538af5d3569 100644 --- a/sys/dev/ixgbe/ixgbe_type.h +++ b/sys/dev/ixgbe/ixgbe_type.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_vf.c b/sys/dev/ixgbe/ixgbe_vf.c index a125bcbb8386..f01fd99eb4c0 100644 --- a/sys/dev/ixgbe/ixgbe_vf.c +++ b/sys/dev/ixgbe/ixgbe_vf.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_vf.h b/sys/dev/ixgbe/ixgbe_vf.h index cdc59704dcaf..5cdb241ec2aa 100644 --- a/sys/dev/ixgbe/ixgbe_vf.h +++ b/sys/dev/ixgbe/ixgbe_vf.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_x540.c b/sys/dev/ixgbe/ixgbe_x540.c index db2d90e1230e..ace1ec8a33d3 100644 --- a/sys/dev/ixgbe/ixgbe_x540.c +++ b/sys/dev/ixgbe/ixgbe_x540.c @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_x540.h b/sys/dev/ixgbe/ixgbe_x540.h index 6f630602567b..e48ef52f576c 100644 --- a/sys/dev/ixgbe/ixgbe_x540.h +++ b/sys/dev/ixgbe/ixgbe_x540.h @@ -1,7 +1,7 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index b5f1bc4f6ef8..df19c4c65201 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/sys/dev/ixgbe/ixgbe_x550.h b/sys/dev/ixgbe/ixgbe_x550.h index ac2de750cfb7..7a24e50e1b5a 100644 --- a/sys/dev/ixgbe/ixgbe_x550.h +++ b/sys/dev/ixgbe/ixgbe_x550.h @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2017, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 21BD46AD4E6; Tue, 14 Sep 2021 00:48:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l866SWYz3hCc; Tue, 14 Sep 2021 00:48:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2D4F1166A; Tue, 14 Sep 2021 00:48:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0mMse045443; Tue, 14 Sep 2021 00:48:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0mM72045442; Tue, 14 Sep 2021 00:48:22 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:22 GMT Message-Id: <202109140048.18E0mM72045442@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 7e7e6f8a5c94 - stable/12 - ixgbe: remove whitespace in function comments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7e7e6f8a5c940692d81da157b74d298c8566a0fb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:23 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=7e7e6f8a5c940692d81da157b74d298c8566a0fb commit 7e7e6f8a5c940692d81da157b74d298c8566a0fb Author: Kevin Bowling AuthorDate: 2021-09-07 03:26:44 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:45:57 +0000 ixgbe: remove whitespace in function comments Remove unnecessary extra whitespace on all function comments, replacing ' * ' with ' * '. This was done automatically via sed using the following transformation: sed 's/^ \* / * /' Signed-off-by: Jacob Keller Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (40023f73c76579e58a859dab87b4c30278eb2e48) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 4cdc5e12a849871e4e8062a62a31f28545901d84) --- sys/dev/ixgbe/ixgbe_82598.c | 238 +++++----- sys/dev/ixgbe/ixgbe_82599.c | 384 ++++++++-------- sys/dev/ixgbe/ixgbe_api.c | 890 ++++++++++++++++++------------------ sys/dev/ixgbe/ixgbe_common.c | 1030 +++++++++++++++++++++--------------------- sys/dev/ixgbe/ixgbe_dcb.c | 6 +- sys/dev/ixgbe/ixgbe_fdir.h | 2 +- sys/dev/ixgbe/ixgbe_mbx.c | 194 ++++---- sys/dev/ixgbe/ixgbe_phy.c | 394 ++++++++-------- sys/dev/ixgbe/ixgbe_vf.c | 166 +++---- sys/dev/ixgbe/ixgbe_x540.c | 188 ++++---- sys/dev/ixgbe/ixgbe_x550.c | 480 ++++++++++---------- 11 files changed, 1986 insertions(+), 1986 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_82598.c b/sys/dev/ixgbe/ixgbe_82598.c index c1d657afb6f5..1bfdcae6da55 100644 --- a/sys/dev/ixgbe/ixgbe_82598.c +++ b/sys/dev/ixgbe/ixgbe_82598.c @@ -69,14 +69,14 @@ static void ixgbe_set_rxpba_82598(struct ixgbe_hw *hw, int num_pb, static s32 ixgbe_read_i2c_sff8472_82598(struct ixgbe_hw *hw, u8 byte_offset, u8 *sff8472_data); /** - * ixgbe_set_pcie_completion_timeout - set pci-e completion timeout - * @hw: pointer to the HW structure + * ixgbe_set_pcie_completion_timeout - set pci-e completion timeout + * @hw: pointer to the HW structure * - * The defaults for 82598 should be in the range of 50us to 50ms, - * however the hardware default for these parts is 500us to 1ms which is less - * than the 10ms recommended by the pci-e spec. To address this we need to - * increase the value to either 10ms to 250ms for capability version 1 config, - * or 16ms to 55ms for version 2. + * The defaults for 82598 should be in the range of 50us to 50ms, + * however the hardware default for these parts is 500us to 1ms which is less + * than the 10ms recommended by the pci-e spec. To address this we need to + * increase the value to either 10ms to 250ms for capability version 1 config, + * or 16ms to 55ms for version 2. **/ void ixgbe_set_pcie_completion_timeout(struct ixgbe_hw *hw) { @@ -111,11 +111,11 @@ out: } /** - * ixgbe_init_ops_82598 - Inits func ptrs and MAC type - * @hw: pointer to hardware structure + * ixgbe_init_ops_82598 - Inits func ptrs and MAC type + * @hw: pointer to hardware structure * - * Initialize the function pointers and assign the MAC type for 82598. - * Does not touch the hardware. + * Initialize the function pointers and assign the MAC type for 82598. + * Does not touch the hardware. **/ s32 ixgbe_init_ops_82598(struct ixgbe_hw *hw) { @@ -181,12 +181,12 @@ s32 ixgbe_init_ops_82598(struct ixgbe_hw *hw) } /** - * ixgbe_init_phy_ops_82598 - PHY/SFP specific init - * @hw: pointer to hardware structure + * ixgbe_init_phy_ops_82598 - PHY/SFP specific init + * @hw: pointer to hardware structure * - * Initialize any function pointers that were not able to be - * set during init_shared_code because the PHY/SFP type was - * not known. Perform the SFP init if necessary. + * Initialize any function pointers that were not able to be + * set during init_shared_code because the PHY/SFP type was + * not known. Perform the SFP init if necessary. * **/ s32 ixgbe_init_phy_ops_82598(struct ixgbe_hw *hw) @@ -245,11 +245,11 @@ out: } /** - * ixgbe_start_hw_82598 - Prepare hardware for Tx/Rx - * @hw: pointer to hardware structure + * ixgbe_start_hw_82598 - Prepare hardware for Tx/Rx + * @hw: pointer to hardware structure * - * Starts the hardware using the generic start_hw function. - * Disables relaxed ordering Then set pcie completion timeout + * Starts the hardware using the generic start_hw function. + * Disables relaxed ordering Then set pcie completion timeout * **/ s32 ixgbe_start_hw_82598(struct ixgbe_hw *hw) @@ -287,12 +287,12 @@ s32 ixgbe_start_hw_82598(struct ixgbe_hw *hw) } /** - * ixgbe_get_link_capabilities_82598 - Determines link capabilities - * @hw: pointer to hardware structure - * @speed: pointer to link speed - * @autoneg: boolean auto-negotiation value + * ixgbe_get_link_capabilities_82598 - Determines link capabilities + * @hw: pointer to hardware structure + * @speed: pointer to link speed + * @autoneg: boolean auto-negotiation value * - * Determines the link capabilities by reading the AUTOC register. + * Determines the link capabilities by reading the AUTOC register. **/ static s32 ixgbe_get_link_capabilities_82598(struct ixgbe_hw *hw, ixgbe_link_speed *speed, @@ -348,10 +348,10 @@ static s32 ixgbe_get_link_capabilities_82598(struct ixgbe_hw *hw, } /** - * ixgbe_get_media_type_82598 - Determines media type - * @hw: pointer to hardware structure + * ixgbe_get_media_type_82598 - Determines media type + * @hw: pointer to hardware structure * - * Returns the media type (fiber, copper, backplane) + * Returns the media type (fiber, copper, backplane) **/ static enum ixgbe_media_type ixgbe_get_media_type_82598(struct ixgbe_hw *hw) { @@ -401,10 +401,10 @@ out: } /** - * ixgbe_fc_enable_82598 - Enable flow control - * @hw: pointer to hardware structure + * ixgbe_fc_enable_82598 - Enable flow control + * @hw: pointer to hardware structure * - * Enable flow control according to the current settings. + * Enable flow control according to the current settings. **/ s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw) { @@ -548,12 +548,12 @@ out: } /** - * ixgbe_start_mac_link_82598 - Configures MAC link settings - * @hw: pointer to hardware structure - * @autoneg_wait_to_complete: true when waiting for completion is needed + * ixgbe_start_mac_link_82598 - Configures MAC link settings + * @hw: pointer to hardware structure + * @autoneg_wait_to_complete: true when waiting for completion is needed * - * Configures link settings based on values in the ixgbe_hw struct. - * Restarts the link. Performs autonegotiation if needed. + * Configures link settings based on values in the ixgbe_hw struct. + * Restarts the link. Performs autonegotiation if needed. **/ static s32 ixgbe_start_mac_link_82598(struct ixgbe_hw *hw, bool autoneg_wait_to_complete) @@ -597,11 +597,11 @@ static s32 ixgbe_start_mac_link_82598(struct ixgbe_hw *hw, } /** - * ixgbe_validate_link_ready - Function looks for phy link - * @hw: pointer to hardware structure + * ixgbe_validate_link_ready - Function looks for phy link + * @hw: pointer to hardware structure * - * Function indicates success when phy link is available. If phy is not ready - * within 5 seconds of MAC indicating link, the function returns error. + * Function indicates success when phy link is available. If phy is not ready + * within 5 seconds of MAC indicating link, the function returns error. **/ static s32 ixgbe_validate_link_ready(struct ixgbe_hw *hw) { @@ -632,13 +632,13 @@ static s32 ixgbe_validate_link_ready(struct ixgbe_hw *hw) } /** - * ixgbe_check_mac_link_82598 - Get link/speed status - * @hw: pointer to hardware structure - * @speed: pointer to link speed - * @link_up: true is link is up, false otherwise - * @link_up_wait_to_complete: bool used to wait for link up or not + * ixgbe_check_mac_link_82598 - Get link/speed status + * @hw: pointer to hardware structure + * @speed: pointer to link speed + * @link_up: true is link is up, false otherwise + * @link_up_wait_to_complete: bool used to wait for link up or not * - * Reads the links register to determine if link is up and the current speed + * Reads the links register to determine if link is up and the current speed **/ static s32 ixgbe_check_mac_link_82598(struct ixgbe_hw *hw, ixgbe_link_speed *speed, bool *link_up, @@ -722,12 +722,12 @@ out: } /** - * ixgbe_setup_mac_link_82598 - Set MAC link speed - * @hw: pointer to hardware structure - * @speed: new link speed - * @autoneg_wait_to_complete: true when waiting for completion is needed + * ixgbe_setup_mac_link_82598 - Set MAC link speed + * @hw: pointer to hardware structure + * @speed: new link speed + * @autoneg_wait_to_complete: true when waiting for completion is needed * - * Set the link speed in the AUTOC register and restarts link. + * Set the link speed in the AUTOC register and restarts link. **/ static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw, ixgbe_link_speed speed, @@ -776,12 +776,12 @@ static s32 ixgbe_setup_mac_link_82598(struct ixgbe_hw *hw, /** - * ixgbe_setup_copper_link_82598 - Set the PHY autoneg advertised field - * @hw: pointer to hardware structure - * @speed: new link speed - * @autoneg_wait_to_complete: true if waiting is needed to complete + * ixgbe_setup_copper_link_82598 - Set the PHY autoneg advertised field + * @hw: pointer to hardware structure + * @speed: new link speed + * @autoneg_wait_to_complete: true if waiting is needed to complete * - * Sets the link speed in the AUTOC register in the MAC and restarts link. + * Sets the link speed in the AUTOC register in the MAC and restarts link. **/ static s32 ixgbe_setup_copper_link_82598(struct ixgbe_hw *hw, ixgbe_link_speed speed, @@ -801,12 +801,12 @@ static s32 ixgbe_setup_copper_link_82598(struct ixgbe_hw *hw, } /** - * ixgbe_reset_hw_82598 - Performs hardware reset - * @hw: pointer to hardware structure + * ixgbe_reset_hw_82598 - Performs hardware reset + * @hw: pointer to hardware structure * - * Resets the hardware by resetting the transmit and receive units, masks and - * clears all interrupts, performing a PHY reset, and performing a link (MAC) - * reset. + * Resets the hardware by resetting the transmit and receive units, masks and + * clears all interrupts, performing a PHY reset, and performing a link (MAC) + * reset. **/ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw) { @@ -939,10 +939,10 @@ reset_hw_out: } /** - * ixgbe_set_vmdq_82598 - Associate a VMDq set index with a rx address - * @hw: pointer to hardware struct - * @rar: receive address register index to associate with a VMDq index - * @vmdq: VMDq set index + * ixgbe_set_vmdq_82598 - Associate a VMDq set index with a rx address + * @hw: pointer to hardware struct + * @rar: receive address register index to associate with a VMDq index + * @vmdq: VMDq set index **/ s32 ixgbe_set_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq) { @@ -965,10 +965,10 @@ s32 ixgbe_set_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq) } /** - * ixgbe_clear_vmdq_82598 - Disassociate a VMDq set index from an rx address - * @hw: pointer to hardware struct - * @rar: receive address register index to associate with a VMDq index - * @vmdq: VMDq clear index (not used in 82598, but elsewhere) + * ixgbe_clear_vmdq_82598 - Disassociate a VMDq set index from an rx address + * @hw: pointer to hardware struct + * @rar: receive address register index to associate with a VMDq index + * @vmdq: VMDq clear index (not used in 82598, but elsewhere) **/ static s32 ixgbe_clear_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq) { @@ -993,14 +993,14 @@ static s32 ixgbe_clear_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq) } /** - * ixgbe_set_vfta_82598 - Set VLAN filter table - * @hw: pointer to hardware structure - * @vlan: VLAN id to write to VLAN filter - * @vind: VMDq output index that maps queue to VLAN id in VFTA - * @vlan_on: boolean flag to turn on/off VLAN in VFTA - * @vlvf_bypass: boolean flag - unused + * ixgbe_set_vfta_82598 - Set VLAN filter table + * @hw: pointer to hardware structure + * @vlan: VLAN id to write to VLAN filter + * @vind: VMDq output index that maps queue to VLAN id in VFTA + * @vlan_on: boolean flag to turn on/off VLAN in VFTA + * @vlvf_bypass: boolean flag - unused * - * Turn on/off specified VLAN in the VLAN filter table. + * Turn on/off specified VLAN in the VLAN filter table. **/ s32 ixgbe_set_vfta_82598(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on, bool vlvf_bypass) @@ -1046,10 +1046,10 @@ s32 ixgbe_set_vfta_82598(struct ixgbe_hw *hw, u32 vlan, u32 vind, } /** - * ixgbe_clear_vfta_82598 - Clear VLAN filter table - * @hw: pointer to hardware structure + * ixgbe_clear_vfta_82598 - Clear VLAN filter table + * @hw: pointer to hardware structure * - * Clears the VLAN filer table, and the VMDq index associated with the filter + * Clears the VLAN filer table, and the VMDq index associated with the filter **/ static s32 ixgbe_clear_vfta_82598(struct ixgbe_hw *hw) { @@ -1070,12 +1070,12 @@ static s32 ixgbe_clear_vfta_82598(struct ixgbe_hw *hw) } /** - * ixgbe_read_analog_reg8_82598 - Reads 8 bit Atlas analog register - * @hw: pointer to hardware structure - * @reg: analog register to read - * @val: read value + * ixgbe_read_analog_reg8_82598 - Reads 8 bit Atlas analog register + * @hw: pointer to hardware structure + * @reg: analog register to read + * @val: read value * - * Performs read operation to Atlas analog register specified. + * Performs read operation to Atlas analog register specified. **/ s32 ixgbe_read_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 *val) { @@ -1094,12 +1094,12 @@ s32 ixgbe_read_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 *val) } /** - * ixgbe_write_analog_reg8_82598 - Writes 8 bit Atlas analog register - * @hw: pointer to hardware structure - * @reg: atlas register to write - * @val: value to write + * ixgbe_write_analog_reg8_82598 - Writes 8 bit Atlas analog register + * @hw: pointer to hardware structure + * @reg: atlas register to write + * @val: value to write * - * Performs write operation to Atlas analog register specified. + * Performs write operation to Atlas analog register specified. **/ s32 ixgbe_write_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 val) { @@ -1116,13 +1116,13 @@ s32 ixgbe_write_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 val) } /** - * ixgbe_read_i2c_phy_82598 - Reads 8 bit word over I2C interface. - * @hw: pointer to hardware structure - * @dev_addr: address to read from - * @byte_offset: byte offset to read from dev_addr - * @eeprom_data: value read + * ixgbe_read_i2c_phy_82598 - Reads 8 bit word over I2C interface. + * @hw: pointer to hardware structure + * @dev_addr: address to read from + * @byte_offset: byte offset to read from dev_addr + * @eeprom_data: value read * - * Performs 8 byte read operation to SFP module's EEPROM over I2C interface. + * Performs 8 byte read operation to SFP module's EEPROM over I2C interface. **/ static s32 ixgbe_read_i2c_phy_82598(struct ixgbe_hw *hw, u8 dev_addr, u8 byte_offset, u8 *eeprom_data) @@ -1190,12 +1190,12 @@ out: } /** - * ixgbe_read_i2c_eeprom_82598 - Reads 8 bit word over I2C interface. - * @hw: pointer to hardware structure - * @byte_offset: EEPROM byte offset to read - * @eeprom_data: value read + * ixgbe_read_i2c_eeprom_82598 - Reads 8 bit word over I2C interface. + * @hw: pointer to hardware structure + * @byte_offset: EEPROM byte offset to read + * @eeprom_data: value read * - * Performs 8 byte read operation to SFP module's EEPROM over I2C interface. + * Performs 8 byte read operation to SFP module's EEPROM over I2C interface. **/ s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset, u8 *eeprom_data) @@ -1205,12 +1205,12 @@ s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset, } /** - * ixgbe_read_i2c_sff8472_82598 - Reads 8 bit word over I2C interface. - * @hw: pointer to hardware structure - * @byte_offset: byte offset at address 0xA2 - * @sff8472_data: value read + * ixgbe_read_i2c_sff8472_82598 - Reads 8 bit word over I2C interface. + * @hw: pointer to hardware structure + * @byte_offset: byte offset at address 0xA2 + * @sff8472_data: value read * - * Performs 8 byte read operation to SFP module's SFF-8472 data over I2C + * Performs 8 byte read operation to SFP module's SFF-8472 data over I2C **/ static s32 ixgbe_read_i2c_sff8472_82598(struct ixgbe_hw *hw, u8 byte_offset, u8 *sff8472_data) @@ -1220,10 +1220,10 @@ static s32 ixgbe_read_i2c_sff8472_82598(struct ixgbe_hw *hw, u8 byte_offset, } /** - * ixgbe_get_supported_physical_layer_82598 - Returns physical layer type - * @hw: pointer to hardware structure + * ixgbe_get_supported_physical_layer_82598 - Returns physical layer type + * @hw: pointer to hardware structure * - * Determines physical layer capabilities of the current configuration. + * Determines physical layer capabilities of the current configuration. **/ u64 ixgbe_get_supported_physical_layer_82598(struct ixgbe_hw *hw) { @@ -1322,12 +1322,12 @@ out: } /** - * ixgbe_set_lan_id_multi_port_pcie_82598 - Set LAN id for PCIe multiple - * port devices. - * @hw: pointer to the HW structure + * ixgbe_set_lan_id_multi_port_pcie_82598 - Set LAN id for PCIe multiple + * port devices. + * @hw: pointer to the HW structure * - * Calls common function and corrects issue with some single port devices - * that enable LAN1 but not LAN0. + * Calls common function and corrects issue with some single port devices + * that enable LAN1 but not LAN0. **/ void ixgbe_set_lan_id_multi_port_pcie_82598(struct ixgbe_hw *hw) { @@ -1356,8 +1356,8 @@ void ixgbe_set_lan_id_multi_port_pcie_82598(struct ixgbe_hw *hw) } /** - * ixgbe_enable_relaxed_ordering_82598 - enable relaxed ordering - * @hw: pointer to hardware structure + * ixgbe_enable_relaxed_ordering_82598 - enable relaxed ordering + * @hw: pointer to hardware structure * **/ void ixgbe_enable_relaxed_ordering_82598(struct ixgbe_hw *hw) @@ -1426,11 +1426,11 @@ static void ixgbe_set_rxpba_82598(struct ixgbe_hw *hw, int num_pb, } /** - * ixgbe_enable_rx_dma_82598 - Enable the Rx DMA unit - * @hw: pointer to hardware structure - * @regval: register value to write to RXCTRL + * ixgbe_enable_rx_dma_82598 - Enable the Rx DMA unit + * @hw: pointer to hardware structure + * @regval: register value to write to RXCTRL * - * Enables the Rx DMA unit + * Enables the Rx DMA unit **/ s32 ixgbe_enable_rx_dma_82598(struct ixgbe_hw *hw, u32 regval) { diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c index f692c19dc979..0222acd2f0d5 100644 --- a/sys/dev/ixgbe/ixgbe_82599.c +++ b/sys/dev/ixgbe/ixgbe_82599.c @@ -105,12 +105,12 @@ void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) } /** - * ixgbe_init_phy_ops_82599 - PHY/SFP specific init - * @hw: pointer to hardware structure + * ixgbe_init_phy_ops_82599 - PHY/SFP specific init + * @hw: pointer to hardware structure * - * Initialize any function pointers that were not able to be - * set during init_shared_code because the PHY/SFP type was - * not known. Perform the SFP init if necessary. + * Initialize any function pointers that were not able to be + * set during init_shared_code because the PHY/SFP type was + * not known. Perform the SFP init if necessary. * **/ s32 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw) @@ -239,14 +239,14 @@ setup_sfp_err: } /** - * prot_autoc_read_82599 - Hides MAC differences needed for AUTOC read - * @hw: pointer to hardware structure - * @locked: Return the if we locked for this read. - * @reg_val: Value we read from AUTOC + * prot_autoc_read_82599 - Hides MAC differences needed for AUTOC read + * @hw: pointer to hardware structure + * @locked: Return the if we locked for this read. + * @reg_val: Value we read from AUTOC * - * For this part (82599) we need to wrap read-modify-writes with a possible - * FW/SW lock. It is assumed this lock will be freed with the next - * prot_autoc_write_82599(). + * For this part (82599) we need to wrap read-modify-writes with a possible + * FW/SW lock. It is assumed this lock will be freed with the next + * prot_autoc_write_82599(). */ s32 prot_autoc_read_82599(struct ixgbe_hw *hw, bool *locked, u32 *reg_val) { @@ -272,7 +272,7 @@ s32 prot_autoc_read_82599(struct ixgbe_hw *hw, bool *locked, u32 *reg_val) * @hw: pointer to hardware structure * @autoc: value to write to AUTOC * @locked: bool to indicate whether the SW/FW lock was already taken by - * previous proc_autoc_read_82599. + * previous proc_autoc_read_82599. * * This part (82599) may need to hold the SW/FW lock around all writes to * AUTOC. Likewise after a write we need to do a pipeline reset. @@ -312,11 +312,11 @@ out: } /** - * ixgbe_init_ops_82599 - Inits func ptrs and MAC type - * @hw: pointer to hardware structure + * ixgbe_init_ops_82599 - Inits func ptrs and MAC type + * @hw: pointer to hardware structure * - * Initialize the function pointers and assign the MAC type for 82599. - * Does not touch the hardware. + * Initialize the function pointers and assign the MAC type for 82599. + * Does not touch the hardware. **/ s32 ixgbe_init_ops_82599(struct ixgbe_hw *hw) @@ -406,12 +406,12 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw *hw) } /** - * ixgbe_get_link_capabilities_82599 - Determines link capabilities - * @hw: pointer to hardware structure - * @speed: pointer to link speed - * @autoneg: true when autoneg or autotry is enabled + * ixgbe_get_link_capabilities_82599 - Determines link capabilities + * @hw: pointer to hardware structure + * @speed: pointer to link speed + * @autoneg: true when autoneg or autotry is enabled * - * Determines the link capabilities by reading the AUTOC register. + * Determines the link capabilities by reading the AUTOC register. **/ s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, ixgbe_link_speed *speed, @@ -518,10 +518,10 @@ out: } /** - * ixgbe_get_media_type_82599 - Get media type - * @hw: pointer to hardware structure + * ixgbe_get_media_type_82599 - Get media type + * @hw: pointer to hardware structure * - * Returns the media type (fiber, copper, backplane) + * Returns the media type (fiber, copper, backplane) **/ enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw) { @@ -579,10 +579,10 @@ out: } /** - * ixgbe_stop_mac_link_on_d3_82599 - Disables link on D3 - * @hw: pointer to hardware structure + * ixgbe_stop_mac_link_on_d3_82599 - Disables link on D3 + * @hw: pointer to hardware structure * - * Disables link during D3 power down sequence. + * Disables link during D3 power down sequence. * **/ void ixgbe_stop_mac_link_on_d3_82599(struct ixgbe_hw *hw) @@ -602,12 +602,12 @@ void ixgbe_stop_mac_link_on_d3_82599(struct ixgbe_hw *hw) } /** - * ixgbe_start_mac_link_82599 - Setup MAC link settings - * @hw: pointer to hardware structure - * @autoneg_wait_to_complete: true when waiting for completion is needed + * ixgbe_start_mac_link_82599 - Setup MAC link settings + * @hw: pointer to hardware structure + * @autoneg_wait_to_complete: true when waiting for completion is needed * - * Configures link settings based on values in the ixgbe_hw struct. - * Restarts the link. Performs autonegotiation if needed. + * Configures link settings based on values in the ixgbe_hw struct. + * Restarts the link. Performs autonegotiation if needed. **/ s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw, bool autoneg_wait_to_complete) @@ -670,12 +670,12 @@ out: } /** - * ixgbe_disable_tx_laser_multispeed_fiber - Disable Tx laser - * @hw: pointer to hardware structure + * ixgbe_disable_tx_laser_multispeed_fiber - Disable Tx laser + * @hw: pointer to hardware structure * - * The base drivers may require better control over SFP+ module - * PHY states. This includes selectively shutting down the Tx - * laser on the PHY, effectively halting physical link. + * The base drivers may require better control over SFP+ module + * PHY states. This includes selectively shutting down the Tx + * laser on the PHY, effectively halting physical link. **/ void ixgbe_disable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) { @@ -693,12 +693,12 @@ void ixgbe_disable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) } /** - * ixgbe_enable_tx_laser_multispeed_fiber - Enable Tx laser - * @hw: pointer to hardware structure + * ixgbe_enable_tx_laser_multispeed_fiber - Enable Tx laser + * @hw: pointer to hardware structure * - * The base drivers may require better control over SFP+ module - * PHY states. This includes selectively turning on the Tx - * laser on the PHY, effectively starting physical link. + * The base drivers may require better control over SFP+ module + * PHY states. This includes selectively turning on the Tx + * laser on the PHY, effectively starting physical link. **/ void ixgbe_enable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) { @@ -712,16 +712,16 @@ void ixgbe_enable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) } /** - * ixgbe_flap_tx_laser_multispeed_fiber - Flap Tx laser - * @hw: pointer to hardware structure + * ixgbe_flap_tx_laser_multispeed_fiber - Flap Tx laser + * @hw: pointer to hardware structure * - * When the driver changes the link speeds that it can support, - * it sets autotry_restart to true to indicate that we need to - * initiate a new autotry session with the link partner. To do - * so, we set the speed then disable and re-enable the Tx laser, to - * alert the link partner that it also needs to restart autotry on its - * end. This is consistent with true clause 37 autoneg, which also - * involves a loss of signal. + * When the driver changes the link speeds that it can support, + * it sets autotry_restart to true to indicate that we need to + * initiate a new autotry session with the link partner. To do + * so, we set the speed then disable and re-enable the Tx laser, to + * alert the link partner that it also needs to restart autotry on its + * end. This is consistent with true clause 37 autoneg, which also + * involves a loss of signal. **/ void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) { @@ -739,11 +739,11 @@ void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) } /** - * ixgbe_set_hard_rate_select_speed - Set module link speed - * @hw: pointer to hardware structure - * @speed: link speed to set + * ixgbe_set_hard_rate_select_speed - Set module link speed + * @hw: pointer to hardware structure + * @speed: link speed to set * - * Set module link speed via RS0/RS1 rate select pins. + * Set module link speed via RS0/RS1 rate select pins. */ void ixgbe_set_hard_rate_select_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed) @@ -768,12 +768,12 @@ void ixgbe_set_hard_rate_select_speed(struct ixgbe_hw *hw, } /** - * ixgbe_setup_mac_link_smartspeed - Set MAC link speed using SmartSpeed - * @hw: pointer to hardware structure - * @speed: new link speed - * @autoneg_wait_to_complete: true when waiting for completion is needed + * ixgbe_setup_mac_link_smartspeed - Set MAC link speed using SmartSpeed + * @hw: pointer to hardware structure + * @speed: new link speed + * @autoneg_wait_to_complete: true when waiting for completion is needed * - * Implements the Intel SmartSpeed algorithm. + * Implements the Intel SmartSpeed algorithm. **/ s32 ixgbe_setup_mac_link_smartspeed(struct ixgbe_hw *hw, ixgbe_link_speed speed, @@ -880,12 +880,12 @@ out: } /** - * ixgbe_setup_mac_link_82599 - Set MAC link speed - * @hw: pointer to hardware structure - * @speed: new link speed - * @autoneg_wait_to_complete: true when waiting for completion is needed + * ixgbe_setup_mac_link_82599 - Set MAC link speed + * @hw: pointer to hardware structure + * @speed: new link speed + * @autoneg_wait_to_complete: true when waiting for completion is needed * - * Set the link speed in the AUTOC register and restarts link. + * Set the link speed in the AUTOC register and restarts link. **/ s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw, ixgbe_link_speed speed, @@ -998,12 +998,12 @@ out: } /** - * ixgbe_setup_copper_link_82599 - Set the PHY autoneg advertised field - * @hw: pointer to hardware structure - * @speed: new link speed - * @autoneg_wait_to_complete: true if waiting is needed to complete + * ixgbe_setup_copper_link_82599 - Set the PHY autoneg advertised field + * @hw: pointer to hardware structure + * @speed: new link speed + * @autoneg_wait_to_complete: true if waiting is needed to complete * - * Restarts link on PHY and MAC based on settings passed in. + * Restarts link on PHY and MAC based on settings passed in. **/ static s32 ixgbe_setup_copper_link_82599(struct ixgbe_hw *hw, ixgbe_link_speed speed, @@ -1023,12 +1023,12 @@ static s32 ixgbe_setup_copper_link_82599(struct ixgbe_hw *hw, } /** - * ixgbe_reset_hw_82599 - Perform hardware reset - * @hw: pointer to hardware structure + * ixgbe_reset_hw_82599 - Perform hardware reset + * @hw: pointer to hardware structure * - * Resets the hardware by resetting the transmit and receive units, masks - * and clears all interrupts, perform a PHY reset, and perform a link (MAC) - * reset. + * Resets the hardware by resetting the transmit and receive units, masks + * and clears all interrupts, perform a PHY reset, and perform a link (MAC) + * reset. **/ s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw) { @@ -1224,8 +1224,8 @@ static s32 ixgbe_fdir_check_cmd_complete(struct ixgbe_hw *hw, u32 *fdircmd) } /** - * ixgbe_reinit_fdir_tables_82599 - Reinitialize Flow Director tables. - * @hw: pointer to hardware structure + * ixgbe_reinit_fdir_tables_82599 - Reinitialize Flow Director tables. + * @hw: pointer to hardware structure **/ s32 ixgbe_reinit_fdir_tables_82599(struct ixgbe_hw *hw) { @@ -1297,9 +1297,9 @@ s32 ixgbe_reinit_fdir_tables_82599(struct ixgbe_hw *hw) } /** - * ixgbe_fdir_enable_82599 - Initialize Flow Director control registers - * @hw: pointer to hardware structure - * @fdirctrl: value to write to flow director control register + * ixgbe_fdir_enable_82599 - Initialize Flow Director control registers + * @hw: pointer to hardware structure + * @fdirctrl: value to write to flow director control register **/ static void ixgbe_fdir_enable_82599(struct ixgbe_hw *hw, u32 fdirctrl) { @@ -1338,9 +1338,9 @@ static void ixgbe_fdir_enable_82599(struct ixgbe_hw *hw, u32 fdirctrl) } /** - * ixgbe_init_fdir_signature_82599 - Initialize Flow Director signature filters - * @hw: pointer to hardware structure - * @fdirctrl: value to write to flow director control register, initially + * ixgbe_init_fdir_signature_82599 - Initialize Flow Director signature filters + * @hw: pointer to hardware structure + * @fdirctrl: value to write to flow director control register, initially * contains just the value of the Rx packet buffer allocation **/ s32 ixgbe_init_fdir_signature_82599(struct ixgbe_hw *hw, u32 fdirctrl) @@ -1364,11 +1364,11 @@ s32 ixgbe_init_fdir_signature_82599(struct ixgbe_hw *hw, u32 fdirctrl) } /** - * ixgbe_init_fdir_perfect_82599 - Initialize Flow Director perfect filters - * @hw: pointer to hardware structure - * @fdirctrl: value to write to flow director control register, initially + * ixgbe_init_fdir_perfect_82599 - Initialize Flow Director perfect filters + * @hw: pointer to hardware structure + * @fdirctrl: value to write to flow director control register, initially * contains just the value of the Rx packet buffer allocation - * @cloud_mode: true - cloud mode, false - other mode + * @cloud_mode: true - cloud mode, false - other mode **/ s32 ixgbe_init_fdir_perfect_82599(struct ixgbe_hw *hw, u32 fdirctrl, bool cloud_mode) @@ -1403,9 +1403,9 @@ s32 ixgbe_init_fdir_perfect_82599(struct ixgbe_hw *hw, u32 fdirctrl, } /** - * ixgbe_set_fdir_drop_queue_82599 - Set Flow Director drop queue - * @hw: pointer to hardware structure - * @dropqueue: Rx queue index used for the dropped packets + * ixgbe_set_fdir_drop_queue_82599 - Set Flow Director drop queue + * @hw: pointer to hardware structure + * @dropqueue: Rx queue index used for the dropped packets **/ void ixgbe_set_fdir_drop_queue_82599(struct ixgbe_hw *hw, u8 dropqueue) { @@ -1461,15 +1461,15 @@ do { \ } while (0) /** - * ixgbe_atr_compute_sig_hash_82599 - Compute the signature hash - * @input: input bitstream to compute the hash on - * @common: compressed common input dword + * ixgbe_atr_compute_sig_hash_82599 - Compute the signature hash + * @input: input bitstream to compute the hash on + * @common: compressed common input dword * - * This function is almost identical to the function above but contains - * several optimizations such as unwinding all of the loops, letting the - * compiler work out all of the conditional ifs since the keys are static - * defines, and computing two keys at once since the hashed dword stream - * will be the same for both keys. + * This function is almost identical to the function above but contains + * several optimizations such as unwinding all of the loops, letting the + * compiler work out all of the conditional ifs since the keys are static + * defines, and computing two keys at once since the hashed dword stream + * will be the same for both keys. **/ u32 ixgbe_atr_compute_sig_hash_82599(union ixgbe_atr_hash_dword input, union ixgbe_atr_hash_dword common) @@ -1528,11 +1528,11 @@ u32 ixgbe_atr_compute_sig_hash_82599(union ixgbe_atr_hash_dword input, } /** - * ixgbe_atr_add_signature_filter_82599 - Adds a signature hash filter - * @hw: pointer to hardware structure - * @input: unique input dword - * @common: compressed common input dword - * @queue: queue index to direct traffic to + * ixgbe_atr_add_signature_filter_82599 - Adds a signature hash filter + * @hw: pointer to hardware structure + * @input: unique input dword + * @common: compressed common input dword + * @queue: queue index to direct traffic to * * Note that the tunnel bit in input must not be set when the hardware * tunneling support does not exist. @@ -1601,15 +1601,15 @@ do { \ } while (0) /** - * ixgbe_atr_compute_perfect_hash_82599 - Compute the perfect filter hash - * @input: input bitstream to compute the hash on - * @input_mask: mask for the input bitstream + * ixgbe_atr_compute_perfect_hash_82599 - Compute the perfect filter hash + * @input: input bitstream to compute the hash on + * @input_mask: mask for the input bitstream * - * This function serves two main purposes. First it applies the input_mask - * to the atr_input resulting in a cleaned up atr_input data stream. - * Secondly it computes the hash and stores it in the bkt_hash field at - * the end of the input byte stream. This way it will be available for - * future use without needing to recompute the hash. + * This function serves two main purposes. First it applies the input_mask + * to the atr_input resulting in a cleaned up atr_input data stream. + * Secondly it computes the hash and stores it in the bkt_hash field at + * the end of the input byte stream. This way it will be available for + * future use without needing to recompute the hash. **/ void ixgbe_atr_compute_perfect_hash_82599(union ixgbe_atr_input *input, union ixgbe_atr_input *input_mask) @@ -1660,13 +1660,13 @@ void ixgbe_atr_compute_perfect_hash_82599(union ixgbe_atr_input *input, } /** - * ixgbe_get_fdirtcpm_82599 - generate a TCP port from atr_input_masks - * @input_mask: mask to be bit swapped + * ixgbe_get_fdirtcpm_82599 - generate a TCP port from atr_input_masks + * @input_mask: mask to be bit swapped * - * The source and destination port masks for flow director are bit swapped - * in that bit 15 effects bit 0, 14 effects 1, 13, 2 etc. In order to - * generate a correctly swapped value we need to bit swap the mask and that - * is what is accomplished by this function. + * The source and destination port masks for flow director are bit swapped + * in that bit 15 effects bit 0, 14 effects 1, 13, 2 etc. In order to + * generate a correctly swapped value we need to bit swap the mask and that + * is what is accomplished by this function. **/ static u32 ixgbe_get_fdirtcpm_82599(union ixgbe_atr_input *input_mask) { @@ -2000,16 +2000,16 @@ s32 ixgbe_fdir_erase_perfect_filter_82599(struct ixgbe_hw *hw, } /** - * ixgbe_fdir_add_perfect_filter_82599 - Adds a perfect filter - * @hw: pointer to hardware structure - * @input: input bitstream - * @input_mask: mask for the input bitstream - * @soft_id: software index for the filters - * @queue: queue index to direct traffic to - * @cloud_mode: unused + * ixgbe_fdir_add_perfect_filter_82599 - Adds a perfect filter + * @hw: pointer to hardware structure + * @input: input bitstream + * @input_mask: mask for the input bitstream + * @soft_id: software index for the filters + * @queue: queue index to direct traffic to + * @cloud_mode: unused * - * Note that the caller to this function must lock before calling, since the - * hardware writes must be protected from one another. + * Note that the caller to this function must lock before calling, since the + * hardware writes must be protected from one another. **/ s32 ixgbe_fdir_add_perfect_filter_82599(struct ixgbe_hw *hw, union ixgbe_atr_input *input, @@ -2067,12 +2067,12 @@ s32 ixgbe_fdir_add_perfect_filter_82599(struct ixgbe_hw *hw, } /** - * ixgbe_read_analog_reg8_82599 - Reads 8 bit Omer analog register - * @hw: pointer to hardware structure - * @reg: analog register to read - * @val: read value + * ixgbe_read_analog_reg8_82599 - Reads 8 bit Omer analog register + * @hw: pointer to hardware structure + * @reg: analog register to read + * @val: read value * - * Performs read operation to Omer analog register specified. + * Performs read operation to Omer analog register specified. **/ s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val) { @@ -2091,12 +2091,12 @@ s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val) } /** - * ixgbe_write_analog_reg8_82599 - Writes 8 bit Omer analog register - * @hw: pointer to hardware structure - * @reg: atlas register to write - * @val: value to write + * ixgbe_write_analog_reg8_82599 - Writes 8 bit Omer analog register + * @hw: pointer to hardware structure + * @reg: atlas register to write + * @val: value to write * - * Performs write operation to Omer analog register specified. + * Performs write operation to Omer analog register specified. **/ s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val) { @@ -2113,12 +2113,12 @@ s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val) *** 6480 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A441A6AD567; Tue, 14 Sep 2021 00:48:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l8B5p22z3h9L; Tue, 14 Sep 2021 00:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6761114B9; Tue, 14 Sep 2021 00:48:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0mOaF045495; Tue, 14 Sep 2021 00:48:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0mOWc045494; Tue, 14 Sep 2021 00:48:24 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:24 GMT Message-Id: <202109140048.18E0mOWc045494@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: bd6a3f4c8087 - stable/12 - ixgbe: add register definitions for NVM update MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: bd6a3f4c80873df129b91eb78c5422bcbdbfd0a1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:27 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=bd6a3f4c80873df129b91eb78c5422bcbdbfd0a1 commit bd6a3f4c80873df129b91eb78c5422bcbdbfd0a1 Author: Guinan Sun AuthorDate: 2020-07-09 08:00:32 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:46:09 +0000 ixgbe: add register definitions for NVM update Added additional register for X550 and above device family. Signed-off-by: Piotr Skajewski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (4a6847d78814b1c3df896efe31562643d419317d) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit ff8db817abbd348f0a7518ce32f0e52c6ab8e06e) --- sys/dev/ixgbe/ixgbe_type.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/ixgbe/ixgbe_type.h b/sys/dev/ixgbe/ixgbe_type.h index 48751e7386bb..1c04f09df77c 100644 --- a/sys/dev/ixgbe/ixgbe_type.h +++ b/sys/dev/ixgbe/ixgbe_type.h @@ -1095,8 +1095,10 @@ struct ixgbe_dmac_config { #define IXGBE_HSMC0R 0x15F04 #define IXGBE_HSMC1R 0x15F08 #define IXGBE_SWSR 0x15F10 +#define IXGBE_FWRESETCNT 0x15F40 #define IXGBE_HFDR 0x15FE8 #define IXGBE_FLEX_MNG 0x15800 /* 0x15800 - 0x15EFC */ +#define IXGBE_FLEX_MNG_PTR(_i) (IXGBE_FLEX_MNG + ((_i) * 4)) #define IXGBE_HICR_EN 0x01 /* Enable bit - RO */ /* Driver sets this bit when done to put command in RAM */ From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1E776AD59D; Tue, 14 Sep 2021 00:48:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l8B6PYWz3h9Q; Tue, 14 Sep 2021 00:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 117B510D56; Tue, 14 Sep 2021 00:48:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0mPJN045519; Tue, 14 Sep 2021 00:48:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0mPFZ045518; Tue, 14 Sep 2021 00:48:25 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:25 GMT Message-Id: <202109140048.18E0mPFZ045518@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 74e5adf09fd3 - stable/12 - ixgbe: create function to restart autoneg MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 74e5adf09fd39119b0189e73c94fd6dfc6092129 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:27 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=74e5adf09fd39119b0189e73c94fd6dfc6092129 commit 74e5adf09fd39119b0189e73c94fd6dfc6092129 Author: Guinan Sun AuthorDate: 2020-07-09 08:00:36 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:46:16 +0000 ixgbe: create function to restart autoneg This patch is for restarting auto negotiation on PHY. Signed-off-by: Jakub Chylkowski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (664ea2614eafbec8eda5c86764ff047475a1e5c6) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 80a39a2bda8208c716f614f792c8d9a3628d6c26) --- sys/dev/ixgbe/ixgbe_phy.c | 48 ++++++++++++++++++++++------------------------- sys/dev/ixgbe/ixgbe_phy.h | 1 + 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_phy.c b/sys/dev/ixgbe/ixgbe_phy.c index c1cbc282c790..e9e1dd2d8c1c 100644 --- a/sys/dev/ixgbe/ixgbe_phy.c +++ b/sys/dev/ixgbe/ixgbe_phy.c @@ -573,6 +573,26 @@ out: return status; } +/** + * ixgbe_restart_auto_neg - Restart auto negotiation on the PHY + * @hw: pointer to hardware structure + **/ +void ixgbe_restart_auto_neg(struct ixgbe_hw *hw) +{ + u16 autoneg_reg; + + /* Check if PHY reset is blocked by MNG FW */ + if (ixgbe_check_reset_blocked(hw)) + return; + + /* Restart PHY auto-negotiation. */ + hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL, + IXGBE_MDIO_AUTO_NEG_DEV_TYPE, &autoneg_reg); + autoneg_reg |= IXGBE_MII_RESTART; + hw->phy.ops.write_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL, + IXGBE_MDIO_AUTO_NEG_DEV_TYPE, autoneg_reg); +} + /** * ixgbe_read_phy_mdi - Reads a value from a specified PHY register without * the SWFW lock @@ -857,19 +877,7 @@ s32 ixgbe_setup_phy_link_generic(struct ixgbe_hw *hw) IXGBE_MDIO_AUTO_NEG_DEV_TYPE, autoneg_reg); - /* Blocked by MNG FW so don't reset PHY */ - if (ixgbe_check_reset_blocked(hw)) - return status; - - /* Restart PHY auto-negotiation. */ - hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL, - IXGBE_MDIO_AUTO_NEG_DEV_TYPE, &autoneg_reg); - - autoneg_reg |= IXGBE_MII_RESTART; - - hw->phy.ops.write_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL, - IXGBE_MDIO_AUTO_NEG_DEV_TYPE, autoneg_reg); - + ixgbe_restart_auto_neg(hw); return status; } @@ -1093,19 +1101,7 @@ s32 ixgbe_setup_phy_link_tnx(struct ixgbe_hw *hw) autoneg_reg); } - /* Blocked by MNG FW so don't reset PHY */ - if (ixgbe_check_reset_blocked(hw)) - return status; - - /* Restart PHY auto-negotiation. */ - hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL, - IXGBE_MDIO_AUTO_NEG_DEV_TYPE, &autoneg_reg); - - autoneg_reg |= IXGBE_MII_RESTART; - - hw->phy.ops.write_reg(hw, IXGBE_MDIO_AUTO_NEG_CONTROL, - IXGBE_MDIO_AUTO_NEG_DEV_TYPE, autoneg_reg); - + ixgbe_restart_auto_neg(hw); return status; } diff --git a/sys/dev/ixgbe/ixgbe_phy.h b/sys/dev/ixgbe/ixgbe_phy.h index 9fd3f6d2163e..7f51ccc1dd2c 100644 --- a/sys/dev/ixgbe/ixgbe_phy.h +++ b/sys/dev/ixgbe/ixgbe_phy.h @@ -163,6 +163,7 @@ enum ixgbe_phy_type ixgbe_get_phy_type_from_id(u32 phy_id); s32 ixgbe_get_phy_id(struct ixgbe_hw *hw); s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw); s32 ixgbe_reset_phy_generic(struct ixgbe_hw *hw); +void ixgbe_restart_auto_neg(struct ixgbe_hw *hw); s32 ixgbe_read_phy_reg_mdi(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, u16 *phy_data); s32 ixgbe_write_phy_reg_mdi(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type, From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2410C6AD277; Tue, 14 Sep 2021 00:48:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l850Dr0z3hFp; Tue, 14 Sep 2021 00:48:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DE6D11420; Tue, 14 Sep 2021 00:48:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0mKNa045393; Tue, 14 Sep 2021 00:48:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0mKw6045392; Tue, 14 Sep 2021 00:48:20 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:20 GMT Message-Id: <202109140048.18E0mKw6045392@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: d29834819db1 - stable/12 - ixgbe: update X550 SFP identification MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: d29834819db1f946f9710d8b084b7e719ccf3d9a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:22 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=d29834819db1f946f9710d8b084b7e719ccf3d9a commit d29834819db1f946f9710d8b084b7e719ccf3d9a Author: Xiaoyun Li AuthorDate: 2018-09-17 09:28:12 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:45:45 +0000 ixgbe: update X550 SFP identification Use ixgbe_identify_sfp_module_X550em to update SFP identification flow. ixgbe_identify_sfp_module_X550em includes specific checks for X550 about supported SFP modules. Signed-off-by: Xiaoyun Li Acked-by: Qi Zhang Approved by: imp Obtained from: DPDK (175bedb0cc8f801be3050fa35b8d8d0971cea7cc) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 0a4f0befab9d3a048232b00bea77bf3da20cfdd0) --- sys/dev/ixgbe/ixgbe_x550.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index df19c4c65201..1c79dda6c235 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -351,7 +351,7 @@ static s32 ixgbe_identify_phy_x550em(struct ixgbe_hw *hw) switch (hw->device_id) { case IXGBE_DEV_ID_X550EM_A_SFP: - return ixgbe_identify_module_generic(hw); + return ixgbe_identify_sfp_module_X550em(hw); case IXGBE_DEV_ID_X550EM_X_SFP: /* set up for CS4227 usage */ ixgbe_setup_mux_ctl(hw); @@ -359,7 +359,7 @@ static s32 ixgbe_identify_phy_x550em(struct ixgbe_hw *hw) /* Fallthrough */ case IXGBE_DEV_ID_X550EM_A_SFP_N: - return ixgbe_identify_module_generic(hw); + return ixgbe_identify_sfp_module_X550em(hw); break; case IXGBE_DEV_ID_X550EM_X_KX4: hw->phy.type = ixgbe_phy_x550em_kx4; From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 66D0B6AD608; Tue, 14 Sep 2021 00:48:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l886S4Lz3h2Z; Tue, 14 Sep 2021 00:48:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C90C51126C; Tue, 14 Sep 2021 00:48:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0mNAN045471; Tue, 14 Sep 2021 00:48:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0mN9r045470; Tue, 14 Sep 2021 00:48:23 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:23 GMT Message-Id: <202109140048.18E0mN9r045470@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 4cfdd23e189f - stable/12 - ixgbe: move increments after evaluations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 4cfdd23e189f369079462a2fd216b4dfc3b51993 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:26 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=4cfdd23e189f369079462a2fd216b4dfc3b51993 commit 4cfdd23e189f369079462a2fd216b4dfc3b51993 Author: Guinan Sun AuthorDate: 2020-07-09 08:00:35 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:46:04 +0000 ixgbe: move increments after evaluations The retry variable was being incremented before it was evaluated by the subsequent conditional against the maximum retries to figure out which message to print. So we'll move the increment op to the end. Signed-off-by: Jeb Cramer Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (390445ec30b4c52a3d2887c3d2a202d9cf37ea8e) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit dc11ba4eb3fe5cce615f361de83e85e07005ca24) --- sys/dev/ixgbe/ixgbe_phy.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_phy.c b/sys/dev/ixgbe/ixgbe_phy.c index 236d6685f8a9..c1cbc282c790 100644 --- a/sys/dev/ixgbe/ixgbe_phy.c +++ b/sys/dev/ixgbe/ixgbe_phy.c @@ -169,12 +169,12 @@ fail: ixgbe_i2c_bus_clear(hw); if (lock) hw->mac.ops.release_swfw_sync(hw, swfw_mask); - retry++; if (retry < max_retry) DEBUGOUT("I2C byte read combined error - Retrying.\n"); else DEBUGOUT("I2C byte read combined error.\n"); - } while (retry < max_retry); + retry++; + } while (retry <= max_retry); return IXGBE_ERR_I2C; } @@ -234,12 +234,12 @@ fail: ixgbe_i2c_bus_clear(hw); if (lock) hw->mac.ops.release_swfw_sync(hw, swfw_mask); - retry++; if (retry < max_retry) DEBUGOUT("I2C byte write combined error - Retrying.\n"); else DEBUGOUT("I2C byte write combined error.\n"); - } while (retry < max_retry); + retry++; + } while (retry <= max_retry); return IXGBE_ERR_I2C; } @@ -2066,13 +2066,12 @@ fail: hw->mac.ops.release_swfw_sync(hw, swfw_mask); msec_delay(100); } - retry++; if (retry < max_retry) DEBUGOUT("I2C byte read error - Retrying.\n"); else DEBUGOUT("I2C byte read error.\n"); - - } while (retry < max_retry); + retry++; + } while (retry <= max_retry); return status; } @@ -2170,12 +2169,12 @@ static s32 ixgbe_write_i2c_byte_generic_int(struct ixgbe_hw *hw, u8 byte_offset, fail: ixgbe_i2c_bus_clear(hw); - retry++; if (retry < max_retry) DEBUGOUT("I2C byte write error - Retrying.\n"); else DEBUGOUT("I2C byte write error.\n"); - } while (retry < max_retry); + retry++; + } while (retry <= max_retry); if (lock) hw->mac.ops.release_swfw_sync(hw, swfw_mask); From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 644C76AD56B; Tue, 14 Sep 2021 00:48:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l8D00zJz3RLr; Tue, 14 Sep 2021 00:48:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 684131152F; Tue, 14 Sep 2021 00:48:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0mRuW045543; Tue, 14 Sep 2021 00:48:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0mR5l045542; Tue, 14 Sep 2021 00:48:27 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:27 GMT Message-Id: <202109140048.18E0mR5l045542@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 900b6eedcc7b - stable/12 - ixgbe: remove unnecessary return value check MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 900b6eedcc7bf7ca50ae3207c10e78ce234da8cf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:28 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=900b6eedcc7bf7ca50ae3207c10e78ce234da8cf commit 900b6eedcc7bf7ca50ae3207c10e78ce234da8cf Author: Guinan Sun AuthorDate: 2020-07-09 08:00:38 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:46:22 +0000 ixgbe: remove unnecessary return value check Remove unnecessary return value check. Signed-off-by: Jakub Chylkowski Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (4b0ee6529b7897c2a08dd56669f07ac1f46a8474) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 3a89005394bc5d82ce9b6baa9e7f8dee362354ae) --- sys/dev/ixgbe/ixgbe_82599.c | 4 +--- sys/dev/ixgbe/ixgbe_common.c | 4 +--- sys/dev/ixgbe/ixgbe_common.h | 2 +- sys/dev/ixgbe/ixgbe_phy.c | 25 +++++++------------------ sys/dev/ixgbe/ixgbe_x540.c | 2 +- 5 files changed, 11 insertions(+), 26 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c index 0222acd2f0d5..9eb3904a30f9 100644 --- a/sys/dev/ixgbe/ixgbe_82599.c +++ b/sys/dev/ixgbe/ixgbe_82599.c @@ -2130,9 +2130,7 @@ s32 ixgbe_start_hw_82599(struct ixgbe_hw *hw) if (ret_val != IXGBE_SUCCESS) goto out; - ret_val = ixgbe_start_hw_gen2(hw); - if (ret_val != IXGBE_SUCCESS) - goto out; + ixgbe_start_hw_gen2(hw); /* We need to run link autotry after the driver loads */ hw->mac.autotry_restart = true; diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index f099fcec3be7..96d733004383 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -457,7 +457,7 @@ s32 ixgbe_start_hw_generic(struct ixgbe_hw *hw) * 82599 * X540 **/ -s32 ixgbe_start_hw_gen2(struct ixgbe_hw *hw) +void ixgbe_start_hw_gen2(struct ixgbe_hw *hw) { u32 i; u32 regval; @@ -482,8 +482,6 @@ s32 ixgbe_start_hw_gen2(struct ixgbe_hw *hw) IXGBE_DCA_RXCTRL_HEAD_WRO_EN); IXGBE_WRITE_REG(hw, IXGBE_DCA_RXCTRL(i), regval); } - - return IXGBE_SUCCESS; } /** diff --git a/sys/dev/ixgbe/ixgbe_common.h b/sys/dev/ixgbe/ixgbe_common.h index b072770acafa..051af213b628 100644 --- a/sys/dev/ixgbe/ixgbe_common.h +++ b/sys/dev/ixgbe/ixgbe_common.h @@ -56,7 +56,7 @@ u16 ixgbe_get_pcie_msix_count_generic(struct ixgbe_hw *hw); s32 ixgbe_init_ops_generic(struct ixgbe_hw *hw); s32 ixgbe_init_hw_generic(struct ixgbe_hw *hw); s32 ixgbe_start_hw_generic(struct ixgbe_hw *hw); -s32 ixgbe_start_hw_gen2(struct ixgbe_hw *hw); +void ixgbe_start_hw_gen2(struct ixgbe_hw *hw); s32 ixgbe_clear_hw_cntrs_generic(struct ixgbe_hw *hw); s32 ixgbe_read_pba_num_generic(struct ixgbe_hw *hw, u32 *pba_num); s32 ixgbe_read_pba_string_generic(struct ixgbe_hw *hw, u8 *pba_num, diff --git a/sys/dev/ixgbe/ixgbe_phy.c b/sys/dev/ixgbe/ixgbe_phy.c index e9e1dd2d8c1c..5a2f49e9ebac 100644 --- a/sys/dev/ixgbe/ixgbe_phy.c +++ b/sys/dev/ixgbe/ixgbe_phy.c @@ -39,10 +39,10 @@ static void ixgbe_i2c_start(struct ixgbe_hw *hw); static void ixgbe_i2c_stop(struct ixgbe_hw *hw); -static s32 ixgbe_clock_in_i2c_byte(struct ixgbe_hw *hw, u8 *data); +static void ixgbe_clock_in_i2c_byte(struct ixgbe_hw *hw, u8 *data); static s32 ixgbe_clock_out_i2c_byte(struct ixgbe_hw *hw, u8 data); static s32 ixgbe_get_i2c_ack(struct ixgbe_hw *hw); -static s32 ixgbe_clock_in_i2c_bit(struct ixgbe_hw *hw, bool *data); +static void ixgbe_clock_in_i2c_bit(struct ixgbe_hw *hw, bool *data); static s32 ixgbe_clock_out_i2c_bit(struct ixgbe_hw *hw, bool data); static void ixgbe_raise_i2c_clk(struct ixgbe_hw *hw, u32 *i2cctl); static void ixgbe_lower_i2c_clk(struct ixgbe_hw *hw, u32 *i2cctl); @@ -77,11 +77,7 @@ static s32 ixgbe_out_i2c_byte_ack(struct ixgbe_hw *hw, u8 byte) */ static s32 ixgbe_in_i2c_byte_ack(struct ixgbe_hw *hw, u8 *byte) { - s32 status; - - status = ixgbe_clock_in_i2c_byte(hw, byte); - if (status) - return status; + ixgbe_clock_in_i2c_byte(hw, byte); /* ACK */ return ixgbe_clock_out_i2c_bit(hw, false); } @@ -154,8 +150,7 @@ s32 ixgbe_read_i2c_combined_generic_int(struct ixgbe_hw *hw, u8 addr, u16 reg, if (ixgbe_in_i2c_byte_ack(hw, &low_bits)) goto fail; /* Get csum */ - if (ixgbe_clock_in_i2c_byte(hw, &csum_byte)) - goto fail; + ixgbe_clock_in_i2c_byte(hw, &csum_byte); /* NACK */ if (ixgbe_clock_out_i2c_bit(hw, false)) goto fail; @@ -2043,9 +2038,7 @@ static s32 ixgbe_read_i2c_byte_generic_int(struct ixgbe_hw *hw, u8 byte_offset, if (status != IXGBE_SUCCESS) goto fail; - status = ixgbe_clock_in_i2c_byte(hw, data); - if (status != IXGBE_SUCCESS) - goto fail; + ixgbe_clock_in_i2c_byte(hw, data); status = ixgbe_clock_out_i2c_bit(hw, nack); if (status != IXGBE_SUCCESS) @@ -2290,7 +2283,7 @@ static void ixgbe_i2c_stop(struct ixgbe_hw *hw) * * Clocks in one byte data via I2C data/clock **/ -static s32 ixgbe_clock_in_i2c_byte(struct ixgbe_hw *hw, u8 *data) +static void ixgbe_clock_in_i2c_byte(struct ixgbe_hw *hw, u8 *data) { s32 i; bool bit = 0; @@ -2302,8 +2295,6 @@ static s32 ixgbe_clock_in_i2c_byte(struct ixgbe_hw *hw, u8 *data) ixgbe_clock_in_i2c_bit(hw, &bit); *data |= bit << i; } - - return IXGBE_SUCCESS; } /** @@ -2399,7 +2390,7 @@ static s32 ixgbe_get_i2c_ack(struct ixgbe_hw *hw) * * Clocks in one bit via I2C data/clock **/ -static s32 ixgbe_clock_in_i2c_bit(struct ixgbe_hw *hw, bool *data) +static void ixgbe_clock_in_i2c_bit(struct ixgbe_hw *hw, bool *data) { u32 i2cctl = IXGBE_READ_REG(hw, IXGBE_I2CCTL_BY_MAC(hw)); u32 data_oe_bit = IXGBE_I2C_DATA_OE_N_EN_BY_MAC(hw); @@ -2424,8 +2415,6 @@ static s32 ixgbe_clock_in_i2c_bit(struct ixgbe_hw *hw, bool *data) /* Minimum low period of clock is 4.7 us */ usec_delay(IXGBE_I2C_T_LOW); - - return IXGBE_SUCCESS; } /** diff --git a/sys/dev/ixgbe/ixgbe_x540.c b/sys/dev/ixgbe/ixgbe_x540.c index 4ba256ede44a..d03b34ee8135 100644 --- a/sys/dev/ixgbe/ixgbe_x540.c +++ b/sys/dev/ixgbe/ixgbe_x540.c @@ -323,7 +323,7 @@ s32 ixgbe_start_hw_X540(struct ixgbe_hw *hw) if (ret_val != IXGBE_SUCCESS) goto out; - ret_val = ixgbe_start_hw_gen2(hw); + ixgbe_start_hw_gen2(hw); out: return ret_val; From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BAE176AD3E6; Tue, 14 Sep 2021 00:48:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l8F1fd4z3hGP; Tue, 14 Sep 2021 00:48:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 532B31166B; Tue, 14 Sep 2021 00:48:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0mSXY045567; Tue, 14 Sep 2021 00:48:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0mS8k045566; Tue, 14 Sep 2021 00:48:28 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:28 GMT Message-Id: <202109140048.18E0mS8k045566@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 479184c29752 - stable/12 - ixgbe: cleanup spelling mistakes in comments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 479184c2975294dcd4107a0efb30ca0edfdb7331 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:30 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=479184c2975294dcd4107a0efb30ca0edfdb7331 commit 479184c2975294dcd4107a0efb30ca0edfdb7331 Author: Guinan Sun AuthorDate: 2020-07-09 08:00:33 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:46:28 +0000 ixgbe: cleanup spelling mistakes in comments Several functions in the driver code have a weird function comment formatting which uses two spaces instead of only one space for the main function body. This formatting will be mechanically fixed by sed in a future patch, but doing so leads to some spelling warnings on that patch. Cleanup the spelling mistakes that will be detected first. This way, it is easier to verify the mechanical transformation done by sed in the following patch. Signed-off-by: Jacob Keller Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (fc75eee32037c1379e77e57031c1c353badd2272) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 46981e903cf3e8e4a5bf7f6152f8ca5b92b37e07) --- sys/dev/ixgbe/ixgbe_mbx.c | 4 ++-- sys/dev/ixgbe/ixgbe_vf.c | 2 +- sys/dev/ixgbe/ixgbe_x550.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_mbx.c b/sys/dev/ixgbe/ixgbe_mbx.c index 3650efc9d2bf..f72bbf34256a 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.c +++ b/sys/dev/ixgbe/ixgbe_mbx.c @@ -69,11 +69,11 @@ out: } /** - * ixgbe_poll_for_ack - Wait for message acknowledgement + * ixgbe_poll_for_ack - Wait for message acknowledgment * @hw: pointer to the HW structure * @mbx_id: id of mailbox to write * - * returns SUCCESS if it successfully received a message acknowledgement + * returns SUCCESS if it successfully received a message acknowledgment **/ static s32 ixgbe_poll_for_ack(struct ixgbe_hw *hw, u16 mbx_id) { diff --git a/sys/dev/ixgbe/ixgbe_vf.c b/sys/dev/ixgbe/ixgbe_vf.c index 895d9e06e1d0..82800b4a3d87 100644 --- a/sys/dev/ixgbe/ixgbe_vf.c +++ b/sys/dev/ixgbe/ixgbe_vf.c @@ -171,7 +171,7 @@ s32 ixgbe_init_hw_vf(struct ixgbe_hw *hw) * ixgbe_reset_hw_vf - Performs hardware reset * @hw: pointer to hardware structure * - * Resets the hardware by reseting the transmit and receive units, masks and + * Resets the hardware by resetting the transmit and receive units, masks and * clears all interrupts. **/ s32 ixgbe_reset_hw_vf(struct ixgbe_hw *hw) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index 8a42295ab10e..7fc556662b00 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -1066,7 +1066,7 @@ void ixgbe_set_source_address_pruning_X550(struct ixgbe_hw *hw, bool enable, } /** - * ixgbe_set_ethertype_anti_spoofing_X550 - Enable/Disable Ethertype anti-spoofing + * ixgbe_set_ethertype_anti_spoofing_X550 - Configure Ethertype anti-spoofing * @hw: pointer to hardware structure * @enable: enable or disable switch for Ethertype anti-spoofing * @vf: Virtual Function pool - VF Pool to set for Ethertype anti-spoofing From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:48:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C115D6AD455; Tue, 14 Sep 2021 00:48:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7l8G2GhXz3h5L; Tue, 14 Sep 2021 00:48:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E2B9112EE; Tue, 14 Sep 2021 00:48:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0mT8f045597; Tue, 14 Sep 2021 00:48:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0mTDm045596; Tue, 14 Sep 2021 00:48:29 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:48:29 GMT Message-Id: <202109140048.18E0mTDm045596@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: ebb3327d09ce - stable/12 - ixgbe: increase the timeout MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ebb3327d09cecafc4e188ce2222b70d7ed061dbe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:31 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ebb3327d09cecafc4e188ce2222b70d7ed061dbe commit ebb3327d09cecafc4e188ce2222b70d7ed061dbe Author: Qiming Yang AuthorDate: 2018-01-10 16:04:33 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:46:35 +0000 ixgbe: increase the timeout Increase SECRX_RDY polling frequency and semaphore timeout which fixes the FWSW.PT check in ixgbe_mng_present(). Signed-off-by: Qiming Yang Acked-by: Wenzhuo Lu Approved by: imp Obtained from: DPDK (6175260d12cc22852cecf2fb7ecd95cdb07611b5) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 5fd1f4be8d81a0019c632103121d68e2f20bc238) --- sys/dev/ixgbe/ixgbe_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_common.c b/sys/dev/ixgbe/ixgbe_common.c index 96d733004383..d19f82bc3eab 100644 --- a/sys/dev/ixgbe/ixgbe_common.c +++ b/sys/dev/ixgbe/ixgbe_common.c @@ -3356,7 +3356,7 @@ void ixgbe_release_swfw_sync(struct ixgbe_hw *hw, u32 mask) **/ s32 ixgbe_disable_sec_rx_path_generic(struct ixgbe_hw *hw) { -#define IXGBE_MAX_SECRX_POLL 40 +#define IXGBE_MAX_SECRX_POLL 4000 int i; int secrxreg; @@ -3373,7 +3373,7 @@ s32 ixgbe_disable_sec_rx_path_generic(struct ixgbe_hw *hw) break; else /* Use interrupt-safe sleep just in case */ - usec_delay(1000); + usec_delay(10); } /* For informational purposes only */ From owner-dev-commits-src-all@freebsd.org Tue Sep 14 00:50:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D88456ADC62; Tue, 14 Sep 2021 00:50:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7lBH0zWpz3jLd; Tue, 14 Sep 2021 00:50:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 53D0710E66; Tue, 14 Sep 2021 00:41:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E0fXsf040172; Tue, 14 Sep 2021 00:41:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E0fXC0040171; Tue, 14 Sep 2021 00:41:33 GMT (envelope-from git) Date: Tue, 14 Sep 2021 00:41:33 GMT Message-Id: <202109140041.18E0fXC0040171@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 61bb00e52838 - stable/13 - ixgbe: cleanup spelling mistakes in comments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 61bb00e52838c056a5a72ab60027e7f44d9dc3b8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:50:16 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=61bb00e52838c056a5a72ab60027e7f44d9dc3b8 commit 61bb00e52838c056a5a72ab60027e7f44d9dc3b8 Author: Guinan Sun AuthorDate: 2020-07-09 08:00:33 +0000 Commit: Kevin Bowling CommitDate: 2021-09-14 00:37:44 +0000 ixgbe: cleanup spelling mistakes in comments Several functions in the driver code have a weird function comment formatting which uses two spaces instead of only one space for the main function body. This formatting will be mechanically fixed by sed in a future patch, but doing so leads to some spelling warnings on that patch. Cleanup the spelling mistakes that will be detected first. This way, it is easier to verify the mechanical transformation done by sed in the following patch. Signed-off-by: Jacob Keller Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (fc75eee32037c1379e77e57031c1c353badd2272) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621 (cherry picked from commit 46981e903cf3e8e4a5bf7f6152f8ca5b92b37e07) --- sys/dev/ixgbe/ixgbe_mbx.c | 4 ++-- sys/dev/ixgbe/ixgbe_vf.c | 2 +- sys/dev/ixgbe/ixgbe_x550.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_mbx.c b/sys/dev/ixgbe/ixgbe_mbx.c index 3650efc9d2bf..f72bbf34256a 100644 --- a/sys/dev/ixgbe/ixgbe_mbx.c +++ b/sys/dev/ixgbe/ixgbe_mbx.c @@ -69,11 +69,11 @@ out: } /** - * ixgbe_poll_for_ack - Wait for message acknowledgement + * ixgbe_poll_for_ack - Wait for message acknowledgment * @hw: pointer to the HW structure * @mbx_id: id of mailbox to write * - * returns SUCCESS if it successfully received a message acknowledgement + * returns SUCCESS if it successfully received a message acknowledgment **/ static s32 ixgbe_poll_for_ack(struct ixgbe_hw *hw, u16 mbx_id) { diff --git a/sys/dev/ixgbe/ixgbe_vf.c b/sys/dev/ixgbe/ixgbe_vf.c index 895d9e06e1d0..82800b4a3d87 100644 --- a/sys/dev/ixgbe/ixgbe_vf.c +++ b/sys/dev/ixgbe/ixgbe_vf.c @@ -171,7 +171,7 @@ s32 ixgbe_init_hw_vf(struct ixgbe_hw *hw) * ixgbe_reset_hw_vf - Performs hardware reset * @hw: pointer to hardware structure * - * Resets the hardware by reseting the transmit and receive units, masks and + * Resets the hardware by resetting the transmit and receive units, masks and * clears all interrupts. **/ s32 ixgbe_reset_hw_vf(struct ixgbe_hw *hw) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index 8a42295ab10e..7fc556662b00 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -1066,7 +1066,7 @@ void ixgbe_set_source_address_pruning_X550(struct ixgbe_hw *hw, bool enable, } /** - * ixgbe_set_ethertype_anti_spoofing_X550 - Enable/Disable Ethertype anti-spoofing + * ixgbe_set_ethertype_anti_spoofing_X550 - Configure Ethertype anti-spoofing * @hw: pointer to hardware structure * @enable: enable or disable switch for Ethertype anti-spoofing * @vf: Virtual Function pool - VF Pool to set for Ethertype anti-spoofing From owner-dev-commits-src-all@freebsd.org Tue Sep 14 03:39:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 83A31660335 for ; Tue, 14 Sep 2021 03:39:27 +0000 (UTC) (envelope-from wma@semihalf.com) Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com [IPv6:2607:f8b0:4864:20::b32]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7pxW2Q8Vz3GZC for ; Tue, 14 Sep 2021 03:39:27 +0000 (UTC) (envelope-from wma@semihalf.com) Received: by mail-yb1-xb32.google.com with SMTP id i12so24814533ybq.9 for ; Mon, 13 Sep 2021 20:39:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=otQrQW8V9U2Pw2OfQW78sPF84cpbU3v3gQYpi46BB3k=; b=fERXj0YHGIRak+mAyFlNH8Mvl9CrWiry8LT5fAg1jIkMIcyITUppMCfhsbKdjJfhxF jf9e69Fm2lH3Hq1v4isrNZwOJOFoAKBGH8HNFlsr1g4z/biLVlkGHr2vnyQuCHwNmv+h nl9nu1iHW7dgvs8V0no6DWX9Uj4NpGT2gtGKe9hA1B1jdcFMljPM6zNMcYOUlW52KJfY Tnpq3Zd6DEaJ1deDZ2L2DWKLw1pYHIjB+CQcZoP7QP54+i9FPCfSRtYLcPTSaAjOIKCi Csg7in2ZAeMZ+KcmoKSi6LISbrxkWJEkiyYkigiX8/dQo+wq2/s+/1ZSGLTe1I1Nq7LJ MeuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=otQrQW8V9U2Pw2OfQW78sPF84cpbU3v3gQYpi46BB3k=; b=HjkJwrjxwySYSOgra9lGOUZcJEg91X/JvTVZu4pffME9CEoxlho+wgl+s9KlD12Mnp qIcY4PIG3HbHuFgdGwrFU8GnRe/mKKtB4YkDP3x7tHpMRnU0NBQ58Ssx3skJUG67d2I+ zpGfB9QsuoPuq8OsXAMnvV4BQA0+32sj8q2f93J/NQn1N5cOnfyxYPG9eM293yquFJkM qUVYzpxaWIHRF0usMJBgkY/7IAkANTW87YkdZk6QU0U8FABN2Qg1Pd1pM07JuNDqw/w9 LA7yNkEqAUQNyPG1742GKr3KIyianCBoT0KdwjJFS2qLw4HOxEjnCKutdbgK97dMOl6n +AFw== X-Gm-Message-State: AOAM530oU3IyGypC3O5rSho61PRKUM6aw8xBYoldbvVssrqcf0YRlpMr UySHPkZL7vG1ef3/0/HtJJH4AqzKsmISMRQTnaiTXQ== X-Google-Smtp-Source: ABdhPJwuSpB1/NdAIQJAOAkMxx5Ex1p2FH/uollfXhG2VJn7qtrD8MGk+p2O7usasOBi9hzZscy3mSxTIsh9vkrCifc= X-Received: by 2002:a25:7ec3:: with SMTP id z186mr18852918ybc.147.1631590766806; Mon, 13 Sep 2021 20:39:26 -0700 (PDT) MIME-Version: 1.0 References: <202109130411.18D4BUs3004805@gitrepo.freebsd.org> In-Reply-To: From: Wojciech Macek Date: Tue, 14 Sep 2021 05:39:15 +0200 Message-ID: Subject: Re: git: 6fa041d7f125 - main - Measure latency of PMC interruptions To: Mitchell Horne Cc: Wojciech Macek , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4H7pxW2Q8Vz3GZC X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 03:39:27 -0000 Hi, Thanks for comments, I'll handle all of them as well as docs. Wojtek pon., 13 wrz 2021 o 22:06 Mitchell Horne napisa=C5=82(= a): > On Mon, Sep 13, 2021 at 1:11 AM Wojciech Macek wrote: > > > > The branch main has been updated by wma: > > > > URL: > https://cgit.FreeBSD.org/src/commit/?id=3D6fa041d7f125db65f400af7f520a41f= f78d19cd7 > > > > commit 6fa041d7f125db65f400af7f520a41ff78d19cd7 > > Author: Wojciech Macek > > AuthorDate: 2021-09-13 04:08:32 +0000 > > Commit: Wojciech Macek > > CommitDate: 2021-09-13 04:08:32 +0000 > > > > Measure latency of PMC interruptions > > > > Add HWPMC events to measure latency. > > Provide sysctl to choose the number of outstanding events which > > trigger HWPMC event. > > > > Obtained from: Semihalf > > Sponsored by: Stormshield > > Differential revision: https://reviews.freebsd.org/D31283 > > --- > > sys/kern/kern_intr.c | 58 > ++++++++++++++++++++++++++++++++++++++++++++++------ > > 1 file changed, 52 insertions(+), 6 deletions(-) > > > > diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c > > index 1660414a50ef..19401877dfbd 100644 > > --- a/sys/kern/kern_intr.c > > +++ b/sys/kern/kern_intr.c > > @@ -30,6 +30,7 @@ > > __FBSDID("$FreeBSD$"); > > > > #include "opt_ddb.h" > > +#include "opt_hwpmc_hooks.h" > > #include "opt_kstack_usage_prof.h" > > > > #include > > @@ -75,6 +76,7 @@ struct intr_thread { > > struct thread *it_thread; /* Kernel thread. */ > > int it_flags; /* (j) IT_* flags. */ > > int it_need; /* Needs service. */ > > + int it_waiting; /* Waiting in the runq. */ > > }; > > > > /* Interrupt thread flags kept in it_flags */ > > @@ -100,13 +102,19 @@ SYSCTL_INT(_hw, OID_AUTO, intr_storm_threshold, > CTLFLAG_RWTUN, > > static int intr_epoch_batch =3D 1000; > > SYSCTL_INT(_hw, OID_AUTO, intr_epoch_batch, CTLFLAG_RWTUN, > &intr_epoch_batch, > > 0, "Maximum interrupt handler executions without re-entering > epoch(9)"); > > +#ifdef HWPMC_HOOKS > > +static int intr_hwpmc_waiting_report_threshold =3D 1; > > +SYSCTL_INT(_hw, OID_AUTO, intr_hwpmc_waiting_report_threshold, > CTLFLAG_RWTUN, > > + &intr_hwpmc_waiting_report_threshold, 1, > > + "Threshold for reporting number of events in a workq"); > > +#endif > > static TAILQ_HEAD(, intr_event) event_list =3D > > TAILQ_HEAD_INITIALIZER(event_list); > > static struct mtx event_lock; > > MTX_SYSINIT(intr_event_list, &event_lock, "intr event list", MTX_DEF); > > > > static void intr_event_update(struct intr_event *ie); > > -static int intr_event_schedule_thread(struct intr_event *ie); > > +static int intr_event_schedule_thread(struct intr_event *ie, struc= t > trapframe *frame); > > static struct intr_thread *ithread_create(const char *name); > > static void ithread_destroy(struct intr_thread *ithread); > > static void ithread_execute_handlers(struct proc *p, > > @@ -115,6 +123,16 @@ static void ithread_loop(void *); > > static void ithread_update(struct intr_thread *ithd); > > static void start_softintr(void *); > > > > +#ifdef HWPMC_HOOKS > > +#include > > +PMC_SOFT_DEFINE( , , intr, all); > > +PMC_SOFT_DEFINE( , , intr, ithread); > > +PMC_SOFT_DEFINE( , , intr, filter); > > +PMC_SOFT_DEFINE( , , intr, stray); > > +PMC_SOFT_DEFINE( , , intr, schedule); > > +PMC_SOFT_DEFINE( , , intr, waiting); > > +#endif > > + > > Hi Wojciech, > > Do you plan to document these new events in the pmc.soft(3) man page? > > Cheers, > Mitchell > > > > /* Map an interrupt type to an ithread priority. */ > > u_char > > intr_priority(enum intr_type flags) > > @@ -773,7 +791,7 @@ intr_handler_barrier(struct intr_handler *handler) > > } > > if ((handler->ih_flags & IH_CHANGED) =3D=3D 0) { > > handler->ih_flags |=3D IH_CHANGED; > > - intr_event_schedule_thread(ie); > > + intr_event_schedule_thread(ie, NULL); > > } > > while ((handler->ih_flags & IH_CHANGED) !=3D 0) > > msleep(handler, &ie->ie_lock, 0, "ih_barr", 0); > > @@ -872,7 +890,7 @@ intr_event_remove_handler(void *cookie) > > KASSERT((handler->ih_flags & IH_DEAD) =3D=3D 0, > > ("duplicate handle remove")); > > handler->ih_flags |=3D IH_DEAD; > > - intr_event_schedule_thread(ie); > > + intr_event_schedule_thread(ie, NULL); > > while (handler->ih_flags & IH_DEAD) > > msleep(handler, &ie->ie_lock, 0, "iev_rmh", 0); > > intr_event_update(ie); > > @@ -944,7 +962,7 @@ intr_event_resume_handler(void *cookie) > > } > > > > static int > > -intr_event_schedule_thread(struct intr_event *ie) > > +intr_event_schedule_thread(struct intr_event *ie, struct trapframe > *frame) > > { > > struct intr_entropy entropy; > > struct intr_thread *it; > > @@ -986,11 +1004,28 @@ intr_event_schedule_thread(struct intr_event *ie= ) > > atomic_store_rel_int(&it->it_need, 1); > > thread_lock(td); > > if (TD_AWAITING_INTR(td)) { > > +#ifdef HWPMC_HOOKS > > + atomic_set_int(&it->it_waiting, 0); > > + if (frame !=3D NULL) > > + PMC_SOFT_CALL_TF( , , intr, schedule, frame); > > + else > > + PMC_SOFT_CALL( , , intr, schedule); > > +#endif > > CTR3(KTR_INTR, "%s: schedule pid %d (%s)", __func__, > td->td_proc->p_pid, > > td->td_name); > > TD_CLR_IWAIT(td); > > sched_add(td, SRQ_INTR); > > } else { > > +#ifdef HWPMC_HOOKS > > + atomic_add_int(&it->it_waiting, 1); > > + > > + if (atomic_load_int(&it->it_waiting) >=3D > intr_hwpmc_waiting_report_threshold) { > > + if (frame !=3D NULL) > > + PMC_SOFT_CALL_TF( , , intr, waiting, > frame); > > + else > > + PMC_SOFT_CALL( , , intr, waiting); > > + } > > +#endif > > CTR5(KTR_INTR, "%s: pid %d (%s): it_need %d, state %d", > > __func__, td->td_proc->p_pid, td->td_name, > it->it_need, TD_GET_STATE(td)); > > thread_unlock(td); > > @@ -1083,7 +1118,7 @@ swi_sched(void *cookie, int flags) > > #endif > > } else { > > VM_CNT_INC(v_soft); > > - error =3D intr_event_schedule_thread(ie); > > + error =3D intr_event_schedule_thread(ie, NULL); > > KASSERT(error =3D=3D 0, ("stray software interrupt")); > > } > > } > > @@ -1374,12 +1409,23 @@ intr_event_handle(struct intr_event *ie, struct > trapframe *frame) > > ret =3D ih->ih_filter(frame); > > else > > ret =3D ih->ih_filter(ih->ih_argument); > > +#ifdef HWPMC_HOOKS > > + PMC_SOFT_CALL_TF( , , intr, all, frame); > > +#endif > > KASSERT(ret =3D=3D FILTER_STRAY || > > ((ret & (FILTER_SCHEDULE_THREAD | FILTER_HANDLED)) > !=3D 0 && > > (ret & ~(FILTER_SCHEDULE_THREAD | FILTER_HANDLED)) > =3D=3D 0), > > ("%s: incorrect return value %#x from %s", __func__= , > ret, > > ih->ih_name)); > > filter =3D filter || ret =3D=3D FILTER_HANDLED; > > +#ifdef HWPMC_HOOKS > > + if (ret & FILTER_SCHEDULE_THREAD) > > + PMC_SOFT_CALL_TF( , , intr, ithread, frame); > > + else if (ret & FILTER_HANDLED) > > + PMC_SOFT_CALL_TF( , , intr, filter, frame); > > + else if (ret =3D=3D FILTER_STRAY) > > + PMC_SOFT_CALL_TF( , , intr, stray, frame); > > +#endif > > > > /* > > * Wrapper handler special handling: > > @@ -1416,7 +1462,7 @@ intr_event_handle(struct intr_event *ie, struct > trapframe *frame) > > if (thread) { > > int error __unused; > > > > - error =3D intr_event_schedule_thread(ie); > > + error =3D intr_event_schedule_thread(ie, frame); > > KASSERT(error =3D=3D 0, ("bad stray interrupt")); > > } > > critical_exit(); > From owner-dev-commits-src-all@freebsd.org Tue Sep 14 06:30:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6029C66256A; Tue, 14 Sep 2021 06:30:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7tl774Sdz4lVd; Tue, 14 Sep 2021 06:30:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3567315FEE; Tue, 14 Sep 2021 06:30:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E6Uhno005279; Tue, 14 Sep 2021 06:30:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E6Uh7o005278; Tue, 14 Sep 2021 06:30:43 GMT (envelope-from git) Date: Tue, 14 Sep 2021 06:30:43 GMT Message-Id: <202109140630.18E6Uh7o005278@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wojciech Macek Subject: git: bcf5c7a8b1dc - main - if_mvneta: Build the driver as a kernel module MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wma X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bcf5c7a8b1dcdcd5f27c1aa694f66208dc07a0dd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 06:30:44 -0000 The branch main has been updated by wma: URL: https://cgit.FreeBSD.org/src/commit/?id=bcf5c7a8b1dcdcd5f27c1aa694f66208dc07a0dd commit bcf5c7a8b1dcdcd5f27c1aa694f66208dc07a0dd Author: Hubert Mazur AuthorDate: 2021-09-13 09:44:31 +0000 Commit: Wojciech Macek CommitDate: 2021-09-14 06:29:53 +0000 if_mvneta: Build the driver as a kernel module Fix device detach and attach routine. Add required Makefile to build as a module. Remove entry from GENERIC, since now it can be loaded automatically. Tested on EspressoBin. Obtained from: Semihalf Reviewed by: manu Differential revision: https://reviews.freebsd.org/D31581 --- sys/dev/neta/if_mvneta.c | 73 ++++++++++++++++++++++++++++------------------- sys/modules/Makefile | 2 ++ sys/modules/neta/Makefile | 10 +++++++ 3 files changed, 55 insertions(+), 30 deletions(-) diff --git a/sys/dev/neta/if_mvneta.c b/sys/dev/neta/if_mvneta.c index debb4a922cbc..242e139b8cac 100644 --- a/sys/dev/neta/if_mvneta.c +++ b/sys/dev/neta/if_mvneta.c @@ -222,6 +222,11 @@ static device_method_t mvneta_methods[] = { DEVMETHOD_END }; +static struct ofw_compat_data compat_data[] = { + { "marvell,armada-3700-neta", true }, + { NULL, false } +}; + DEFINE_CLASS_0(mvneta, mvneta_driver, mvneta_methods, sizeof(struct mvneta_softc)); DRIVER_MODULE(miibus, mvneta, miibus_driver, miibus_devclass, 0, 0); @@ -229,7 +234,7 @@ DRIVER_MODULE(mdio, mvneta, mdio_driver, mdio_devclass, 0, 0); MODULE_DEPEND(mvneta, mdio, 1, 1, 1); MODULE_DEPEND(mvneta, ether, 1, 1, 1); MODULE_DEPEND(mvneta, miibus, 1, 1, 1); -MODULE_DEPEND(mvneta, mvxpbm, 1, 1, 1); +SIMPLEBUS_PNP_INFO(compat_data); /* * List of MIB register and names @@ -609,6 +614,16 @@ mvneta_attach(device_t self) } #endif + error = bus_setup_intr(self, sc->res[1], + INTR_TYPE_NET | INTR_MPSAFE, NULL, mvneta_intrs[0].handler, sc, + &sc->ih_cookie[0]); + if (error) { + device_printf(self, "could not setup %s\n", + mvneta_intrs[0].description); + mvneta_detach(self); + return (error); + } + /* * MAC address */ @@ -704,8 +719,6 @@ mvneta_attach(device_t self) } } - ether_ifattach(ifp, sc->enaddr); - /* * Enable DMA engines and Initialize Device Registers. */ @@ -835,20 +848,11 @@ mvneta_attach(device_t self) mvneta_update_media(sc, ifm_target); } - sysctl_mvneta_init(sc); + ether_ifattach(ifp, sc->enaddr); callout_reset(&sc->tick_ch, 0, mvneta_tick, sc); - error = bus_setup_intr(self, sc->res[1], - INTR_TYPE_NET | INTR_MPSAFE, NULL, mvneta_intrs[0].handler, sc, - &sc->ih_cookie[0]); - if (error) { - device_printf(self, "could not setup %s\n", - mvneta_intrs[0].description); - ether_ifdetach(sc->ifp); - mvneta_detach(self); - return (error); - } + sysctl_mvneta_init(sc); return (0); } @@ -857,20 +861,28 @@ STATIC int mvneta_detach(device_t dev) { struct mvneta_softc *sc; + struct ifnet *ifp; int q; sc = device_get_softc(dev); + ifp = sc->ifp; - mvneta_stop(sc); - /* Detach network interface */ - if (sc->ifp) - if_free(sc->ifp); + if (device_is_attached(dev)) { + mvneta_stop(sc); + callout_drain(&sc->tick_ch); + ether_ifdetach(sc->ifp); + } for (q = 0; q < MVNETA_RX_QNUM_MAX; q++) mvneta_ring_dealloc_rx_queue(sc, q); for (q = 0; q < MVNETA_TX_QNUM_MAX; q++) mvneta_ring_dealloc_tx_queue(sc, q); + device_delete_children(dev); + + if (sc->ih_cookie[0] != NULL) + bus_teardown_intr(dev, sc->res[1], sc->ih_cookie[0]); + if (sc->tx_dtag != NULL) bus_dma_tag_destroy(sc->tx_dtag); if (sc->rx_dtag != NULL) @@ -881,6 +893,13 @@ mvneta_detach(device_t dev) bus_dma_tag_destroy(sc->rxbuf_dtag); bus_release_resources(dev, res_spec, sc->res); + + if (sc->ifp) + if_free(sc->ifp); + + if (mtx_initialized(&sc->mtx)) + mtx_destroy(&sc->mtx); + return (0); } @@ -1254,6 +1273,9 @@ mvneta_ring_alloc_rx_queue(struct mvneta_softc *sc, int q) return (0); fail: + mvneta_rx_lockq(sc, q); + mvneta_ring_flush_rx_queue(sc, q); + mvneta_rx_unlockq(sc, q); mvneta_ring_dealloc_rx_queue(sc, q); device_printf(sc->dev, "DMA Ring buffer allocation failure.\n"); return (error); @@ -1295,6 +1317,9 @@ mvneta_ring_alloc_tx_queue(struct mvneta_softc *sc, int q) return (0); fail: + mvneta_tx_lockq(sc, q); + mvneta_ring_flush_tx_queue(sc, q); + mvneta_tx_unlockq(sc, q); mvneta_ring_dealloc_tx_queue(sc, q); device_printf(sc->dev, "DMA Ring buffer allocation failure.\n"); return (error); @@ -1324,16 +1349,6 @@ mvneta_ring_dealloc_tx_queue(struct mvneta_softc *sc, int q) #endif if (sc->txmbuf_dtag != NULL) { - if (mtx_name(&tx->ring_mtx) != NULL) { - /* - * It is assumed that maps are being loaded after mutex - * is initialized. Therefore we can skip unloading maps - * when mutex is empty. - */ - mvneta_tx_lockq(sc, q); - mvneta_ring_flush_tx_queue(sc, q); - mvneta_tx_unlockq(sc, q); - } for (i = 0; i < MVNETA_TX_RING_CNT; i++) { txbuf = &tx->txbuf[i]; if (txbuf->dmap != NULL) { @@ -1372,8 +1387,6 @@ mvneta_ring_dealloc_rx_queue(struct mvneta_softc *sc, int q) rx = MVNETA_RX_RING(sc, q); - mvneta_ring_flush_rx_queue(sc, q); - if (rx->desc_pa != 0) bus_dmamap_unload(sc->rx_dtag, rx->desc_map); diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 7ed2169445e4..b1063ad003d8 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -264,6 +264,7 @@ SUBDIR= \ mxge \ my \ ${_nctgpio} \ + ${_neta} \ ${_netgraph} \ ${_nfe} \ nfscl \ @@ -626,6 +627,7 @@ _rockchip= rockchip .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" _sdhci_fdt= sdhci_fdt _e6000sw= e6000sw +_neta= neta .endif .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" diff --git a/sys/modules/neta/Makefile b/sys/modules/neta/Makefile new file mode 100644 index 000000000000..8845e181efaa --- /dev/null +++ b/sys/modules/neta/Makefile @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${SRCTOP}/sys/dev/neta + +CFLAGS+= -DFDT + +KMOD= if_mvneta +SRCS= if_mvneta.c if_mvneta_fdt.c if_mvnetavar.h +SRCS+= bus_if.h device_if.h mdio_if.h miibus_if.h ofw_bus_if.h opt_platform.h +.include From owner-dev-commits-src-all@freebsd.org Tue Sep 14 07:51:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5FD19663E2C; Tue, 14 Sep 2021 07:51:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7wXW1k6mz3Pnh; Tue, 14 Sep 2021 07:51:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B20F16B54; Tue, 14 Sep 2021 07:51:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E7pd2R015663; Tue, 14 Sep 2021 07:51:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E7pdHr015662; Tue, 14 Sep 2021 07:51:39 GMT (envelope-from git) Date: Tue, 14 Sep 2021 07:51:39 GMT Message-Id: <202109140751.18E7pdHr015662@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: 94c678cf19ca - main - stress2: A two second timeout is too short MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 94c678cf19ca78330cbec1338167127964d3272a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 07:51:39 -0000 The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=94c678cf19ca78330cbec1338167127964d3272a commit 94c678cf19ca78330cbec1338167127964d3272a Author: Peter Holm AuthorDate: 2021-09-14 07:50:26 +0000 Commit: Peter Holm CommitDate: 2021-09-14 07:50:26 +0000 stress2: A two second timeout is too short --- tools/test/stress2/testcases/mkfifo/mkfifo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/test/stress2/testcases/mkfifo/mkfifo.c b/tools/test/stress2/testcases/mkfifo/mkfifo.c index 6bd20d6679f9..caeb5e45310b 100644 --- a/tools/test/stress2/testcases/mkfifo/mkfifo.c +++ b/tools/test/stress2/testcases/mkfifo/mkfifo.c @@ -58,7 +58,7 @@ reader(void) { setproctitle("reader"); signal(SIGALRM, handler2); - alarm(2); + alarm(60); if ((fd = open(path, O_RDWR, 0600)) < 0) { unlink(path); err(1, "open(%s)", path); @@ -81,7 +81,7 @@ writer(void) { int fd; signal(SIGALRM, handler2); - alarm(2); + alarm(60); setproctitle("writer"); if ((fd = open(path, O_RDWR, 0600)) < 0) { From owner-dev-commits-src-all@freebsd.org Tue Sep 14 09:50:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D192566583D; Tue, 14 Sep 2021 09:50:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H7z9F5JPdz4k0t; Tue, 14 Sep 2021 09:50:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95C74187EA; Tue, 14 Sep 2021 09:50:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18E9o9gH065407; Tue, 14 Sep 2021 09:50:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18E9o9gc065404; Tue, 14 Sep 2021 09:50:09 GMT (envelope-from git) Date: Tue, 14 Sep 2021 09:50:09 GMT Message-Id: <202109140950.18E9o9gc065404@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Wojciech Macek Subject: git: ba4d9d9d5b24 - main - Revert "if_mvneta: Build the driver as a kernel module" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wma X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ba4d9d9d5b2478bb97676a7fa031ef271f1075c9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 09:50:09 -0000 The branch main has been updated by wma: URL: https://cgit.FreeBSD.org/src/commit/?id=ba4d9d9d5b2478bb97676a7fa031ef271f1075c9 commit ba4d9d9d5b2478bb97676a7fa031ef271f1075c9 Author: Wojciech Macek AuthorDate: 2021-09-14 09:49:59 +0000 Commit: Wojciech Macek CommitDate: 2021-09-14 09:49:59 +0000 Revert "if_mvneta: Build the driver as a kernel module" This reverts commit bcf5c7a8b1dcdcd5f27c1aa694f66208dc07a0dd. --- sys/dev/neta/if_mvneta.c | 73 +++++++++++++++++++---------------------------- sys/modules/Makefile | 2 -- sys/modules/neta/Makefile | 10 ------- 3 files changed, 30 insertions(+), 55 deletions(-) diff --git a/sys/dev/neta/if_mvneta.c b/sys/dev/neta/if_mvneta.c index 242e139b8cac..debb4a922cbc 100644 --- a/sys/dev/neta/if_mvneta.c +++ b/sys/dev/neta/if_mvneta.c @@ -222,11 +222,6 @@ static device_method_t mvneta_methods[] = { DEVMETHOD_END }; -static struct ofw_compat_data compat_data[] = { - { "marvell,armada-3700-neta", true }, - { NULL, false } -}; - DEFINE_CLASS_0(mvneta, mvneta_driver, mvneta_methods, sizeof(struct mvneta_softc)); DRIVER_MODULE(miibus, mvneta, miibus_driver, miibus_devclass, 0, 0); @@ -234,7 +229,7 @@ DRIVER_MODULE(mdio, mvneta, mdio_driver, mdio_devclass, 0, 0); MODULE_DEPEND(mvneta, mdio, 1, 1, 1); MODULE_DEPEND(mvneta, ether, 1, 1, 1); MODULE_DEPEND(mvneta, miibus, 1, 1, 1); -SIMPLEBUS_PNP_INFO(compat_data); +MODULE_DEPEND(mvneta, mvxpbm, 1, 1, 1); /* * List of MIB register and names @@ -614,16 +609,6 @@ mvneta_attach(device_t self) } #endif - error = bus_setup_intr(self, sc->res[1], - INTR_TYPE_NET | INTR_MPSAFE, NULL, mvneta_intrs[0].handler, sc, - &sc->ih_cookie[0]); - if (error) { - device_printf(self, "could not setup %s\n", - mvneta_intrs[0].description); - mvneta_detach(self); - return (error); - } - /* * MAC address */ @@ -719,6 +704,8 @@ mvneta_attach(device_t self) } } + ether_ifattach(ifp, sc->enaddr); + /* * Enable DMA engines and Initialize Device Registers. */ @@ -848,11 +835,20 @@ mvneta_attach(device_t self) mvneta_update_media(sc, ifm_target); } - ether_ifattach(ifp, sc->enaddr); + sysctl_mvneta_init(sc); callout_reset(&sc->tick_ch, 0, mvneta_tick, sc); - sysctl_mvneta_init(sc); + error = bus_setup_intr(self, sc->res[1], + INTR_TYPE_NET | INTR_MPSAFE, NULL, mvneta_intrs[0].handler, sc, + &sc->ih_cookie[0]); + if (error) { + device_printf(self, "could not setup %s\n", + mvneta_intrs[0].description); + ether_ifdetach(sc->ifp); + mvneta_detach(self); + return (error); + } return (0); } @@ -861,28 +857,20 @@ STATIC int mvneta_detach(device_t dev) { struct mvneta_softc *sc; - struct ifnet *ifp; int q; sc = device_get_softc(dev); - ifp = sc->ifp; - if (device_is_attached(dev)) { - mvneta_stop(sc); - callout_drain(&sc->tick_ch); - ether_ifdetach(sc->ifp); - } + mvneta_stop(sc); + /* Detach network interface */ + if (sc->ifp) + if_free(sc->ifp); for (q = 0; q < MVNETA_RX_QNUM_MAX; q++) mvneta_ring_dealloc_rx_queue(sc, q); for (q = 0; q < MVNETA_TX_QNUM_MAX; q++) mvneta_ring_dealloc_tx_queue(sc, q); - device_delete_children(dev); - - if (sc->ih_cookie[0] != NULL) - bus_teardown_intr(dev, sc->res[1], sc->ih_cookie[0]); - if (sc->tx_dtag != NULL) bus_dma_tag_destroy(sc->tx_dtag); if (sc->rx_dtag != NULL) @@ -893,13 +881,6 @@ mvneta_detach(device_t dev) bus_dma_tag_destroy(sc->rxbuf_dtag); bus_release_resources(dev, res_spec, sc->res); - - if (sc->ifp) - if_free(sc->ifp); - - if (mtx_initialized(&sc->mtx)) - mtx_destroy(&sc->mtx); - return (0); } @@ -1273,9 +1254,6 @@ mvneta_ring_alloc_rx_queue(struct mvneta_softc *sc, int q) return (0); fail: - mvneta_rx_lockq(sc, q); - mvneta_ring_flush_rx_queue(sc, q); - mvneta_rx_unlockq(sc, q); mvneta_ring_dealloc_rx_queue(sc, q); device_printf(sc->dev, "DMA Ring buffer allocation failure.\n"); return (error); @@ -1317,9 +1295,6 @@ mvneta_ring_alloc_tx_queue(struct mvneta_softc *sc, int q) return (0); fail: - mvneta_tx_lockq(sc, q); - mvneta_ring_flush_tx_queue(sc, q); - mvneta_tx_unlockq(sc, q); mvneta_ring_dealloc_tx_queue(sc, q); device_printf(sc->dev, "DMA Ring buffer allocation failure.\n"); return (error); @@ -1349,6 +1324,16 @@ mvneta_ring_dealloc_tx_queue(struct mvneta_softc *sc, int q) #endif if (sc->txmbuf_dtag != NULL) { + if (mtx_name(&tx->ring_mtx) != NULL) { + /* + * It is assumed that maps are being loaded after mutex + * is initialized. Therefore we can skip unloading maps + * when mutex is empty. + */ + mvneta_tx_lockq(sc, q); + mvneta_ring_flush_tx_queue(sc, q); + mvneta_tx_unlockq(sc, q); + } for (i = 0; i < MVNETA_TX_RING_CNT; i++) { txbuf = &tx->txbuf[i]; if (txbuf->dmap != NULL) { @@ -1387,6 +1372,8 @@ mvneta_ring_dealloc_rx_queue(struct mvneta_softc *sc, int q) rx = MVNETA_RX_RING(sc, q); + mvneta_ring_flush_rx_queue(sc, q); + if (rx->desc_pa != 0) bus_dmamap_unload(sc->rx_dtag, rx->desc_map); diff --git a/sys/modules/Makefile b/sys/modules/Makefile index b1063ad003d8..7ed2169445e4 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -264,7 +264,6 @@ SUBDIR= \ mxge \ my \ ${_nctgpio} \ - ${_neta} \ ${_netgraph} \ ${_nfe} \ nfscl \ @@ -627,7 +626,6 @@ _rockchip= rockchip .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" _sdhci_fdt= sdhci_fdt _e6000sw= e6000sw -_neta= neta .endif .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" diff --git a/sys/modules/neta/Makefile b/sys/modules/neta/Makefile deleted file mode 100644 index 8845e181efaa..000000000000 --- a/sys/modules/neta/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# $FreeBSD$ - -.PATH: ${SRCTOP}/sys/dev/neta - -CFLAGS+= -DFDT - -KMOD= if_mvneta -SRCS= if_mvneta.c if_mvneta_fdt.c if_mvnetavar.h -SRCS+= bus_if.h device_if.h mdio_if.h miibus_if.h ofw_bus_if.h opt_platform.h -.include From owner-dev-commits-src-all@freebsd.org Tue Sep 14 10:42:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8F0C66640D; Tue, 14 Sep 2021 10:42:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H80Kk50Zkz3GW1; Tue, 14 Sep 2021 10:42:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D316194DB; Tue, 14 Sep 2021 10:42:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EAgYmh041615; Tue, 14 Sep 2021 10:42:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EAgYCI041614; Tue, 14 Sep 2021 10:42:34 GMT (envelope-from git) Date: Tue, 14 Sep 2021 10:42:34 GMT Message-Id: <202109141042.18EAgYCI041614@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: c6f3076d4405 - main - Move the GICv2m msi handling to the parent MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c6f3076d44055f7b02467ce074210f73d0ce0ef6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 10:42:34 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=c6f3076d44055f7b02467ce074210f73d0ce0ef6 commit c6f3076d44055f7b02467ce074210f73d0ce0ef6 Author: Andrew Turner AuthorDate: 2021-09-01 09:39:01 +0000 Commit: Andrew Turner CommitDate: 2021-09-14 07:24:52 +0000 Move the GICv2m msi handling to the parent This is in preperation for adding support for the GICv2m driver as a child of the GICv3 driver. PR: 258136 Reported by: trasz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31767 --- sys/arm/arm/gic.c | 296 ++++++++++++++++++++++++++++++----------------- sys/arm/arm/gic.h | 8 +- sys/arm/arm/gic_common.h | 4 + 3 files changed, 195 insertions(+), 113 deletions(-) diff --git a/sys/arm/arm/gic.c b/sys/arm/arm/gic.c index 1851e69644ed..bd34e92b9e28 100644 --- a/sys/arm/arm/gic.c +++ b/sys/arm/arm/gic.c @@ -501,6 +501,56 @@ arm_gic_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) ("arm_gic_read_ivar: Invalid bus type %u", sc->gic_bus)); *result = sc->gic_bus; return (0); + case GIC_IVAR_MBI_START: + *result = sc->sc_spi_start; + return (0); + case GIC_IVAR_MBI_COUNT: + *result = sc->sc_spi_count; + return (0); + } + + return (ENOENT); +} + +static int +arm_gic_write_ivar(device_t dev, device_t child, int which, uintptr_t value) +{ + struct arm_gic_softc *sc; + + sc = device_get_softc(dev); + + switch(which) { + case GIC_IVAR_HW_REV: + case GIC_IVAR_BUS: + return (EINVAL); + case GIC_IVAR_MBI_START: + /* + * GIC_IVAR_MBI_START must be set once and first. This allows + * us to reserve the registers when GIC_IVAR_MBI_COUNT is set. + */ + MPASS(sc->sc_spi_start == 0); + MPASS(sc->sc_spi_count == 0); + MPASS(value >= GIC_FIRST_SPI); + MPASS(value < sc->nirqs); + + sc->sc_spi_start = value; + return (0); + case GIC_IVAR_MBI_COUNT: + MPASS(sc->sc_spi_start != 0); + MPASS(sc->sc_spi_count == 0); + MPASS(value >= sc->sc_spi_start); + MPASS(value >= GIC_FIRST_SPI); + + sc->sc_spi_count = value; + sc->sc_spi_end = sc->sc_spi_start + sc->sc_spi_count; + + MPASS(sc->sc_spi_end <= sc->nirqs); + + /* Reserve these interrupts for MSI/MSI-X use */ + arm_gic_reserve_msi_range(dev, sc->sc_spi_start, + sc->sc_spi_count); + + return (0); } return (ENOENT); @@ -995,99 +1045,20 @@ arm_gic_ipi_setup(device_t dev, u_int ipi, struct intr_irqsrc **isrcp) } #endif -static device_method_t arm_gic_methods[] = { - /* Bus interface */ - DEVMETHOD(bus_print_child, arm_gic_print_child), - DEVMETHOD(bus_add_child, bus_generic_add_child), - DEVMETHOD(bus_alloc_resource, arm_gic_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), - DEVMETHOD(bus_activate_resource,bus_generic_activate_resource), - DEVMETHOD(bus_read_ivar, arm_gic_read_ivar), - - /* Interrupt controller interface */ - DEVMETHOD(pic_disable_intr, arm_gic_disable_intr), - DEVMETHOD(pic_enable_intr, arm_gic_enable_intr), - DEVMETHOD(pic_map_intr, arm_gic_map_intr), - DEVMETHOD(pic_setup_intr, arm_gic_setup_intr), - DEVMETHOD(pic_teardown_intr, arm_gic_teardown_intr), - DEVMETHOD(pic_post_filter, arm_gic_post_filter), - DEVMETHOD(pic_post_ithread, arm_gic_post_ithread), - DEVMETHOD(pic_pre_ithread, arm_gic_pre_ithread), -#ifdef SMP - DEVMETHOD(pic_bind_intr, arm_gic_bind_intr), - DEVMETHOD(pic_init_secondary, arm_gic_init_secondary), - DEVMETHOD(pic_ipi_send, arm_gic_ipi_send), - DEVMETHOD(pic_ipi_setup, arm_gic_ipi_setup), -#endif - { 0, 0 } -}; - -DEFINE_CLASS_0(gic, arm_gic_driver, arm_gic_methods, - sizeof(struct arm_gic_softc)); - -/* - * GICv2m support -- the GICv2 MSI/MSI-X controller. - */ - -#define GICV2M_MSI_TYPER 0x008 -#define MSI_TYPER_SPI_BASE(x) (((x) >> 16) & 0x3ff) -#define MSI_TYPER_SPI_COUNT(x) (((x) >> 0) & 0x3ff) -#define GICv2M_MSI_SETSPI_NS 0x040 -#define GICV2M_MSI_IIDR 0xFCC - -int -arm_gicv2m_attach(device_t dev) -{ - struct arm_gicv2m_softc *sc; - uint32_t typer; - int rid; - - sc = device_get_softc(dev); - - rid = 0; - sc->sc_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, - RF_ACTIVE); - if (sc->sc_mem == NULL) { - device_printf(dev, "Unable to allocate resources\n"); - return (ENXIO); - } - - typer = bus_read_4(sc->sc_mem, GICV2M_MSI_TYPER); - sc->sc_spi_start = MSI_TYPER_SPI_BASE(typer); - sc->sc_spi_count = MSI_TYPER_SPI_COUNT(typer); - sc->sc_spi_end = sc->sc_spi_start + sc->sc_spi_count; - - /* Reserve these interrupts for MSI/MSI-X use */ - arm_gic_reserve_msi_range(device_get_parent(dev), sc->sc_spi_start, - sc->sc_spi_count); - - mtx_init(&sc->sc_mutex, "GICv2m lock", NULL, MTX_DEF); - - intr_msi_register(dev, sc->sc_xref); - - if (bootverbose) - device_printf(dev, "using spi %u to %u\n", sc->sc_spi_start, - sc->sc_spi_start + sc->sc_spi_count - 1); - - return (0); -} - static int -arm_gicv2m_alloc_msi(device_t dev, device_t child, int count, int maxcount, +arm_gic_alloc_msi(device_t dev, device_t child, int count, int maxcount, device_t *pic, struct intr_irqsrc **srcs) { - struct arm_gic_softc *psc; - struct arm_gicv2m_softc *sc; + struct arm_gic_softc *sc; int i, irq, end_irq; bool found; KASSERT(powerof2(count), ("%s: bad count", __func__)); KASSERT(powerof2(maxcount), ("%s: bad maxcount", __func__)); - psc = device_get_softc(device_get_parent(dev)); sc = device_get_softc(dev); - mtx_lock(&sc->sc_mutex); + mtx_lock(&sc->mutex); found = false; for (irq = sc->sc_spi_start; irq < sc->sc_spi_end; irq++) { @@ -1106,11 +1077,11 @@ arm_gicv2m_alloc_msi(device_t dev, device_t child, int count, int maxcount, break; } - KASSERT((psc->gic_irqs[end_irq].gi_flags & GI_FLAG_MSI)!= 0, + KASSERT((sc->gic_irqs[end_irq].gi_flags & GI_FLAG_MSI)!= 0, ("%s: Non-MSI interrupt found", __func__)); /* This is already used */ - if ((psc->gic_irqs[end_irq].gi_flags & GI_FLAG_MSI_USED) == + if ((sc->gic_irqs[end_irq].gi_flags & GI_FLAG_MSI_USED) == GI_FLAG_MSI_USED) { found = false; break; @@ -1122,34 +1093,34 @@ arm_gicv2m_alloc_msi(device_t dev, device_t child, int count, int maxcount, /* Not enough interrupts were found */ if (!found || irq == sc->sc_spi_end) { - mtx_unlock(&sc->sc_mutex); + mtx_unlock(&sc->mutex); return (ENXIO); } for (i = 0; i < count; i++) { /* Mark the interrupt as used */ - psc->gic_irqs[irq + i].gi_flags |= GI_FLAG_MSI_USED; + sc->gic_irqs[irq + i].gi_flags |= GI_FLAG_MSI_USED; } - mtx_unlock(&sc->sc_mutex); + mtx_unlock(&sc->mutex); for (i = 0; i < count; i++) - srcs[i] = (struct intr_irqsrc *)&psc->gic_irqs[irq + i]; - *pic = device_get_parent(dev); + srcs[i] = (struct intr_irqsrc *)&sc->gic_irqs[irq + i]; + *pic = dev; return (0); } static int -arm_gicv2m_release_msi(device_t dev, device_t child, int count, +arm_gic_release_msi(device_t dev, device_t child, int count, struct intr_irqsrc **isrc) { - struct arm_gicv2m_softc *sc; + struct arm_gic_softc *sc; struct gic_irqsrc *gi; int i; sc = device_get_softc(dev); - mtx_lock(&sc->sc_mutex); + mtx_lock(&sc->mutex); for (i = 0; i < count; i++) { gi = (struct gic_irqsrc *)isrc[i]; @@ -1159,50 +1130,48 @@ arm_gicv2m_release_msi(device_t dev, device_t child, int count, gi->gi_flags &= ~GI_FLAG_MSI_USED; } - mtx_unlock(&sc->sc_mutex); + mtx_unlock(&sc->mutex); return (0); } static int -arm_gicv2m_alloc_msix(device_t dev, device_t child, device_t *pic, +arm_gic_alloc_msix(device_t dev, device_t child, device_t *pic, struct intr_irqsrc **isrcp) { - struct arm_gicv2m_softc *sc; - struct arm_gic_softc *psc; + struct arm_gic_softc *sc; int irq; - psc = device_get_softc(device_get_parent(dev)); sc = device_get_softc(dev); - mtx_lock(&sc->sc_mutex); + mtx_lock(&sc->mutex); /* Find an unused interrupt */ for (irq = sc->sc_spi_start; irq < sc->sc_spi_end; irq++) { - KASSERT((psc->gic_irqs[irq].gi_flags & GI_FLAG_MSI) != 0, + KASSERT((sc->gic_irqs[irq].gi_flags & GI_FLAG_MSI) != 0, ("%s: Non-MSI interrupt found", __func__)); - if ((psc->gic_irqs[irq].gi_flags & GI_FLAG_MSI_USED) == 0) + if ((sc->gic_irqs[irq].gi_flags & GI_FLAG_MSI_USED) == 0) break; } /* No free interrupt was found */ if (irq == sc->sc_spi_end) { - mtx_unlock(&sc->sc_mutex); + mtx_unlock(&sc->mutex); return (ENXIO); } /* Mark the interrupt as used */ - psc->gic_irqs[irq].gi_flags |= GI_FLAG_MSI_USED; - mtx_unlock(&sc->sc_mutex); + sc->gic_irqs[irq].gi_flags |= GI_FLAG_MSI_USED; + mtx_unlock(&sc->mutex); - *isrcp = (struct intr_irqsrc *)&psc->gic_irqs[irq]; - *pic = device_get_parent(dev); + *isrcp = (struct intr_irqsrc *)&sc->gic_irqs[irq]; + *pic = dev; return (0); } static int -arm_gicv2m_release_msix(device_t dev, device_t child, struct intr_irqsrc *isrc) +arm_gic_release_msix(device_t dev, device_t child, struct intr_irqsrc *isrc) { - struct arm_gicv2m_softc *sc; + struct arm_gic_softc *sc; struct gic_irqsrc *gi; sc = device_get_softc(dev); @@ -1211,13 +1180,122 @@ arm_gicv2m_release_msix(device_t dev, device_t child, struct intr_irqsrc *isrc) KASSERT((gi->gi_flags & GI_FLAG_MSI_USED) == GI_FLAG_MSI_USED, ("%s: Trying to release an unused MSI-X interrupt", __func__)); - mtx_lock(&sc->sc_mutex); + mtx_lock(&sc->mutex); gi->gi_flags &= ~GI_FLAG_MSI_USED; - mtx_unlock(&sc->sc_mutex); + mtx_unlock(&sc->mutex); return (0); } +static device_method_t arm_gic_methods[] = { + /* Bus interface */ + DEVMETHOD(bus_print_child, arm_gic_print_child), + DEVMETHOD(bus_add_child, bus_generic_add_child), + DEVMETHOD(bus_alloc_resource, arm_gic_alloc_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_activate_resource,bus_generic_activate_resource), + DEVMETHOD(bus_read_ivar, arm_gic_read_ivar), + DEVMETHOD(bus_write_ivar, arm_gic_write_ivar), + + /* Interrupt controller interface */ + DEVMETHOD(pic_disable_intr, arm_gic_disable_intr), + DEVMETHOD(pic_enable_intr, arm_gic_enable_intr), + DEVMETHOD(pic_map_intr, arm_gic_map_intr), + DEVMETHOD(pic_setup_intr, arm_gic_setup_intr), + DEVMETHOD(pic_teardown_intr, arm_gic_teardown_intr), + DEVMETHOD(pic_post_filter, arm_gic_post_filter), + DEVMETHOD(pic_post_ithread, arm_gic_post_ithread), + DEVMETHOD(pic_pre_ithread, arm_gic_pre_ithread), +#ifdef SMP + DEVMETHOD(pic_bind_intr, arm_gic_bind_intr), + DEVMETHOD(pic_init_secondary, arm_gic_init_secondary), + DEVMETHOD(pic_ipi_send, arm_gic_ipi_send), + DEVMETHOD(pic_ipi_setup, arm_gic_ipi_setup), +#endif + + /* MSI/MSI-X */ + DEVMETHOD(msi_alloc_msi, arm_gic_alloc_msi), + DEVMETHOD(msi_release_msi, arm_gic_release_msi), + DEVMETHOD(msi_alloc_msix, arm_gic_alloc_msix), + DEVMETHOD(msi_release_msix, arm_gic_release_msix), + + { 0, 0 } +}; + +DEFINE_CLASS_0(gic, arm_gic_driver, arm_gic_methods, + sizeof(struct arm_gic_softc)); + +/* + * GICv2m support -- the GICv2 MSI/MSI-X controller. + */ + +#define GICV2M_MSI_TYPER 0x008 +#define MSI_TYPER_SPI_BASE(x) (((x) >> 16) & 0x3ff) +#define MSI_TYPER_SPI_COUNT(x) (((x) >> 0) & 0x3ff) +#define GICv2M_MSI_SETSPI_NS 0x040 +#define GICV2M_MSI_IIDR 0xFCC + +int +arm_gicv2m_attach(device_t dev) +{ + struct arm_gicv2m_softc *sc; + uint32_t typer; + u_int spi_start, spi_count; + int rid; + + sc = device_get_softc(dev); + + rid = 0; + sc->sc_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->sc_mem == NULL) { + device_printf(dev, "Unable to allocate resources\n"); + return (ENXIO); + } + + typer = bus_read_4(sc->sc_mem, GICV2M_MSI_TYPER); + spi_start = MSI_TYPER_SPI_BASE(typer); + spi_count = MSI_TYPER_SPI_COUNT(typer); + gic_set_mbi_start(dev, spi_start); + gic_set_mbi_count(dev, spi_count); + + intr_msi_register(dev, sc->sc_xref); + + if (bootverbose) + device_printf(dev, "using spi %u to %u\n", spi_start, + spi_start + spi_count - 1); + + return (0); +} + +static int +arm_gicv2m_alloc_msi(device_t dev, device_t child, int count, int maxcount, + device_t *pic, struct intr_irqsrc **srcs) +{ + return (MSI_ALLOC_MSI(device_get_parent(dev), child, count, maxcount, + pic, srcs)); +} + +static int +arm_gicv2m_release_msi(device_t dev, device_t child, int count, + struct intr_irqsrc **isrc) +{ + return (MSI_RELEASE_MSI(device_get_parent(dev), child, count, isrc)); +} + +static int +arm_gicv2m_alloc_msix(device_t dev, device_t child, device_t *pic, + struct intr_irqsrc **isrcp) +{ + return (MSI_ALLOC_MSIX(device_get_parent(dev), child, pic, isrcp)); +} + +static int +arm_gicv2m_release_msix(device_t dev, device_t child, struct intr_irqsrc *isrc) +{ + return (MSI_RELEASE_MSIX(device_get_parent(dev), child, isrc)); +} + static int arm_gicv2m_map_msi(device_t dev, device_t child, struct intr_irqsrc *isrc, uint64_t *addr, uint32_t *data) diff --git a/sys/arm/arm/gic.h b/sys/arm/arm/gic.h index 74cfbbee9d5a..55f7f0cc5e44 100644 --- a/sys/arm/arm/gic.h +++ b/sys/arm/arm/gic.h @@ -63,17 +63,17 @@ struct arm_gic_softc { int nranges; struct arm_gic_range * ranges; + + u_int sc_spi_start; + u_int sc_spi_end; + u_int sc_spi_count; }; DECLARE_CLASS(arm_gic_driver); struct arm_gicv2m_softc { struct resource *sc_mem; - struct mtx sc_mutex; uintptr_t sc_xref; - u_int sc_spi_start; - u_int sc_spi_end; - u_int sc_spi_count; }; DECLARE_CLASS(arm_gicv2m_driver); diff --git a/sys/arm/arm/gic_common.h b/sys/arm/arm/gic_common.h index 9e8fb19300ca..52827d03e600 100644 --- a/sys/arm/arm/gic_common.h +++ b/sys/arm/arm/gic_common.h @@ -33,6 +33,8 @@ #define GIC_IVAR_HW_REV 500 #define GIC_IVAR_BUS 501 +#define GIC_IVAR_MBI_START 510 +#define GIC_IVAR_MBI_COUNT 511 /* GIC_IVAR_BUS values */ #define GIC_BUS_UNKNOWN 0 @@ -42,6 +44,8 @@ __BUS_ACCESSOR(gic, hw_rev, GIC, HW_REV, u_int); __BUS_ACCESSOR(gic, bus, GIC, BUS, u_int); +__BUS_ACCESSOR(gic, mbi_start, GIC, MBI_START, u_int); +__BUS_ACCESSOR(gic, mbi_count, GIC, MBI_COUNT, u_int); /* Software Generated Interrupts */ #define GIC_FIRST_SGI 0 /* Irqs 0-15 are SGIs/IPIs. */ From owner-dev-commits-src-all@freebsd.org Tue Sep 14 10:42:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 83E05665FB8; Tue, 14 Sep 2021 10:42:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H80Km01pvz3GPK; Tue, 14 Sep 2021 10:42:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B2237195CA; Tue, 14 Sep 2021 10:42:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EAgZUL041639; Tue, 14 Sep 2021 10:42:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EAgZX9041638; Tue, 14 Sep 2021 10:42:35 GMT (envelope-from git) Date: Tue, 14 Sep 2021 10:42:35 GMT Message-Id: <202109141042.18EAgZX9041638@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: e4d89a633e3b - main - Add support for gicv2m as a child of gicv3 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e4d89a633e3b31ec1319e3238abceee2048996c4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 10:42:36 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=e4d89a633e3b31ec1319e3238abceee2048996c4 commit e4d89a633e3b31ec1319e3238abceee2048996c4 Author: Andrew Turner AuthorDate: 2021-09-01 09:41:14 +0000 Commit: Andrew Turner CommitDate: 2021-09-14 07:24:52 +0000 Add support for gicv2m as a child of gicv3 On some systems, e.g. Parallels set to host a Linux VM under an M1 Mac, there is a GICv2m as a child of the GICv3. We previously assumed the GICv2m was always a child of a GICv2. Fix this by adding the needed support to the GICv3 driver. PR: 258136 Reported by: trasz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31768 --- sys/arm64/arm64/gic_v3.c | 90 ++++++++++++++++++++++++++++++++++++++++---- sys/arm64/arm64/gic_v3_fdt.c | 2 +- 2 files changed, 83 insertions(+), 9 deletions(-) diff --git a/sys/arm64/arm64/gic_v3.c b/sys/arm64/arm64/gic_v3.c index 3e7cd30140eb..a53d0b272723 100644 --- a/sys/arm64/arm64/gic_v3.c +++ b/sys/arm64/arm64/gic_v3.c @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); static bus_get_domain_t gic_v3_get_domain; static bus_read_ivar_t gic_v3_read_ivar; +static bus_write_ivar_t gic_v3_write_ivar; static pic_disable_intr_t gic_v3_disable_intr; static pic_enable_intr_t gic_v3_enable_intr; @@ -113,6 +114,7 @@ static device_method_t gic_v3_methods[] = { /* Bus interface */ DEVMETHOD(bus_get_domain, gic_v3_get_domain), DEVMETHOD(bus_read_ivar, gic_v3_read_ivar), + DEVMETHOD(bus_write_ivar, gic_v3_write_ivar), /* Interrupt controller interface */ DEVMETHOD(pic_disable_intr, gic_v3_disable_intr), @@ -242,6 +244,33 @@ gic_r_write_8(device_t dev, bus_size_t offset, uint64_t val) bus_write_8(rdist, offset, val); } +static void +gic_v3_reserve_msi_range(device_t dev, u_int start, u_int count) +{ + struct gic_v3_softc *sc; + int i; + + sc = device_get_softc(dev); + + KASSERT((start + count) < sc->gic_nirqs, + ("%s: Trying to allocate too many MSI IRQs: %d + %d > %d", __func__, + start, count, sc->gic_nirqs)); + for (i = 0; i < count; i++) { + KASSERT(sc->gic_irqs[start + i].gi_isrc.isrc_handlers == 0, + ("%s: MSI interrupt %d already has a handler", __func__, + count + i)); + KASSERT(sc->gic_irqs[start + i].gi_pol == INTR_POLARITY_CONFORM, + ("%s: MSI interrupt %d already has a polarity", __func__, + count + i)); + KASSERT(sc->gic_irqs[start + i].gi_trig == INTR_TRIGGER_CONFORM, + ("%s: MSI interrupt %d already has a trigger", __func__, + count + i)); + sc->gic_irqs[start + i].gi_pol = INTR_POLARITY_HIGH; + sc->gic_irqs[start + i].gi_trig = INTR_TRIGGER_EDGE; + sc->gic_irqs[start + i].gi_flags |= GI_FLAG_MSI; + } +} + /* * Device interface. */ @@ -332,15 +361,10 @@ gic_v3_attach(device_t dev) } } + mtx_init(&sc->gic_mbi_mtx, "GICv3 mbi lock", NULL, MTX_DEF); if (sc->gic_mbi_start > 0) { - /* Reserve these interrupts for MSI/MSI-X use */ - for (irq = sc->gic_mbi_start; irq <= sc->gic_mbi_end; irq++) { - sc->gic_irqs[irq].gi_pol = INTR_POLARITY_HIGH; - sc->gic_irqs[irq].gi_trig = INTR_TRIGGER_EDGE; - sc->gic_irqs[irq].gi_flags |= GI_FLAG_MSI; - } - - mtx_init(&sc->gic_mbi_mtx, "GICv3 mbi lock", NULL, MTX_DEF); + gic_v3_reserve_msi_range(dev, sc->gic_mbi_start, + sc->gic_mbi_end - sc->gic_mbi_start); if (bootverbose) { device_printf(dev, "using spi %u to %u\n", sc->gic_mbi_start, @@ -442,6 +466,56 @@ gic_v3_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) KASSERT(sc->gic_bus <= GIC_BUS_MAX, ("gic_v3_read_ivar: Invalid bus type %u", sc->gic_bus)); *result = sc->gic_bus; + return (0); + case GIC_IVAR_MBI_START: + *result = sc->gic_mbi_start; + return (0); + case GIC_IVAR_MBI_COUNT: + *result = sc->gic_mbi_end - sc->gic_mbi_start; + return (0); + } + + return (ENOENT); +} + +static int +gic_v3_write_ivar(device_t dev, device_t child, int which, uintptr_t value) +{ + struct gic_v3_softc *sc; + + sc = device_get_softc(dev); + + switch(which) { + case GICV3_IVAR_NIRQS: + case GICV3_IVAR_REDIST: + case GIC_IVAR_HW_REV: + case GIC_IVAR_BUS: + return (EINVAL); + case GIC_IVAR_MBI_START: + /* + * GIC_IVAR_MBI_START must be set once and first. This allows + * us to reserve the registers when GIC_IVAR_MBI_COUNT is set. + */ + MPASS(sc->gic_mbi_start == 0); + MPASS(sc->gic_mbi_end == 0); + MPASS(value >= GIC_FIRST_SPI); + MPASS(value < sc->gic_nirqs); + + sc->gic_mbi_start = value; + return (0); + case GIC_IVAR_MBI_COUNT: + MPASS(sc->gic_mbi_start != 0); + MPASS(sc->gic_mbi_end == 0); + MPASS(value >= sc->gic_mbi_start); + MPASS(value >= GIC_FIRST_SPI); + + sc->gic_mbi_end = value - sc->gic_mbi_start; + + MPASS(sc->gic_mbi_end <= sc->gic_nirqs); + + /* Reserve these interrupts for MSI/MSI-X use */ + gic_v3_reserve_msi_range(dev, sc->gic_mbi_start, value); + return (0); } diff --git a/sys/arm64/arm64/gic_v3_fdt.c b/sys/arm64/arm64/gic_v3_fdt.c index d2c0611c9167..65d7ca7e374d 100644 --- a/sys/arm64/arm64/gic_v3_fdt.c +++ b/sys/arm64/arm64/gic_v3_fdt.c @@ -143,7 +143,7 @@ gic_v3_fdt_attach(device_t dev) if (ret % 2 == 0) { /* Limit to a single range for now. */ sc->gic_mbi_start = mbi_ranges[0]; - sc->gic_mbi_end = mbi_ranges[0] + mbi_ranges[1] - 1; + sc->gic_mbi_end = mbi_ranges[0] + mbi_ranges[1]; } else { if (bootverbose) device_printf(dev, "Malformed mbi-ranges property\n"); From owner-dev-commits-src-all@freebsd.org Tue Sep 14 12:52:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8BC4E668F88; Tue, 14 Sep 2021 12:52:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H83CD3PsYz4hCf; Tue, 14 Sep 2021 12:52:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 564121B10D; Tue, 14 Sep 2021 12:52:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18ECq8Ip016092; Tue, 14 Sep 2021 12:52:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ECq80r016091; Tue, 14 Sep 2021 12:52:08 GMT (envelope-from git) Date: Tue, 14 Sep 2021 12:52:08 GMT Message-Id: <202109141252.18ECq80r016091@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: c03c1abd2ccb - stable/13 - g_label: Handle small sector sizes when tasting MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c03c1abd2ccb6431372b6f8c435463440cc4a5bc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 12:52:08 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c03c1abd2ccb6431372b6f8c435463440cc4a5bc commit c03c1abd2ccb6431372b6f8c435463440cc4a5bc Author: Mark Johnston AuthorDate: 2021-09-07 13:46:58 +0000 Commit: Mark Johnston CommitDate: 2021-09-14 12:50:09 +0000 g_label: Handle small sector sizes when tasting Make sure that the provider sector size is large enough to contain a valid label before trying to read it. We performed this check already for most label types, but not for several filesystem labels. Reported by: syzbot+f52918174cdf193ae29c@syzkaller.appspotmail.com Sponsored by: The FreeBSD Foundation (cherry picked from commit 5402baa5b5d14819101e1e847df66b02cedf1639) --- sys/geom/label/g_label.c | 2 ++ sys/geom/label/g_label_ext2fs.c | 4 +++- sys/geom/label/g_label_iso9660.c | 5 +++-- sys/geom/label/g_label_ntfs.c | 6 +++++- sys/geom/label/g_label_reiserfs.c | 4 +++- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/sys/geom/label/g_label.c b/sys/geom/label/g_label.c index 026f5318b4ed..1df7e799b014 100644 --- a/sys/geom/label/g_label.c +++ b/sys/geom/label/g_label.c @@ -310,6 +310,8 @@ g_label_read_metadata(struct g_consumer *cp, struct g_label_metadata *md) int error; pp = cp->provider; + if (pp->sectorsize < sizeof(*md)) + return (EINVAL); buf = g_read_data(cp, pp->mediasize - pp->sectorsize, pp->sectorsize, &error); if (buf == NULL) diff --git a/sys/geom/label/g_label_ext2fs.c b/sys/geom/label/g_label_ext2fs.c index 2003d9b631f6..3420efb7ca3a 100644 --- a/sys/geom/label/g_label_ext2fs.c +++ b/sys/geom/label/g_label_ext2fs.c @@ -64,8 +64,10 @@ g_label_ext2fs_taste(struct g_consumer *cp, char *label, size_t size) if ((EXT2FS_SB_OFFSET % pp->sectorsize) != 0) return; + if (pp->sectorsize < sizeof(*fs)) + return; - fs = (e2sb_t *)g_read_data(cp, EXT2FS_SB_OFFSET, pp->sectorsize, NULL); + fs = g_read_data(cp, EXT2FS_SB_OFFSET, pp->sectorsize, NULL); if (fs == NULL) return; diff --git a/sys/geom/label/g_label_iso9660.c b/sys/geom/label/g_label_iso9660.c index bd44a38cb972..b46a47bbd36a 100644 --- a/sys/geom/label/g_label_iso9660.c +++ b/sys/geom/label/g_label_iso9660.c @@ -54,8 +54,9 @@ g_label_iso9660_taste(struct g_consumer *cp, char *label, size_t size) if ((ISO9660_OFFSET % pp->sectorsize) != 0) return; - sector = (char *)g_read_data(cp, ISO9660_OFFSET, pp->sectorsize, - NULL); + if (pp->sectorsize < 0x28 + VOLUME_LEN) + return; + sector = g_read_data(cp, ISO9660_OFFSET, pp->sectorsize, NULL); if (sector == NULL) return; if (bcmp(sector, ISO9660_MAGIC, sizeof(ISO9660_MAGIC) - 1) != 0) { diff --git a/sys/geom/label/g_label_ntfs.c b/sys/geom/label/g_label_ntfs.c index dee105bcc833..f78d4d28b967 100644 --- a/sys/geom/label/g_label_ntfs.c +++ b/sys/geom/label/g_label_ntfs.c @@ -108,9 +108,13 @@ g_label_ntfs_taste(struct g_consumer *cp, char *label, size_t size) label[0] = '\0'; pp = cp->provider; + bf = NULL; filerecp = NULL; - bf = (struct ntfs_bootfile *)g_read_data(cp, 0, pp->sectorsize, NULL); + if (pp->sectorsize < sizeof(*bf)) + goto done; + + bf = g_read_data(cp, 0, pp->sectorsize, NULL); if (bf == NULL || strncmp(bf->bf_sysid, "NTFS ", 8) != 0) goto done; diff --git a/sys/geom/label/g_label_reiserfs.c b/sys/geom/label/g_label_reiserfs.c index 4ed04f632324..d6f9a0428b6a 100644 --- a/sys/geom/label/g_label_reiserfs.c +++ b/sys/geom/label/g_label_reiserfs.c @@ -61,8 +61,10 @@ g_label_reiserfs_read_super(struct g_consumer *cp, off_t offset) if ((offset % secsize) != 0) return (NULL); + if (secsize < sizeof(*fs)) + return (NULL); - fs = (reiserfs_sb_t *)g_read_data(cp, offset, secsize, NULL); + fs = g_read_data(cp, offset, secsize, NULL); if (fs == NULL) return (NULL); From owner-dev-commits-src-all@freebsd.org Tue Sep 14 12:52:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 02D81668F8E; Tue, 14 Sep 2021 12:52:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H83CF58rCz4hLJ; Tue, 14 Sep 2021 12:52:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 757ED1ADE1; Tue, 14 Sep 2021 12:52:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18ECq9ls016116; Tue, 14 Sep 2021 12:52:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ECq9s6016115; Tue, 14 Sep 2021 12:52:09 GMT (envelope-from git) Date: Tue, 14 Sep 2021 12:52:09 GMT Message-Id: <202109141252.18ECq9s6016115@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 7ca6b62f8dcb - stable/13 - dtrace.1: Document -x ldpath MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7ca6b62f8dcb96bd8100b7dd73a43c0008470f66 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 12:52:10 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7ca6b62f8dcb96bd8100b7dd73a43c0008470f66 commit 7ca6b62f8dcb96bd8100b7dd73a43c0008470f66 Author: Mark Johnston AuthorDate: 2021-09-07 15:18:28 +0000 Commit: Mark Johnston CommitDate: 2021-09-14 12:50:21 +0000 dtrace.1: Document -x ldpath Sponsored by: The FreeBSD Foundation (cherry picked from commit 13d9437a6074b02770546d1ec329b306e1a0f30e) --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 index c91dfc8270bb..8112fa7da4dc 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 @@ -20,7 +20,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 2, 2021 +.Dd September 7, 2021 .Dt DTRACE 1 .Os .Sh NAME @@ -602,6 +602,14 @@ Number of default stack frames for .It Sy jstackstrsize Ns = Ns Ar scalar Default string space size for .Fn jstack . +.It Sy ldpath Ns = Ns Ar path +When +.Fl G +is specified, use the specified path for a static linker +rather than searching for +.Dq "ld" +in +.Ev PATH . .It Sy libdir Ns = Ns Ar path Add a directory to the system library path. .It Sy nspec Ns = Ns Ar scalar From owner-dev-commits-src-all@freebsd.org Tue Sep 14 12:52:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7443C668EAA; Tue, 14 Sep 2021 12:52:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H83CK26VKz4h9K; Tue, 14 Sep 2021 12:52:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E00F61B28F; Tue, 14 Sep 2021 12:52:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18ECqCLB016195; Tue, 14 Sep 2021 12:52:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ECqCrv016194; Tue, 14 Sep 2021 12:52:12 GMT (envelope-from git) Date: Tue, 14 Sep 2021 12:52:12 GMT Message-Id: <202109141252.18ECqCrv016194@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: ad9f3a91d521 - stable/13 - libc: Use the initial-exec TLS model MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ad9f3a91d52105564dc32e5c0132377c74c3a204 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 12:52:13 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ad9f3a91d52105564dc32e5c0132377c74c3a204 commit ad9f3a91d52105564dc32e5c0132377c74c3a204 Author: Mark Johnston AuthorDate: 2021-07-16 02:35:28 +0000 Commit: Mark Johnston CommitDate: 2021-09-14 12:50:53 +0000 libc: Use the initial-exec TLS model This permits more efficient accesses of thread-local variables, which are heavily used at least by jemalloc and locale-aware code. Note that on amd64 and i386, jemalloc's thread-local variables already have their TLS model overridden by defining JEMALLOC_TLS_MODEL. For now the change is applied only to tested platforms, but should in principle be enabled everywhere. PR: 255840 Suggested by: jrtc27 Reviewed by: kib Sponsored by: The FreeBSD Foundation (cherry picked from commit 9c97062b620137a1f7cad4c6b3fb030a396b3266) --- lib/libc/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/libc/Makefile b/lib/libc/Makefile index 958270e6ddf5..fdf6aa49932b 100644 --- a/lib/libc/Makefile +++ b/lib/libc/Makefile @@ -54,6 +54,13 @@ CANCELPOINTS_CFLAGS=-fexceptions CFLAGS+=${CANCELPOINTS_CFLAGS} .endif +# Use a more efficient TLS model for libc since we can reasonably assume that +# it will be loaded during program startup. +.if ${LIBC_ARCH} == "aarch64" || ${LIBC_ARCH} == "amd64" || \ + ${LIBC_ARCH} == "i386" || ${LIBC_ARCH} == "riscv" +CFLAGS+= -ftls-model=initial-exec +.endif + # # Link with static libcompiler_rt.a. # From owner-dev-commits-src-all@freebsd.org Tue Sep 14 12:52:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EEC8F668D4F; Tue, 14 Sep 2021 12:52:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H83CG5y4jz4hNg; Tue, 14 Sep 2021 12:52:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 99E1D1B10F; Tue, 14 Sep 2021 12:52:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18ECqAG5016140; Tue, 14 Sep 2021 12:52:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ECqAU7016139; Tue, 14 Sep 2021 12:52:10 GMT (envelope-from git) Date: Tue, 14 Sep 2021 12:52:10 GMT Message-Id: <202109141252.18ECqAU7016139@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 603c9bb0295b - stable/13 - kqueue.2: Document the fact that EVFILT_READ can be used on kqueues MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 603c9bb0295b2219f0b83f7079908e6349724816 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 12:52:11 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=603c9bb0295b2219f0b83f7079908e6349724816 commit 603c9bb0295b2219f0b83f7079908e6349724816 Author: Mark Johnston AuthorDate: 2021-09-07 15:17:33 +0000 Commit: Mark Johnston CommitDate: 2021-09-14 12:50:31 +0000 kqueue.2: Document the fact that EVFILT_READ can be used on kqueues Reviewed by: bcr, kib Sponsored by: The FreeBSD Foundation (cherry picked from commit f756c911681d7730ca34c23b69dbdb6143965858) --- lib/libc/sys/kqueue.2 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/libc/sys/kqueue.2 b/lib/libc/sys/kqueue.2 index 9be380bb5d99..ed737c626ef8 100644 --- a/lib/libc/sys/kqueue.2 +++ b/lib/libc/sys/kqueue.2 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 26, 2021 +.Dd September 7, 2021 .Dt KQUEUE 2 .Os .Sh NAME @@ -346,6 +346,10 @@ Returns when the counter is greater than 0; .Va data contains the counter value, which must be cast to .Vt uint64_t . +.It Kqueues +Returns when pending events are present on the queue; +.Va data +contains the number of events available. .El .It Dv EVFILT_WRITE Takes a descriptor as the identifier, and returns whenever From owner-dev-commits-src-all@freebsd.org Tue Sep 14 12:52:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59AAD668F9A; Tue, 14 Sep 2021 12:52:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H83CJ1K8Bz4hJ8; Tue, 14 Sep 2021 12:52:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0BAC1B334; Tue, 14 Sep 2021 12:52:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18ECqBHE016164; Tue, 14 Sep 2021 12:52:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ECqBf9016163; Tue, 14 Sep 2021 12:52:11 GMT (envelope-from git) Date: Tue, 14 Sep 2021 12:52:11 GMT Message-Id: <202109141252.18ECqBf9016163@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 7ae8074df1c2 - stable/13 - dtrace.1: Document a couple of preprocessor-related options MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7ae8074df1c225ea87d019c744b2349435b8b027 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 12:52:12 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7ae8074df1c225ea87d019c744b2349435b8b027 commit 7ae8074df1c225ea87d019c744b2349435b8b027 Author: Mark Johnston AuthorDate: 2021-09-07 18:03:23 +0000 Commit: Mark Johnston CommitDate: 2021-09-14 12:50:42 +0000 dtrace.1: Document a couple of preprocessor-related options Suggested by: swills Sponsored by: The FreeBSD Foundation (cherry picked from commit a40c4ae8667772d7e4c4c3d8d8ae843e63c05019) --- cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 index 8112fa7da4dc..8724b27f4cbb 100644 --- a/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 +++ b/cddl/contrib/opensolaris/cmd/dtrace/dtrace.1 @@ -577,6 +577,17 @@ Must be specified in number-per-second with the suffix. .It Sy cpu Ns = Ns Ar scalar Specifies the CPU on which to enable tracing. +.It Sy cpp +Run a C preprocessor over input files. +Same as the +.Fl C +flag. +.It Sy cpppath Ns = Ns Ar path +Use the specified path for the C preprocessor rather than +searching for +.Dq cpp +in +.Ev PATH . .It Sy defaultargs Allow references to unspecified macro arguments. .It Sy destructive From owner-dev-commits-src-all@freebsd.org Tue Sep 14 12:52:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 49989669138; Tue, 14 Sep 2021 12:52:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H83CM5TkNz4h9Z; Tue, 14 Sep 2021 12:52:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F7D01B03D; Tue, 14 Sep 2021 12:52:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18ECqF64016243; Tue, 14 Sep 2021 12:52:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ECqFtx016242; Tue, 14 Sep 2021 12:52:15 GMT (envelope-from git) Date: Tue, 14 Sep 2021 12:52:15 GMT Message-Id: <202109141252.18ECqFtx016242@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 086a3ea828dd - stable/13 - sctp: Remove an unused sctp_inpcb field MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 086a3ea828dd101e9a07bb07fc698e009e68e3c3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 12:52:17 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=086a3ea828dd101e9a07bb07fc698e009e68e3c3 commit 086a3ea828dd101e9a07bb07fc698e009e68e3c3 Author: Mark Johnston AuthorDate: 2021-09-07 13:44:48 +0000 Commit: Mark Johnston CommitDate: 2021-09-14 12:51:45 +0000 sctp: Remove an unused sctp_inpcb field This appears to be unused in usrsctp as well. No functional change intended. Reviewed by: tuexen Sponsored by: The FreeBSD Foundation (cherry picked from commit e8e23ec127d44e04c9be1cba381eaa3aa1041ea5) --- sys/netinet/sctp_input.c | 1 - sys/netinet/sctp_pcb.h | 1 - sys/netinet/sctp_peeloff.c | 1 - 3 files changed, 3 deletions(-) diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index ed15b81ba3e5..0344d4419f32 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -2686,7 +2686,6 @@ sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset, inp->sctp_context = (*inp_p)->sctp_context; inp->local_strreset_support = (*inp_p)->local_strreset_support; inp->fibnum = (*inp_p)->fibnum; - inp->inp_starting_point_for_iterator = NULL; /* * copy in the authentication parameters from the * original endpoint diff --git a/sys/netinet/sctp_pcb.h b/sys/netinet/sctp_pcb.h index e14c9f39356c..f93e8f11b3e4 100644 --- a/sys/netinet/sctp_pcb.h +++ b/sys/netinet/sctp_pcb.h @@ -395,7 +395,6 @@ struct sctp_inpcb { #ifdef SCTP_TRACK_FREED_ASOCS struct sctpasochead sctp_asoc_free_list; #endif - struct sctp_iterator *inp_starting_point_for_iterator; uint32_t sctp_frag_point; uint32_t partial_delivery_point; uint32_t sctp_context; diff --git a/sys/netinet/sctp_peeloff.c b/sys/netinet/sctp_peeloff.c index 6490fb5596b0..aeff4acb9dae 100644 --- a/sys/netinet/sctp_peeloff.c +++ b/sys/netinet/sctp_peeloff.c @@ -132,7 +132,6 @@ sctp_do_peeloff(struct socket *head, struct socket *so, sctp_assoc_t assoc_id) n_inp->sctp_context = inp->sctp_context; n_inp->max_cwnd = inp->max_cwnd; n_inp->local_strreset_support = inp->local_strreset_support; - n_inp->inp_starting_point_for_iterator = NULL; /* copy in the authentication parameters from the original endpoint */ if (n_inp->sctp_ep.local_hmacs) sctp_free_hmaclist(n_inp->sctp_ep.local_hmacs); From owner-dev-commits-src-all@freebsd.org Tue Sep 14 12:52:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A5726668B50; Tue, 14 Sep 2021 12:52:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H83CL2Fzwz4hR5; Tue, 14 Sep 2021 12:52:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF9261B335; Tue, 14 Sep 2021 12:52:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18ECqDwm016219; Tue, 14 Sep 2021 12:52:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ECqDlf016218; Tue, 14 Sep 2021 12:52:13 GMT (envelope-from git) Date: Tue, 14 Sep 2021 12:52:13 GMT Message-Id: <202109141252.18ECqDlf016218@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 072901b7bc0b - stable/13 - sctp: Fix races around sctp_inpcb_free() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 072901b7bc0be6375940d06bf9e2fdce54a77a8e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 12:52:14 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=072901b7bc0be6375940d06bf9e2fdce54a77a8e commit 072901b7bc0be6375940d06bf9e2fdce54a77a8e Author: Mark Johnston AuthorDate: 2021-09-07 13:44:12 +0000 Commit: Mark Johnston CommitDate: 2021-09-14 12:51:35 +0000 sctp: Fix races around sctp_inpcb_free() sctp_close() and sctp_abort() disassociate the PCB from its socket. As a part of this, they attempt to free the PCB, which may end up lingering. Fix some bugs in this area: - For some reason, sctp_close() and sctp_abort() set SCTP_PCB_FLAGS_SOCKET_GONE using an atomic compare-and-set without the PCB lock held. This is racy since sctp_flags is normally updated without atomics, using the PCB lock to synchronize. So, the update can be lost, which can cause all sort of races with other SCTP components which look for the _GONE flag. Fix the problem simply by acquiring the PCB lock in order to set the flag. Note that we have to drop and re-acquire the lock again in sctp_inpcb_free(), but I don't see a good way around that for now. If it's a real problem, the _GONE flag could be split out of sctp_flags and into a dedicated sctp_inpcb field. - In sctp_inpcb_free(), load sctp_socket after acquiring the PCB lock, to avoid possible races with parallel sctp_inpcb_free() calls. - Add an assertion sctp_inpcb_free() to verify that _ALLGONE is not set. Reviewed by: tuexen Sponsored by: The FreeBSD Foundation (cherry picked from commit c17b531bedd10c7ebea08919fd73ee708ff37336) --- sys/netinet/sctp_pcb.c | 16 ++++++---------- sys/netinet/sctp_usrreq.c | 31 +++++++++++-------------------- 2 files changed, 17 insertions(+), 30 deletions(-) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 3e517889d171..85ea5a3f8a53 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -3321,19 +3321,15 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from) /* mark any iterators on the list or being processed */ sctp_iterator_inp_being_freed(inp); SCTP_ITERATOR_UNLOCK(); - so = inp->sctp_socket; - if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) { - /* been here before.. eeks.. get out of here */ - SCTP_PRINTF("This conflict in free SHOULD not be happening! from %d, imm %d\n", from, immediate); -#ifdef SCTP_LOG_CLOSING - sctp_log_closing(inp, NULL, 1); -#endif - return; - } + SCTP_ASOC_CREATE_LOCK(inp); SCTP_INP_INFO_WLOCK(); - SCTP_INP_WLOCK(inp); + so = inp->sctp_socket; + KASSERT((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) != 0, + ("%s: inp %p still has socket", __func__, inp)); + KASSERT((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE) == 0, + ("%s: double free of inp %p", __func__, inp)); if (from == SCTP_CALLED_AFTER_CMPSET_OFCLOSE) { inp->sctp_flags &= ~SCTP_PCB_FLAGS_CLOSE_IP; /* socket is gone, so no more wakeups allowed */ diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 822a8ffb534f..62d6996ab60d 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -416,24 +416,23 @@ sctp_abort(struct socket *so) { struct epoch_tracker et; struct sctp_inpcb *inp; - uint32_t flags; inp = (struct sctp_inpcb *)so->so_pcb; if (inp == NULL) { return; } + SCTP_INP_WLOCK(inp); NET_EPOCH_ENTER(et); -sctp_must_try_again: - flags = inp->sctp_flags; #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 17); #endif - if (((flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) && - (atomic_cmpset_int(&inp->sctp_flags, flags, (flags | SCTP_PCB_FLAGS_SOCKET_GONE | SCTP_PCB_FLAGS_CLOSE_IP)))) { + if (((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0)) { + inp->sctp_flags |= SCTP_PCB_FLAGS_SOCKET_GONE | SCTP_PCB_FLAGS_CLOSE_IP; #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 16); #endif + SCTP_INP_WUNLOCK(inp); sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_ABORT, SCTP_CALLED_AFTER_CMPSET_OFCLOSE); SOCK_LOCK(so); @@ -448,13 +447,9 @@ sctp_must_try_again: so->so_pcb = NULL; SOCK_UNLOCK(so); } else { - flags = inp->sctp_flags; - if ((flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) { - goto sctp_must_try_again; - } + SCTP_INP_WUNLOCK(inp); } NET_EPOCH_EXIT(et); - return; } static int @@ -516,7 +511,6 @@ sctp_close(struct socket *so) { struct epoch_tracker et; struct sctp_inpcb *inp; - uint32_t flags; inp = (struct sctp_inpcb *)so->so_pcb; if (inp == NULL) @@ -525,25 +519,26 @@ sctp_close(struct socket *so) /* * Inform all the lower layer assoc that we are done. */ + SCTP_INP_WLOCK(inp); NET_EPOCH_ENTER(et); -sctp_must_try_again: - flags = inp->sctp_flags; #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 17); #endif - if (((flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) && - (atomic_cmpset_int(&inp->sctp_flags, flags, (flags | SCTP_PCB_FLAGS_SOCKET_GONE | SCTP_PCB_FLAGS_CLOSE_IP)))) { + if ((inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) { + inp->sctp_flags |= SCTP_PCB_FLAGS_SOCKET_GONE | SCTP_PCB_FLAGS_CLOSE_IP; if (((so->so_options & SO_LINGER) && (so->so_linger == 0)) || (so->so_rcv.sb_cc > 0)) { #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 13); #endif + SCTP_INP_WUNLOCK(inp); sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_ABORT, SCTP_CALLED_AFTER_CMPSET_OFCLOSE); } else { #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 14); #endif + SCTP_INP_WUNLOCK(inp); sctp_inpcb_free(inp, SCTP_FREE_SHOULD_USE_GRACEFUL_CLOSE, SCTP_CALLED_AFTER_CMPSET_OFCLOSE); } @@ -563,13 +558,9 @@ sctp_must_try_again: so->so_pcb = NULL; SOCK_UNLOCK(so); } else { - flags = inp->sctp_flags; - if ((flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) { - goto sctp_must_try_again; - } + SCTP_INP_WUNLOCK(inp); } NET_EPOCH_EXIT(et); - return; } int From owner-dev-commits-src-all@freebsd.org Tue Sep 14 12:52:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D0B11668D61; Tue, 14 Sep 2021 12:52:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H83CP4T7bz4hTW; Tue, 14 Sep 2021 12:52:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48A391B112; Tue, 14 Sep 2021 12:52:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18ECqGU8016267; Tue, 14 Sep 2021 12:52:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ECqG1s016266; Tue, 14 Sep 2021 12:52:16 GMT (envelope-from git) Date: Tue, 14 Sep 2021 12:52:16 GMT Message-Id: <202109141252.18ECqG1s016266@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 97d24f3dfa7e - stable/13 - sctp: Fix iterator synchronization in sctp_sendall() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 97d24f3dfa7e9b8f4d59d29375ff600206aada12 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 12:52:18 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=97d24f3dfa7e9b8f4d59d29375ff600206aada12 commit 97d24f3dfa7e9b8f4d59d29375ff600206aada12 Author: Mark Johnston AuthorDate: 2021-09-07 13:44:57 +0000 Commit: Mark Johnston CommitDate: 2021-09-14 12:51:54 +0000 sctp: Fix iterator synchronization in sctp_sendall() - The SCTP_PCB_FLAGS_SND_ITERATOR_UP check was racy, since two threads could observe that the flag is not set and then both set it. I'm not sure if this is actually a problem in practice, i.e., maybe there's no problem having multiple sends for a single PCB in the iterator list? - sctp_sendall() was modifying sctp_flags without the inp lock held. The change simply acquires the PCB write lock before toggling the flag, fixing both problems. Reviewed by: tuexen Sponsored by: The FreeBSD Foundation (cherry picked from commit 173a7a4ee4fa8fbce6b4532d4d324bc72ee25fe0) --- sys/netinet/sctp_output.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c index 4be4ef375ca0..5953cf724c89 100644 --- a/sys/netinet/sctp_output.c +++ b/sys/netinet/sctp_output.c @@ -6770,7 +6770,9 @@ sctp_sendall_completes(void *ptr, uint32_t val SCTP_UNUSED) /* now free everything */ if (ca->inp) { /* Lets clear the flag to allow others to run. */ + SCTP_INP_WLOCK(ca->inp); ca->inp->sctp_flags &= ~SCTP_PCB_FLAGS_SND_ITERATOR_UP; + SCTP_INP_WUNLOCK(ca->inp); } sctp_m_freem(ca->m); SCTP_FREE(ca, SCTP_M_COPYAL); @@ -6825,10 +6827,6 @@ sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, struct mbuf *m, int ret; struct sctp_copy_all *ca; - if (inp->sctp_flags & SCTP_PCB_FLAGS_SND_ITERATOR_UP) { - /* There is another. */ - return (EBUSY); - } if (uio->uio_resid > (ssize_t)SCTP_BASE_SYSCTL(sctp_sendall_limit)) { /* You must not be larger than the limit! */ return (EMSGSIZE); @@ -6846,6 +6844,18 @@ sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, struct mbuf *m, if (srcv) { memcpy(&ca->sndrcv, srcv, sizeof(struct sctp_nonpad_sndrcvinfo)); } + + /* Serialize. */ + SCTP_INP_WLOCK(inp); + if ((inp->sctp_flags & SCTP_PCB_FLAGS_SND_ITERATOR_UP) != 0) { + SCTP_INP_WUNLOCK(inp); + sctp_m_freem(m); + SCTP_FREE(ca, SCTP_M_COPYAL); + return (EBUSY); + } + inp->sctp_flags |= SCTP_PCB_FLAGS_SND_ITERATOR_UP; + SCTP_INP_WUNLOCK(inp); + /* * take off the sendall flag, it would be bad if we failed to do * this :-0 @@ -6857,6 +6867,10 @@ sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, struct mbuf *m, ca->m = sctp_copy_out_all(uio, ca->sndlen); if (ca->m == NULL) { SCTP_FREE(ca, SCTP_M_COPYAL); + sctp_m_freem(m); + SCTP_INP_WLOCK(inp); + inp->sctp_flags &= ~SCTP_PCB_FLAGS_SND_ITERATOR_UP; + SCTP_INP_WUNLOCK(inp); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); return (ENOMEM); } @@ -6869,14 +6883,15 @@ sctp_sendall(struct sctp_inpcb *inp, struct uio *uio, struct mbuf *m, ca->sndlen += SCTP_BUF_LEN(mat); } } - inp->sctp_flags |= SCTP_PCB_FLAGS_SND_ITERATOR_UP; ret = sctp_initiate_iterator(NULL, sctp_sendall_iterator, NULL, SCTP_PCB_ANY_FLAGS, SCTP_PCB_ANY_FEATURES, SCTP_ASOC_ANY_STATE, (void *)ca, 0, sctp_sendall_completes, inp, 1); if (ret) { + SCTP_INP_WLOCK(inp); inp->sctp_flags &= ~SCTP_PCB_FLAGS_SND_ITERATOR_UP; + SCTP_INP_WUNLOCK(inp); SCTP_FREE(ca, SCTP_M_COPYAL); SCTP_LTRACE_ERR_RET_PKT(m, inp, NULL, NULL, SCTP_FROM_SCTP_OUTPUT, EFAULT); return (EFAULT); From owner-dev-commits-src-all@freebsd.org Tue Sep 14 12:53:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 460506692D2; Tue, 14 Sep 2021 12:53:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H83Dq1Vh9z4jBH; Tue, 14 Sep 2021 12:53:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13F761ADE5; Tue, 14 Sep 2021 12:53:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18ECrVfD016501; Tue, 14 Sep 2021 12:53:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ECrVoR016500; Tue, 14 Sep 2021 12:53:31 GMT (envelope-from git) Date: Tue, 14 Sep 2021 12:53:31 GMT Message-Id: <202109141253.18ECrVoR016500@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: fd860ace3bde - main - Remove the DN flag from the initial arm64 fpcr value MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fd860ace3bded96bee0e5c090a5a4d8b085b700c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 12:53:31 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=fd860ace3bded96bee0e5c090a5a4d8b085b700c commit fd860ace3bded96bee0e5c090a5a4d8b085b700c Author: Andrew Turner AuthorDate: 2021-08-25 10:05:55 +0000 Commit: Andrew Turner CommitDate: 2021-09-14 12:52:48 +0000 Remove the DN flag from the initial arm64 fpcr value This fixes software that expects NaN values to propagate. Sponsored by: The FreeBSD Foundation --- sys/arm64/include/vfp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/include/vfp.h b/sys/arm64/include/vfp.h index 629b1b7fadf4..bee0121d9d2a 100644 --- a/sys/arm64/include/vfp.h +++ b/sys/arm64/include/vfp.h @@ -35,7 +35,7 @@ #define VFPCR_AHP (0x04000000) /* alt. half-precision: */ #define VFPCR_DN (0x02000000) /* default NaN enable */ #define VFPCR_FZ (0x01000000) /* flush to zero enabled */ -#define VFPCR_INIT VFPCR_DN /* Default fpcr after exec */ +#define VFPCR_INIT 0 /* Default fpcr after exec */ #define VFPCR_RMODE_OFF 22 /* rounding mode offset */ #define VFPCR_RMODE_MASK (0x00c00000) /* rounding mode mask */ From owner-dev-commits-src-all@freebsd.org Tue Sep 14 13:10:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C0523669616; Tue, 14 Sep 2021 13:10:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H83cd4jZGz4mwp; Tue, 14 Sep 2021 13:10:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 81ADD1B2B9; Tue, 14 Sep 2021 13:10:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EDAfBB039580; Tue, 14 Sep 2021 13:10:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EDAfJw039579; Tue, 14 Sep 2021 13:10:41 GMT (envelope-from git) Date: Tue, 14 Sep 2021 13:10:41 GMT Message-Id: <202109141310.18EDAfJw039579@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: fa0463c384b6 - main - socket: De-duplicate SBLOCKWAIT() definitions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fa0463c384b652e1e962d5e8e70396e6a876f01b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 13:10:41 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fa0463c384b652e1e962d5e8e70396e6a876f01b commit fa0463c384b652e1e962d5e8e70396e6a876f01b Author: Mark Johnston AuthorDate: 2021-09-14 13:01:32 +0000 Commit: Mark Johnston CommitDate: 2021-09-14 13:01:32 +0000 socket: De-duplicate SBLOCKWAIT() definitions MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/dev/hyperv/hvsock/hv_sock.c | 1 - sys/kern/uipc_socket.c | 2 -- sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c | 2 -- sys/sys/socketvar.h | 2 ++ 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/dev/hyperv/hvsock/hv_sock.c b/sys/dev/hyperv/hvsock/hv_sock.c index b95b8eebb77d..6d5ad4fc6609 100644 --- a/sys/dev/hyperv/hvsock/hv_sock.c +++ b/sys/dev/hyperv/hvsock/hv_sock.c @@ -627,7 +627,6 @@ hvs_trans_disconnect(struct socket *so) return (0); } -#define SBLOCKWAIT(f) (((f) & MSG_DONTWAIT) ? 0 : SBL_WAIT) struct hvs_callback_arg { struct uio *uio; struct sockbuf *sb; diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index cbddd80e0546..95222a1ecf7b 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1413,8 +1413,6 @@ sodisconnect(struct socket *so) return (error); } -#define SBLOCKWAIT(f) (((f) & MSG_DONTWAIT) ? 0 : SBL_WAIT) - int sosend_dgram(struct socket *so, struct sockaddr *addr, struct uio *uio, struct mbuf *top, struct mbuf *control, int flags, struct thread *td) diff --git a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c index ed9dd1fcb224..973372b21761 100644 --- a/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c +++ b/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c @@ -1047,8 +1047,6 @@ out: return (error); } -#define SBLOCKWAIT(f) (((f) & MSG_DONTWAIT) ? 0 : SBL_WAIT) - /* * Send on a socket. If send must go all at once and message is larger than * send buffering, then hard error. Lock against other senders. If must go diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 57913f7bbd65..18db5e34d3b5 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -292,6 +292,8 @@ struct socket { #define SBL_NOINTR 0x00000002 /* Force non-interruptible sleep. */ #define SBL_VALID (SBL_WAIT | SBL_NOINTR) +#define SBLOCKWAIT(f) (((f) & MSG_DONTWAIT) ? 0 : SBL_WAIT) + #define SOCK_IO_SEND_LOCK(so, flags) \ soiolock((so), &(so)->so_snd_sx, (flags)) #define SOCK_IO_SEND_UNLOCK(so) \ From owner-dev-commits-src-all@freebsd.org Tue Sep 14 13:10:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 263D86694E5; Tue, 14 Sep 2021 13:10:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H83cg0B4pz4mp3; Tue, 14 Sep 2021 13:10:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2BE71B13C; Tue, 14 Sep 2021 13:10:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EDAgIa039604; Tue, 14 Sep 2021 13:10:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EDAg4K039603; Tue, 14 Sep 2021 13:10:42 GMT (envelope-from git) Date: Tue, 14 Sep 2021 13:10:42 GMT Message-Id: <202109141310.18EDAg4K039603@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: e6c19aa94da4 - main - sctp: Allow blocking on I/O locks even with non-blocking sockets MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e6c19aa94da4a799472f8b82f196ffc42d0dbdaf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 13:10:43 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=e6c19aa94da4a799472f8b82f196ffc42d0dbdaf commit e6c19aa94da4a799472f8b82f196ffc42d0dbdaf Author: Mark Johnston AuthorDate: 2021-09-14 13:02:05 +0000 Commit: Mark Johnston CommitDate: 2021-09-14 13:02:05 +0000 sctp: Allow blocking on I/O locks even with non-blocking sockets There are two flags to request a non-blocking receive on a socket: MSG_NBIO and MSG_DONTWAIT. They are handled a bit differently in that soreceive_generic() and soreceive_stream() will block on the socket I/O lock when MSG_NBIO is set, but not if MSG_DONTWAIT is set. In general, MSG_NBIO seems to mean, "don't block if there is no data to receive" and MSG_DONTWAIT means "don't go to sleep for any reason". SCTP's soreceive implementation did not allow blocking on the I/O lock if either flag is set, but this violates an assumption in aio_process_sb(), which specifies MSG_NBIO but nonetheless expects to make progress if data is available to read. Change sctp_sorecvmsg() to block on the I/O lock only if MSG_DONTWAIT is not set. Reported by: syzbot+c7d22dbbb9aef509421d@syzkaller.appspotmail.com Reviewed by: tuexen MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31915 --- sys/netinet/sctputil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 09d486038b65..c6cdd3315704 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -5585,7 +5585,7 @@ sctp_sorecvmsg(struct socket *so, rwnd_req, block_allowed, so->so_rcv.sb_cc, (uint32_t)uio->uio_resid); } - error = SOCK_IO_RECV_LOCK(so, (block_allowed ? SBL_WAIT : 0)); + error = SOCK_IO_RECV_LOCK(so, SBLOCKWAIT(in_flags)); if (error) { goto release_unlocked; } From owner-dev-commits-src-all@freebsd.org Tue Sep 14 13:42:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A2A0066A278; Tue, 14 Sep 2021 13:42:43 +0000 (UTC) (envelope-from SRS0=Q8r5=OE=klop.ws=ronald-lists@realworks.nl) Received: from smtp-relay-int.realworks.nl (smtp-relay-int.realworks.nl [194.109.157.24]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4H84Kb3VrGz3CcC; Tue, 14 Sep 2021 13:42:43 +0000 (UTC) (envelope-from SRS0=Q8r5=OE=klop.ws=ronald-lists@realworks.nl) Date: Tue, 14 Sep 2021 15:42:35 +0200 (CEST) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=klop.ws; s=rw1; t=1631626955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5j27DK2Frb0f79bid5K+HrMK71ImIFnQs6QTowPXoGg=; b=FvZAnmJUkzTFhmtnLBKpL2JgHlexJvuasiYISmyKk/WTwjymva7F3m9gS5zxTvO0E7NXLS zrSYhGtihCHnZmAw== From: Ronald Klop To: Andrew Turner Cc: dev-commits-src-all@FreeBSD.org, src-committers@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: <629177790.2.1631626955525@mailrelay> In-Reply-To: <202109141253.18ECrVoR016500@gitrepo.freebsd.org> References: <202109141253.18ECrVoR016500@gitrepo.freebsd.org> Subject: Re: git: fd860ace3bde - main - Remove the DN flag from the initial arm64 fpcr value MIME-Version: 1.0 X-Mailer: Realworks (576.841.ea608bb) Importance: Normal X-Priority: 3 (Normal) X-Rspamd-Queue-Id: 4H84Kb3VrGz3CcC X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 13:42:43 -0000 Hi, Do you have an example of this software? Just for my understanding. Ronald. Van: Andrew Turner Datum: dinsdag, 14 september 2021 14:53 Aan: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Onderwerp: git: fd860ace3bde - main - Remove the DN flag from the initial arm64 fpcr value > > The branch main has been updated by andrew: > > URL: https://cgit.FreeBSD.org/src/commit/?id=fd860ace3bded96bee0e5c090a5a4d8b085b700c > > commit fd860ace3bded96bee0e5c090a5a4d8b085b700c > Author: Andrew Turner > AuthorDate: 2021-08-25 10:05:55 +0000 > Commit: Andrew Turner > CommitDate: 2021-09-14 12:52:48 +0000 > > Remove the DN flag from the initial arm64 fpcr value > > This fixes software that expects NaN values to propagate. > > Sponsored by: The FreeBSD Foundation > --- > sys/arm64/include/vfp.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sys/arm64/include/vfp.h b/sys/arm64/include/vfp.h > index 629b1b7fadf4..bee0121d9d2a 100644 > --- a/sys/arm64/include/vfp.h > +++ b/sys/arm64/include/vfp.h > @@ -35,7 +35,7 @@ > #define VFPCR_AHP (0x04000000) /* alt. half-precision: */ > #define VFPCR_DN (0x02000000) /* default NaN enable */ > #define VFPCR_FZ (0x01000000) /* flush to zero enabled */ > -#define VFPCR_INIT VFPCR_DN /* Default fpcr after exec */ > +#define VFPCR_INIT 0 /* Default fpcr after exec */ > > #define VFPCR_RMODE_OFF 22 /* rounding mode offset */ > #define VFPCR_RMODE_MASK (0x00c00000) /* rounding mode mask */ > _______________________________________________ > dev-commits-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all > To unsubscribe, send any mail to "dev-commits-src-all-unsubscribe@freebsd.org" > > > From owner-dev-commits-src-all@freebsd.org Tue Sep 14 15:04:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D791C66AAF0; Tue, 14 Sep 2021 15:04:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H867q5LS8z3qtF; Tue, 14 Sep 2021 15:04:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 976E91C6F1; Tue, 14 Sep 2021 15:04:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EF4NtH090655; Tue, 14 Sep 2021 15:04:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EF4Nio090654; Tue, 14 Sep 2021 15:04:23 GMT (envelope-from git) Date: Tue, 14 Sep 2021 15:04:23 GMT Message-Id: <202109141504.18EF4Nio090654@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: b1746faad6d6 - main - debugnet: Include some required headers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b1746faad6d690e43ac78ba3a9bca96c767ea729 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 15:04:23 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=b1746faad6d690e43ac78ba3a9bca96c767ea729 commit b1746faad6d690e43ac78ba3a9bca96c767ea729 Author: Mark Johnston AuthorDate: 2021-09-14 14:53:15 +0000 Commit: Mark Johnston CommitDate: 2021-09-14 15:02:45 +0000 debugnet: Include some required headers Don't depend on pollution from net/vnet.h. PR: 258496 MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/net/debugnet.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/net/debugnet.c b/sys/net/debugnet.c index 8652597c55db..7a2c98ace65d 100644 --- a/sys/net/debugnet.c +++ b/sys/net/debugnet.c @@ -39,6 +39,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include +#include #include #include @@ -53,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include From owner-dev-commits-src-all@freebsd.org Tue Sep 14 15:11:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7694966B32A; Tue, 14 Sep 2021 15:11:14 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H86Hj5Px7z3t5f; Tue, 14 Sep 2021 15:11:13 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-lj1-x231.google.com with SMTP id p15so24549078ljn.3; Tue, 14 Sep 2021 08:11:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=nNYuDvZ7S81Nhz6iC5cEDTIYEweU8c+ABEPXgj568Lw=; b=mTRY4qTUVPVsocNO8GZvzfZ/pmnRfpPHA/xbUs1ui+Htb309aOMjSs5fIQ2GlHH+gN GOPReu4L03jtxDDbftXMYLgXkToWHIv7ihob3aSvlTSbaEeZv6Z5plrotRYliZt1vyq8 Cui3JYcyubR2wZfww0kcPXZ7tH7ZtBnoJ4HXf/pB9nt9raqCRu1F2FjEjIuG2zj1MfiI qOV+Q6At4RqbhamgAzOCvC2YAr8uQpfyYXFeOTOiPFa6dMqEMkHo/jkWvkQjJkwy/kTo ZpSSfS7vd6NybtiUo+UldAPMseHMDlSBRzDYl7J32+IQzkFM1N7xt7lsq90132H6sd+L ENUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=nNYuDvZ7S81Nhz6iC5cEDTIYEweU8c+ABEPXgj568Lw=; b=oPIlhsRRkEXJjNHujb+r5YajYFwi25pExOs3bi8iT/g32VdgJdKyXve3kV6FKQI9NU Vqxs5+nLd/26JcnE7ZxOJKfyGtILi7/iuW+AJRBS9oJp8Mr01Ubu23nr2nb70kmtNsO+ UQrxek+qxd6rGbTLW45M9qmwcBOEPbXB0sGxPHf7ieZSp4g9z4j7140c3fjsL7pjxuVH nlL4Fk+12afu8wLRx3Sfhf030LNeEt91oxkeS5GcxHdFJiVIlONoRgbJYXCxlSZgi6dN i8KLudodR9Y0uTRqCF7qWlRPwMVfZNh9c4qxslu1ol/3EcRZEIqeHr9wX9YMgLuL6o0T 8q5Q== X-Gm-Message-State: AOAM531GUNupjN6KKgAQq/Hfe0eZJW7JnK0bJ6uEvKji3R13HWic/bfu Jp4XGqqe5U2lu98bWsHz0HEmIZUMVb8AbxLvlHdE7AR3 X-Google-Smtp-Source: ABdhPJxAn5h9YS3ZWlq1mMJyCOpSf/3h+UWRYzerrYePrWIPmb9RvFa8sHYfl4Y0LdV7gagkYBD8qteb/5+rQszFszs= X-Received: by 2002:a2e:8906:: with SMTP id d6mr15908333lji.248.1631632272501; Tue, 14 Sep 2021 08:11:12 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:6f04:0:0:0:0:0 with HTTP; Tue, 14 Sep 2021 08:11:11 -0700 (PDT) In-Reply-To: References: <202108171959.17HJx2lL069856@gitrepo.freebsd.org> From: Mateusz Guzik Date: Tue, 14 Sep 2021 17:11:11 +0200 Message-ID: Subject: Re: git: 5091ca26507b - main - pf: save on branching in the common case in pf_test To: Gleb Smirnoff Cc: kp@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4H86Hj5Px7z3t5f X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=mTRY4qTU; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::231 as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-4.00 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCPT_COUNT_FIVE(0.00)[5]; MID_RHS_MATCH_FROMTLD(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::231:from]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 15:11:14 -0000 On 9/10/21, Gleb Smirnoff wrote: > Mateusz, > > On Fri, Sep 10, 2021 at 09:43:06AM +0200, Mateusz Guzik wrote: > M> > M> diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c > M> > M> index e2dd3eb7c0de..add76c7b98d4 100644 > M> > M> --- a/sys/netpfil/pf/pf.c > M> > M> +++ b/sys/netpfil/pf/pf.c > M> > M> @@ -6151,7 +6151,7 @@ pf_test(int dir, int pflags, struct ifnet > *ifp, > M> > struct mbuf **m0, struct inpcb * > M> > M> > M> > M> PF_RULES_RLOCK(); > M> > M> > M> > M> - if (ip_divert_ptr != NULL && > M> > M> + if (__predict_false(ip_divert_ptr != NULL) && > M> > > M> > This is an optimization for a setup without divert(4) at cost of > M> > pessimization > M> > for a setup with divert(4). IMHO, __predict_false() predicate should > guard > M> > against error paths and other unusual events, not favor one setup over > M> > other. > M> > > M> > M> divert is non-standard and comes with tons of overhead, so I think > M> this is justified. > > pf is also non-standard and comes with tons of overhead, so what > about such change to ip_input(), and similar to ip_output(): > > diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c > index 465c00e4dac..e6feb837114 100644 > --- a/sys/netinet/ip_input.c > +++ b/sys/netinet/ip_input.c > @@ -605,7 +605,7 @@ ip_input(struct mbuf *m) > */ > > /* Jump over all PFIL processing if hooks are not active. */ > - if (!PFIL_HOOKED_IN(V_inet_pfil_head)) > + if (__predict_true(!PFIL_HOOKED_IN(V_inet_pfil_head))) > goto passin; > > odst = ip->ip_dst; > > I hope that brings my point. > > M> The real fix would be to either implement hot patchable branches or > M> otherwise generate pf_test always (or never) doing divert without > M> having to check for it, but that's far in the future. > > That would be great, but before we have such tools, I believe optimization > for one particular setup at cost of pessimization of other setups is not > a way to go. > So happens I would argue the pfil change should also be made, perhaps conditional on whether a known consumer is compiled in. I guess I should elaborate on how I see things here. The network stack comes with a rampant branch fest which can be significantly reduced in easy ways. For example from ip_input: #if defined(IPSEC) || defined(IPSEC_SUPPORT) /* * Bypass packet filtering for packets previously handled by IPsec. */ if (IPSEC_ENABLED(ipv4) && IPSEC_CAPS(ipv4, m, IPSEC_CAP_BYPASS_FILTER) != 0) goto passin; #endif Let's say this has to be checked every time. Even then IPSEC_CAPS is a func call which induces 2 more func calls, which also branch for no reason. Instead the complete result could be computed so that there is one bool to check (and even that could be hot patched later on). Finally, it should probably be predicted one way or the other. pf_test is an egregious example of this proble and, the commit at hand was a step towards cleaning the state up -- it is not meant to be permanent in the current form. The idea is to gradually split it into parts which have to be there and parts which are optional, the annotation will help going forward and should not measurably hurt divert. -- Mateusz Guzik From owner-dev-commits-src-all@freebsd.org Tue Sep 14 15:36:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9489066B7BA; Tue, 14 Sep 2021 15:36:21 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta001.cacentral1.a.cloudfilter.net (omta001.cacentral1.a.cloudfilter.net [3.97.99.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H86rh2Grdz4VhC; Tue, 14 Sep 2021 15:36:20 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from shw-obgw-4004a.ext.cloudfilter.net ([10.228.9.227]) by cmsmtp with ESMTP id Q5AkmMHjIczbLQATrmmjsd; Tue, 14 Sep 2021 15:36:19 +0000 Received: from spqr.komquats.com ([70.66.148.124]) by cmsmtp with ESMTPA id QATqmAr9KdCHGQATrmJIhA; Tue, 14 Sep 2021 15:36:19 +0000 X-Authority-Analysis: v=2.4 cv=SdyUytdu c=1 sm=1 tr=0 ts=6140c173 a=Cwc3rblV8FOMdVN/wOAqyQ==:117 a=Cwc3rblV8FOMdVN/wOAqyQ==:17 a=kj9zAlcOel0A:10 a=7QKq2e-ADPsA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=a6Yr_-BYhy3xce3D-50A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 9DDDA15A; Tue, 14 Sep 2021 06:53:27 +0000 () Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.16.1/8.16.1) with ESMTP id 18EDrPqq022951; Tue, 14 Sep 2021 13:53:26 GMT (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202109141353.18EDrPqq022951@slippy.cwsent.com> X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Edward Tomasz Napierala cc: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: ddedf2a11eb2 - main - tzcode: Implement timezone change detection In-reply-to: <202109131442.18DEgDIn043709@gitrepo.freebsd.org> References: <202109131442.18DEgDIn043709@gitrepo.freebsd.org> Comments: In-reply-to Edward Tomasz Napierala message dated "Mon, 13 Sep 2021 14:42:13 +0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Tue, 14 Sep 2021 13:53:25 +0000 X-CMAE-Envelope: MS4xfHRkrkHXn0gdukaD75BkwOrZcxz5gLe0LVuC0k+VJkJQFiOJNKA5TiGGszk7VJ0WspqShQuAOjvLqwMy8JN4re7OQR+MJgg/T5xmS+uFXX2H75XCRKIw MgaDEtg4/xqLWLuzviY/UzU40sGkbMeTvlQbLd4jC43E4cLhWvpEbx8Nr1V2QK5yku2uClaG7X9ZnGpYJvIRhmrC3bdOJe0HgobZAEr0sDccRfazxN4SN3G5 6FHO/AaotyY5YFH8G9OAMGbZdAyAuqCF+xwpWIAho87RdQ6Y/GeYzoGPqxID+UYTz+UykIRSiT6/G2m8tWijGSKAQDKVd88WlnsJQ1cqXc8= X-Rspamd-Queue-Id: 4H86rh2Grdz4VhC X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of cy.schubert@cschubert.com has no SPF policy when checking 3.97.99.32) smtp.mailfrom=cy.schubert@cschubert.com X-Spamd-Result: default: False [-1.60 / 15.00]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US]; RCVD_TLS_LAST(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[70.66.148.124:received]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; RCVD_COUNT_FIVE(0.00)[5]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[cschubert.com: no valid DMARC record]; AUTH_NA(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[3.97.99.32:from]; R_SPF_NA(0.00)[no SPF record]; RWL_MAILSPIKE_VERYGOOD(0.00)[3.97.99.32:from]; MAILMAN_DEST(0.00)[dev-commits-src-main,dev-commits-src-all] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 15:36:21 -0000 In message <202109131442.18DEgDIn043709@gitrepo.freebsd.org>, Edward Tomasz Nap ierala writes: > The branch main has been updated by trasz: > > URL: https://cgit.FreeBSD.org/src/commit/?id=ddedf2a11eb20af1ee52cb3da70a57c2 > 1904af8f > > commit ddedf2a11eb20af1ee52cb3da70a57c21904af8f > Author: Edward Tomasz Napierala > AuthorDate: 2021-09-12 03:07:26 +0000 > Commit: Edward Tomasz Napierala > CommitDate: 2021-09-12 03:07:58 +0000 > > tzcode: Implement timezone change detection > > Implement optional timezone change detection for local time libc > functions. This is disabled by default; set WITH_DETECT_TZ_CHANGES > to build it. > > Reviewed By: imp > Sponsored by: NetApp, Inc. > Sponsored by: Klara, Inc. > X-NetApp-PR: #47 > Differential Revision: https://reviews.freebsd.org/D30183 > --- > contrib/tzcode/stdtime/localtime.c | 89 ++++++++++++++++++++++++++++ > +- > lib/libc/stdtime/Makefile.inc | 4 ++ > share/mk/src.opts.mk | 1 + > tools/build/options/WITH_DETECT_TZ_CHANGES | 2 + > 4 files changed, 95 insertions(+), 1 deletion(-) > > diff --git a/contrib/tzcode/stdtime/localtime.c b/contrib/tzcode/stdtime/loca > ltime.c > index e221c1fa3964..926b24470e19 100644 > --- a/contrib/tzcode/stdtime/localtime.c > +++ b/contrib/tzcode/stdtime/localtime.c > @@ -354,6 +354,45 @@ settzname(void) > } > } > > +#ifdef DETECT_TZ_CHANGES > +/* > + * Determine if there's a change in the timezone since the last time we chec > ked. > + * Returns: -1 on error > + * 0 if the timezone has not changed > + * 1 if the timezone has changed > + */ > +static int > +change_in_tz(const char *name) > +{ > + static char old_name[PATH_MAX]; > + static struct stat old_sb; > + struct stat sb; > + int error; > + > + error = stat(name, &sb); > + if (error != 0) > + return -1; > + > + if (strcmp(name, old_name) != 0) { > + strlcpy(old_name, name, sizeof(old_name)); > + old_sb = sb; > + return 1; > + } > + > + if (sb.st_dev != old_sb.st_dev || > + sb.st_ino != old_sb.st_ino || > + sb.st_ctime != old_sb.st_ctime || > + sb.st_mtime != old_sb.st_mtime) { > + old_sb = sb; > + return 1; > + } > + > + return 0; > +} > +#else /* !DETECT_TZ_CHANGES */ > +#define change_in_tz(X) 0 > +#endif /* !DETECT_TZ_CHANGES */ > + > static int > differ_by_repeat(const time_t t1, const time_t t0) > { > @@ -379,6 +418,7 @@ register const int doextend; > int stored; > int nread; > int res; > + int ret; > union { > struct tzhead tzhead; > char buf[2 * sizeof(struct tzhead) + > @@ -427,6 +467,22 @@ register const int doextend; > (void) strcat(fullname, name); > name = fullname; > } > + if (doextend == TRUE) { > + /* > + * Detect if the timezone file has changed. Check > + * 'doextend' to ignore TZDEFRULES; the change_in_tz() > + * function can only keep state for a single file. > + */ > + ret = change_in_tz(name); > + if (ret <= 0) { > + /* > + * Returns -1 if there was an error, > + * and 0 if the timezone had not changed. > + */ > + free(fullname); > + return ret; > + } > + } > if ((fid = _open(name, OPEN_MODE)) == -1) { > free(fullname); > return -1; > @@ -1209,12 +1265,43 @@ gmtload(struct state *const sp) > (void) tzparse(gmt, sp, TRUE); > } > > +#ifdef DETECT_TZ_CHANGES > +static int > +recheck_tzdata() > +{ > + static time_t last_checked; > + struct timespec now; > + time_t current_time; > + int error; > + > + /* > + * We want to recheck the timezone file every 61 sec. > + */ > + error = clock_gettime(CLOCK_MONOTONIC, &now); > + if (error <= 0) { > + /* XXX: Can we somehow report this? */ > + return 0; > + } > + > + current_time = now.tv_sec; > + if ((current_time - last_checked > 61) || > + (last_checked > current_time)) { > + last_checked = current_time; > + return 1; > + } > + > + return 0; > +} > +#else /* !DETECT_TZ_CHANGES */ > +#define recheck_tzdata() 0 > +#endif /* !DETECT_TZ_CHANGES */ > + > static void > tzsetwall_basic(int rdlocked) > { > if (!rdlocked) > _RWLOCK_RDLOCK(&lcl_rwlock); > - if (lcl_is_set < 0) { > + if (lcl_is_set < 0 && recheck_tzdata() == 0) { > if (!rdlocked) > _RWLOCK_UNLOCK(&lcl_rwlock); > return; > diff --git a/lib/libc/stdtime/Makefile.inc b/lib/libc/stdtime/Makefile.inc > index fb0d2b934148..3d483469bc97 100644 > --- a/lib/libc/stdtime/Makefile.inc > +++ b/lib/libc/stdtime/Makefile.inc > @@ -12,6 +12,10 @@ CFLAGS+= -I${SRCTOP}/contrib/tzcode/stdtime -I${LIBC_SRCTO > P}/stdtime > > CFLAGS.localtime.c= -fwrapv > > +.if ${MK_DETECT_TZ_CHANGES} != "no" > +CFLAGS+= -DDETECT_TZ_CHANGES > +.endif > + > MAN+= ctime.3 strftime.3 strptime.3 time2posix.3 > MAN+= tzfile.5 > > diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk > index 28e18260affd..ff894d3b3517 100644 > --- a/share/mk/src.opts.mk > +++ b/share/mk/src.opts.mk > @@ -196,6 +196,7 @@ __DEFAULT_NO_OPTIONS = \ > BHYVE_SNAPSHOT \ > CLANG_EXTRAS \ > CLANG_FORMAT \ > + DETECT_TZ_CHANGES \ > DTRACE_TESTS \ > EXPERIMENTAL \ > HESIOD \ > diff --git a/tools/build/options/WITH_DETECT_TZ_CHANGES b/tools/build/options > /WITH_DETECT_TZ_CHANGES > new file mode 100644 > index 000000000000..6a2d18473892 > --- /dev/null > +++ b/tools/build/options/WITH_DETECT_TZ_CHANGES > @@ -0,0 +1,2 @@ > +.\" $FreeBSD$ > +Make the time handling code detect changes to the timezone files. > Hi, This patch caused all of the machines on my network to display UTC. After reboot everything was ok. However moments ago my screen locked while typing on my laptop. The time is now UTC instead of PDT. TZ is still set to America/Vancouver. Changing the TZ makes no difference. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-dev-commits-src-all@freebsd.org Tue Sep 14 16:39:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A47BC66C43F; Tue, 14 Sep 2021 16:39:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "freefall.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H88FJ40Pqz4pyv; Tue, 14 Sep 2021 16:39:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1631637556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ofYepXUz2iKK14qNbah/IDq1cJO7Je38EViZNaT/7D4=; b=sJwss9Tcc364JsgW1L5dCbcoozPaoFeXY4/b3guQ7Fw0MqUJ6FrE8F5mZ9x/EZHG8gwW+y iYlyAd1jfFViFqtDQhgiFyGP8owYnNr2klEia6oKogniuf3+iq9OMlvcMJ878ej++iLrVp 4uuBaDwVARMq1iqmzArFLprJiv02vPLm9Kk0uXqE0TtPINohym9DMtRbzxj6lOWKBU/kpF Tpj+2cKGVxIA9nuv5dPAQwKB+z5a5uuBQZu6qlLmeI55MXJPEgsV7TfzpXqPag7kx/Mma9 6v797E8BnqZUOsh4Lt5jk072YBxMJh3UOYQtCDAQdZYyrR1ZbCfKsJ4kBVONXg== Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 62D5871EF; Tue, 14 Sep 2021 16:39:16 +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 96B5B7D02; Tue, 14 Sep 2021 09:39:15 -0700 (PDT) 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 KAkljf4f3DHT; Tue, 14 Sep 2021 09:39:13 -0700 (PDT) Subject: Re: git: ddedf2a11eb2 - main - tzcode: Implement timezone change detection DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com 4B0B07CF5 To: Edward Tomasz Napierala , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202109131442.18DEgDIn043709@gitrepo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: <59a39614-45d2-d9b0-a84a-476e52a81c76@FreeBSD.org> Date: Tue, 14 Sep 2021 09:39:14 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <202109131442.18DEgDIn043709@gitrepo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wSgEHqHSqGi1wIEqfMGgf01N8RK7YaRGw" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1631637556; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ofYepXUz2iKK14qNbah/IDq1cJO7Je38EViZNaT/7D4=; b=u/6TJOSHgKwB8T28EeVhtb59b8hm+V29dCvuxRbt6wRGgObehEuTHzuiliISba2KBwNz5h CsIo42jl2ipPfYV8yFjC/dC4K5nL839WwrApe+/jP5JjbWNIvtYu7A8RO4YBhgBPYNwbeX oI7v8hKR+URqFcgjyWXXHMeOUPuBGclC5bcFjJmvRh+VrYb6TUq0P5djEpzI5WdhSjDBwy l/tWmBvB/ibwlF3fXonIOwfKaja/9nd0x66WBl5hJpKZ+2ZMY8+v+epGSUIkJK4HTNQDaC SDQ+qSez7XxogJDDMxnMuBchJQkLtZkFnlOZ+x2HcwDYLctk5VH40dDeU/J05A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1631637556; a=rsa-sha256; cv=none; b=cU1qN1VRKql7m5hLqOMVAoVy9mk6HeCx0COQ55Ivo8ZMJfcXIuy7XWBuhs2dCN0okAPQcL EsqFKr0O41i4bOOMmcm4c/P/GjZgzjx7Vq0h4+r2OaQ4FA4kirQ80lNGsBhzTV3OO/2Ecd LMJuB/HOvjC+lHPSHRDdOAh9UJsONsKsS53ogUq2YfdQ8CHOTh/8+2oh8qTiAKNzD1MFft FNOYeVG/snv6i820jDLAoyzCrJVdxiGgImnCRIX1FGtHknNzzWgrFEIyIXj2XDt8kaZNw7 bk35TSYN/M/nxc6RGsVlZcQAuMj9cy3Kj09BrC66TDwSXqeceeF5l+Qh215VKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 16:39:16 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wSgEHqHSqGi1wIEqfMGgf01N8RK7YaRGw Content-Type: multipart/mixed; boundary="U0hUOraZIKiLM0PKAMawQq5Vp3r1t51sj"; protected-headers="v1" From: Bryan Drewery To: Edward Tomasz Napierala , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Message-ID: <59a39614-45d2-d9b0-a84a-476e52a81c76@FreeBSD.org> Subject: Re: git: ddedf2a11eb2 - main - tzcode: Implement timezone change detection References: <202109131442.18DEgDIn043709@gitrepo.freebsd.org> In-Reply-To: <202109131442.18DEgDIn043709@gitrepo.freebsd.org> --U0hUOraZIKiLM0PKAMawQq5Vp3r1t51sj Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 9/13/2021 7:42 AM, Edward Tomasz Napierala wrote: > +#else /* !DETECT_TZ_CHANGES */ > +#define change_in_tz(X) 0 WITHOUT_DETECT_TZ_CHANGES: change_in_tz() =3D=3D 0 > +#endif /* !DETECT_TZ_CHANGES */ > + > static int > differ_by_repeat(const time_t t1, const time_t t0) > { > @@ -379,6 +418,7 @@ register const int doextend; > int stored; > int nread; > int res; > + int ret; > union { > struct tzhead tzhead; > char buf[2 * sizeof(struct tzhead) + > @@ -427,6 +467,22 @@ register const int doextend; > (void) strcat(fullname, name); > name =3D fullname; > } > + if (doextend =3D=3D TRUE) { > + /* > + * Detect if the timezone file has changed. Check > + * 'doextend' to ignore TZDEFRULES; the change_in_tz() > + * function can only keep state for a single file. > + */ > + ret =3D change_in_tz(name); > + if (ret <=3D 0) { WITHOUT_DETECT_TZ_CHANGES: Always returns a false-positive "done" but short-circuits the rest of tzload(). > + /* > + * Returns -1 if there was an error, > + * and 0 if the timezone had not changed. > + */ > + free(fullname); > + return ret; > + } > + } --=20 Regards, Bryan Drewery --U0hUOraZIKiLM0PKAMawQq5Vp3r1t51sj-- --wSgEHqHSqGi1wIEqfMGgf01N8RK7YaRGw Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEE+Rc8ssOq6npcih8JNddxu25Gl88FAmFA0DIFAwAAAAAACgkQNddxu25Gl88r hAgAltyUu1Bn2s6N+Vg0AHDgThsClWA1Fq7nmTu+45BSqIilAMUQk7Uf/CvdfxAU1u658fGPhnYp t25/fxRF4hDvyO0dN/Rmlbqx7HGInLYH6+HVPC+1SxTapR5mR54O8DxCOqVaF7wn5/tZXAQoVcZw Alzsc+/aIlhlsthPjiX/6utjdGaDawLJaf6ugEWNHJncQmY7UN/8u3kbqstw+V6Kd8rQikgoO+8s zx/4ABf1/vGylOK1JsisDCdM5buRbjU98B5E1uspXmdNzP8PDoknLXRDcgeX+Fs1sggL1pabrdrb OT9K74mDkG/GqSPMs2hJfrxNSCz8zfknP7Jb45My0g== =XIeD -----END PGP SIGNATURE----- --wSgEHqHSqGi1wIEqfMGgf01N8RK7YaRGw-- From owner-dev-commits-src-all@freebsd.org Tue Sep 14 17:12:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 23E4166D12B; Tue, 14 Sep 2021 17:12:04 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id 4H88z76zmBz3F9B; Tue, 14 Sep 2021 17:12:03 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtpclient.apple (cpc91232-cmbg18-2-0-cust554.5-4.cable.virginm.net [82.2.126.43]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id 16A844E703; Tue, 14 Sep 2021 17:11:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fubar.geek.nz; s=mail; t=1631639517; bh=o3/qvZJg+yweuIv9K9P4W3NbOL9dEz137QL69GkZX1M=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=prIJnkidB4jjVISBO5fZm9WJ2+oiIdtnjJ2qvIjgdxuhNQGtXP0sJZ00Maq9Rte3a 9Nql3rYORwExPYvvqV8sVocaamU2rs9z60S3xhWdIfsyeoYtzvEE73/8vZ2IGzO/wX f85vW7rxeri6eHJgexqJ7brfFLxIKRUZGrKHtssNao6mkWV3r4DRV5HE6XPu/qaT1n SVS58Nk2dvEOi9Sv7ukUPNGMaG3YpAJQba1EI0CGmcFemJfiTMNwAynN7OeYkm2IEE wBYINCDxMHutErh9Ha/nKT86/DUzM3cfVrna/qUFXbrKPik7hhyv+uUb3LAF0oQHMv zOImSqE5FT91Eau+SMeqwNftHcD8KAHvS/t1DPk/Q2rmLuNPze6dqGZ7v7vzWElyGV PWRw0S1T2lkKPOzLmVr1gl/Z+xWpKyz6OpjWbGDrD9auIvAwSeFdLXgiGnWWDJzWtg X6gBzWqgmp7ui4E1eg15XjNeNSt7Q6/F0GdxKJKQZzW98usiTeDbXxrcbYWpUIu05F /EXdTLYZiyaQTlIGBvvkwbyxut4nriY4zSAgT6tJN2ptrOZYlf2boeRjLLZlwgV2Gd rxnncPtz40y/ioilG94f0nV16sLvHx2Nr8fiAt+7x8CWjCzUAQw5P8DziRR26ZByrM j1pUmst//7Tcuc2tPLsvQduk= Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: fd860ace3bde - main - Remove the DN flag from the initial arm64 fpcr value From: Andrew Turner X-Priority: 3 (Normal) In-Reply-To: <629177790.2.1631626955525@mailrelay> Date: Tue, 14 Sep 2021 18:11:56 +0100 Cc: Andrew Turner , "dev-commits-src-all@freebsd.org" , "src-committers@freebsd.org" , "dev-commits-src-main@freebsd.org" Message-Id: <7E354DA3-CC3D-4240-A4EF-320AD7728C59@fubar.geek.nz> References: <202109141253.18ECrVoR016500@gitrepo.freebsd.org> <629177790.2.1631626955525@mailrelay> To: Ronald Klop X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4H88z76zmBz3F9B X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 17:12:04 -0000 I found it with the lldb test suite. I also checked the value Mac and = Linux initialised the register to & found it to be zero. Andrew > On 14 Sep 2021, at 14:42, Ronald Klop wrote: >=20 > Hi, >=20 > Do you have an example of this software? Just for my understanding. >=20 > Ronald. >=20 > Van: Andrew Turner > Datum: dinsdag, 14 september 2021 14:53 > Aan: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, = dev-commits-src-main@FreeBSD.org > Onderwerp: git: fd860ace3bde - main - Remove the DN flag from the = initial arm64 fpcr value >=20 > The branch main has been updated by andrew: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dfd860ace3bded96bee0e5c090a5a4d8b= 085b700c = >=20 > commit fd860ace3bded96bee0e5c090a5a4d8b085b700c > Author: Andrew Turner > AuthorDate: 2021-08-25 10:05:55 +0000 > Commit: Andrew Turner > CommitDate: 2021-09-14 12:52:48 +0000 >=20 > Remove the DN flag from the initial arm64 fpcr value > =20 > This fixes software that expects NaN values to propagate. > =20 > Sponsored by: The FreeBSD Foundation > --- > sys/arm64/include/vfp.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/sys/arm64/include/vfp.h b/sys/arm64/include/vfp.h > index 629b1b7fadf4..bee0121d9d2a 100644 > --- a/sys/arm64/include/vfp.h > +++ b/sys/arm64/include/vfp.h > @@ -35,7 +35,7 @@ > #define VFPCR_AHP (0x04000000) /* alt. half-precision: */ > #define VFPCR_DN (0x02000000) /* default NaN enable */ > #define VFPCR_FZ (0x01000000) /* flush to zero enabled = */ > -#define VFPCR_INIT VFPCR_DN /* Default fpcr after exec */ > +#define VFPCR_INIT 0 /* Default fpcr after exec */ > =20 > #define VFPCR_RMODE_OFF 22 /* rounding mode offset */ > #define VFPCR_RMODE_MASK (0x00c00000) /* rounding mode mask = */ > _______________________________________________ > dev-commits-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all = > To unsubscribe, send any mail to = "dev-commits-src-all-unsubscribe@freebsd.org" From owner-dev-commits-src-all@freebsd.org Tue Sep 14 17:51:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DFE1A66DA87; Tue, 14 Sep 2021 17:51:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H89rh62lgz3jxt; Tue, 14 Sep 2021 17:51:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF4531F325; Tue, 14 Sep 2021 17:51:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EHpWuI015755; Tue, 14 Sep 2021 17:51:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EHpWI1015754; Tue, 14 Sep 2021 17:51:32 GMT (envelope-from git) Date: Tue, 14 Sep 2021 17:51:32 GMT Message-Id: <202109141751.18EHpWI1015754@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 0f9bafdfc325 - main - openssh: pass ssh context to BLACKLIST_NOTIFY MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0f9bafdfc325779e4ecc5154d5bb06c752297138 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 17:51:33 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=0f9bafdfc325779e4ecc5154d5bb06c752297138 commit 0f9bafdfc325779e4ecc5154d5bb06c752297138 Author: Ed Maste AuthorDate: 2021-09-14 16:39:21 +0000 Commit: Ed Maste CommitDate: 2021-09-14 17:44:39 +0000 openssh: pass ssh context to BLACKLIST_NOTIFY Fixes: 19261079b743 ("openssh: update to OpenSSH v8.7p1") Sponsored by: The FreeBSD Foundation --- crypto/openssh/auth-pam.c | 2 +- crypto/openssh/auth.c | 4 ++-- crypto/openssh/auth2.c | 2 +- crypto/openssh/blacklist.c | 6 +++--- crypto/openssh/blacklist_client.h | 6 +++--- crypto/openssh/packet.c | 2 +- crypto/openssh/sshd.c | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/crypto/openssh/auth-pam.c b/crypto/openssh/auth-pam.c index f077b70595e6..7e6f972681e9 100644 --- a/crypto/openssh/auth-pam.c +++ b/crypto/openssh/auth-pam.c @@ -923,7 +923,7 @@ sshpam_query(void *ctx, char **name, char **info, sshbuf_free(buffer); return (0); } - BLACKLIST_NOTIFY(BLACKLIST_BAD_USER, + BLACKLIST_NOTIFY(NULL, BLACKLIST_BAD_USER, sshpam_authctxt->user); error("PAM: %s for %s%.100s from %.100s", msg, sshpam_authctxt->valid ? "" : "illegal user ", diff --git a/crypto/openssh/auth.c b/crypto/openssh/auth.c index 6b53585e2567..581d8dce2792 100644 --- a/crypto/openssh/auth.c +++ b/crypto/openssh/auth.c @@ -336,7 +336,7 @@ auth_log(struct ssh *ssh, int authenticated, int partial, else { authmsg = authenticated ? "Accepted" : "Failed"; if (authenticated) - BLACKLIST_NOTIFY(BLACKLIST_AUTH_OK, "ssh"); + BLACKLIST_NOTIFY(ssh, BLACKLIST_AUTH_OK, "ssh"); } if ((extra = format_method_key(authctxt)) == NULL) { @@ -600,7 +600,7 @@ getpwnamallow(struct ssh *ssh, const char *user) aix_restoreauthdb(); #endif if (pw == NULL) { - BLACKLIST_NOTIFY(BLACKLIST_BAD_USER, user); + BLACKLIST_NOTIFY(ssh, BLACKLIST_BAD_USER, user); logit("Invalid user %.100s from %.100s port %d", user, ssh_remote_ipaddr(ssh), ssh_remote_port(ssh)); #ifdef CUSTOM_FAILED_LOGIN diff --git a/crypto/openssh/auth2.c b/crypto/openssh/auth2.c index cd5bd9ff501c..ff1228513d1e 100644 --- a/crypto/openssh/auth2.c +++ b/crypto/openssh/auth2.c @@ -425,7 +425,7 @@ userauth_finish(struct ssh *ssh, int authenticated, const char *method, if (!partial && !authctxt->server_caused_failure && (authctxt->attempt > 1 || strcmp(method, "none") != 0)) { authctxt->failures++; - BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, "ssh"); + BLACKLIST_NOTIFY(ssh, BLACKLIST_AUTH_FAIL, "ssh"); } if (authctxt->failures >= options.max_authtries) { #ifdef SSH_AUDIT_EVENTS diff --git a/crypto/openssh/blacklist.c b/crypto/openssh/blacklist.c index 78830c525c85..f118edab40cf 100644 --- a/crypto/openssh/blacklist.c +++ b/crypto/openssh/blacklist.c @@ -88,10 +88,10 @@ blacklist_init(void) } void -blacklist_notify(int action, const char *msg) +blacklist_notify(struct ssh *ssh, int action, const char *msg) { - if (blstate != NULL && ssh_packet_connection_is_on_socket(NULL)) + if (blstate != NULL && ssh_packet_connection_is_on_socket(ssh)) (void)blacklist_r(blstate, action, - ssh_packet_get_connection_in(NULL), msg); + ssh_packet_get_connection_in(ssh), msg); } diff --git a/crypto/openssh/blacklist_client.h b/crypto/openssh/blacklist_client.h index af5a2a6d3c1d..236884092010 100644 --- a/crypto/openssh/blacklist_client.h +++ b/crypto/openssh/blacklist_client.h @@ -45,15 +45,15 @@ enum { #ifdef USE_BLACKLIST void blacklist_init(void); -void blacklist_notify(int, const char *); +void blacklist_notify(struct ssh *, int, const char *); #define BLACKLIST_INIT() blacklist_init() -#define BLACKLIST_NOTIFY(x,msg) blacklist_notify(x,msg) +#define BLACKLIST_NOTIFY(ssh,x,msg) blacklist_notify(ssh,x,msg) #else #define BLACKLIST_INIT() -#define BLACKLIST_NOTIFY(x,msg) +#define BLACKLIST_NOTIFY(ssh,x,msg) #endif diff --git a/crypto/openssh/packet.c b/crypto/openssh/packet.c index 3379862ebc79..bc8314287cba 100644 --- a/crypto/openssh/packet.c +++ b/crypto/openssh/packet.c @@ -1876,7 +1876,7 @@ sshpkt_vfatal(struct ssh *ssh, int r, const char *fmt, va_list ap) case SSH_ERR_NO_KEX_ALG_MATCH: case SSH_ERR_NO_HOSTKEY_ALG_MATCH: if (ssh && ssh->kex && ssh->kex->failed_choice) { - BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, "ssh"); + BLACKLIST_NOTIFY(ssh, BLACKLIST_AUTH_FAIL, "ssh"); ssh_packet_clear_keys(ssh); errno = oerrno; logdie("Unable to negotiate with %s: %s. " diff --git a/crypto/openssh/sshd.c b/crypto/openssh/sshd.c index b3a2c4151e01..864ad09b29fc 100644 --- a/crypto/openssh/sshd.c +++ b/crypto/openssh/sshd.c @@ -385,7 +385,7 @@ grace_alarm_handler(int sig) kill(0, SIGTERM); } - BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, "ssh"); + BLACKLIST_NOTIFY(NULL, BLACKLIST_AUTH_FAIL, "ssh"); /* Log error and exit. */ if (use_privsep && pmonitor != NULL && pmonitor->m_pid <= 0) From owner-dev-commits-src-all@freebsd.org Tue Sep 14 18:18:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44CBB66E11F; Tue, 14 Sep 2021 18:18:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8BRQ1Qq2z3s8n; Tue, 14 Sep 2021 18:18:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 115381EDE8; Tue, 14 Sep 2021 18:18:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EII94C044014; Tue, 14 Sep 2021 18:18:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EII9NB044013; Tue, 14 Sep 2021 18:18:09 GMT (envelope-from git) Date: Tue, 14 Sep 2021 18:18:09 GMT Message-Id: <202109141818.18EII9NB044013@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 272c4a4dc5fb - main - Allow setting NFS server scope and owner. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 272c4a4dc5fbe3d82d735c5b9a3b6faab052808b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 18:18:10 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=272c4a4dc5fbe3d82d735c5b9a3b6faab052808b commit 272c4a4dc5fbe3d82d735c5b9a3b6faab052808b Author: Alexander Motin AuthorDate: 2021-09-14 18:14:30 +0000 Commit: Alexander Motin CommitDate: 2021-09-14 18:18:03 +0000 Allow setting NFS server scope and owner. By default NFS server reports as scope and owner major the host UUID value and zero for owner minor. It works good in case of standalone server. But in case of CARP-based HA cluster failover the values should remain persistent, otherwise some clients like VMware ESXi get confused by the change and fail to reconnect automatically. The patch makes server scope, major owner and minor owner values configurable via sysctls. If not set (by default) the host UUID value is still used. Reviewed by: rmacklem MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D31952 --- sys/fs/nfsserver/nfs_nfsdserv.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdserv.c b/sys/fs/nfsserver/nfs_nfsdserv.c index 85834f7796f7..4394d3033fce 100644 --- a/sys/fs/nfsserver/nfs_nfsdserv.c +++ b/sys/fs/nfsserver/nfs_nfsdserv.c @@ -82,6 +82,15 @@ static bool nfsrv_openaccess = true; SYSCTL_BOOL(_vfs_nfsd, OID_AUTO, v4openaccess, CTLFLAG_RW, &nfsrv_openaccess, 0, "Enable Linux style NFSv4 Open access check"); +static char nfsrv_scope[NFSV4_OPAQUELIMIT]; +SYSCTL_STRING(_vfs_nfsd, OID_AUTO, scope, CTLFLAG_RWTUN, + &nfsrv_scope, NFSV4_OPAQUELIMIT, "Server scope"); +static char nfsrv_owner_major[NFSV4_OPAQUELIMIT]; +SYSCTL_STRING(_vfs_nfsd, OID_AUTO, owner_major, CTLFLAG_RWTUN, + &nfsrv_owner_major, NFSV4_OPAQUELIMIT, "Server owner major"); +static uint64_t nfsrv_owner_minor; +SYSCTL_U64(_vfs_nfsd, OID_AUTO, owner_minor, CTLFLAG_RWTUN, + &nfsrv_owner_minor, 0, "Server owner minor"); /* * This list defines the GSS mechanisms supported. @@ -4253,7 +4262,6 @@ nfsrvd_exchangeid(struct nfsrv_descript *nd, __unused int isdgram, nfsquad_t clientid, confirm; uint8_t *verf; uint32_t sp4type, v41flags; - uint64_t owner_minor; struct timespec verstime; #ifdef INET struct sockaddr_in *sin, *rin; @@ -4262,6 +4270,7 @@ nfsrvd_exchangeid(struct nfsrv_descript *nd, __unused int isdgram, struct sockaddr_in6 *sin6, *rin6; #endif struct thread *p = curthread; + char *s; if ((nd->nd_repstat = nfsd_checkrootexp(nd)) != 0) goto nfsmout; @@ -4376,12 +4385,17 @@ nfsrvd_exchangeid(struct nfsrv_descript *nd, __unused int isdgram, *tl++ = txdr_unsigned(confirm.lval[0]); /* SequenceID */ *tl++ = txdr_unsigned(v41flags); /* Exch flags */ *tl++ = txdr_unsigned(NFSV4EXCH_SP4NONE); /* No SSV */ - owner_minor = 0; /* Owner */ - txdr_hyper(owner_minor, tl); /* Minor */ - (void)nfsm_strtom(nd, nd->nd_cred->cr_prison->pr_hostuuid, - strlen(nd->nd_cred->cr_prison->pr_hostuuid)); /* Major */ - (void)nfsm_strtom(nd, nd->nd_cred->cr_prison->pr_hostuuid, - strlen(nd->nd_cred->cr_prison->pr_hostuuid)); /* Scope */ + txdr_hyper(nfsrv_owner_minor, tl); /* Owner Minor */ + if (nfsrv_owner_major[0] != 0) + s = nfsrv_owner_major; + else + s = nd->nd_cred->cr_prison->pr_hostuuid; + nfsm_strtom(nd, s, strlen(s)); /* Owner Major */ + if (nfsrv_scope[0] != 0) + s = nfsrv_scope; + else + s = nd->nd_cred->cr_prison->pr_hostuuid; + nfsm_strtom(nd, s, strlen(s) ); /* Scope */ NFSM_BUILD(tl, uint32_t *, NFSX_UNSIGNED); *tl = txdr_unsigned(1); (void)nfsm_strtom(nd, "freebsd.org", strlen("freebsd.org")); From owner-dev-commits-src-all@freebsd.org Tue Sep 14 18:32:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B11DA66E684; Tue, 14 Sep 2021 18:32:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8BmF4Ndyz4QyT; Tue, 14 Sep 2021 18:32:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7065F1F5FF; Tue, 14 Sep 2021 18:32:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EIWjcU070333; Tue, 14 Sep 2021 18:32:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EIWj5I070332; Tue, 14 Sep 2021 18:32:45 GMT (envelope-from git) Date: Tue, 14 Sep 2021 18:32:45 GMT Message-Id: <202109141832.18EIWj5I070332@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: cf4670fe0b10 - main - kcov: Integrate with KMSAN MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cf4670fe0b1049863ed3150a6ffb0b80dad151b2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 18:32:45 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cf4670fe0b1049863ed3150a6ffb0b80dad151b2 commit cf4670fe0b1049863ed3150a6ffb0b80dad151b2 Author: Mark Johnston AuthorDate: 2021-09-14 18:29:27 +0000 Commit: Mark Johnston CommitDate: 2021-09-14 18:29:27 +0000 kcov: Integrate with KMSAN - kern_kcov.c needs to be compiled with -fsanitize=kernel-memory when KMSAN is configured since it calls into various other subsystems. - Disable address and memory sanitizers in kcov(4)'s coverage sanitizer callbacks, as they do not provide useful checking. Moreover, with KMSAN we may otherwise get false positives since the caller (coverage sanitizer runtime) is not instrumented. - Disable KASAN and KMSAN interceptors in subr_coverage.c, as they do not provide any benefit but do introduce overhead when fuzzing. Sponsored by: The FreeBSD Foundation --- sys/conf/files | 2 +- sys/kern/kern_kcov.c | 7 ++++--- sys/kern/subr_coverage.c | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index a5690ec1df75..eb0c489b7833 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -3826,7 +3826,7 @@ kern/kern_idle.c standard kern/kern_intr.c standard kern/kern_jail.c standard kern/kern_kcov.c optional kcov \ - compile-with "${NORMAL_C:N-fsanitize*}" + compile-with "${NORMAL_C:N-fsanitize*} ${NORMAL_C:M-fsanitize=kernel-memory}" kern/kern_khelp.c standard kern/kern_kthread.c standard kern/kern_ktr.c optional ktr diff --git a/sys/kern/kern_kcov.c b/sys/kern/kern_kcov.c index 23e0da4cdb79..7a11f800c7ce 100644 --- a/sys/kern/kern_kcov.c +++ b/sys/kern/kern_kcov.c @@ -35,7 +35,8 @@ * $FreeBSD$ */ -#ifdef KCSAN +/* Interceptors are required for KMSAN. */ +#if defined(KASAN) || defined(KCSAN) #define SAN_RUNTIME #endif @@ -191,7 +192,7 @@ get_kinfo(struct thread *td) return (info); } -static void +static void __nosanitizeaddress __nosanitizememory trace_pc(uintptr_t ret) { struct thread *td; @@ -223,7 +224,7 @@ trace_pc(uintptr_t ret) buf[0] = index + 1; } -static bool +static bool __nosanitizeaddress __nosanitizememory trace_cmp(uint64_t type, uint64_t arg1, uint64_t arg2, uint64_t ret) { struct thread *td; diff --git a/sys/kern/subr_coverage.c b/sys/kern/subr_coverage.c index 9a719bcaecad..28467af6a8d0 100644 --- a/sys/kern/subr_coverage.c +++ b/sys/kern/subr_coverage.c @@ -35,7 +35,7 @@ * $FreeBSD$ */ -#ifdef KCSAN +#ifdef SAN_NEEDS_INTERCEPTORS #define SAN_RUNTIME #endif From owner-dev-commits-src-all@freebsd.org Tue Sep 14 18:51:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F2EE66EA98; Tue, 14 Sep 2021 18:51:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8C9w1QvVz4VqB; Tue, 14 Sep 2021 18:51:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 113381FC3A; Tue, 14 Sep 2021 18:51:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EIpWrH093662; Tue, 14 Sep 2021 18:51:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EIpVfE093661; Tue, 14 Sep 2021 18:51:31 GMT (envelope-from git) Date: Tue, 14 Sep 2021 18:51:31 GMT Message-Id: <202109141851.18EIpVfE093661@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: c782ea8bb50b - main - Add a switch structure for send tags. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c782ea8bb50bf49f5da20da66417952b0e77472e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 18:51:32 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c782ea8bb50bf49f5da20da66417952b0e77472e commit c782ea8bb50bf49f5da20da66417952b0e77472e Author: John Baldwin AuthorDate: 2021-09-14 18:43:41 +0000 Commit: John Baldwin CommitDate: 2021-09-14 18:43:41 +0000 Add a switch structure for send tags. Move the type and function pointers for operations on existing send tags (modify, query, next, free) out of 'struct ifnet' and into a new 'struct if_snd_tag_sw'. A pointer to this structure is added to the generic part of send tags and is initialized by m_snd_tag_init() (which now accepts a switch structure as a new argument in place of the type). Previously, device driver ifnet methods switched on the type to call type-specific functions. Now, those type-specific functions are saved in the switch structure and invoked directly. In addition, this more gracefully permits multiple implementations of the same tag within a driver. In particular, NIC TLS for future Chelsio adapters will use a different implementation than the existing NIC TLS support for T6 adapters. Reviewed by: gallatin, hselasky, kib (older version) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D31572 --- sys/dev/cxgbe/adapter.h | 4 -- sys/dev/cxgbe/crypto/t4_kern_tls.c | 10 +++- sys/dev/cxgbe/t4_main.c | 60 +--------------------- sys/dev/cxgbe/t4_sched.c | 22 +++++++-- sys/dev/cxgbe/t4_sge.c | 4 +- sys/dev/mlx5/mlx5_en/en.h | 5 -- sys/dev/mlx5/mlx5_en/en_hw_tls.h | 3 -- sys/dev/mlx5/mlx5_en/en_rl.h | 3 -- sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c | 73 ++++++++++++++------------- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 93 +++++------------------------------ sys/dev/mlx5/mlx5_en/mlx5_en_rl.c | 19 +++++-- sys/dev/mlx5/mlx5_en/mlx5_en_tx.c | 2 +- sys/kern/kern_mbuf.c | 7 +-- sys/kern/uipc_ktls.c | 6 +-- sys/net/if_dead.c | 20 -------- sys/net/if_lagg.c | 72 ++++++++++++++++++++++++--- sys/net/if_var.h | 27 ++++++---- sys/net/if_vlan.c | 72 ++++++++++++++++++++++++--- sys/netinet/in_pcb.c | 31 +++--------- sys/netinet/tcp_ratelimit.c | 8 +-- sys/sys/mbuf.h | 7 ++- 21 files changed, 263 insertions(+), 285 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 6b25dff7081a..4762b46f3799 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -1292,7 +1292,6 @@ void t4_os_dump_devlog(struct adapter *); /* t4_kern_tls.c */ int cxgbe_tls_tag_alloc(struct ifnet *, union if_snd_tag_alloc_params *, struct m_snd_tag **); -void cxgbe_tls_tag_free(struct m_snd_tag *); void t6_ktls_modload(void); void t6_ktls_modunload(void); int t6_ktls_try(struct ifnet *, struct socket *, struct ktls_session *); @@ -1409,9 +1408,6 @@ void t4_free_etid_table(struct adapter *); struct cxgbe_rate_tag *lookup_etid(struct adapter *, int); int cxgbe_rate_tag_alloc(struct ifnet *, union if_snd_tag_alloc_params *, struct m_snd_tag **); -int cxgbe_rate_tag_modify(struct m_snd_tag *, union if_snd_tag_modify_params *); -int cxgbe_rate_tag_query(struct m_snd_tag *, union if_snd_tag_query_params *); -void cxgbe_rate_tag_free(struct m_snd_tag *); void cxgbe_rate_tag_free_locked(struct cxgbe_rate_tag *); void cxgbe_ratelimit_query(struct ifnet *, struct if_ratelimit_query_results *); #endif diff --git a/sys/dev/cxgbe/crypto/t4_kern_tls.c b/sys/dev/cxgbe/crypto/t4_kern_tls.c index a20c3045b5b3..f8d5e54cc3b5 100644 --- a/sys/dev/cxgbe/crypto/t4_kern_tls.c +++ b/sys/dev/cxgbe/crypto/t4_kern_tls.c @@ -102,9 +102,15 @@ struct tlspcb { bool open_pending; }; +static void cxgbe_tls_tag_free(struct m_snd_tag *mst); static int ktls_setup_keys(struct tlspcb *tlsp, const struct ktls_session *tls, struct sge_txq *txq); +static const struct if_snd_tag_sw cxgbe_tls_tag_sw = { + .snd_tag_free = cxgbe_tls_tag_free, + .type = IF_SND_TAG_TYPE_TLS +}; + static inline struct tlspcb * mst_to_tls(struct m_snd_tag *t) { @@ -122,7 +128,7 @@ alloc_tlspcb(struct ifnet *ifp, struct vi_info *vi, int flags) if (tlsp == NULL) return (NULL); - m_snd_tag_init(&tlsp->com, ifp, IF_SND_TAG_TYPE_TLS); + m_snd_tag_init(&tlsp->com, ifp, &cxgbe_tls_tag_sw); tlsp->vi = vi; tlsp->sc = sc; tlsp->ctrlq = &sc->sge.ctrlq[pi->port_id]; @@ -2071,7 +2077,7 @@ t6_ktls_write_wr(struct sge_txq *txq, void *dst, struct mbuf *m, u_int nsegs, return (totdesc); } -void +static void cxgbe_tls_tag_free(struct m_snd_tag *mst) { struct adapter *sc; diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index af24977ec29b..f728ddf5b212 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -253,11 +253,6 @@ static void cxgbe_qflush(struct ifnet *); #if defined(KERN_TLS) || defined(RATELIMIT) static int cxgbe_snd_tag_alloc(struct ifnet *, union if_snd_tag_alloc_params *, struct m_snd_tag **); -static int cxgbe_snd_tag_modify(struct m_snd_tag *, - union if_snd_tag_modify_params *); -static int cxgbe_snd_tag_query(struct m_snd_tag *, - union if_snd_tag_query_params *); -static void cxgbe_snd_tag_free(struct m_snd_tag *); #endif MALLOC_DEFINE(M_CXGBE, "cxgbe", "Chelsio T4/T5 Ethernet driver and services"); @@ -2453,9 +2448,6 @@ cxgbe_vi_attach(device_t dev, struct vi_info *vi) ifp->if_get_counter = cxgbe_get_counter; #if defined(KERN_TLS) || defined(RATELIMIT) ifp->if_snd_tag_alloc = cxgbe_snd_tag_alloc; - ifp->if_snd_tag_modify = cxgbe_snd_tag_modify; - ifp->if_snd_tag_query = cxgbe_snd_tag_query; - ifp->if_snd_tag_free = cxgbe_snd_tag_free; #endif #ifdef RATELIMIT ifp->if_ratelimit_query = cxgbe_ratelimit_query; @@ -2926,7 +2918,7 @@ cxgbe_transmit(struct ifnet *ifp, struct mbuf *m) } #ifdef RATELIMIT if (m->m_pkthdr.csum_flags & CSUM_SND_TAG) { - if (m->m_pkthdr.snd_tag->type == IF_SND_TAG_TYPE_RATE_LIMIT) + if (m->m_pkthdr.snd_tag->sw->type == IF_SND_TAG_TYPE_RATE_LIMIT) return (ethofld_transmit(ifp, m)); } #endif @@ -3109,56 +3101,6 @@ cxgbe_snd_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params, } return (error); } - -static int -cxgbe_snd_tag_modify(struct m_snd_tag *mst, - union if_snd_tag_modify_params *params) -{ - - switch (mst->type) { -#ifdef RATELIMIT - case IF_SND_TAG_TYPE_RATE_LIMIT: - return (cxgbe_rate_tag_modify(mst, params)); -#endif - default: - return (EOPNOTSUPP); - } -} - -static int -cxgbe_snd_tag_query(struct m_snd_tag *mst, - union if_snd_tag_query_params *params) -{ - - switch (mst->type) { -#ifdef RATELIMIT - case IF_SND_TAG_TYPE_RATE_LIMIT: - return (cxgbe_rate_tag_query(mst, params)); -#endif - default: - return (EOPNOTSUPP); - } -} - -static void -cxgbe_snd_tag_free(struct m_snd_tag *mst) -{ - - switch (mst->type) { -#ifdef RATELIMIT - case IF_SND_TAG_TYPE_RATE_LIMIT: - cxgbe_rate_tag_free(mst); - return; -#endif -#ifdef KERN_TLS - case IF_SND_TAG_TYPE_TLS: - cxgbe_tls_tag_free(mst); - return; -#endif - default: - panic("shouldn't get here"); - } -} #endif /* diff --git a/sys/dev/cxgbe/t4_sched.c b/sys/dev/cxgbe/t4_sched.c index b19e62474bbb..82f8537bda38 100644 --- a/sys/dev/cxgbe/t4_sched.c +++ b/sys/dev/cxgbe/t4_sched.c @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include "common/t4_regs_values.h" #include "common/t4_msg.h" - static int in_range(int val, int lo, int hi) { @@ -785,6 +784,19 @@ free_etid(struct adapter *sc, int etid) mtx_unlock(&t->etid_lock); } +static int cxgbe_rate_tag_modify(struct m_snd_tag *, + union if_snd_tag_modify_params *); +static int cxgbe_rate_tag_query(struct m_snd_tag *, + union if_snd_tag_query_params *); +static void cxgbe_rate_tag_free(struct m_snd_tag *); + +static const struct if_snd_tag_sw cxgbe_rate_tag_sw = { + .snd_tag_modify = cxgbe_rate_tag_modify, + .snd_tag_query = cxgbe_rate_tag_query, + .snd_tag_free = cxgbe_rate_tag_free, + .type = IF_SND_TAG_TYPE_RATE_LIMIT +}; + int cxgbe_rate_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params, struct m_snd_tag **pt) @@ -819,7 +831,7 @@ failed: mtx_init(&cst->lock, "cst_lock", NULL, MTX_DEF); mbufq_init(&cst->pending_tx, INT_MAX); mbufq_init(&cst->pending_fwack, INT_MAX); - m_snd_tag_init(&cst->com, ifp, IF_SND_TAG_TYPE_RATE_LIMIT); + m_snd_tag_init(&cst->com, ifp, &cxgbe_rate_tag_sw); cst->flags |= EO_FLOWC_PENDING | EO_SND_TAG_REF; cst->adapter = sc; cst->port_id = pi->port_id; @@ -843,7 +855,7 @@ failed: /* * Change in parameters, no change in ifp. */ -int +static int cxgbe_rate_tag_modify(struct m_snd_tag *mst, union if_snd_tag_modify_params *params) { @@ -869,7 +881,7 @@ cxgbe_rate_tag_modify(struct m_snd_tag *mst, return (0); } -int +static int cxgbe_rate_tag_query(struct m_snd_tag *mst, union if_snd_tag_query_params *params) { @@ -908,7 +920,7 @@ cxgbe_rate_tag_free_locked(struct cxgbe_rate_tag *cst) free(cst, M_CXGBE); } -void +static void cxgbe_rate_tag_free(struct m_snd_tag *mst) { struct cxgbe_rate_tag *cst = mst_to_crt(mst); diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index d927d34b616b..8a502907d172 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -2369,7 +2369,7 @@ static inline int needs_eo(struct m_snd_tag *mst) { - return (mst != NULL && mst->type == IF_SND_TAG_TYPE_RATE_LIMIT); + return (mst != NULL && mst->sw->type == IF_SND_TAG_TYPE_RATE_LIMIT); } #endif @@ -2712,7 +2712,7 @@ restart: mst = NULL; #endif #ifdef KERN_TLS - if (mst != NULL && mst->type == IF_SND_TAG_TYPE_TLS) { + if (mst != NULL && mst->sw->type == IF_SND_TAG_TYPE_TLS) { int len16; cflags |= MC_TLS; diff --git a/sys/dev/mlx5/mlx5_en/en.h b/sys/dev/mlx5/mlx5_en/en.h index 7c37a785f23c..e8d4dcda85de 100644 --- a/sys/dev/mlx5/mlx5_en/en.h +++ b/sys/dev/mlx5/mlx5_en/en.h @@ -1216,9 +1216,4 @@ int mlx5e_update_buf_lossy(struct mlx5e_priv *priv); int mlx5e_fec_update(struct mlx5e_priv *priv); int mlx5e_hw_temperature_update(struct mlx5e_priv *priv); -if_snd_tag_alloc_t mlx5e_ul_snd_tag_alloc; -if_snd_tag_modify_t mlx5e_ul_snd_tag_modify; -if_snd_tag_query_t mlx5e_ul_snd_tag_query; -if_snd_tag_free_t mlx5e_ul_snd_tag_free; - #endif /* _MLX5_EN_H_ */ diff --git a/sys/dev/mlx5/mlx5_en/en_hw_tls.h b/sys/dev/mlx5/mlx5_en/en_hw_tls.h index eca9843c7673..5f2c5da5dfc0 100644 --- a/sys/dev/mlx5/mlx5_en/en_hw_tls.h +++ b/sys/dev/mlx5/mlx5_en/en_hw_tls.h @@ -97,8 +97,5 @@ void mlx5e_tls_cleanup(struct mlx5e_priv *); int mlx5e_sq_tls_xmit(struct mlx5e_sq *, struct mlx5e_xmit_args *, struct mbuf **); if_snd_tag_alloc_t mlx5e_tls_snd_tag_alloc; -if_snd_tag_modify_t mlx5e_tls_snd_tag_modify; -if_snd_tag_query_t mlx5e_tls_snd_tag_query; -if_snd_tag_free_t mlx5e_tls_snd_tag_free; #endif /* _MLX5_TLS_H_ */ diff --git a/sys/dev/mlx5/mlx5_en/en_rl.h b/sys/dev/mlx5/mlx5_en/en_rl.h index f30e8ba8cc07..1d7f7afc487d 100644 --- a/sys/dev/mlx5/mlx5_en/en_rl.h +++ b/sys/dev/mlx5/mlx5_en/en_rl.h @@ -168,8 +168,5 @@ void mlx5e_rl_cleanup(struct mlx5e_priv *priv); void mlx5e_rl_refresh_sq_inline(struct mlx5e_rl_priv_data *rl); if_snd_tag_alloc_t mlx5e_rl_snd_tag_alloc; -if_snd_tag_modify_t mlx5e_rl_snd_tag_modify; -if_snd_tag_query_t mlx5e_rl_snd_tag_query; -if_snd_tag_free_t mlx5e_rl_snd_tag_free; #endif /* __MLX5_EN_RL_H__ */ diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c index 1a92e5aa222a..6140671fe0c2 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_hw_tls.c @@ -37,6 +37,27 @@ #ifdef KERN_TLS +#ifdef RATELIMIT +static if_snd_tag_modify_t mlx5e_tls_rl_snd_tag_modify; +#endif +static if_snd_tag_query_t mlx5e_tls_snd_tag_query; +static if_snd_tag_free_t mlx5e_tls_snd_tag_free; + +static const struct if_snd_tag_sw mlx5e_tls_snd_tag_sw = { + .snd_tag_query = mlx5e_tls_snd_tag_query, + .snd_tag_free = mlx5e_tls_snd_tag_free, + .type = IF_SND_TAG_TYPE_TLS +}; + +#ifdef RATELIMIT +static const struct if_snd_tag_sw mlx5e_tls_rl_snd_tag_sw = { + .snd_tag_modify = mlx5e_tls_rl_snd_tag_modify, + .snd_tag_query = mlx5e_tls_snd_tag_query, + .snd_tag_free = mlx5e_tls_snd_tag_free, + .type = IF_SND_TAG_TYPE_TLS_RATE_LIMIT +}; +#endif + MALLOC_DEFINE(M_MLX5E_TLS, "MLX5E_TLS", "MLX5 ethernet HW TLS"); /* software TLS context */ @@ -281,6 +302,7 @@ mlx5e_tls_snd_tag_alloc(struct ifnet *ifp, struct m_snd_tag **ppmt) { union if_snd_tag_alloc_params rl_params; + const struct if_snd_tag_sw *snd_tag_sw; struct mlx5e_priv *priv; struct mlx5e_tls_tag *ptag; const struct tls_session_params *en; @@ -384,10 +406,12 @@ mlx5e_tls_snd_tag_alloc(struct ifnet *ifp, case IF_SND_TAG_TYPE_TLS_RATE_LIMIT: rl_params.hdr.type = IF_SND_TAG_TYPE_RATE_LIMIT; rl_params.rate_limit.max_rate = params->tls_rate_limit.max_rate; + snd_tag_sw = &mlx5e_tls_rl_snd_tag_sw; break; #endif case IF_SND_TAG_TYPE_TLS: rl_params.hdr.type = IF_SND_TAG_TYPE_UNLIMITED; + snd_tag_sw = &mlx5e_tls_snd_tag_sw; break; default: error = EOPNOTSUPP; @@ -400,7 +424,7 @@ mlx5e_tls_snd_tag_alloc(struct ifnet *ifp, /* store pointer to mbuf tag */ MPASS(ptag->tag.refcount == 0); - m_snd_tag_init(&ptag->tag, ifp, params->hdr.type); + m_snd_tag_init(&ptag->tag, ifp, snd_tag_sw); *ppmt = &ptag->tag; queue_work(priv->tls.wq, &ptag->work); @@ -413,53 +437,32 @@ failure: return (error); } -int -mlx5e_tls_snd_tag_modify(struct m_snd_tag *pmt, union if_snd_tag_modify_params *params) -{ #ifdef RATELIMIT +static int +mlx5e_tls_rl_snd_tag_modify(struct m_snd_tag *pmt, union if_snd_tag_modify_params *params) +{ union if_snd_tag_modify_params rl_params; struct mlx5e_tls_tag *ptag = container_of(pmt, struct mlx5e_tls_tag, tag); int error; -#endif - switch (pmt->type) { -#ifdef RATELIMIT - case IF_SND_TAG_TYPE_TLS_RATE_LIMIT: - memset(&rl_params, 0, sizeof(rl_params)); - rl_params.rate_limit.max_rate = params->tls_rate_limit.max_rate; - error = ptag->rl_tag->ifp->if_snd_tag_modify(ptag->rl_tag, - &rl_params); - return (error); -#endif - default: - return (EOPNOTSUPP); - } + memset(&rl_params, 0, sizeof(rl_params)); + rl_params.rate_limit.max_rate = params->tls_rate_limit.max_rate; + error = ptag->rl_tag->sw->snd_tag_modify(ptag->rl_tag, &rl_params); + return (error); } +#endif -int +static int mlx5e_tls_snd_tag_query(struct m_snd_tag *pmt, union if_snd_tag_query_params *params) { struct mlx5e_tls_tag *ptag = container_of(pmt, struct mlx5e_tls_tag, tag); - int error; - switch (pmt->type) { -#ifdef RATELIMIT - case IF_SND_TAG_TYPE_TLS_RATE_LIMIT: -#endif - case IF_SND_TAG_TYPE_TLS: - error = ptag->rl_tag->ifp->if_snd_tag_query(ptag->rl_tag, - params); - break; - default: - error = EOPNOTSUPP; - break; - } - return (error); + return (ptag->rl_tag->sw->snd_tag_query(ptag->rl_tag, params)); } -void +static void mlx5e_tls_snd_tag_free(struct m_snd_tag *pmt) { struct mlx5e_tls_tag *ptag = @@ -690,9 +693,9 @@ mlx5e_sq_tls_xmit(struct mlx5e_sq *sq, struct mlx5e_xmit_args *parg, struct mbuf if ( #ifdef RATELIMIT - ptag->type != IF_SND_TAG_TYPE_TLS_RATE_LIMIT && + ptag->sw->type != IF_SND_TAG_TYPE_TLS_RATE_LIMIT && #endif - ptag->type != IF_SND_TAG_TYPE_TLS) + ptag->sw->type != IF_SND_TAG_TYPE_TLS) return (MLX5E_TLS_CONTINUE); ptls_tag = container_of(ptag, struct mlx5e_tls_tag, tag); diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index 40e0d2b0c342..9d8854528d4a 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -36,6 +36,8 @@ #include static int mlx5e_get_wqe_sz(struct mlx5e_priv *priv, u32 *wqe_sz, u32 *nsegs); +static if_snd_tag_query_t mlx5e_ul_snd_tag_query; +static if_snd_tag_free_t mlx5e_ul_snd_tag_free; struct mlx5e_channel_param { struct mlx5e_rq_param rq; @@ -346,6 +348,12 @@ static const struct media mlx5e_ext_mode_table[MLX5E_EXT_LINK_SPEEDS_NUMBER][MLX }, }; +static const struct if_snd_tag_sw mlx5e_ul_snd_tag_sw = { + .snd_tag_query = mlx5e_ul_snd_tag_query, + .snd_tag_free = mlx5e_ul_snd_tag_free, + .type = IF_SND_TAG_TYPE_UNLIMITED +}; + DEBUGNET_DEFINE(mlx5_en); MALLOC_DEFINE(M_MLX5EN, "MLX5EN", "MLX5 Ethernet"); @@ -2113,7 +2121,7 @@ mlx5e_chan_static_init(struct mlx5e_priv *priv, struct mlx5e_channel *c, int ix) c->ix = ix; /* setup send tag */ - m_snd_tag_init(&c->tag, c->priv->ifp, IF_SND_TAG_TYPE_UNLIMITED); + m_snd_tag_init(&c->tag, c->priv->ifp, &mlx5e_ul_snd_tag_sw); init_completion(&c->completion); @@ -4174,7 +4182,7 @@ mlx5e_setup_pauseframes(struct mlx5e_priv *priv) PRIV_UNLOCK(priv); } -int +static int mlx5e_ul_snd_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params, struct m_snd_tag **ppmt) @@ -4216,7 +4224,7 @@ mlx5e_ul_snd_tag_alloc(struct ifnet *ifp, } } -int +static int mlx5e_ul_snd_tag_query(struct m_snd_tag *pmt, union if_snd_tag_query_params *params) { struct mlx5e_channel *pch = @@ -4227,7 +4235,7 @@ mlx5e_ul_snd_tag_query(struct m_snd_tag *pmt, union if_snd_tag_query_params *par return (0); } -void +static void mlx5e_ul_snd_tag_free(struct m_snd_tag *pmt) { struct mlx5e_channel *pch = @@ -4262,52 +4270,6 @@ mlx5e_snd_tag_alloc(struct ifnet *ifp, } } -static int -mlx5e_snd_tag_modify(struct m_snd_tag *pmt, union if_snd_tag_modify_params *params) -{ - - switch (pmt->type) { -#ifdef RATELIMIT - case IF_SND_TAG_TYPE_RATE_LIMIT: - return (mlx5e_rl_snd_tag_modify(pmt, params)); -#ifdef KERN_TLS - case IF_SND_TAG_TYPE_TLS_RATE_LIMIT: - return (mlx5e_tls_snd_tag_modify(pmt, params)); -#endif -#endif - case IF_SND_TAG_TYPE_UNLIMITED: -#ifdef KERN_TLS - case IF_SND_TAG_TYPE_TLS: -#endif - default: - return (EOPNOTSUPP); - } -} - -static int -mlx5e_snd_tag_query(struct m_snd_tag *pmt, union if_snd_tag_query_params *params) -{ - - switch (pmt->type) { -#ifdef RATELIMIT - case IF_SND_TAG_TYPE_RATE_LIMIT: - return (mlx5e_rl_snd_tag_query(pmt, params)); -#ifdef KERN_TLS - case IF_SND_TAG_TYPE_TLS_RATE_LIMIT: - return (mlx5e_tls_snd_tag_query(pmt, params)); -#endif -#endif - case IF_SND_TAG_TYPE_UNLIMITED: - return (mlx5e_ul_snd_tag_query(pmt, params)); -#ifdef KERN_TLS - case IF_SND_TAG_TYPE_TLS: - return (mlx5e_tls_snd_tag_query(pmt, params)); -#endif - default: - return (EOPNOTSUPP); - } -} - #ifdef RATELIMIT #define NUM_HDWR_RATES_MLX 13 static const uint64_t adapter_rates_mlx[NUM_HDWR_RATES_MLX] = { @@ -4352,34 +4314,6 @@ mlx5e_ratelimit_query(struct ifnet *ifp __unused, struct if_ratelimit_query_resu } #endif -static void -mlx5e_snd_tag_free(struct m_snd_tag *pmt) -{ - - switch (pmt->type) { -#ifdef RATELIMIT - case IF_SND_TAG_TYPE_RATE_LIMIT: - mlx5e_rl_snd_tag_free(pmt); - break; -#ifdef KERN_TLS - case IF_SND_TAG_TYPE_TLS_RATE_LIMIT: - mlx5e_tls_snd_tag_free(pmt); - break; -#endif -#endif - case IF_SND_TAG_TYPE_UNLIMITED: - mlx5e_ul_snd_tag_free(pmt); - break; -#ifdef KERN_TLS - case IF_SND_TAG_TYPE_TLS: - mlx5e_tls_snd_tag_free(pmt); - break; -#endif - default: - break; - } -} - static void mlx5e_ifm_add(struct mlx5e_priv *priv, int type) { @@ -4467,9 +4401,6 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) #endif ifp->if_capabilities |= IFCAP_VXLAN_HWCSUM | IFCAP_VXLAN_HWTSO; ifp->if_snd_tag_alloc = mlx5e_snd_tag_alloc; - ifp->if_snd_tag_free = mlx5e_snd_tag_free; - ifp->if_snd_tag_modify = mlx5e_snd_tag_modify; - ifp->if_snd_tag_query = mlx5e_snd_tag_query; #ifdef RATELIMIT ifp->if_ratelimit_query = mlx5e_ratelimit_query; #endif diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c b/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c index 43532c4d0cc0..a95a227e639d 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_rl.c @@ -38,6 +38,16 @@ static void mlx5e_rl_sysctl_add_stats_u64_oid(struct mlx5e_rl_priv_data *rl, uns struct sysctl_oid *node, const char *name, const char *desc); static int mlx5e_rl_tx_limit_add(struct mlx5e_rl_priv_data *, uint64_t value); static int mlx5e_rl_tx_limit_clr(struct mlx5e_rl_priv_data *, uint64_t value); +static if_snd_tag_modify_t mlx5e_rl_snd_tag_modify; +static if_snd_tag_query_t mlx5e_rl_snd_tag_query; +static if_snd_tag_free_t mlx5e_rl_snd_tag_free; + +static const struct if_snd_tag_sw mlx5e_rl_snd_tag_sw = { + .snd_tag_modify = mlx5e_rl_snd_tag_modify, + .snd_tag_query = mlx5e_rl_snd_tag_query, + .snd_tag_free = mlx5e_rl_snd_tag_free, + .type = IF_SND_TAG_TYPE_RATE_LIMIT +}; static void mlx5e_rl_build_sq_param(struct mlx5e_rl_priv_data *rl, @@ -830,7 +840,6 @@ mlx5e_rl_init(struct mlx5e_priv *priv) for (i = 0; i < rl->param.tx_channels_per_worker_def; i++) { struct mlx5e_rl_channel *channel = rlw->channels + i; channel->worker = rlw; - channel->tag.type = IF_SND_TAG_TYPE_RATE_LIMIT; STAILQ_INSERT_TAIL(&rlw->index_list_head, channel, entry); } MLX5E_RL_WORKER_UNLOCK(rlw); @@ -1110,14 +1119,14 @@ mlx5e_rl_snd_tag_alloc(struct ifnet *ifp, /* store pointer to mbuf tag */ MPASS(channel->tag.refcount == 0); - m_snd_tag_init(&channel->tag, ifp, IF_SND_TAG_TYPE_RATE_LIMIT); + m_snd_tag_init(&channel->tag, ifp, &mlx5e_rl_snd_tag_sw); *ppmt = &channel->tag; done: return (error); } -int +static int mlx5e_rl_snd_tag_modify(struct m_snd_tag *pmt, union if_snd_tag_modify_params *params) { struct mlx5e_rl_channel *channel = @@ -1126,7 +1135,7 @@ mlx5e_rl_snd_tag_modify(struct m_snd_tag *pmt, union if_snd_tag_modify_params *p return (mlx5e_rl_modify(channel->worker, channel, params->rate_limit.max_rate)); } -int +static int mlx5e_rl_snd_tag_query(struct m_snd_tag *pmt, union if_snd_tag_query_params *params) { struct mlx5e_rl_channel *channel = @@ -1135,7 +1144,7 @@ mlx5e_rl_snd_tag_query(struct m_snd_tag *pmt, union if_snd_tag_query_params *par return (mlx5e_rl_query(channel->worker, channel, params)); } -void +static void mlx5e_rl_snd_tag_free(struct m_snd_tag *pmt) { struct mlx5e_rl_channel *channel = diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c b/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c index e85522bdfad7..e469482c99bd 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c @@ -98,7 +98,7 @@ mlx5e_select_queue_by_send_tag(struct ifnet *ifp, struct mbuf *mb) top: #endif /* get pointer to sendqueue */ - switch (mb_tag->type) { + switch (mb_tag->sw->type) { #ifdef RATELIMIT case IF_SND_TAG_TYPE_RATE_LIMIT: sq = container_of(mb_tag, diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c index 123985a7dec2..36316f2bc3ff 100644 --- a/sys/kern/kern_mbuf.c +++ b/sys/kern/kern_mbuf.c @@ -1585,13 +1585,14 @@ m_snd_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params, } void -m_snd_tag_init(struct m_snd_tag *mst, struct ifnet *ifp, u_int type) +m_snd_tag_init(struct m_snd_tag *mst, struct ifnet *ifp, + const struct if_snd_tag_sw *sw) { if_ref(ifp); mst->ifp = ifp; refcount_init(&mst->refcount, 1); - mst->type = type; + mst->sw = sw; counter_u64_add(snd_tag_count, 1); } @@ -1601,7 +1602,7 @@ m_snd_tag_destroy(struct m_snd_tag *mst) struct ifnet *ifp; ifp = mst->ifp; - ifp->if_snd_tag_free(mst); + mst->sw->snd_tag_free(mst); if_rele(ifp); counter_u64_add(snd_tag_count, -1); } diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 28fc7a0a97ec..9e9a6b5b60fb 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -1459,7 +1459,6 @@ ktls_modify_txrtlmt(struct ktls_session *tls, uint64_t max_pacing_rate) .rate_limit.flags = M_NOWAIT, }; struct m_snd_tag *mst; - struct ifnet *ifp; /* Can't get to the inp, but it should be locked. */ /* INP_LOCK_ASSERT(inp); */ @@ -1477,11 +1476,10 @@ ktls_modify_txrtlmt(struct ktls_session *tls, uint64_t max_pacing_rate) } MPASS(tls->snd_tag != NULL); - MPASS(tls->snd_tag->type == IF_SND_TAG_TYPE_TLS_RATE_LIMIT); + MPASS(tls->snd_tag->sw->type == IF_SND_TAG_TYPE_TLS_RATE_LIMIT); mst = tls->snd_tag; - ifp = mst->ifp; - return (ifp->if_snd_tag_modify(mst, ¶ms)); + return (mst->sw->snd_tag_modify(mst, ¶ms)); } #endif #endif diff --git a/sys/net/if_dead.c b/sys/net/if_dead.c index b01d17fe9b1b..5721e9490776 100644 --- a/sys/net/if_dead.c +++ b/sys/net/if_dead.c @@ -109,23 +109,6 @@ ifdead_snd_tag_alloc(struct ifnet *ifp, union if_snd_tag_alloc_params *params, return (EOPNOTSUPP); } -static int -ifdead_snd_tag_modify(struct m_snd_tag *pmt, union if_snd_tag_modify_params *params) -{ - return (EOPNOTSUPP); -} - -static int -ifdead_snd_tag_query(struct m_snd_tag *pmt, union if_snd_tag_query_params *params) -{ - return (EOPNOTSUPP); -} - -static void -ifdead_snd_tag_free(struct m_snd_tag *pmt) -{ -} - static void ifdead_ratelimit_query(struct ifnet *ifp __unused, struct if_ratelimit_query_results *q) @@ -156,8 +139,5 @@ if_dead(struct ifnet *ifp) ifp->if_transmit = ifdead_transmit; ifp->if_get_counter = ifdead_get_counter; ifp->if_snd_tag_alloc = ifdead_snd_tag_alloc; - ifp->if_snd_tag_modify = ifdead_snd_tag_modify; - ifp->if_snd_tag_query = ifdead_snd_tag_query; - ifp->if_snd_tag_free = ifdead_snd_tag_free; ifp->if_ratelimit_query = ifdead_ratelimit_query; } diff --git a/sys/net/if_lagg.c b/sys/net/if_lagg.c index c53e5b283b76..8f7900277f01 100644 --- a/sys/net/if_lagg.c +++ b/sys/net/if_lagg.c @@ -583,10 +583,6 @@ lagg_clone_create(struct if_clone *ifc, int unit, caddr_t params) ifp->if_flags = IFF_SIMPLEX | IFF_BROADCAST | IFF_MULTICAST; #if defined(KERN_TLS) || defined(RATELIMIT) ifp->if_snd_tag_alloc = lagg_snd_tag_alloc; - ifp->if_snd_tag_modify = lagg_snd_tag_modify; - ifp->if_snd_tag_query = lagg_snd_tag_query; - ifp->if_snd_tag_free = lagg_snd_tag_free; - ifp->if_next_snd_tag = lagg_next_snd_tag; ifp->if_ratelimit_query = lagg_ratelimit_query; #endif ifp->if_capenable = ifp->if_capabilities = IFCAP_HWSTATS; @@ -1741,6 +1737,44 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) } #if defined(KERN_TLS) || defined(RATELIMIT) +#ifdef RATELIMIT +static const struct if_snd_tag_sw lagg_snd_tag_ul_sw = { + .snd_tag_modify = lagg_snd_tag_modify, + .snd_tag_query = lagg_snd_tag_query, + .snd_tag_free = lagg_snd_tag_free, + .next_snd_tag = lagg_next_snd_tag, + .type = IF_SND_TAG_TYPE_UNLIMITED +}; + +static const struct if_snd_tag_sw lagg_snd_tag_rl_sw = { + .snd_tag_modify = lagg_snd_tag_modify, + .snd_tag_query = lagg_snd_tag_query, + .snd_tag_free = lagg_snd_tag_free, + .next_snd_tag = lagg_next_snd_tag, + .type = IF_SND_TAG_TYPE_RATE_LIMIT +}; +#endif + +#ifdef KERN_TLS +static const struct if_snd_tag_sw lagg_snd_tag_tls_sw = { + .snd_tag_modify = lagg_snd_tag_modify, + .snd_tag_query = lagg_snd_tag_query, + .snd_tag_free = lagg_snd_tag_free, + .next_snd_tag = lagg_next_snd_tag, + .type = IF_SND_TAG_TYPE_TLS +}; + +#ifdef RATELIMIT +static const struct if_snd_tag_sw lagg_snd_tag_tls_rl_sw = { + .snd_tag_modify = lagg_snd_tag_modify, + .snd_tag_query = lagg_snd_tag_query, + .snd_tag_free = lagg_snd_tag_free, + .next_snd_tag = lagg_next_snd_tag, + .type = IF_SND_TAG_TYPE_TLS_RATE_LIMIT +}; +#endif +#endif + static inline struct lagg_snd_tag * mst_to_lst(struct m_snd_tag *mst) { @@ -1796,6 +1830,7 @@ lagg_snd_tag_alloc(struct ifnet *ifp, struct m_snd_tag **ppmt) { struct epoch_tracker et; + const struct if_snd_tag_sw *sw; struct lagg_snd_tag *lst; struct lagg_softc *sc; struct lagg_port *lp; @@ -1804,6 +1839,29 @@ lagg_snd_tag_alloc(struct ifnet *ifp, sc = ifp->if_softc; + switch (params->hdr.type) { +#ifdef RATELIMIT + case IF_SND_TAG_TYPE_UNLIMITED: + sw = &lagg_snd_tag_ul_sw; + break; + case IF_SND_TAG_TYPE_RATE_LIMIT: + sw = &lagg_snd_tag_rl_sw; + break; +#endif +#ifdef KERN_TLS + case IF_SND_TAG_TYPE_TLS: + sw = &lagg_snd_tag_tls_sw; + break; +#ifdef RATELIMIT + case IF_SND_TAG_TYPE_TLS_RATE_LIMIT: + sw = &lagg_snd_tag_tls_rl_sw; + break; +#endif +#endif + default: + return (EOPNOTSUPP); + } + NET_EPOCH_ENTER(et); lp = lookup_snd_tag_port(ifp, params->hdr.flowid, params->hdr.flowtype, params->hdr.numa_domain); @@ -1832,7 +1890,7 @@ lagg_snd_tag_alloc(struct ifnet *ifp, return (error); } - m_snd_tag_init(&lst->com, ifp, lst->tag->type); + m_snd_tag_init(&lst->com, ifp, sw); *ppmt = &lst->com; return (0); @@ -1854,7 +1912,7 @@ lagg_snd_tag_modify(struct m_snd_tag *mst, struct lagg_snd_tag *lst; lst = mst_to_lst(mst); - return (lst->tag->ifp->if_snd_tag_modify(lst->tag, params)); + return (lst->tag->sw->snd_tag_modify(lst->tag, params)); } static int @@ -1864,7 +1922,7 @@ lagg_snd_tag_query(struct m_snd_tag *mst, struct lagg_snd_tag *lst; lst = mst_to_lst(mst); - return (lst->tag->ifp->if_snd_tag_query(lst->tag, params)); + return (lst->tag->sw->snd_tag_query(lst->tag, params)); } static void diff --git a/sys/net/if_var.h b/sys/net/if_var.h index 052ec6b407a0..45fba9513a8b 100644 --- a/sys/net/if_var.h +++ b/sys/net/if_var.h @@ -249,6 +249,21 @@ union if_snd_tag_query_params { struct if_snd_tag_rate_limit_params tls_rate_limit; }; +typedef int (if_snd_tag_alloc_t)(struct ifnet *, union if_snd_tag_alloc_params *, + struct m_snd_tag **); +typedef int (if_snd_tag_modify_t)(struct m_snd_tag *, union if_snd_tag_modify_params *); +typedef int (if_snd_tag_query_t)(struct m_snd_tag *, union if_snd_tag_query_params *); +typedef void (if_snd_tag_free_t)(struct m_snd_tag *); +typedef struct m_snd_tag *(if_next_send_tag_t)(struct m_snd_tag *); + +struct if_snd_tag_sw { + if_snd_tag_modify_t *snd_tag_modify; + if_snd_tag_query_t *snd_tag_query; + if_snd_tag_free_t *snd_tag_free; + if_next_send_tag_t *next_snd_tag; + u_int type; /* One of IF_SND_TAG_TYPE_*. */ +}; + /* Query return flags */ #define RT_NOSUPPORT 0x00000000 /* Not supported */ #define RT_IS_INDIRECT 0x00000001 /* @@ -273,12 +288,6 @@ struct if_ratelimit_query_results { uint32_t min_segment_burst; /* The amount the adapter bursts at each send */ }; -typedef int (if_snd_tag_alloc_t)(struct ifnet *, union if_snd_tag_alloc_params *, - struct m_snd_tag **); -typedef int (if_snd_tag_modify_t)(struct m_snd_tag *, union if_snd_tag_modify_params *); -typedef int (if_snd_tag_query_t)(struct m_snd_tag *, union if_snd_tag_query_params *); -typedef void (if_snd_tag_free_t)(struct m_snd_tag *); -typedef struct m_snd_tag *(if_next_send_tag_t)(struct m_snd_tag *); typedef void (if_ratelimit_query_t)(struct ifnet *, struct if_ratelimit_query_results *); typedef int (if_ratelimit_setup_t)(struct ifnet *, uint64_t, uint32_t); @@ -420,10 +429,8 @@ struct ifnet { * Network adapter send tag support: */ if_snd_tag_alloc_t *if_snd_tag_alloc; - if_snd_tag_modify_t *if_snd_tag_modify; - if_snd_tag_query_t *if_snd_tag_query; - if_snd_tag_free_t *if_snd_tag_free; - if_next_send_tag_t *if_next_snd_tag; + + /* Ratelimit (packet pacing) */ if_ratelimit_query_t *if_ratelimit_query; if_ratelimit_setup_t *if_ratelimit_setup; diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c index 10a254d22440..07c325d0cb12 100644 --- a/sys/net/if_vlan.c +++ b/sys/net/if_vlan.c @@ -336,6 +336,44 @@ VNET_DEFINE_STATIC(struct if_clone *, vlan_cloner); *** 259 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Tue Sep 14 18:56:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2BDAA66EC55; Tue, 14 Sep 2021 18:56:45 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8CHw3lSZz4Wk9; Tue, 14 Sep 2021 18:56:44 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm1-x332.google.com with SMTP id c8-20020a7bc008000000b002e6e462e95fso2938815wmb.2; Tue, 14 Sep 2021 11:56:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=28JPq7X2OaarKyHP4zBBkeheqDsbh7iPF4faibRQIv0=; b=Nhhqoh574cX40tZoEMlUHC9vpt0uwyOUUHtAat+Y3b5kqt7RlJR/Ix1/avGXmGMV7U zs3kZzAy9rrw2rgGD7uZR/XAE2l3ZQgjkNqK0iDR64QhOibKFIXcUEWA5tu2crCZWmVD /zFq1fG+BOqHQl5lr9btSLsM8Owo4vb8lqiTkZmomty4YAgge8WfoIaQXWgXdfnN5qnZ 7sQRXHSpceuRQ0gzVBHSLkKqgdVglRXl70bsOLzoAZmksknhvNT+mK1biQQ1qFWtun97 0iW0b+Rip0KP3aDKJ94h2QJRvIlxqGK2dgrV4POqW2ba0hfH6DDxRva0IXChYz0usEpc NFNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:mime-version:subject:from:in-reply-to :date:cc:content-transfer-encoding:message-id:references:to; bh=28JPq7X2OaarKyHP4zBBkeheqDsbh7iPF4faibRQIv0=; b=bL78VYx/XoVRJE3Nv/JWl/VM554/hKgt8TB8vCP5eHSQb/d/Xkf4m9toD/FJSfjQoR hJuk9L08FG8jAN4vLEmaH4bIIN/WKB9TX0n0OH2Ox5Xysu68FrdmG7DQC2/yhN/IttBW zW5bnxGE+xGprWEmKiYb/PirLMggteO/RgxbMoUGjKNkglMOLWknuMxLmg/iOa+HA4ha 40oAzlm0HuhbyGndFr/VaQ7K3n2txzi3waq1ZwnbDeU2y0If7ONOIZueUo1sesULxFpE CrHP2IFS+NEV7L2w+TuCAbQ+jGZnhIuPKwoMvl4+Cl0i9eYop+UjQOmreyIvejMNJTil XKHg== X-Gm-Message-State: AOAM533SBRcLACED3W23F3VXlsqRlf4qyvcEz1+LJy9G0caN+CTkISjO 58mAZcM1rF6FldHGgTRTD8FX/i1BkQk= X-Google-Smtp-Source: ABdhPJzbs/0tD46Cy1rK0utfbrsKjCs3wM6hlDlDCrPWV7/7Vwhu54HYHH1OqM0Md8xGot6grcCGkA== X-Received: by 2002:a05:600c:b56:: with SMTP id k22mr585239wmr.92.1631645803542; Tue, 14 Sep 2021 11:56:43 -0700 (PDT) Received: from smtpclient.apple (cpc159423-cmbg20-2-0-cust338.5-4.cable.virginm.net. [86.7.147.83]) by smtp.gmail.com with ESMTPSA id i2sm7074632wrq.78.2021.09.14.11.56.42 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 11:56:43 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: ddedf2a11eb2 - main - tzcode: Implement timezone change detection From: Edward Napierala In-Reply-To: <59a39614-45d2-d9b0-a84a-476e52a81c76@FreeBSD.org> Date: Tue, 14 Sep 2021 19:56:42 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202109131442.18DEgDIn043709@gitrepo.freebsd.org> <59a39614-45d2-d9b0-a84a-476e52a81c76@FreeBSD.org> To: Bryan Drewery X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4H8CHw3lSZz4Wk9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=Nhhqoh57; dmarc=none; spf=pass (mx1.freebsd.org: domain of etnapierala@gmail.com designates 2a00:1450:4864:20::332 as permitted sender) smtp.mailfrom=etnapierala@gmail.com X-Spamd-Result: default: False [-2.70 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FORGED_SENDER(0.30)[trasz@freebsd.org,etnapierala@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[86.7.147.83:received]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[trasz@freebsd.org,etnapierala@gmail.com]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::332:from]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 18:56:45 -0000 > On 14 Sep 2021, at 17:39, Bryan Drewery wrote: >=20 > On 9/13/2021 7:42 AM, Edward Tomasz Napierala wrote: >> +#else /* !DETECT_TZ_CHANGES */ >> +#define change_in_tz(X) 0 >=20 > WITHOUT_DETECT_TZ_CHANGES: change_in_tz() =3D=3D 0 >=20 >> +#endif /* !DETECT_TZ_CHANGES */ >> + >> static int >> differ_by_repeat(const time_t t1, const time_t t0) >> { >> @@ -379,6 +418,7 @@ register const int doextend; >> int stored; >> int nread; >> int res; >> + int ret; >> union { >> struct tzhead tzhead; >> char buf[2 * sizeof(struct tzhead) + >> @@ -427,6 +467,22 @@ register const int doextend; >> (void) strcat(fullname, name); >> name =3D fullname; >> } >> + if (doextend =3D=3D TRUE) { >> + /* >> + * Detect if the timezone file has changed. = Check >> + * 'doextend' to ignore TZDEFRULES; the = change_in_tz() >> + * function can only keep state for a single = file. >> + */ >> + ret =3D change_in_tz(name); >> + if (ret <=3D 0) { >=20 > WITHOUT_DETECT_TZ_CHANGES: Always returns a false-positive "done" but > short-circuits the rest of tzload(). >=20 >> + /* >> + * Returns -1 if there was an error, >> + * and 0 if the timezone had not = changed. >> + */ >> + free(fullname); >> + return ret; >> + } >> + } Thanks! No idea how I could miss this. Does = https://reviews.freebsd.org/D31961 look reasonable? From owner-dev-commits-src-all@freebsd.org Tue Sep 14 19:11:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA0C866F1A1; Tue, 14 Sep 2021 19:11:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8CdQ32vqz4bRh; Tue, 14 Sep 2021 19:11:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D2ED20412; Tue, 14 Sep 2021 19:11:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EJBsvF022641; Tue, 14 Sep 2021 19:11:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EJBsMj022640; Tue, 14 Sep 2021 19:11:54 GMT (envelope-from git) Date: Tue, 14 Sep 2021 19:11:54 GMT Message-Id: <202109141911.18EJBsMj022640@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 90f33f34bace - main - Remove a bogus assertion from the gic drivers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 90f33f34baceab33046ee8401153aaafd164bb48 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 19:11:54 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=90f33f34baceab33046ee8401153aaafd164bb48 commit 90f33f34baceab33046ee8401153aaafd164bb48 Author: Andrew Turner AuthorDate: 2021-09-14 19:03:30 +0000 Commit: Andrew Turner CommitDate: 2021-09-14 19:06:25 +0000 Remove a bogus assertion from the gic drivers When setting a message based interrupt range we set the base and count. In an earlier the count was implemented as an end value, however the asserts used to check this value was correct were incorrectly left in. Reported by: emaste Sponsored by: The FreeBSD Foundation --- sys/arm/arm/gic.c | 2 -- sys/arm64/arm64/gic_v3.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/sys/arm/arm/gic.c b/sys/arm/arm/gic.c index bd34e92b9e28..d7edd7885404 100644 --- a/sys/arm/arm/gic.c +++ b/sys/arm/arm/gic.c @@ -538,8 +538,6 @@ arm_gic_write_ivar(device_t dev, device_t child, int which, uintptr_t value) case GIC_IVAR_MBI_COUNT: MPASS(sc->sc_spi_start != 0); MPASS(sc->sc_spi_count == 0); - MPASS(value >= sc->sc_spi_start); - MPASS(value >= GIC_FIRST_SPI); sc->sc_spi_count = value; sc->sc_spi_end = sc->sc_spi_start + sc->sc_spi_count; diff --git a/sys/arm64/arm64/gic_v3.c b/sys/arm64/arm64/gic_v3.c index a53d0b272723..23e1b3632fb8 100644 --- a/sys/arm64/arm64/gic_v3.c +++ b/sys/arm64/arm64/gic_v3.c @@ -506,8 +506,6 @@ gic_v3_write_ivar(device_t dev, device_t child, int which, uintptr_t value) case GIC_IVAR_MBI_COUNT: MPASS(sc->gic_mbi_start != 0); MPASS(sc->gic_mbi_end == 0); - MPASS(value >= sc->gic_mbi_start); - MPASS(value >= GIC_FIRST_SPI); sc->gic_mbi_end = value - sc->gic_mbi_start; From owner-dev-commits-src-all@freebsd.org Tue Sep 14 19:14:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6DC3466F03E; Tue, 14 Sep 2021 19:14:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8Chr2jZFz4cPF; Tue, 14 Sep 2021 19:14:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3DD0A2022F; Tue, 14 Sep 2021 19:14:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EJEqn8023918; Tue, 14 Sep 2021 19:14:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EJEqDW023917; Tue, 14 Sep 2021 19:14:52 GMT (envelope-from git) Date: Tue, 14 Sep 2021 19:14:52 GMT Message-Id: <202109141914.18EJEqDW023917@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 8cba2003e85b - main - Cirrus-CI: add a manually triggered arm64 task MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8cba2003e85b49a482ca623945209ca537374229 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 19:14:52 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8cba2003e85b49a482ca623945209ca537374229 commit 8cba2003e85b49a482ca623945209ca537374229 Author: Ed Maste AuthorDate: 2021-06-23 19:24:36 +0000 Commit: Ed Maste CommitDate: 2021-09-14 19:12:55 +0000 Cirrus-CI: add a manually triggered arm64 task Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31953 --- .cirrus.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 461339f1bfcb..d34f189f0db0 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -11,7 +11,16 @@ compute_engine_instance: disk: 40 task: - name: World and kernel amd64 build and boot smoke test + matrix: + - name: World and kernel amd64 build and boot smoke test + env: + TARGET: amd64 + TARGET_ARCH: amd64 + - name: World and kernel arm64 build and boot smoke test + trigger_type: manual + env: + TARGET: arm64 + TARGET_ARCH: aarch64 timeout_in: 120m install_script: - sh .cirrus-ci/pkg-install.sh qemu llvm12 From owner-dev-commits-src-all@freebsd.org Tue Sep 14 19:52:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E614F66F9D1; Tue, 14 Sep 2021 19:52:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8DXJ65CZz4mXG; Tue, 14 Sep 2021 19:52:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B162B20AB8; Tue, 14 Sep 2021 19:52:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EJqWmk076357; Tue, 14 Sep 2021 19:52:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EJqWa5076356; Tue, 14 Sep 2021 19:52:32 GMT (envelope-from git) Date: Tue, 14 Sep 2021 19:52:32 GMT Message-Id: <202109141952.18EJqWa5076356@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ka Ho Ng Subject: git: 49050613ef1f - main - ctl(4): Do hole-punching for UNMAP to file-backed LUNs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: khng X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 49050613ef1fac244c3cb9767cbdff3d10bee670 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 19:52:33 -0000 The branch main has been updated by khng: URL: https://cgit.FreeBSD.org/src/commit/?id=49050613ef1fac244c3cb9767cbdff3d10bee670 commit 49050613ef1fac244c3cb9767cbdff3d10bee670 Author: Ka Ho Ng AuthorDate: 2021-09-14 19:51:58 +0000 Commit: Ka Ho Ng CommitDate: 2021-09-14 19:51:58 +0000 ctl(4): Do hole-punching for UNMAP to file-backed LUNs This adds support for SCSI UNMAP command to file-backed LUNs, if the underlying file system has a non-zerofilling VOP_DEALLOCATE implementation where some or all parts of the requested operation range may be deallocated. Sponsored by: The FreeBSD Foundation Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D31922 --- sys/cam/ctl/ctl_backend_block.c | 99 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 2 deletions(-) diff --git a/sys/cam/ctl/ctl_backend_block.c b/sys/cam/ctl/ctl_backend_block.c index 83ea6b43dac3..8c126d8be229 100644 --- a/sys/cam/ctl/ctl_backend_block.c +++ b/sys/cam/ctl/ctl_backend_block.c @@ -3,13 +3,16 @@ * * Copyright (c) 2003 Silicon Graphics International Corp. * Copyright (c) 2009-2011 Spectra Logic Corporation - * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2012,2021 The FreeBSD Foundation * Copyright (c) 2014-2015 Alexander Motin * All rights reserved. * * Portions of this software were developed by Edward Tomasz Napierala * under sponsorship from the FreeBSD Foundation. * + * Portions of this software were developed by Ka Ho Ng + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -81,6 +84,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -245,6 +249,8 @@ static void ctl_be_block_gls_file(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio); static uint64_t ctl_be_block_getattr_file(struct ctl_be_block_lun *be_lun, const char *attrname); +static void ctl_be_block_unmap_file(struct ctl_be_block_lun *be_lun, + struct ctl_be_block_io *beio); static void ctl_be_block_flush_dev(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio); static void ctl_be_block_unmap_dev(struct ctl_be_block_lun *be_lun, @@ -854,6 +860,84 @@ ctl_be_block_getattr_file(struct ctl_be_block_lun *be_lun, const char *attrname) return (val); } +static void +ctl_be_block_unmap_file(struct ctl_be_block_lun *be_lun, + struct ctl_be_block_io *beio) +{ + struct ctl_be_block_filedata *file_data; + union ctl_io *io; + struct ctl_ptr_len_flags *ptrlen; + struct scsi_unmap_desc *buf, *end; + struct mount *mp; + off_t off, len; + int error; + + io = beio->io; + file_data = &be_lun->backend.file; + mp = NULL; + error = 0; + + binuptime(&beio->ds_t0); + devstat_start_transaction(be_lun->disk_stats, &beio->ds_t0); + + (void)vn_start_write(be_lun->vn, &mp, V_WAIT); + vn_lock(be_lun->vn, vn_lktype_write(mp, be_lun->vn) | LK_RETRY); + if (beio->io_offset == -1) { + beio->io_len = 0; + ptrlen = (struct ctl_ptr_len_flags *) + &io->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; + buf = (struct scsi_unmap_desc *)ptrlen->ptr; + end = buf + ptrlen->len / sizeof(*buf); + for (; buf < end; buf++) { + off = (off_t)scsi_8btou64(buf->lba) * + be_lun->cbe_lun.blocksize; + len = (off_t)scsi_4btoul(buf->length) * + be_lun->cbe_lun.blocksize; + beio->io_len += len; + error = vn_deallocate(be_lun->vn, &off, &len, + 0, IO_NOMACCHECK | IO_NODELOCKED, file_data->cred, + NOCRED); + if (error != 0) + break; + } + } else { + /* WRITE_SAME */ + off = beio->io_offset; + len = beio->io_len; + error = vn_deallocate(be_lun->vn, &off, &len, 0, + IO_NOMACCHECK | IO_NODELOCKED, file_data->cred, NOCRED); + } + VOP_UNLOCK(be_lun->vn); + vn_finished_write(mp); + + mtx_lock(&be_lun->io_lock); + devstat_end_transaction(beio->lun->disk_stats, beio->io_len, + beio->ds_tag_type, beio->ds_trans_type, + /*now*/ NULL, /*then*/&beio->ds_t0); + mtx_unlock(&be_lun->io_lock); + + /* + * If we got an error, set the sense data to "MEDIUM ERROR" and + * return the I/O to the user. + */ + switch (error) { + case 0: + ctl_set_success(&io->scsiio); + break; + case ENOSPC: + case EDQUOT: + ctl_set_space_alloc_fail(&io->scsiio); + break; + case EROFS: + case EACCES: + ctl_set_hw_write_protected(&io->scsiio); + break; + default: + ctl_set_medium_error(&io->scsiio, false); + } + ctl_complete_beio(beio); +} + static void ctl_be_block_dispatch_zvol(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio) @@ -1804,6 +1888,7 @@ ctl_be_block_open_file(struct ctl_be_block_lun *be_lun, struct ctl_lun_req *req) struct vattr vattr; off_t ps, pss, po, pos, us, uss, uo, uos; int error; + long pconf; cbe_lun = &be_lun->cbe_lun; file_data = &be_lun->backend.file; @@ -1814,7 +1899,7 @@ ctl_be_block_open_file(struct ctl_be_block_lun *be_lun, struct ctl_lun_req *req) be_lun->lun_flush = ctl_be_block_flush_file; be_lun->get_lba_status = ctl_be_block_gls_file; be_lun->getattr = ctl_be_block_getattr_file; - be_lun->unmap = NULL; + be_lun->unmap = ctl_be_block_unmap_file; cbe_lun->flags &= ~CTL_LUN_FLAG_UNMAP; error = VOP_GETATTR(be_lun->vn, &vattr, curthread->td_ucred); @@ -1825,6 +1910,16 @@ ctl_be_block_open_file(struct ctl_be_block_lun *be_lun, struct ctl_lun_req *req) return (error); } + error = VOP_PATHCONF(be_lun->vn, _PC_DEALLOC_PRESENT, &pconf); + if (error != 0) { + snprintf(req->error_str, sizeof(req->error_str), + "error calling VOP_PATHCONF() for file %s", + be_lun->dev_path); + return (error); + } + if (pconf == 1) + cbe_lun->flags |= CTL_LUN_FLAG_UNMAP; + file_data->cred = crhold(curthread->td_ucred); if (params->lun_size_bytes != 0) be_lun->size_bytes = params->lun_size_bytes; From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:01:15 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 268BE66F9EF; Tue, 14 Sep 2021 20:01:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8DkM0Pxxz4pSD; Tue, 14 Sep 2021 20:01:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E318420B46; Tue, 14 Sep 2021 20:01:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EK1Ejf086831; Tue, 14 Sep 2021 20:01:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EK1E6Z086830; Tue, 14 Sep 2021 20:01:14 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:01:14 GMT Message-Id: <202109142001.18EK1E6Z086830@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 8aeafec21afc - stable/13 - pf: remove unused function prototype MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8aeafec21afc2168587201c7c15a04433d3895d6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:01:15 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=8aeafec21afc2168587201c7c15a04433d3895d6 commit 8aeafec21afc2168587201c7c15a04433d3895d6 Author: Kristof Provost AuthorDate: 2021-09-07 12:33:59 +0000 Commit: Kristof Provost CommitDate: 2021-09-14 20:00:24 +0000 pf: remove unused function prototype MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit bb25e36e133bd723d5c5bdecf9f73452d597e100) --- sys/net/pfvar.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 9cd605f659c7..2bd8a613b510 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2079,7 +2079,6 @@ int pf_match_tag(struct mbuf *, struct pf_krule *, int *, int); int pf_tag_packet(struct mbuf *, struct pf_pdesc *, int); int pf_addr_cmp(struct pf_addr *, struct pf_addr *, sa_family_t); -void pf_qid2qname(u_int32_t, char *); u_int16_t pf_get_mss(struct mbuf *, int, u_int16_t, sa_family_t); u_int8_t pf_get_wscale(struct mbuf *, int, u_int16_t, sa_family_t); From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:01:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75CF766FDB4; Tue, 14 Sep 2021 20:01:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8DkN1Gp3z4pf5; Tue, 14 Sep 2021 20:01:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A57920ACB; Tue, 14 Sep 2021 20:01:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EK1FNS086862; Tue, 14 Sep 2021 20:01:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EK1FcL086860; Tue, 14 Sep 2021 20:01:15 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:01:15 GMT Message-Id: <202109142001.18EK1FcL086860@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 34055dacee7f - stable/13 - ipfw: Introduce dnctl MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 34055dacee7fb5c3ab38f226b1930ee32e056551 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:01:16 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=34055dacee7fb5c3ab38f226b1930ee32e056551 commit 34055dacee7fb5c3ab38f226b1930ee32e056551 Author: Kristof Provost AuthorDate: 2021-05-25 14:54:32 +0000 Commit: Kristof Provost CommitDate: 2021-09-14 20:00:24 +0000 ipfw: Introduce dnctl Introduce a link to the ipfw command, dnctl, for dummynet configuration. dnctl only handles dummynet configuration, and is part of the effort to support dummynet in pf. /sbin/ipfw continues to accept pipe, queue and sched commands, but these can now also be issued via the new dnctl command. Reviewed by: donner MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D30465 (cherry picked from commit 0b95680e077b7ef5bc6930c7c0f1a41106251d5d) --- sbin/ipfw/Makefile | 4 + sbin/ipfw/ipfw.8 | 68 ++++++++--------- sbin/ipfw/ipfw2.c | 6 ++ sbin/ipfw/ipfw2.h | 8 ++ sbin/ipfw/main.c | 219 +++++++++++++++++++++++++++++++++-------------------- 5 files changed, 189 insertions(+), 116 deletions(-) diff --git a/sbin/ipfw/Makefile b/sbin/ipfw/Makefile index 552755a16961..c0b7e56226c4 100644 --- a/sbin/ipfw/Makefile +++ b/sbin/ipfw/Makefile @@ -4,6 +4,10 @@ PACKAGE=ipfw PROG= ipfw + +LINKS= ${BINDIR}/ipfw ${BINDIR}/dnctl +MLINKS= ipfw.8 dnctl.8 + SRCS= ipfw2.c dummynet.c ipv6.c main.c nat.c tables.c SRCS+= nat64clat.c nat64lsn.c nat64stl.c nptv6.c diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8 index be3f92f3bd6b..dc895310b638 100644 --- a/sbin/ipfw/ipfw.8 +++ b/sbin/ipfw/ipfw.8 @@ -1,11 +1,11 @@ .\" .\" $FreeBSD$ .\" -.Dd June 4, 2021 +.Dd June 14, 2021 .Dt IPFW 8 .Os .Sh NAME -.Nm ipfw +.Nm ipfw , dnctl .Nd User interface for firewall, traffic shaper, packet scheduler, in-kernel NAT. .Sh SYNOPSIS @@ -88,12 +88,12 @@ in-kernel NAT. .Brq Ar name | all .Cm flush .Ss DUMMYNET CONFIGURATION (TRAFFIC SHAPER AND PACKET SCHEDULER) -.Nm +.Nm dnctl .Brq Cm pipe | queue | sched .Ar number .Cm config .Ar config-options -.Nm +.Nm dnctl .Op Fl s Op Ar field .Brq Cm pipe | queue | sched .Brq Cm delete | list | show @@ -440,7 +440,7 @@ them on the local hostname) and the use of macros to centralize frequently required arguments like IP addresses. .Ss TRAFFIC SHAPER CONFIGURATION The -.Nm +.Nm dnctl .Cm pipe , queue and .Cm sched @@ -2650,11 +2650,11 @@ Bandwidth, measured in A value of 0 (default) means unlimited bandwidth. The unit must immediately follow the number, as in .Pp -.Dl "ipfw pipe 1 config bw 300Kbit/s" +.Dl "dnctl pipe 1 config bw 300Kbit/s" .Pp If a device name is specified instead of a numeric value, as in .Pp -.Dl "ipfw pipe 1 config bw tun0" +.Dl "dnctl pipe 1 config bw tun0" .Pp then the transmit clock is supplied by the specified device. At the moment only the @@ -2731,7 +2731,7 @@ The file format is the following, with whitespace acting as a separator and '#' indicating the beginning a comment: .Bl -tag -width indent .It Cm name Ar identifier -optional name (listed by "ipfw pipe show") +optional name (listed by "dnctl pipe show") to identify the delay distribution; .It Cm bw Ar value the bandwidth used for the pipe. @@ -4356,15 +4356,15 @@ A similar effect can be achieved making use of .Nm dummynet pipes: .Pp -.Dl "ipfw add pipe 10 ip from any to any" -.Dl "ipfw pipe 10 config plr 0.05" +.Dl "dnctl add pipe 10 ip from any to any" +.Dl "dnctl pipe 10 config plr 0.05" .Pp We can use pipes to artificially limit bandwidth, e.g.\& on a machine acting as a router, if we want to limit traffic from local clients on 192.168.2.0/24 we do: .Pp .Dl "ipfw add pipe 1 ip from 192.168.2.0/24 to any out" -.Dl "ipfw pipe 1 config bw 300Kbit/s queue 50KBytes" +.Dl "dnctl pipe 1 config bw 300Kbit/s queue 50KBytes" .Pp note that we use the .Cm out @@ -4378,8 +4378,8 @@ limitations, the correct way is the following: .Pp .Dl "ipfw add pipe 1 ip from any to any out" .Dl "ipfw add pipe 2 ip from any to any in" -.Dl "ipfw pipe 1 config bw 64Kbit/s queue 10Kbytes" -.Dl "ipfw pipe 2 config bw 64Kbit/s queue 10Kbytes" +.Dl "dnctl pipe 1 config bw 64Kbit/s queue 10Kbytes" +.Dl "dnctl pipe 2 config bw 64Kbit/s queue 10Kbytes" .Pp The above can be very useful, e.g.\& if you want to see how your fancy Web page will look for a residential user who @@ -4394,7 +4394,7 @@ Should we want to verify network performance with the RED queue management algorithm: .Pp .Dl "ipfw add pipe 1 ip from any to any" -.Dl "ipfw pipe 1 config bw 500Kbit/s queue 100 red 0.002/30/80/0.1" +.Dl "dnctl pipe 1 config bw 500Kbit/s queue 100 red 0.002/30/80/0.1" .Pp Another typical application of the traffic shaper is to introduce some delay in the communication. @@ -4405,8 +4405,8 @@ bandwidth: .Pp .Dl "ipfw add pipe 1 ip from any to any out" .Dl "ipfw add pipe 2 ip from any to any in" -.Dl "ipfw pipe 1 config delay 250ms bw 1Mbit/s" -.Dl "ipfw pipe 2 config delay 250ms bw 1Mbit/s" +.Dl "dnctl pipe 1 config delay 250ms bw 1Mbit/s" +.Dl "dnctl pipe 2 config delay 250ms bw 1Mbit/s" .Pp Per-flow queueing can be useful for a variety of purposes. A very simple one is counting traffic: @@ -4414,7 +4414,7 @@ A very simple one is counting traffic: .Dl "ipfw add pipe 1 tcp from any to any" .Dl "ipfw add pipe 1 udp from any to any" .Dl "ipfw add pipe 1 ip from any to any" -.Dl "ipfw pipe 1 config mask all" +.Dl "dnctl pipe 1 config mask all" .Pp The above set of rules will create queues (and collect statistics) for all traffic. @@ -4432,8 +4432,8 @@ on a net with per-host limits, rather than per-network limits: .Pp .Dl "ipfw add pipe 1 ip from 192.168.2.0/24 to any out" .Dl "ipfw add pipe 2 ip from any to 192.168.2.0/24 in" -.Dl "ipfw pipe 1 config mask src-ip 0x000000ff bw 200Kbit/s queue 20Kbytes" -.Dl "ipfw pipe 2 config mask dst-ip 0x000000ff bw 200Kbit/s queue 20Kbytes" +.Dl "dnctl pipe 1 config mask src-ip 0x000000ff bw 200Kbit/s queue 20Kbytes" +.Dl "dnctl pipe 2 config mask dst-ip 0x000000ff bw 200Kbit/s queue 20Kbytes" .Ss LOOKUP TABLES In the following example, we need to create several traffic bandwidth classes and we need different hosts/networks to fall into different classes. @@ -4443,8 +4443,8 @@ For each subnet/host we set the argument equal to the number of the pipe that it should use. Then we classify traffic using a single rule: .Pp -.Dl "ipfw pipe 1 config bw 1000Kbyte/s" -.Dl "ipfw pipe 4 config bw 4000Kbyte/s" +.Dl "dnctl pipe 1 config bw 1000Kbyte/s" +.Dl "dnctl pipe 4 config bw 4000Kbyte/s" .Dl "..." .Dl "ipfw table T1 create type addr" .Dl "ipfw table T1 add 192.168.2.0/24 1" @@ -4626,7 +4626,7 @@ with AQM using default configuration for traffic from 192.168.0.0/24 and 1Mbits/s rate limit, we do: .Pp -.Dl "ipfw pipe 1 config bw 1mbits/s codel" +.Dl "dnctl pipe 1 config bw 1mbits/s codel" .Dl "ipfw add 100 pipe 1 ip from 192.168.0.0/24 to any" .Pp To configure a @@ -4636,8 +4636,8 @@ with AQM using different configurations parameters for traffic from 192.168.0.0/24 and 1Mbits/s rate limit, we do: .Pp -.Dl "ipfw pipe 1 config bw 1mbits/s" -.Dl "ipfw queue 1 config pipe 1 codel target 8ms interval 160ms ecn" +.Dl "dnctl pipe 1 config bw 1mbits/s" +.Dl "dnctl queue 1 config pipe 1 codel target 8ms interval 160ms ecn" .Dl "ipfw add 100 queue 1 ip from 192.168.0.0/24 to any" .Pp To configure a @@ -4647,7 +4647,7 @@ with AQM using default configuration for traffic from 192.168.0.0/24 and 1Mbits/s rate limit, we do: .Pp -.Dl "ipfw pipe 1 config bw 1mbits/s pie" +.Dl "dnctl pipe 1 config bw 1mbits/s pie" .Dl "ipfw add 100 pipe 1 ip from 192.168.0.0/24 to any" .Pp To configure a @@ -4657,8 +4657,8 @@ with AQM using different configuration parameters for traffic from 192.168.0.0/24 and 1Mbits/s rate limit, we do: .Pp -.Dl "ipfw pipe 1 config bw 1mbits/s" -.Dl "ipfw queue 1 config pipe 1 pie target 20ms tupdate 30ms ecn" +.Dl "dnctl pipe 1 config bw 1mbits/s" +.Dl "dnctl queue 1 config pipe 1 pie target 20ms tupdate 30ms ecn" .Dl "ipfw add 100 queue 1 ip from 192.168.0.0/24 to any" .Pp .Cm fq_codel @@ -4673,9 +4673,9 @@ To configure scheduler using different configurations parameters for traffic from 192.168.0.0/24 and 1Mbits/s rate limit, we do: .Pp -.Dl "ipfw pipe 1 config bw 1mbits/s" -.Dl "ipfw sched 1 config pipe 1 type fq_codel" -.Dl "ipfw queue 1 config sched 1" +.Dl "dnctl pipe 1 config bw 1mbits/s" +.Dl "dnctl sched 1 config pipe 1 type fq_codel" +.Dl "dnctl queue 1 config sched 1" .Dl "ipfw add 100 queue 1 ip from 192.168.0.0/24 to any" .Pp To change @@ -4686,7 +4686,7 @@ such as disable ECN and change the .Ar target to 10ms, we do: .Pp -.Dl "ipfw sched 1 config pipe 1 type fq_codel target 10ms noecn" +.Dl "dnctl sched 1 config pipe 1 type fq_codel target 10ms noecn" .Pp Similar to .Cm fq_codel , @@ -4695,9 +4695,9 @@ to configure scheduler using different configurations parameters for traffic from 192.168.0.0/24 and 1Mbits/s rate limit, we do: .Pp -.Dl "ipfw pipe 1 config bw 1mbits/s" -.Dl "ipfw sched 1 config pipe 1 type fq_pie" -.Dl "ipfw queue 1 config sched 1" +.Dl "dnctl pipe 1 config bw 1mbits/s" +.Dl "dnctl sched 1 config pipe 1 type fq_pie" +.Dl "dnctl queue 1 config sched 1" .Dl "ipfw add 100 queue 1 ip from 192.168.0.0/24 to any" .Pp The configurations of diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index deb46fc64e00..e210cbfd02ec 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -411,6 +411,12 @@ static void object_sort_ctlv(ipfw_obj_ctlv *ctlv); static char *object_search_ctlv(ipfw_obj_ctlv *ctlv, uint16_t idx, uint16_t type); +int +is_ipfw(void) +{ + return (g_co.prog == cmdline_prog_ipfw); +} + /* * Simple string buffer API. * Used to simplify buffer passing between function and for diff --git a/sbin/ipfw/ipfw2.h b/sbin/ipfw/ipfw2.h index 42e4f4777792..9a39c215692d 100644 --- a/sbin/ipfw/ipfw2.h +++ b/sbin/ipfw/ipfw2.h @@ -20,6 +20,11 @@ * $FreeBSD$ */ +enum cmdline_prog { + cmdline_prog_ipfw, + cmdline_prog_dnctl +}; + /* * Options that can be set on the command line. * When reading commands from a file, a subset of the options can also @@ -54,8 +59,11 @@ struct cmdline_opts { uint32_t use_set; /* work with specified set number */ /* 0 means all sets, otherwise apply to set use_set - 1 */ + enum cmdline_prog prog; /* Are we ipfw or dnctl? */ }; +int is_ipfw(void); + enum { TIMESTAMP_NONE = 0, TIMESTAMP_STRING, diff --git a/sbin/ipfw/main.c b/sbin/ipfw/main.c index 89f21062811c..f7aa6af5369c 100644 --- a/sbin/ipfw/main.c +++ b/sbin/ipfw/main.c @@ -36,7 +36,8 @@ static void help(void) { - fprintf(stderr, + if (is_ipfw()) { + fprintf(stderr, "ipfw syntax summary (but please do read the ipfw(8) manpage):\n\n" "\tipfw [-abcdefhnNqStTv] \n\n" "where is one of the following:\n\n" @@ -76,6 +77,16 @@ help(void) " setup | {tcpack|tcpseq|tcpwin} NN | tcpflags SPEC | tcpoptions SPEC |\n" " tcpdatalen LIST | verrevpath | versrcreach | antispoof\n" ); + } else { + fprintf(stderr, +"dnctl syntax summary (but please do read the dnctl(8) manpage):\n\n" +"\tdnctl [-hnsv] \n\n" +"where is one of the following:\n\n" +"[pipe|queue|sched] N config PIPE-BODY\n" +"[pipe|queue|sched] {delete|list|show} [N{,N}]\n" +"\n" +); + } exit(0); } @@ -231,7 +242,8 @@ ipfw_main(int oldac, char **oldav) g_co.do_force = !isatty(STDIN_FILENO); #ifdef EMULATE_SYSCTL /* sysctl emulation */ - if ( ac >= 2 && !strcmp(av[1], "sysctl")) { + if (is_ipfw() && ac >= 2 && + !strcmp(av[1], "sysctl")) { char *s; int i; @@ -263,87 +275,115 @@ ipfw_main(int oldac, char **oldav) save_av = av; optind = optreset = 1; /* restart getopt() */ - while ((ch = getopt(ac, av, "abcdDefhinNp:qs:STtv")) != -1) - switch (ch) { - case 'a': - do_acct = 1; - break; + if (is_ipfw()) { + while ((ch = getopt(ac, av, "abcdDefhinNp:qs:STtv")) != -1) + switch (ch) { + case 'a': + do_acct = 1; + break; - case 'b': - g_co.comment_only = 1; - g_co.do_compact = 1; - break; + case 'b': + g_co.comment_only = 1; + g_co.do_compact = 1; + break; - case 'c': - g_co.do_compact = 1; - break; + case 'c': + g_co.do_compact = 1; + break; - case 'd': - g_co.do_dynamic = 1; - break; + case 'd': + g_co.do_dynamic = 1; + break; - case 'D': - g_co.do_dynamic = 2; - break; + case 'D': + g_co.do_dynamic = 2; + break; - case 'e': - /* nop for compatibility */ - break; + case 'e': + /* nop for compatibility */ + break; - case 'f': - g_co.do_force = 1; - break; + case 'f': + g_co.do_force = 1; + break; - case 'h': /* help */ - free(save_av); - help(); - break; /* NOTREACHED */ + case 'h': /* help */ + free(save_av); + help(); + break; /* NOTREACHED */ - case 'i': - g_co.do_value_as_ip = 1; - break; + case 'i': + g_co.do_value_as_ip = 1; + break; - case 'n': - g_co.test_only = 1; - break; + case 'n': + g_co.test_only = 1; + break; - case 'N': - g_co.do_resolv = 1; - break; + case 'N': + g_co.do_resolv = 1; + break; - case 'p': - errx(EX_USAGE, "An absolute pathname must be used " - "with -p option."); - /* NOTREACHED */ + case 'p': + errx(EX_USAGE, "An absolute pathname must be used " + "with -p option."); + /* NOTREACHED */ - case 'q': - g_co.do_quiet = 1; - break; + case 'q': + g_co.do_quiet = 1; + break; - case 's': /* sort */ - g_co.do_sort = atoi(optarg); - break; + case 's': /* sort */ + g_co.do_sort = atoi(optarg); + break; - case 'S': - g_co.show_sets = 1; - break; + case 'S': + g_co.show_sets = 1; + break; - case 't': - g_co.do_time = TIMESTAMP_STRING; - break; + case 't': + g_co.do_time = TIMESTAMP_STRING; + break; - case 'T': - g_co.do_time = TIMESTAMP_NUMERIC; - break; + case 'T': + g_co.do_time = TIMESTAMP_NUMERIC; + break; - case 'v': /* verbose */ - g_co.verbose = 1; - break; + case 'v': /* verbose */ + g_co.verbose = 1; + break; - default: - free(save_av); - return 1; - } + default: + free(save_av); + return 1; + } + } else { + while ((ch = getopt(ac, av, "hns:v")) != -1) + switch (ch) { + + case 'h': /* help */ + free(save_av); + help(); + break; /* NOTREACHED */ + + case 'n': + g_co.test_only = 1; + break; + + case 's': /* sort */ + g_co.do_sort = atoi(optarg); + break; + + case 'v': /* verbose */ + g_co.verbose = 1; + break; + + default: + free(save_av); + return 1; + } + + } ac -= optind; av += optind; @@ -367,7 +407,7 @@ ipfw_main(int oldac, char **oldav) g_co.do_nat = 0; g_co.do_pipe = 0; g_co.use_set = 0; - if (!strncmp(*av, "nat", strlen(*av))) + if (is_ipfw() && !strncmp(*av, "nat", strlen(*av))) g_co.do_nat = 1; else if (!strncmp(*av, "pipe", strlen(*av))) g_co.do_pipe = 1; @@ -377,7 +417,7 @@ ipfw_main(int oldac, char **oldav) g_co.do_pipe = 2; else if (_substrcmp(*av, "sched") == 0) g_co.do_pipe = 3; - else if (!strncmp(*av, "set", strlen(*av))) { + else if (is_ipfw() && !strncmp(*av, "set", strlen(*av))) { if (ac > 1 && isdigit(av[1][0])) { g_co.use_set = strtonum(av[1], 0, resvd_set_number, &errstr); @@ -406,8 +446,12 @@ ipfw_main(int oldac, char **oldav) av[1] = p; } + if (! is_ipfw() && g_co.do_pipe == 0) { + help(); + } + if (g_co.use_set == 0) { - if (_substrcmp(*av, "add") == 0) + if (is_ipfw() && _substrcmp(*av, "add") == 0) ipfw_add(av); else if (g_co.do_nat && _substrcmp(*av, "show") == 0) ipfw_show_nat(ac, av); @@ -415,13 +459,13 @@ ipfw_main(int oldac, char **oldav) ipfw_config_pipe(ac, av); else if (g_co.do_nat && _substrcmp(*av, "config") == 0) ipfw_config_nat(ac, av); - else if (_substrcmp(*av, "set") == 0) + else if (is_ipfw() && _substrcmp(*av, "set") == 0) ipfw_sets_handler(av); - else if (_substrcmp(*av, "table") == 0) + else if (is_ipfw() && _substrcmp(*av, "table") == 0) ipfw_table_handler(ac, av); - else if (_substrcmp(*av, "enable") == 0) + else if (is_ipfw() && _substrcmp(*av, "enable") == 0) ipfw_sysctl_handler(av, 1); - else if (_substrcmp(*av, "disable") == 0) + else if (is_ipfw() && _substrcmp(*av, "disable") == 0) ipfw_sysctl_handler(av, 0); else try_next = 1; @@ -430,28 +474,28 @@ ipfw_main(int oldac, char **oldav) if (g_co.use_set || try_next) { if (_substrcmp(*av, "delete") == 0) ipfw_delete(av); - else if (!strncmp(*av, "nat64clat", strlen(*av))) + else if (is_ipfw() && !strncmp(*av, "nat64clat", strlen(*av))) ipfw_nat64clat_handler(ac, av); - else if (!strncmp(*av, "nat64stl", strlen(*av))) + else if (is_ipfw() && !strncmp(*av, "nat64stl", strlen(*av))) ipfw_nat64stl_handler(ac, av); - else if (!strncmp(*av, "nat64lsn", strlen(*av))) + else if (is_ipfw() && !strncmp(*av, "nat64lsn", strlen(*av))) ipfw_nat64lsn_handler(ac, av); - else if (!strncmp(*av, "nptv6", strlen(*av))) + else if (is_ipfw() && !strncmp(*av, "nptv6", strlen(*av))) ipfw_nptv6_handler(ac, av); else if (_substrcmp(*av, "flush") == 0) ipfw_flush(g_co.do_force); - else if (_substrcmp(*av, "zero") == 0) + else if (is_ipfw() && _substrcmp(*av, "zero") == 0) ipfw_zero(ac, av, 0 /* IP_FW_ZERO */); - else if (_substrcmp(*av, "resetlog") == 0) + else if (is_ipfw() && _substrcmp(*av, "resetlog") == 0) ipfw_zero(ac, av, 1 /* IP_FW_RESETLOG */); else if (_substrcmp(*av, "print") == 0 || _substrcmp(*av, "list") == 0) ipfw_list(ac, av, do_acct); else if (_substrcmp(*av, "show") == 0) ipfw_list(ac, av, 1 /* show counters */); - else if (_substrcmp(*av, "table") == 0) + else if (is_ipfw() && _substrcmp(*av, "table") == 0) ipfw_table_handler(ac, av); - else if (_substrcmp(*av, "internal") == 0) + else if (is_ipfw() && _substrcmp(*av, "internal") == 0) ipfw_internal_handler(ac, av); else errx(EX_USAGE, "bad command `%s'", *av); @@ -620,12 +664,22 @@ main(int ac, char *av[]) } } #endif + + if (strcmp(av[0], "dnctl") == 0) + g_co.prog = cmdline_prog_dnctl; + else + g_co.prog = cmdline_prog_ipfw; + /* * If the last argument is an absolute pathname, interpret it * as a file to be preprocessed. */ if (ac > 1 && av[ac - 1][0] == '/') { + if (! is_ipfw()) + errx(EX_USAGE, "usage: dnctl [options]\n" + "do \"dnctl -h\" for details"); + if (access(av[ac - 1], R_OK) == 0) ipfw_readfile(ac, av); else @@ -633,8 +687,9 @@ main(int ac, char *av[]) } else { if (ipfw_main(ac, av)) { errx(EX_USAGE, - "usage: ipfw [options]\n" - "do \"ipfw -h\" or \"man ipfw\" for details"); + "usage: %s [options]\n" + "do \"%s -h\" or \"man %s\" for details", av[0], + av[0], av[0]); } } return EX_OK; From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:01:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B080166FEAA; Tue, 14 Sep 2021 20:01:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8DkP3Jdpz4phP; Tue, 14 Sep 2021 20:01:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F46D20B48; Tue, 14 Sep 2021 20:01:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EK1HRr086893; Tue, 14 Sep 2021 20:01:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EK1HZP086892; Tue, 14 Sep 2021 20:01:17 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:01:17 GMT Message-Id: <202109142001.18EK1HZP086892@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: c7e240092435 - stable/13 - dummynet tests: pipe test for IPv6 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c7e240092435d713981f45ddc615bf876d607a76 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:01:17 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c7e240092435d713981f45ddc615bf876d607a76 commit c7e240092435d713981f45ddc615bf876d607a76 Author: Kristof Provost AuthorDate: 2021-06-14 19:24:59 +0000 Commit: Kristof Provost CommitDate: 2021-09-14 20:00:24 +0000 dummynet tests: pipe test for IPv6 MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31787 (cherry picked from commit 5fda5913e16afac72f3f420e227803e33d4c1542) --- tests/sys/netpfil/common/dummynet.sh | 44 ++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tests/sys/netpfil/common/dummynet.sh b/tests/sys/netpfil/common/dummynet.sh index 82cd22b77fef..42fbd83f297e 100644 --- a/tests/sys/netpfil/common/dummynet.sh +++ b/tests/sys/netpfil/common/dummynet.sh @@ -70,6 +70,50 @@ pipe_cleanup() firewall_cleanup $1 } +pipe_v6_head() +{ + atf_set descr 'Basic IPv6 pipe test' + atf_set require.user root +} + +pipe_v6_body() +{ + fw=$1 + firewall_init $fw + dummynet_init $fw + + epair=$(vnet_mkepair) + vnet_mkjail alcatraz ${epair}b + + ifconfig ${epair}a inet6 2001:db8:42::1/64 up no_dad + jexec alcatraz ifconfig ${epair}b inet6 2001:db8:42::2/64 up no_dad + + # Sanity check + atf_check -s exit:0 -o ignore ping6 -i .1 -c 3 -s 1200 2001:db8:42::2 + + jexec alcatraz dnctl pipe 1 config bw 100Byte/s + + firewall_config alcatraz ${fw} \ + "ipfw" \ + "ipfw add 1000 pipe 1 ip6 from any to any" + + # Single ping succeeds + atf_check -s exit:0 -o ignore ping6 -c 1 2001:db8:42::2 + + # Saturate the link + ping6 -i .1 -c 5 -s 1200 2001:db8:42::2 + + # We should now be hitting the limit and get this packet dropped. + atf_check -s exit:2 -o ignore ping6 -c 1 -s 1200 2001:db8:42::2 +} + +pipe_v6_cleanup() +{ + firewall_cleanup $1 +} + setup_tests \ pipe \ + ipfw \ + pipe_v6 \ ipfw From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:01:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 07C7466FE48; Tue, 14 Sep 2021 20:01:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8DkQ4TPfz4phW; Tue, 14 Sep 2021 20:01:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57CFD20863; Tue, 14 Sep 2021 20:01:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EK1I4u086938; Tue, 14 Sep 2021 20:01:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EK1IiI086930; Tue, 14 Sep 2021 20:01:18 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:01:18 GMT Message-Id: <202109142001.18EK1IiI086930@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 7674a7e404da - stable/13 - netpfil tests: dummynet queue test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7674a7e404da8f106dbffe98c6f2947b9e9161c7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:01:19 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=7674a7e404da8f106dbffe98c6f2947b9e9161c7 commit 7674a7e404da8f106dbffe98c6f2947b9e9161c7 Author: Kristof Provost AuthorDate: 2021-09-02 13:38:04 +0000 Commit: Kristof Provost CommitDate: 2021-09-14 20:00:25 +0000 netpfil tests: dummynet queue test Test prioritisation and dummynet queues. We need to give the pipe sufficient bandwidth for dummynet to work. Given that we can't rely on the TCP connection failing alltogether, but we can measure the effect of dummynet by imposing a time limit on a larger data transfer. If TCP is prioritised it'll get most of the pipe bandwidth and easily manage to transfer the data in 3 seconds or less. When not prioritised this will not succeed. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31788 (cherry picked from commit cb6bfef9ca78623e33d2aef347dcee112a639103) --- tests/sys/netpfil/common/dummynet.sh | 104 +++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/tests/sys/netpfil/common/dummynet.sh b/tests/sys/netpfil/common/dummynet.sh index 42fbd83f297e..4b3d01e124eb 100644 --- a/tests/sys/netpfil/common/dummynet.sh +++ b/tests/sys/netpfil/common/dummynet.sh @@ -112,8 +112,112 @@ pipe_v6_cleanup() firewall_cleanup $1 } +queue_head() +{ + atf_set descr 'Basic queue test' + atf_set require.user root +} + +queue_body() +{ + fw=$1 + firewall_init $fw + dummynet_init $fw + + epair=$(vnet_mkepair) + vnet_mkjail alcatraz ${epair}b + + ifconfig ${epair}a 192.0.2.1/24 up + jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up + jexec alcatraz /usr/sbin/inetd -p inetd-alcatraz.pid \ + $(atf_get_srcdir)/../pf/echo_inetd.conf + + # Sanity check + atf_check -s exit:0 -o ignore ping -i .1 -c 3 -s 1200 192.0.2.2 + reply=$(echo "foo" | nc -N 192.0.2.2 7) + if [ "$reply" != "foo" ]; + then + atf_fail "Echo sanity check failed" + fi + + jexec alcatraz dnctl pipe 1 config bw 1MByte/s + jexec alcatraz dnctl sched 1 config pipe 1 type wf2q+ + jexec alcatraz dnctl queue 100 config sched 1 weight 99 mask all + jexec alcatraz dnctl queue 200 config sched 1 weight 1 mask all + + firewall_config alcatraz ${fw} \ + "ipfw" \ + "ipfw add 1000 queue 100 tcp from 192.0.2.2 to any out" \ + "ipfw add 1001 queue 200 icmp from 192.0.2.2 to any out" \ + "ipfw add 1002 allow ip from any to any" + + # Single ping succeeds + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2 + + # Unsaturated TCP succeeds + reply=$(echo "foo" | nc -w 5 -N 192.0.2.2 7) + if [ "$reply" != "foo" ]; + then + atf_fail "Unsaturated echo failed" + fi + + # Saturate the link + ping -f -s 1300 192.0.2.2 & + + # Allow this to fill the queue + sleep 1 + + # TCP should still just pass + fails=0 + for i in `seq 1 3` + do + result=$(dd if=/dev/zero bs=1024 count=2000 | timeout 3 nc -w 5 -N 192.0.2.2 7 | wc -c) + if [ $result -ne 2048000 ]; + then + echo "Failed to prioritise TCP traffic. Got only $result bytes" + fails=$(( ${fails} + 1 )) + fi + done + if [ ${fails} -gt 0 ]; + then + atf_fail "We failed prioritisation ${fails} times" + fi + + # This will fail if we reverse the pola^W priority + firewall_config alcatraz ${fw} \ + "ipfw" \ + "ipfw add 1000 queue 200 tcp from 192.0.2.2 to any out" \ + "ipfw add 1001 queue 100 icmp from 192.0.2.2 to any out" \ + "ipfw add 1002 allow ip from any to any" + + jexec alcatraz ping -f -s 1300 192.0.2.1 & + sleep 1 + + fails=0 + for i in `seq 1 3` + do + result=$(dd if=/dev/zero bs=1024 count=2000 | timeout 3 nc -w 5 -N 192.0.2.2 7 | wc -c) + if [ $result -ne 2048000 ]; + then + echo "Failed to prioritise TCP traffic. Got only $result bytes" + fails=$(( ${fails} + 1 )) + fi + done + if [ ${fails} -lt 3 ]; + then + atf_fail "We failed reversed prioritisation only ${fails} times." + fi +} + +queue_cleanup() +{ + firewall_cleanup $1 +} + setup_tests \ pipe \ ipfw \ pipe_v6 \ + ipfw \ + queue \ ipfw From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:01:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DADFA66FE4F; Tue, 14 Sep 2021 20:01:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8DkR5DqHz4phZ; Tue, 14 Sep 2021 20:01:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6DAF020864; Tue, 14 Sep 2021 20:01:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EK1JSq088371; Tue, 14 Sep 2021 20:01:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EK1Jb5088357; Tue, 14 Sep 2021 20:01:19 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:01:19 GMT Message-Id: <202109142001.18EK1Jb5088357@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: d14ea58c22a8 - stable/13 - netpfil tests: IPv6 dummynet queue test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d14ea58c22a8fdb3572d1bcf94981aee2531e322 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:01:20 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=d14ea58c22a8fdb3572d1bcf94981aee2531e322 commit d14ea58c22a8fdb3572d1bcf94981aee2531e322 Author: Kristof Provost AuthorDate: 2021-09-02 13:40:51 +0000 Commit: Kristof Provost CommitDate: 2021-09-14 20:00:25 +0000 netpfil tests: IPv6 dummynet queue test Same as the v4 test, but with IPv6. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31789 (cherry picked from commit 12184311c16160464a36ae05b1cd8c5e3c24fbaa) --- tests/sys/netpfil/common/dummynet.sh | 107 +++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/tests/sys/netpfil/common/dummynet.sh b/tests/sys/netpfil/common/dummynet.sh index 4b3d01e124eb..7ff9a1e18fdc 100644 --- a/tests/sys/netpfil/common/dummynet.sh +++ b/tests/sys/netpfil/common/dummynet.sh @@ -214,10 +214,117 @@ queue_cleanup() firewall_cleanup $1 } +queue_v6_head() +{ + atf_set descr 'Basic queue test' + atf_set require.user root +} + +queue_v6_body() +{ + fw=$1 + firewall_init $fw + dummynet_init $fw + + epair=$(vnet_mkepair) + vnet_mkjail alcatraz ${epair}b + + ifconfig ${epair}a inet6 2001:db8:42::1/64 no_dad up + jexec alcatraz ifconfig ${epair}b inet6 2001:db8:42::2 no_dad up + jexec alcatraz /usr/sbin/inetd -p inetd-alcatraz.pid \ + $(atf_get_srcdir)/../pf/echo_inetd.conf + + # Sanity check + atf_check -s exit:0 -o ignore ping6 -i .1 -c 3 -s 1200 2001:db8:42::2 + reply=$(echo "foo" | nc -N 2001:db8:42::2 7) + if [ "$reply" != "foo" ]; + then + atf_fail "Echo sanity check failed" + fi + + jexec alcatraz dnctl pipe 1 config bw 1MByte/s + jexec alcatraz dnctl sched 1 config pipe 1 type wf2q+ + jexec alcatraz dnctl queue 100 config sched 1 weight 99 mask all + jexec alcatraz dnctl queue 200 config sched 1 weight 1 mask all + + firewall_config alcatraz ${fw} \ + "ipfw" \ + "ipfw add 1001 queue 100 tcp from 2001:db8:42::2 to any out" \ + "ipfw add 1000 queue 200 ipv6-icmp from 2001:db8:42::2 to any out" \ + "ipfw add 1002 allow ip6 from any to any" \ + "pf" \ + "pass out proto tcp dnqueue 100" \ + "pass out proto icmp6 dnqueue 200" + + # Single ping succeeds + atf_check -s exit:0 -o ignore ping6 -c 1 2001:db8:42::2 + + # Unsaturated TCP succeeds + reply=$(echo "foo" | nc -w 5 -N 2001:db8:42::2 7) + if [ "$reply" != "foo" ]; + then + atf_fail "Unsaturated echo failed" + fi + + # Saturate the link + ping6 -f -s 1200 2001:db8:42::2 & + + # Allow this to fill the queue + sleep 1 + + # TCP should still just pass + fails=0 + for i in `seq 1 3` + do + result=$(dd if=/dev/zero bs=1024 count=1000 | timeout 3 nc -w 5 -N 2001:db8:42::2 7 | wc -c) + if [ $result -ne 1024000 ]; + then + echo "Failed to prioritise TCP traffic. Got only $result bytes" + fails=$(( ${fails} + 1 )) + fi + done + if [ ${fails} -gt 0 ]; + then + atf_fail "We failed prioritisation ${fails} times" + fi + + # What happens if we prioritise ICMP over TCP? + firewall_config alcatraz ${fw} \ + "ipfw" \ + "ipfw add 1001 queue 200 tcp from 2001:db8:42::2 to any out" \ + "ipfw add 1000 queue 100 ipv6-icmp from 2001:db8:42::2 to any out" \ + "ipfw add 1002 allow ip6 from any to any" \ + "pf" \ + "pass out proto tcp dnqueue 200" \ + "pass out proto icmp6 dnqueue 100" + + fails=0 + for i in `seq 1 3` + do + result=$(dd if=/dev/zero bs=1024 count=1000 | timeout 3 nc -w 5 -N 2001:db8:42::2 7 | wc -c) + if [ $result -ne 1024000 ]; + then + echo "Failed to prioritise TCP traffic. Got only $result bytes" + fails=$(( ${fails} + 1 )) + fi + done + if [ ${fails} -lt 3 ]; + then + atf_fail "We failed reversed prioritisation only ${fails} times." + fi +} + +queue_v6_cleanup() +{ + firewall_cleanup $1 +} + setup_tests \ pipe \ ipfw \ pipe_v6 \ ipfw \ queue \ + ipfw \ + queue_v6 \ ipfw From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:01:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C6A766FBC7; Tue, 14 Sep 2021 20:01:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8DkS69csz4pR2; Tue, 14 Sep 2021 20:01:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 914E2209DE; Tue, 14 Sep 2021 20:01:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EK1Kgu089341; Tue, 14 Sep 2021 20:01:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EK1KrG089340; Tue, 14 Sep 2021 20:01:20 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:01:20 GMT Message-Id: <202109142001.18EK1KrG089340@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 13b194766e24 - stable/13 - dummynet: remove unused definitions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 13b194766e24099de0f406eb7fe5d34d6f4cfa72 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:01:21 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=13b194766e24099de0f406eb7fe5d34d6f4cfa72 commit 13b194766e24099de0f406eb7fe5d34d6f4cfa72 Author: Kristof Provost AuthorDate: 2021-06-16 14:52:25 +0000 Commit: Kristof Provost CommitDate: 2021-09-14 20:00:25 +0000 dummynet: remove unused definitions No functional change. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31806 (cherry picked from commit 415e81d5d9ed7a73825d371c0b538765fa57a801) --- sys/netpfil/ipfw/ip_dn_private.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sys/netpfil/ipfw/ip_dn_private.h b/sys/netpfil/ipfw/ip_dn_private.h index 8dedd071bd81..cc084f2fcc0d 100644 --- a/sys/netpfil/ipfw/ip_dn_private.h +++ b/sys/netpfil/ipfw/ip_dn_private.h @@ -77,15 +77,7 @@ MALLOC_DECLARE(M_DUMMYNET); #define DN_BH_WUNLOCK() mtx_unlock(&V_dn_cfg.uh_mtx) #define DN_BH_LOCK_ASSERT() mtx_assert(&V_dn_cfg.uh_mtx, MA_OWNED) -SLIST_HEAD(dn_schk_head, dn_schk); -SLIST_HEAD(dn_sch_inst_head, dn_sch_inst); SLIST_HEAD(dn_fsk_head, dn_fsk); -SLIST_HEAD(dn_queue_head, dn_queue); -SLIST_HEAD(dn_alg_head, dn_alg); - -#ifdef NEW_AQM -SLIST_HEAD(dn_aqm_head, dn_aqm); /* for new AQMs */ -#endif struct mq { /* a basic queue of packets*/ struct mbuf *head, *tail; From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:01:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1EE1066FDC6; Tue, 14 Sep 2021 20:01:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8Dkg6xB1z4pcc; Tue, 14 Sep 2021 20:01:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAFB2208BC; Tue, 14 Sep 2021 20:01:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EK1V1w089535; Tue, 14 Sep 2021 20:01:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EK1VNC089534; Tue, 14 Sep 2021 20:01:31 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:01:31 GMT Message-Id: <202109142001.18EK1VNC089534@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: dc9a98e8ef73 - stable/12 - pf: remove unused function prototype MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: dc9a98e8ef7304696c1740e12c38c99e8a2aa5f0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:01:32 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=dc9a98e8ef7304696c1740e12c38c99e8a2aa5f0 commit dc9a98e8ef7304696c1740e12c38c99e8a2aa5f0 Author: Kristof Provost AuthorDate: 2021-09-07 12:33:59 +0000 Commit: Kristof Provost CommitDate: 2021-09-14 08:16:00 +0000 pf: remove unused function prototype MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit bb25e36e133bd723d5c5bdecf9f73452d597e100) --- sys/net/pfvar.h | 1 - 1 file changed, 1 deletion(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 3433f3790fd7..ffa90555c52e 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -2080,7 +2080,6 @@ int pf_match_tag(struct mbuf *, struct pf_krule *, int *, int); int pf_tag_packet(struct mbuf *, struct pf_pdesc *, int); int pf_addr_cmp(struct pf_addr *, struct pf_addr *, sa_family_t); -void pf_qid2qname(u_int32_t, char *); u_int16_t pf_get_mss(struct mbuf *, int, u_int16_t, sa_family_t); u_int8_t pf_get_wscale(struct mbuf *, int, u_int16_t, sa_family_t); From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:01:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 563A666FDCD; Tue, 14 Sep 2021 20:01:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8Dkj0gWCz4png; Tue, 14 Sep 2021 20:01:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D93A5208BE; Tue, 14 Sep 2021 20:01:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EK1WYo089563; Tue, 14 Sep 2021 20:01:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EK1Wki089562; Tue, 14 Sep 2021 20:01:32 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:01:32 GMT Message-Id: <202109142001.18EK1Wki089562@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 18fecda93605 - stable/12 - ipfw: Introduce dnctl MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 18fecda9360530bd616af5181554122db111d96b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:01:33 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=18fecda9360530bd616af5181554122db111d96b commit 18fecda9360530bd616af5181554122db111d96b Author: Kristof Provost AuthorDate: 2021-05-25 14:54:32 +0000 Commit: Kristof Provost CommitDate: 2021-09-14 08:16:02 +0000 ipfw: Introduce dnctl Introduce a link to the ipfw command, dnctl, for dummynet configuration. dnctl only handles dummynet configuration, and is part of the effort to support dummynet in pf. /sbin/ipfw continues to accept pipe, queue and sched commands, but these can now also be issued via the new dnctl command. Reviewed by: donner MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D30465 (cherry picked from commit 0b95680e077b7ef5bc6930c7c0f1a41106251d5d) --- sbin/ipfw/Makefile | 4 + sbin/ipfw/ipfw.8 | 68 ++++++++--------- sbin/ipfw/ipfw2.c | 6 ++ sbin/ipfw/ipfw2.h | 8 ++ sbin/ipfw/main.c | 219 +++++++++++++++++++++++++++++++++-------------------- 5 files changed, 189 insertions(+), 116 deletions(-) diff --git a/sbin/ipfw/Makefile b/sbin/ipfw/Makefile index 552755a16961..c0b7e56226c4 100644 --- a/sbin/ipfw/Makefile +++ b/sbin/ipfw/Makefile @@ -4,6 +4,10 @@ PACKAGE=ipfw PROG= ipfw + +LINKS= ${BINDIR}/ipfw ${BINDIR}/dnctl +MLINKS= ipfw.8 dnctl.8 + SRCS= ipfw2.c dummynet.c ipv6.c main.c nat.c tables.c SRCS+= nat64clat.c nat64lsn.c nat64stl.c nptv6.c diff --git a/sbin/ipfw/ipfw.8 b/sbin/ipfw/ipfw.8 index be3f92f3bd6b..dc895310b638 100644 --- a/sbin/ipfw/ipfw.8 +++ b/sbin/ipfw/ipfw.8 @@ -1,11 +1,11 @@ .\" .\" $FreeBSD$ .\" -.Dd June 4, 2021 +.Dd June 14, 2021 .Dt IPFW 8 .Os .Sh NAME -.Nm ipfw +.Nm ipfw , dnctl .Nd User interface for firewall, traffic shaper, packet scheduler, in-kernel NAT. .Sh SYNOPSIS @@ -88,12 +88,12 @@ in-kernel NAT. .Brq Ar name | all .Cm flush .Ss DUMMYNET CONFIGURATION (TRAFFIC SHAPER AND PACKET SCHEDULER) -.Nm +.Nm dnctl .Brq Cm pipe | queue | sched .Ar number .Cm config .Ar config-options -.Nm +.Nm dnctl .Op Fl s Op Ar field .Brq Cm pipe | queue | sched .Brq Cm delete | list | show @@ -440,7 +440,7 @@ them on the local hostname) and the use of macros to centralize frequently required arguments like IP addresses. .Ss TRAFFIC SHAPER CONFIGURATION The -.Nm +.Nm dnctl .Cm pipe , queue and .Cm sched @@ -2650,11 +2650,11 @@ Bandwidth, measured in A value of 0 (default) means unlimited bandwidth. The unit must immediately follow the number, as in .Pp -.Dl "ipfw pipe 1 config bw 300Kbit/s" +.Dl "dnctl pipe 1 config bw 300Kbit/s" .Pp If a device name is specified instead of a numeric value, as in .Pp -.Dl "ipfw pipe 1 config bw tun0" +.Dl "dnctl pipe 1 config bw tun0" .Pp then the transmit clock is supplied by the specified device. At the moment only the @@ -2731,7 +2731,7 @@ The file format is the following, with whitespace acting as a separator and '#' indicating the beginning a comment: .Bl -tag -width indent .It Cm name Ar identifier -optional name (listed by "ipfw pipe show") +optional name (listed by "dnctl pipe show") to identify the delay distribution; .It Cm bw Ar value the bandwidth used for the pipe. @@ -4356,15 +4356,15 @@ A similar effect can be achieved making use of .Nm dummynet pipes: .Pp -.Dl "ipfw add pipe 10 ip from any to any" -.Dl "ipfw pipe 10 config plr 0.05" +.Dl "dnctl add pipe 10 ip from any to any" +.Dl "dnctl pipe 10 config plr 0.05" .Pp We can use pipes to artificially limit bandwidth, e.g.\& on a machine acting as a router, if we want to limit traffic from local clients on 192.168.2.0/24 we do: .Pp .Dl "ipfw add pipe 1 ip from 192.168.2.0/24 to any out" -.Dl "ipfw pipe 1 config bw 300Kbit/s queue 50KBytes" +.Dl "dnctl pipe 1 config bw 300Kbit/s queue 50KBytes" .Pp note that we use the .Cm out @@ -4378,8 +4378,8 @@ limitations, the correct way is the following: .Pp .Dl "ipfw add pipe 1 ip from any to any out" .Dl "ipfw add pipe 2 ip from any to any in" -.Dl "ipfw pipe 1 config bw 64Kbit/s queue 10Kbytes" -.Dl "ipfw pipe 2 config bw 64Kbit/s queue 10Kbytes" +.Dl "dnctl pipe 1 config bw 64Kbit/s queue 10Kbytes" +.Dl "dnctl pipe 2 config bw 64Kbit/s queue 10Kbytes" .Pp The above can be very useful, e.g.\& if you want to see how your fancy Web page will look for a residential user who @@ -4394,7 +4394,7 @@ Should we want to verify network performance with the RED queue management algorithm: .Pp .Dl "ipfw add pipe 1 ip from any to any" -.Dl "ipfw pipe 1 config bw 500Kbit/s queue 100 red 0.002/30/80/0.1" +.Dl "dnctl pipe 1 config bw 500Kbit/s queue 100 red 0.002/30/80/0.1" .Pp Another typical application of the traffic shaper is to introduce some delay in the communication. @@ -4405,8 +4405,8 @@ bandwidth: .Pp .Dl "ipfw add pipe 1 ip from any to any out" .Dl "ipfw add pipe 2 ip from any to any in" -.Dl "ipfw pipe 1 config delay 250ms bw 1Mbit/s" -.Dl "ipfw pipe 2 config delay 250ms bw 1Mbit/s" +.Dl "dnctl pipe 1 config delay 250ms bw 1Mbit/s" +.Dl "dnctl pipe 2 config delay 250ms bw 1Mbit/s" .Pp Per-flow queueing can be useful for a variety of purposes. A very simple one is counting traffic: @@ -4414,7 +4414,7 @@ A very simple one is counting traffic: .Dl "ipfw add pipe 1 tcp from any to any" .Dl "ipfw add pipe 1 udp from any to any" .Dl "ipfw add pipe 1 ip from any to any" -.Dl "ipfw pipe 1 config mask all" +.Dl "dnctl pipe 1 config mask all" .Pp The above set of rules will create queues (and collect statistics) for all traffic. @@ -4432,8 +4432,8 @@ on a net with per-host limits, rather than per-network limits: .Pp .Dl "ipfw add pipe 1 ip from 192.168.2.0/24 to any out" .Dl "ipfw add pipe 2 ip from any to 192.168.2.0/24 in" -.Dl "ipfw pipe 1 config mask src-ip 0x000000ff bw 200Kbit/s queue 20Kbytes" -.Dl "ipfw pipe 2 config mask dst-ip 0x000000ff bw 200Kbit/s queue 20Kbytes" +.Dl "dnctl pipe 1 config mask src-ip 0x000000ff bw 200Kbit/s queue 20Kbytes" +.Dl "dnctl pipe 2 config mask dst-ip 0x000000ff bw 200Kbit/s queue 20Kbytes" .Ss LOOKUP TABLES In the following example, we need to create several traffic bandwidth classes and we need different hosts/networks to fall into different classes. @@ -4443,8 +4443,8 @@ For each subnet/host we set the argument equal to the number of the pipe that it should use. Then we classify traffic using a single rule: .Pp -.Dl "ipfw pipe 1 config bw 1000Kbyte/s" -.Dl "ipfw pipe 4 config bw 4000Kbyte/s" +.Dl "dnctl pipe 1 config bw 1000Kbyte/s" +.Dl "dnctl pipe 4 config bw 4000Kbyte/s" .Dl "..." .Dl "ipfw table T1 create type addr" .Dl "ipfw table T1 add 192.168.2.0/24 1" @@ -4626,7 +4626,7 @@ with AQM using default configuration for traffic from 192.168.0.0/24 and 1Mbits/s rate limit, we do: .Pp -.Dl "ipfw pipe 1 config bw 1mbits/s codel" +.Dl "dnctl pipe 1 config bw 1mbits/s codel" .Dl "ipfw add 100 pipe 1 ip from 192.168.0.0/24 to any" .Pp To configure a @@ -4636,8 +4636,8 @@ with AQM using different configurations parameters for traffic from 192.168.0.0/24 and 1Mbits/s rate limit, we do: .Pp -.Dl "ipfw pipe 1 config bw 1mbits/s" -.Dl "ipfw queue 1 config pipe 1 codel target 8ms interval 160ms ecn" +.Dl "dnctl pipe 1 config bw 1mbits/s" +.Dl "dnctl queue 1 config pipe 1 codel target 8ms interval 160ms ecn" .Dl "ipfw add 100 queue 1 ip from 192.168.0.0/24 to any" .Pp To configure a @@ -4647,7 +4647,7 @@ with AQM using default configuration for traffic from 192.168.0.0/24 and 1Mbits/s rate limit, we do: .Pp -.Dl "ipfw pipe 1 config bw 1mbits/s pie" +.Dl "dnctl pipe 1 config bw 1mbits/s pie" .Dl "ipfw add 100 pipe 1 ip from 192.168.0.0/24 to any" .Pp To configure a @@ -4657,8 +4657,8 @@ with AQM using different configuration parameters for traffic from 192.168.0.0/24 and 1Mbits/s rate limit, we do: .Pp -.Dl "ipfw pipe 1 config bw 1mbits/s" -.Dl "ipfw queue 1 config pipe 1 pie target 20ms tupdate 30ms ecn" +.Dl "dnctl pipe 1 config bw 1mbits/s" +.Dl "dnctl queue 1 config pipe 1 pie target 20ms tupdate 30ms ecn" .Dl "ipfw add 100 queue 1 ip from 192.168.0.0/24 to any" .Pp .Cm fq_codel @@ -4673,9 +4673,9 @@ To configure scheduler using different configurations parameters for traffic from 192.168.0.0/24 and 1Mbits/s rate limit, we do: .Pp -.Dl "ipfw pipe 1 config bw 1mbits/s" -.Dl "ipfw sched 1 config pipe 1 type fq_codel" -.Dl "ipfw queue 1 config sched 1" +.Dl "dnctl pipe 1 config bw 1mbits/s" +.Dl "dnctl sched 1 config pipe 1 type fq_codel" +.Dl "dnctl queue 1 config sched 1" .Dl "ipfw add 100 queue 1 ip from 192.168.0.0/24 to any" .Pp To change @@ -4686,7 +4686,7 @@ such as disable ECN and change the .Ar target to 10ms, we do: .Pp -.Dl "ipfw sched 1 config pipe 1 type fq_codel target 10ms noecn" +.Dl "dnctl sched 1 config pipe 1 type fq_codel target 10ms noecn" .Pp Similar to .Cm fq_codel , @@ -4695,9 +4695,9 @@ to configure scheduler using different configurations parameters for traffic from 192.168.0.0/24 and 1Mbits/s rate limit, we do: .Pp -.Dl "ipfw pipe 1 config bw 1mbits/s" -.Dl "ipfw sched 1 config pipe 1 type fq_pie" -.Dl "ipfw queue 1 config sched 1" +.Dl "dnctl pipe 1 config bw 1mbits/s" +.Dl "dnctl sched 1 config pipe 1 type fq_pie" +.Dl "dnctl queue 1 config sched 1" .Dl "ipfw add 100 queue 1 ip from 192.168.0.0/24 to any" .Pp The configurations of diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index feb55b403f0a..6239674f108b 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -411,6 +411,12 @@ static void object_sort_ctlv(ipfw_obj_ctlv *ctlv); static char *object_search_ctlv(ipfw_obj_ctlv *ctlv, uint16_t idx, uint16_t type); +int +is_ipfw(void) +{ + return (g_co.prog == cmdline_prog_ipfw); +} + /* * Simple string buffer API. * Used to simplify buffer passing between function and for diff --git a/sbin/ipfw/ipfw2.h b/sbin/ipfw/ipfw2.h index 42e4f4777792..9a39c215692d 100644 --- a/sbin/ipfw/ipfw2.h +++ b/sbin/ipfw/ipfw2.h @@ -20,6 +20,11 @@ * $FreeBSD$ */ +enum cmdline_prog { + cmdline_prog_ipfw, + cmdline_prog_dnctl +}; + /* * Options that can be set on the command line. * When reading commands from a file, a subset of the options can also @@ -54,8 +59,11 @@ struct cmdline_opts { uint32_t use_set; /* work with specified set number */ /* 0 means all sets, otherwise apply to set use_set - 1 */ + enum cmdline_prog prog; /* Are we ipfw or dnctl? */ }; +int is_ipfw(void); + enum { TIMESTAMP_NONE = 0, TIMESTAMP_STRING, diff --git a/sbin/ipfw/main.c b/sbin/ipfw/main.c index 89f21062811c..f7aa6af5369c 100644 --- a/sbin/ipfw/main.c +++ b/sbin/ipfw/main.c @@ -36,7 +36,8 @@ static void help(void) { - fprintf(stderr, + if (is_ipfw()) { + fprintf(stderr, "ipfw syntax summary (but please do read the ipfw(8) manpage):\n\n" "\tipfw [-abcdefhnNqStTv] \n\n" "where is one of the following:\n\n" @@ -76,6 +77,16 @@ help(void) " setup | {tcpack|tcpseq|tcpwin} NN | tcpflags SPEC | tcpoptions SPEC |\n" " tcpdatalen LIST | verrevpath | versrcreach | antispoof\n" ); + } else { + fprintf(stderr, +"dnctl syntax summary (but please do read the dnctl(8) manpage):\n\n" +"\tdnctl [-hnsv] \n\n" +"where is one of the following:\n\n" +"[pipe|queue|sched] N config PIPE-BODY\n" +"[pipe|queue|sched] {delete|list|show} [N{,N}]\n" +"\n" +); + } exit(0); } @@ -231,7 +242,8 @@ ipfw_main(int oldac, char **oldav) g_co.do_force = !isatty(STDIN_FILENO); #ifdef EMULATE_SYSCTL /* sysctl emulation */ - if ( ac >= 2 && !strcmp(av[1], "sysctl")) { + if (is_ipfw() && ac >= 2 && + !strcmp(av[1], "sysctl")) { char *s; int i; @@ -263,87 +275,115 @@ ipfw_main(int oldac, char **oldav) save_av = av; optind = optreset = 1; /* restart getopt() */ - while ((ch = getopt(ac, av, "abcdDefhinNp:qs:STtv")) != -1) - switch (ch) { - case 'a': - do_acct = 1; - break; + if (is_ipfw()) { + while ((ch = getopt(ac, av, "abcdDefhinNp:qs:STtv")) != -1) + switch (ch) { + case 'a': + do_acct = 1; + break; - case 'b': - g_co.comment_only = 1; - g_co.do_compact = 1; - break; + case 'b': + g_co.comment_only = 1; + g_co.do_compact = 1; + break; - case 'c': - g_co.do_compact = 1; - break; + case 'c': + g_co.do_compact = 1; + break; - case 'd': - g_co.do_dynamic = 1; - break; + case 'd': + g_co.do_dynamic = 1; + break; - case 'D': - g_co.do_dynamic = 2; - break; + case 'D': + g_co.do_dynamic = 2; + break; - case 'e': - /* nop for compatibility */ - break; + case 'e': + /* nop for compatibility */ + break; - case 'f': - g_co.do_force = 1; - break; + case 'f': + g_co.do_force = 1; + break; - case 'h': /* help */ - free(save_av); - help(); - break; /* NOTREACHED */ + case 'h': /* help */ + free(save_av); + help(); + break; /* NOTREACHED */ - case 'i': - g_co.do_value_as_ip = 1; - break; + case 'i': + g_co.do_value_as_ip = 1; + break; - case 'n': - g_co.test_only = 1; - break; + case 'n': + g_co.test_only = 1; + break; - case 'N': - g_co.do_resolv = 1; - break; + case 'N': + g_co.do_resolv = 1; + break; - case 'p': - errx(EX_USAGE, "An absolute pathname must be used " - "with -p option."); - /* NOTREACHED */ + case 'p': + errx(EX_USAGE, "An absolute pathname must be used " + "with -p option."); + /* NOTREACHED */ - case 'q': - g_co.do_quiet = 1; - break; + case 'q': + g_co.do_quiet = 1; + break; - case 's': /* sort */ - g_co.do_sort = atoi(optarg); - break; + case 's': /* sort */ + g_co.do_sort = atoi(optarg); + break; - case 'S': - g_co.show_sets = 1; - break; + case 'S': + g_co.show_sets = 1; + break; - case 't': - g_co.do_time = TIMESTAMP_STRING; - break; + case 't': + g_co.do_time = TIMESTAMP_STRING; + break; - case 'T': - g_co.do_time = TIMESTAMP_NUMERIC; - break; + case 'T': + g_co.do_time = TIMESTAMP_NUMERIC; + break; - case 'v': /* verbose */ - g_co.verbose = 1; - break; + case 'v': /* verbose */ + g_co.verbose = 1; + break; - default: - free(save_av); - return 1; - } + default: + free(save_av); + return 1; + } + } else { + while ((ch = getopt(ac, av, "hns:v")) != -1) + switch (ch) { + + case 'h': /* help */ + free(save_av); + help(); + break; /* NOTREACHED */ + + case 'n': + g_co.test_only = 1; + break; + + case 's': /* sort */ + g_co.do_sort = atoi(optarg); + break; + + case 'v': /* verbose */ + g_co.verbose = 1; + break; + + default: + free(save_av); + return 1; + } + + } ac -= optind; av += optind; @@ -367,7 +407,7 @@ ipfw_main(int oldac, char **oldav) g_co.do_nat = 0; g_co.do_pipe = 0; g_co.use_set = 0; - if (!strncmp(*av, "nat", strlen(*av))) + if (is_ipfw() && !strncmp(*av, "nat", strlen(*av))) g_co.do_nat = 1; else if (!strncmp(*av, "pipe", strlen(*av))) g_co.do_pipe = 1; @@ -377,7 +417,7 @@ ipfw_main(int oldac, char **oldav) g_co.do_pipe = 2; else if (_substrcmp(*av, "sched") == 0) g_co.do_pipe = 3; - else if (!strncmp(*av, "set", strlen(*av))) { + else if (is_ipfw() && !strncmp(*av, "set", strlen(*av))) { if (ac > 1 && isdigit(av[1][0])) { g_co.use_set = strtonum(av[1], 0, resvd_set_number, &errstr); @@ -406,8 +446,12 @@ ipfw_main(int oldac, char **oldav) av[1] = p; } + if (! is_ipfw() && g_co.do_pipe == 0) { + help(); + } + if (g_co.use_set == 0) { - if (_substrcmp(*av, "add") == 0) + if (is_ipfw() && _substrcmp(*av, "add") == 0) ipfw_add(av); else if (g_co.do_nat && _substrcmp(*av, "show") == 0) ipfw_show_nat(ac, av); @@ -415,13 +459,13 @@ ipfw_main(int oldac, char **oldav) ipfw_config_pipe(ac, av); else if (g_co.do_nat && _substrcmp(*av, "config") == 0) ipfw_config_nat(ac, av); - else if (_substrcmp(*av, "set") == 0) + else if (is_ipfw() && _substrcmp(*av, "set") == 0) ipfw_sets_handler(av); - else if (_substrcmp(*av, "table") == 0) + else if (is_ipfw() && _substrcmp(*av, "table") == 0) ipfw_table_handler(ac, av); - else if (_substrcmp(*av, "enable") == 0) + else if (is_ipfw() && _substrcmp(*av, "enable") == 0) ipfw_sysctl_handler(av, 1); - else if (_substrcmp(*av, "disable") == 0) + else if (is_ipfw() && _substrcmp(*av, "disable") == 0) ipfw_sysctl_handler(av, 0); else try_next = 1; @@ -430,28 +474,28 @@ ipfw_main(int oldac, char **oldav) if (g_co.use_set || try_next) { if (_substrcmp(*av, "delete") == 0) ipfw_delete(av); - else if (!strncmp(*av, "nat64clat", strlen(*av))) + else if (is_ipfw() && !strncmp(*av, "nat64clat", strlen(*av))) ipfw_nat64clat_handler(ac, av); - else if (!strncmp(*av, "nat64stl", strlen(*av))) + else if (is_ipfw() && !strncmp(*av, "nat64stl", strlen(*av))) ipfw_nat64stl_handler(ac, av); - else if (!strncmp(*av, "nat64lsn", strlen(*av))) + else if (is_ipfw() && !strncmp(*av, "nat64lsn", strlen(*av))) ipfw_nat64lsn_handler(ac, av); - else if (!strncmp(*av, "nptv6", strlen(*av))) + else if (is_ipfw() && !strncmp(*av, "nptv6", strlen(*av))) ipfw_nptv6_handler(ac, av); else if (_substrcmp(*av, "flush") == 0) ipfw_flush(g_co.do_force); - else if (_substrcmp(*av, "zero") == 0) + else if (is_ipfw() && _substrcmp(*av, "zero") == 0) ipfw_zero(ac, av, 0 /* IP_FW_ZERO */); - else if (_substrcmp(*av, "resetlog") == 0) + else if (is_ipfw() && _substrcmp(*av, "resetlog") == 0) ipfw_zero(ac, av, 1 /* IP_FW_RESETLOG */); else if (_substrcmp(*av, "print") == 0 || _substrcmp(*av, "list") == 0) ipfw_list(ac, av, do_acct); else if (_substrcmp(*av, "show") == 0) ipfw_list(ac, av, 1 /* show counters */); - else if (_substrcmp(*av, "table") == 0) + else if (is_ipfw() && _substrcmp(*av, "table") == 0) ipfw_table_handler(ac, av); - else if (_substrcmp(*av, "internal") == 0) + else if (is_ipfw() && _substrcmp(*av, "internal") == 0) ipfw_internal_handler(ac, av); else errx(EX_USAGE, "bad command `%s'", *av); @@ -620,12 +664,22 @@ main(int ac, char *av[]) } } #endif + + if (strcmp(av[0], "dnctl") == 0) + g_co.prog = cmdline_prog_dnctl; + else + g_co.prog = cmdline_prog_ipfw; + /* * If the last argument is an absolute pathname, interpret it * as a file to be preprocessed. */ if (ac > 1 && av[ac - 1][0] == '/') { + if (! is_ipfw()) + errx(EX_USAGE, "usage: dnctl [options]\n" + "do \"dnctl -h\" for details"); + if (access(av[ac - 1], R_OK) == 0) ipfw_readfile(ac, av); else @@ -633,8 +687,9 @@ main(int ac, char *av[]) } else { if (ipfw_main(ac, av)) { errx(EX_USAGE, - "usage: ipfw [options]\n" - "do \"ipfw -h\" or \"man ipfw\" for details"); + "usage: %s [options]\n" + "do \"%s -h\" or \"man %s\" for details", av[0], + av[0], av[0]); } } return EX_OK; From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:01:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1216766FD2B; Tue, 14 Sep 2021 20:01:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8Dkl0cttz4pjR; Tue, 14 Sep 2021 20:01:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08C2820B4C; Tue, 14 Sep 2021 20:01:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EK1XLh089590; Tue, 14 Sep 2021 20:01:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EK1Xq1089589; Tue, 14 Sep 2021 20:01:33 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:01:33 GMT Message-Id: <202109142001.18EK1Xq1089589@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 99721d9dbbc0 - stable/12 - dummynet: remove unused definitions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 99721d9dbbc0a086b7f5376059286a46e6e698b1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:01:36 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=99721d9dbbc0a086b7f5376059286a46e6e698b1 commit 99721d9dbbc0a086b7f5376059286a46e6e698b1 Author: Kristof Provost AuthorDate: 2021-06-16 14:52:25 +0000 Commit: Kristof Provost CommitDate: 2021-09-14 08:17:30 +0000 dummynet: remove unused definitions No functional change. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31806 (cherry picked from commit 415e81d5d9ed7a73825d371c0b538765fa57a801) --- sys/netpfil/ipfw/ip_dn_private.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sys/netpfil/ipfw/ip_dn_private.h b/sys/netpfil/ipfw/ip_dn_private.h index 8f8fca5fbd58..d33e0823f204 100644 --- a/sys/netpfil/ipfw/ip_dn_private.h +++ b/sys/netpfil/ipfw/ip_dn_private.h @@ -77,15 +77,7 @@ MALLOC_DECLARE(M_DUMMYNET); #define DN_BH_WUNLOCK() mtx_unlock(&V_dn_cfg.uh_mtx) #define DN_BH_LOCK_ASSERT() mtx_assert(&V_dn_cfg.uh_mtx, MA_OWNED) -SLIST_HEAD(dn_schk_head, dn_schk); -SLIST_HEAD(dn_sch_inst_head, dn_sch_inst); SLIST_HEAD(dn_fsk_head, dn_fsk); -SLIST_HEAD(dn_queue_head, dn_queue); -SLIST_HEAD(dn_alg_head, dn_alg); - -#ifdef NEW_AQM -SLIST_HEAD(dn_aqm_head, dn_aqm); /* for new AQMs */ -#endif struct mq { /* a basic queue of packets*/ struct mbuf *head, *tail; From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:01:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 52CCF66FDEF; Tue, 14 Sep 2021 20:01:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8Dkn3SBDz4pwQ; Tue, 14 Sep 2021 20:01:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F34C20A36; Tue, 14 Sep 2021 20:01:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EK1ad2089638; Tue, 14 Sep 2021 20:01:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EK1aYg089637; Tue, 14 Sep 2021 20:01:36 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:01:36 GMT Message-Id: <202109142001.18EK1aYg089637@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: b10cd461a58b - stable/12 - Add basic NAT test for pf, ipf and ipfw MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: b10cd461a58bb3b8b80ae1405d9c88d2af74d547 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:01:38 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b10cd461a58bb3b8b80ae1405d9c88d2af74d547 commit b10cd461a58bb3b8b80ae1405d9c88d2af74d547 Author: Tom Jones AuthorDate: 2019-08-17 06:44:11 +0000 Commit: Kristof Provost CommitDate: 2021-09-14 08:27:23 +0000 Add basic NAT test for pf, ipf and ipfw Add common firewall NAT tests for pf, ipf and ipfw (using both in-kernel and userspace NAT). Submitted by: Ahsan Barkati Sponsored by: Google, Inc. (GSoC 2019) Reviewed by: kp Approved by: bz (mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D21199 (cherry picked from commit 0d9da68f01510ae4c5bb33b744f1e0b3711c7fb9) --- tests/sys/netpfil/common/Makefile | 4 +- tests/sys/netpfil/common/nat.sh | 156 ++++++++++++++++++++++++++++++++++++ tests/sys/netpfil/common/utils.subr | 18 ++++- 3 files changed, 173 insertions(+), 5 deletions(-) diff --git a/tests/sys/netpfil/common/Makefile b/tests/sys/netpfil/common/Makefile index a4c135dbce08..9e1efc924c6e 100644 --- a/tests/sys/netpfil/common/Makefile +++ b/tests/sys/netpfil/common/Makefile @@ -4,7 +4,9 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/netpfil/common -ATF_TESTS_SH+= pass_block +ATF_TESTS_SH+= \ + nat \ + pass_block ${PACKAGE}FILES+= \ pft_ping.py \ diff --git a/tests/sys/netpfil/common/nat.sh b/tests/sys/netpfil/common/nat.sh new file mode 100644 index 000000000000..f74467dce062 --- /dev/null +++ b/tests/sys/netpfil/common/nat.sh @@ -0,0 +1,156 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2019 Ahsan Barkati +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +. $(atf_get_srcdir)/utils.subr +. $(atf_get_srcdir)/runner.subr + +basic_head() +{ + atf_set descr 'Basic IPv4 NAT test' + atf_set require.user root +} + +basic_body() +{ + firewall=$1 + firewall_init $firewall + nat_init $firewall + + epair_host_nat=$(vnet_mkepair) + epair_client1_nat=$(vnet_mkepair) + epair_client2_nat=$(vnet_mkepair) + + vnet_mkjail nat ${epair_host_nat}b ${epair_client1_nat}a ${epair_client2_nat}a + vnet_mkjail client1 ${epair_client1_nat}b + vnet_mkjail client2 ${epair_client2_nat}b + + ifconfig ${epair_host_nat}a 198.51.100.2/24 up + jexec nat ifconfig ${epair_host_nat}b 198.51.100.1/24 up + + jexec nat ifconfig ${epair_client1_nat}a 192.0.2.1/24 up + jexec client1 ifconfig ${epair_client1_nat}b 192.0.2.2/24 up + + jexec nat ifconfig ${epair_client2_nat}a 192.0.3.1/24 up + jexec client2 ifconfig ${epair_client2_nat}b 192.0.3.2/24 up + + jexec nat sysctl net.inet.ip.forwarding=1 + + jexec client1 route add -net 198.51.100.0/24 192.0.2.1 + jexec client2 route add -net 198.51.100.0/24 192.0.3.1 + + # ping fails without NAT configuration + atf_check -s exit:2 -o ignore jexec client1 ping -t 1 -c 1 198.51.100.2 + atf_check -s exit:2 -o ignore jexec client2 ping -t 1 -c 1 198.51.100.2 + + firewall_config nat ${firewall} \ + "pf" \ + "nat pass on ${epair_host_nat}b inet from any to any -> (${epair_host_nat}b)" \ + "ipfw" \ + "ipfw -q nat 123 config if ${epair_host_nat}b" \ + "ipfw -q add 1000 nat 123 all from any to any" \ + "ipfnat" \ + "map ${epair_host_nat}b 192.0.3.0/24 -> 0/32" \ + "map ${epair_host_nat}b 192.0.2.0/24 -> 0/32" \ + + + # ping is successful now + atf_check -s exit:0 -o ignore jexec client1 ping -t 1 -c 1 198.51.100.2 + atf_check -s exit:0 -o ignore jexec client2 ping -t 1 -c 1 198.51.100.2 + +} + +basic_cleanup() +{ + firewall=$1 + firewall_cleanup $firewall +} + +userspace_nat_head() +{ + atf_set descr 'Nat test for ipfw using userspace natd' + atf_set require.user root +} +userspace_nat_body() +{ + firewall=$1 + firewall_init $firewall + + if ! kldstat -q -m ipdivert; then + atf_skip "This test requires ipdivert module loaded" + fi + + epair_host_nat=$(vnet_mkepair) + epair_client1_nat=$(vnet_mkepair) + epair_client2_nat=$(vnet_mkepair) + + vnet_mkjail nat ${epair_host_nat}b ${epair_client1_nat}a ${epair_client2_nat}a + vnet_mkjail client1 ${epair_client1_nat}b + vnet_mkjail client2 ${epair_client2_nat}b + + ifconfig ${epair_host_nat}a 198.51.100.2/24 up + jexec nat ifconfig ${epair_host_nat}b 198.51.100.1/24 up + + jexec nat ifconfig ${epair_client1_nat}a 192.0.2.1/24 up + jexec client1 ifconfig ${epair_client1_nat}b 192.0.2.2/24 up + + jexec nat ifconfig ${epair_client2_nat}a 192.0.3.1/24 up + jexec client2 ifconfig ${epair_client2_nat}b 192.0.3.2/24 up + + jexec nat sysctl net.inet.ip.forwarding=1 + + jexec client1 route add -net 198.51.100.0/24 192.0.2.1 + jexec client2 route add -net 198.51.100.0/24 192.0.3.1 + # Test the userspace NAT of ipfw + # ping fails without NAT configuration + atf_check -s exit:2 -o ignore jexec client1 ping -t 1 -c 1 198.51.100.2 + atf_check -s exit:2 -o ignore jexec client2 ping -t 1 -c 1 198.51.100.2 + + firewall_config nat ${firewall} \ + "ipfw" \ + "natd -interface ${epair_host_nat}b" \ + "ipfw -q add divert natd all from any to any via ${epair_host_nat}b" \ + + # ping is successful now + atf_check -s exit:0 -o ignore jexec client1 ping -t 1 -c 1 198.51.100.2 + atf_check -s exit:0 -o ignore jexec client2 ping -t 1 -c 1 198.51.100.2 +} + +userspace_nat_cleanup() +{ + firewall=$1 + firewall_cleanup $firewall +} + +setup_tests \ + basic \ + pf \ + ipfw \ + ipfnat \ + userspace_nat \ + ipfw \ No newline at end of file diff --git a/tests/sys/netpfil/common/utils.subr b/tests/sys/netpfil/common/utils.subr index d871962f5341..3f9d6b40183a 100644 --- a/tests/sys/netpfil/common/utils.subr +++ b/tests/sys/netpfil/common/utils.subr @@ -37,7 +37,7 @@ firewall_config() shift while [ $# -gt 0 ]; do - if [ $(is_firewall $fw) -eq 1 ]; then + if [ $(is_firewall "$1") -eq 1 ]; then current_fw="$1" shift filename=${current_fw}.rule @@ -94,8 +94,8 @@ firewall_init() atf_skip "This test requires ipf" fi elif [ ${firewall} == "ipfnat" ]; then - if ! kldstat -q -m ipfw_nat; then - atf_skip "This test requires ipfw_nat" + if ! kldstat -q -m ipfilter; then + atf_skip "This test requires ipf" fi else atf_fail "$fw is not a valid firewall to initialize" @@ -103,6 +103,16 @@ firewall_init() } +nat_init() +{ + firewall=$1 + if [ ${firewall} == "ipfw" ]; then + if ! kldstat -q -m ipfw_nat; then + atf_skip "This test requires ipfw_nat" + fi + fi +} + is_firewall() { if [ "$1" = "pf" -o "$1" = "ipfw" -o "$1" = "ipf" -o "$1" = "ipfnat" ]; then @@ -110,4 +120,4 @@ is_firewall() else echo 0 fi -} \ No newline at end of file +} From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:01:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7039F66FF15; Tue, 14 Sep 2021 20:01:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8Dkn0MC4z4pm7; Tue, 14 Sep 2021 20:01:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2FCFC20BB8; Tue, 14 Sep 2021 20:01:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EK1ZZ2089614; Tue, 14 Sep 2021 20:01:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EK1ZOs089613; Tue, 14 Sep 2021 20:01:35 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:01:35 GMT Message-Id: <202109142001.18EK1ZOs089613@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 086f8d605606 - stable/12 - Add common firewall test suite MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 086f8d605606aa0f3d8092f5757558cadd5e4233 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:01:37 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=086f8d605606aa0f3d8092f5757558cadd5e4233 commit 086f8d605606aa0f3d8092f5757558cadd5e4233 Author: Tom Jones AuthorDate: 2019-08-05 11:47:34 +0000 Commit: Kristof Provost CommitDate: 2021-09-14 08:26:33 +0000 Add common firewall test suite Add a common test suite for the firewalls included in the base system. The test suite allows common test infrastructure to test pf, ipfw and ipf firewalls from test files containing the setup for all three firewalls. Add the pass block test for pf, ipfw and ipf. The pass block test checks the allow/deny functionality of the firewalls tested. Submitted by: Ahsan Barkati Sponsored by: Google, Inc. (GSoC 2019) Reviewed by: kp Approved by: bz (co-mentor) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D21065 (cherry picked from commit f97a8a36153a9773d9f93018d66a7de2d050a59a) --- etc/mtree/BSD.tests.dist | 2 + tests/sys/netpfil/Makefile | 3 +- tests/sys/netpfil/common/Makefile | 10 ++- tests/sys/netpfil/common/pass_block.sh | 129 +++++++++++++++++++++++++++++++++ tests/sys/netpfil/common/runner.subr | 67 +++++++++++++++++ tests/sys/netpfil/common/utils.subr | 113 +++++++++++++++++++++++++++++ 6 files changed, 320 insertions(+), 4 deletions(-) diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist index 4997d67296ba..207020665689 100644 --- a/etc/mtree/BSD.tests.dist +++ b/etc/mtree/BSD.tests.dist @@ -805,6 +805,8 @@ netmap .. netpfil + common + .. pf ioctl .. diff --git a/tests/sys/netpfil/Makefile b/tests/sys/netpfil/Makefile index 2fb3b1447f10..18a3532f2e8e 100644 --- a/tests/sys/netpfil/Makefile +++ b/tests/sys/netpfil/Makefile @@ -7,7 +7,8 @@ TESTSDIR= ${TESTSBASE}/sys/netpfil TESTS_SUBDIRS+= common .if ${MK_PF} != "no" -TESTS_SUBDIRS+= pf +TESTS_SUBDIRS+= pf \ + common .endif .include diff --git a/tests/sys/netpfil/common/Makefile b/tests/sys/netpfil/common/Makefile index ce4026a5ed71..a4c135dbce08 100644 --- a/tests/sys/netpfil/common/Makefile +++ b/tests/sys/netpfil/common/Makefile @@ -4,10 +4,14 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/netpfil/common +ATF_TESTS_SH+= pass_block + ${PACKAGE}FILES+= \ - pft_ping.py \ - pft_synflood.py \ - sniffer.py + pft_ping.py \ + pft_synflood.py \ + runner.subr \ + sniffer.py \ + utils.subr ${PACKAGE}FILESMODE_pft_ping.py= 0555 ${PACKAGE}FILESMODE_pft_synflood.py= 0555 diff --git a/tests/sys/netpfil/common/pass_block.sh b/tests/sys/netpfil/common/pass_block.sh new file mode 100644 index 000000000000..141d54eb09f2 --- /dev/null +++ b/tests/sys/netpfil/common/pass_block.sh @@ -0,0 +1,129 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2019 Ahsan Barkati +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +. $(atf_get_srcdir)/utils.subr +. $(atf_get_srcdir)/runner.subr + +v4_head() +{ + atf_set require.user root +} + +v4_body() +{ + firewall=$1 + firewall_init $firewall + + epair=$(vnet_mkepair) + ifconfig ${epair}a 192.0.2.1/24 up + vnet_mkjail iron ${epair}b + jexec iron ifconfig ${epair}b 192.0.2.2/24 up + + # Block All + firewall_config "iron" ${firewall} \ + "pf" \ + "block in" \ + "ipfw" \ + "ipfw -q add 100 deny all from any to any" \ + "ipf" \ + "block in all" + + atf_check -s exit:2 -o ignore ping -c 1 -t 1 192.0.2.2 + + # Pass All + firewall_config "iron" ${firewall} \ + "pf" \ + "pass in" \ + "ipfw" \ + "ipfw -q add 100 allow all from any to any" \ + "ipf" \ + "pass in all" + + atf_check -s exit:0 -o ignore ping -c 1 -t 1 192.0.2.2 +} + +v4_cleanup() +{ + firewall=$1 + firewall_cleanup $firewall +} + +v6_head() +{ + atf_set require.user root +} + +v6_body() +{ + firewall=$1 + firewall_init $firewall + + epair=$(vnet_mkepair) + ifconfig ${epair}a inet6 fd7a:803f:cc4b::1/64 up no_dad + + vnet_mkjail iron ${epair}b + jexec iron ifconfig ${epair}b inet6 fd7a:803f:cc4b::2/64 up no_dad + + # Block All + firewall_config "iron" ${firewall} \ + "pf" \ + "block in" \ + "ipfw" \ + "ipfw -q add 100 deny all from any to any" \ + "ipf" \ + "block in all" + + atf_check -s exit:2 -o ignore ping6 -c 1 -x 1 fd7a:803f:cc4b::2 + + # Pass All + firewall_config "iron" ${firewall} \ + "pf" \ + "pass in" \ + "ipfw" \ + "ipfw -q add 100 allow all from any to any" \ + "ipf" \ + "pass in all" + + atf_check -s exit:0 -o ignore ping6 -c 1 -x 1 fd7a:803f:cc4b::2 +} + +v6_cleanup() +{ + firewall=$1 + firewall_cleanup $firewall +} + +setup_tests "v4" \ + "pf" \ + "ipfw" \ + "ipf" \ + "v6" \ + "pf" \ + "ipfw" \ + "ipf" \ No newline at end of file diff --git a/tests/sys/netpfil/common/runner.subr b/tests/sys/netpfil/common/runner.subr new file mode 100644 index 000000000000..a2291f496fd5 --- /dev/null +++ b/tests/sys/netpfil/common/runner.subr @@ -0,0 +1,67 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2019 Ahsan Barkati +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +. $(atf_get_srcdir)/utils.subr + +setup_tests() +{ + tests="" + while [ $# -gt 0 ]; do + if [ $(is_firewall $1) -eq 1 ]; then + fw=$1 + shift + if [ -z "${testcase}" ]; then + echo "no testcase passed to setup_test" + return + fi + atf_test_case "${fw}_${testcase}" "cleanup" + eval "${fw}_${testcase}_head(){ ${testcase}_head; }" + eval "${fw}_${testcase}_body(){ ${testcase}_body $fw; }" + eval "${fw}_${testcase}_cleanup(){ ${testcase}_cleanup $fw; }" + tests="$tests ${fw}_${testcase}" + else + testcase=$1 + shift + fi + done + init_testcases "$tests" +} + + +init_testcases() +{ + args="$@" + atf_init_test_cases() + { + for testcase in $args; + do + atf_add_test_case "$testcase" + done + } +} \ No newline at end of file diff --git a/tests/sys/netpfil/common/utils.subr b/tests/sys/netpfil/common/utils.subr new file mode 100644 index 000000000000..d871962f5341 --- /dev/null +++ b/tests/sys/netpfil/common/utils.subr @@ -0,0 +1,113 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2019 Ahsan Barkati +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +. $(atf_get_srcdir)/../../common/vnet.subr + +firewall_config() +{ + jname=$1 + shift + fw=$1 + shift + + while [ $# -gt 0 ]; do + if [ $(is_firewall $fw) -eq 1 ]; then + current_fw="$1" + shift + filename=${current_fw}.rule + cwd=$(pwd) + if [ -f ${current_fw}.rule ]; then + rm ${current_fw}.rule + fi + fi + rule=$1 + echo $rule >> $filename + shift + done + + if [ ${fw} == "ipfw" ]; then + jexec ${jname} ipfw -q -f flush + jexec ${jname} /bin/sh $cwd/ipfw.rule + elif [ ${fw} == "pf" ]; then + jexec ${jname} pfctl -e + jexec ${jname} pfctl -F all + jexec ${jname} pfctl -f $cwd/pf.rule + elif [ ${fw} == "ipf" ]; then + jexec ${jname} ipf -E + jexec ${jname} ipf -Fa -f $cwd/ipf.rule + elif [ ${fw} == "ipfnat" ]; then + jexec ${jname} service ipfilter start + jexec ${jname} ipnat -CF -f $cwd/ipfnat.rule + else + atf_fail "$fw is not a valid firewall to configure" + fi +} + +firewall_cleanup() +{ + firewall=$1 + echo "Cleaning $firewall" + vnet_cleanup +} + +firewall_init() +{ + firewall=$1 + vnet_init + + if [ ${firewall} == "ipfw" ]; then + if ! kldstat -q -m ipfw; then + atf_skip "This test requires ipfw" + fi + elif [ ${firewall} == "pf" ]; then + if [ ! -c /dev/pf ]; then + atf_skip "This test requires pf" + fi + elif [ ${firewall} == "ipf" ]; then + if ! kldstat -q -m ipfilter; then + atf_skip "This test requires ipf" + fi + elif [ ${firewall} == "ipfnat" ]; then + if ! kldstat -q -m ipfw_nat; then + atf_skip "This test requires ipfw_nat" + fi + else + atf_fail "$fw is not a valid firewall to initialize" + fi + +} + +is_firewall() +{ + if [ "$1" = "pf" -o "$1" = "ipfw" -o "$1" = "ipf" -o "$1" = "ipfnat" ]; then + echo 1 + else + echo 0 + fi +} \ No newline at end of file From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:01:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C1C3466FDF4; Tue, 14 Sep 2021 20:01:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8Dkr3RCKz4pr1; Tue, 14 Sep 2021 20:01:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 955D8209E0; Tue, 14 Sep 2021 20:01:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EK1cEe089686; Tue, 14 Sep 2021 20:01:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EK1chD089685; Tue, 14 Sep 2021 20:01:38 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:01:38 GMT Message-Id: <202109142001.18EK1chD089685@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 47fb5e0124d1 - stable/12 - netpfil tests: Add too many fragments test for pf, ipfw and ipf MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 47fb5e0124d168d70b9633658426c3cc80169d8c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:01:40 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=47fb5e0124d168d70b9633658426c3cc80169d8c commit 47fb5e0124d168d70b9633658426c3cc80169d8c Author: Kristof Provost AuthorDate: 2019-08-20 14:46:12 +0000 Commit: Kristof Provost CommitDate: 2021-09-14 08:28:37 +0000 netpfil tests: Add too many fragments test for pf, ipfw and ipf Add test for checking that the packets are dropped if it is fragmented into more than the defined value. Submitted by: Ahsan Barkati Reviewed by: kp Sponsored by: Google, Inc. (GSoC 2019) Differential Revision: https://reviews.freebsd.org/D21307 (cherry picked from commit 3e1ebe7fb8244e6d9336216e9a982aa900a0a281) --- tests/sys/netpfil/common/Makefile | 1 + tests/sys/netpfil/common/fragments.sh | 80 +++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) diff --git a/tests/sys/netpfil/common/Makefile b/tests/sys/netpfil/common/Makefile index 7ce47dd7c9b0..319333e8e6d6 100644 --- a/tests/sys/netpfil/common/Makefile +++ b/tests/sys/netpfil/common/Makefile @@ -5,6 +5,7 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/netpfil/common ATF_TESTS_SH+= \ + fragments \ nat \ pass_block \ tos diff --git a/tests/sys/netpfil/common/fragments.sh b/tests/sys/netpfil/common/fragments.sh new file mode 100644 index 000000000000..f20a24b7f197 --- /dev/null +++ b/tests/sys/netpfil/common/fragments.sh @@ -0,0 +1,80 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2019 Ahsan Barkati +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +. $(atf_get_srcdir)/utils.subr +. $(atf_get_srcdir)/runner.subr + +fragments_head() +{ + atf_set descr 'Too many fragments test' + atf_set require.user root +} + +fragments_body() +{ + firewall=$1 + firewall_init $firewall + + epair=$(vnet_mkepair) + ifconfig ${epair}b inet 192.0.2.1/24 up + + vnet_mkjail iron ${epair}a + jexec iron ifconfig ${epair}a 192.0.2.2/24 up + + ifconfig ${epair}b mtu 200 + jexec iron ifconfig ${epair}a mtu 200 + + firewall_config "iron" ${firewall} \ + "pf" \ + "scrub all fragment reassemble" \ + "ipfw" \ + "ipfw -q add 100 reass all from any to any in" \ + "ipf" \ + "pass in all with frags" + + jexec iron sysctl net.inet.ip.maxfragsperpacket=1024 + + atf_check -s exit:0 -o ignore ping -c 1 -t 1 192.0.2.2 + atf_check -s exit:0 -o ignore ping -c 1 -s 800 192.0.2.2 + + # Too many fragments should fail + atf_check -s exit:2 -o ignore ping -c 1 -s 20000 192.0.2.2 +} + +fragments_cleanup() +{ + firewall=$1 + firewall_cleanup $firewall +} + +setup_tests \ + "fragments" \ + "pf" \ + "ipfw" \ + "ipf" From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:01:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C93CA66FF19; Tue, 14 Sep 2021 20:01:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8Dkq2X3Tz4pqv; Tue, 14 Sep 2021 20:01:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71A7020A37; Tue, 14 Sep 2021 20:01:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EK1buN089662; Tue, 14 Sep 2021 20:01:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EK1bXe089661; Tue, 14 Sep 2021 20:01:37 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:01:37 GMT Message-Id: <202109142001.18EK1bXe089661@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: cacf2d4beb4e - stable/12 - netpfil tests: Add the set ToS test for ipfw and pf MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: cacf2d4beb4e50fe636133ae1e2709537a560475 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:01:40 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=cacf2d4beb4e50fe636133ae1e2709537a560475 commit cacf2d4beb4e50fe636133ae1e2709537a560475 Author: Kristof Provost AuthorDate: 2019-08-20 14:31:22 +0000 Commit: Kristof Provost CommitDate: 2021-09-14 08:28:00 +0000 netpfil tests: Add the set ToS test for ipfw and pf This test tests the following: - The firewall is able to set the tos bits - The firewall is able to set the DSCP bits when EN bits is already set and the EN bits remains unchanged. - The firewall is able to drop the packets based on ToS value Submitted by: Ahsan Barkati Reviewed by: kp Sponsored by: Google, Inc. (GSoC 2019) Differential Revision: https://reviews.freebsd.org/D21305 (cherry picked from commit df3d236d96456f1c8400c7898045eae3ea93232d) --- tests/sys/netpfil/common/Makefile | 3 +- tests/sys/netpfil/common/tos.sh | 118 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 120 insertions(+), 1 deletion(-) diff --git a/tests/sys/netpfil/common/Makefile b/tests/sys/netpfil/common/Makefile index 9e1efc924c6e..7ce47dd7c9b0 100644 --- a/tests/sys/netpfil/common/Makefile +++ b/tests/sys/netpfil/common/Makefile @@ -6,7 +6,8 @@ TESTSDIR= ${TESTSBASE}/sys/netpfil/common ATF_TESTS_SH+= \ nat \ - pass_block + pass_block \ + tos ${PACKAGE}FILES+= \ pft_ping.py \ diff --git a/tests/sys/netpfil/common/tos.sh b/tests/sys/netpfil/common/tos.sh new file mode 100644 index 000000000000..452c6a002bbf --- /dev/null +++ b/tests/sys/netpfil/common/tos.sh @@ -0,0 +1,118 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2019 Ahsan Barkati +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +. $(atf_get_srcdir)/utils.subr +. $(atf_get_srcdir)/runner.subr + +tos_head() +{ + atf_set descr 'set-tos test' + atf_set require.user root + atf_set require.progs scapy +} + +tos_body() +{ + firewall=$1 + firewall_init $firewall + + epair_send=$(vnet_mkepair) + ifconfig ${epair_send}a 192.0.2.1/24 up + + epair_recv=$(vnet_mkepair) + ifconfig ${epair_recv}a up + + vnet_mkjail iron ${epair_send}b ${epair_recv}b + jexec iron ifconfig ${epair_send}b 192.0.2.2/24 up + jexec iron ifconfig ${epair_recv}b 198.51.100.2/24 up + jexec iron sysctl net.inet.ip.forwarding=1 + jexec iron arp -s 198.51.100.3 00:01:02:03:04:05 + route add -net 198.51.100.0/24 192.0.2.2 + + # Check if the firewall is able to set the ToS bits + firewall_config "iron" ${firewall} \ + "pf" \ + "scrub out proto icmp set-tos 36" \ + "ipfw" \ + "ipfw -q add 100 setdscp 9 ip from any to any" + # dscp is set to 9 because last two bits are for + # EN and hence tos would be 36 + + atf_check -s exit:0 $(atf_get_srcdir)/pft_ping.py \ + --sendif ${epair_send}a \ + --to 198.51.100.3 \ + --recvif ${epair_recv}a \ + --expect-tos 36 + + # Check if the firewall is able to set the ToS bits + # and persists the EN bits (if already set) + firewall_config "iron" ${firewall} \ + "pf" \ + "scrub out proto icmp set-tos 36" \ + "ipfw" \ + "ipfw -q add 100 setdscp 9 ip from any to any" + + atf_check -s exit:0 $(atf_get_srcdir)/pft_ping.py \ + --sendif ${epair_send}a \ + --to 198.51.100.3 \ + --recvif ${epair_recv}a \ + --send-tos 3 \ + --expect-tos 39 + + # Check if the firewall is able to filter the + # packets based on the ToS value + firewall_config "iron" ${firewall} \ + "pf" \ + "block all tos 36" \ + "ipfw" \ + "ipfw -q add 100 deny all from any to any dscp 9" + + atf_check -s exit:1 $(atf_get_srcdir)/pft_ping.py \ + --sendif ${epair_send}a \ + --to 198.51.100.3 \ + --recvif ${epair_recv}a \ + --send-tos 36 + + atf_check -s exit:0 $(atf_get_srcdir)/pft_ping.py \ + --sendif ${epair_send}a \ + --to 198.51.100.3 \ + --recvif ${epair_recv}a \ + --send-tos 32 +} + +tos_cleanup() +{ + firewall=$1 + firewall_cleanup $firewall +} + +setup_tests \ + "tos" \ + "pf" \ + "ipfw" From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:01:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E6C766FBED; Tue, 14 Sep 2021 20:01:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8Dks4XtFz4ptR; Tue, 14 Sep 2021 20:01:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA22520A38; Tue, 14 Sep 2021 20:01:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EK1d3O089716; Tue, 14 Sep 2021 20:01:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EK1diQ089715; Tue, 14 Sep 2021 20:01:39 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:01:39 GMT Message-Id: <202109142001.18EK1diQ089715@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 8e2cb3da6f0e - stable/12 - netpfil tests: Add forward test for the three firewalls MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 8e2cb3da6f0eba413c465826ee9ebcdcac2ca601 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:01:42 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=8e2cb3da6f0eba413c465826ee9ebcdcac2ca601 commit 8e2cb3da6f0eba413c465826ee9ebcdcac2ca601 Author: Kristof Provost AuthorDate: 2019-08-23 12:11:46 +0000 Commit: Kristof Provost CommitDate: 2021-09-14 08:29:25 +0000 netpfil tests: Add forward test for the three firewalls Submitted by: Ahsan Barkati Reviewed by: kp Sponsored by: Google, Inc. (GSoC 2019) Differential Revision: https://reviews.freebsd.org/D21321 (cherry picked from commit 39cae0d5ed570804b4e689946f131447597122b8) --- tests/sys/netpfil/common/Makefile | 1 + tests/sys/netpfil/common/forward.sh | 101 ++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) diff --git a/tests/sys/netpfil/common/Makefile b/tests/sys/netpfil/common/Makefile index 319333e8e6d6..c0e42b8f1286 100644 --- a/tests/sys/netpfil/common/Makefile +++ b/tests/sys/netpfil/common/Makefile @@ -5,6 +5,7 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/netpfil/common ATF_TESTS_SH+= \ + forward \ fragments \ nat \ pass_block \ diff --git a/tests/sys/netpfil/common/forward.sh b/tests/sys/netpfil/common/forward.sh new file mode 100755 index 000000000000..9f73bb139598 --- /dev/null +++ b/tests/sys/netpfil/common/forward.sh @@ -0,0 +1,101 @@ +#- +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2019 Ahsan Barkati +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +. $(atf_get_srcdir)/utils.subr +. $(atf_get_srcdir)/runner.subr + +v4_head() +{ + atf_set descr 'Basic forwarding test' + atf_set require.user root + atf_set require.progs scapy +} + +v4_body() +{ + firewall=$1 + firewall_init $firewall + + epair_send=$(vnet_mkepair) + ifconfig ${epair_send}a 192.0.2.1/24 up + + epair_recv=$(vnet_mkepair) + ifconfig ${epair_recv}a up + + vnet_mkjail iron ${epair_send}b ${epair_recv}b + jexec iron ifconfig ${epair_send}b 192.0.2.2/24 up + jexec iron ifconfig ${epair_recv}b 198.51.100.2/24 up + jexec iron sysctl net.inet.ip.forwarding=1 + jexec iron arp -s 198.51.100.3 00:01:02:03:04:05 + route add -net 198.51.100.0/24 192.0.2.2 + + + atf_check -s exit:0 $(atf_get_srcdir)/pft_ping.py \ + --sendif ${epair_send}a \ + --to 198.51.100.3 \ + --recvif ${epair_recv}a + + firewall_config "iron" ${firewall} \ + "pf" \ + "block in" \ + "ipfw" \ + "ipfw -q add 100 deny all from any to any in" \ + "ipf" \ + "block in all" \ + + atf_check -s exit:1 $(atf_get_srcdir)/pft_ping.py \ + --sendif ${epair_send}a \ + --to 198.51.100.3 \ + --recvif ${epair_recv}a + + firewall_config "iron" ${firewall} \ + "pf" \ + "block out" \ + "ipfw" \ + "ipfw -q add 100 deny all from any to any out" \ + "ipf" \ + "block out all" \ + + atf_check -s exit:1 $(atf_get_srcdir)/pft_ping.py \ + --sendif ${epair_send}a \ + --to 198.51.100.3 \ + --recv ${epair_recv}a +} + +v4_cleanup() +{ + firewall=$1 + firewall_cleanup $firewall +} + +setup_tests \ + v4 \ + pf \ + ipfw \ + ipf From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:01:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC52366FBEF; Tue, 14 Sep 2021 20:01:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8Dkv33vGz4prB; Tue, 14 Sep 2021 20:01:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C32D020BBA; Tue, 14 Sep 2021 20:01:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EK1emR089740; Tue, 14 Sep 2021 20:01:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EK1ec4089739; Tue, 14 Sep 2021 20:01:40 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:01:40 GMT Message-Id: <202109142001.18EK1ec4089739@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 65329e67450c - stable/12 - netpfil tests: Basic dummynet pipe test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 65329e67450c3158e1ad6540eb886f753531661e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:01:45 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=65329e67450c3158e1ad6540eb886f753531661e commit 65329e67450c3158e1ad6540eb886f753531661e Author: Kristof Provost AuthorDate: 2021-05-21 09:14:34 +0000 Commit: Kristof Provost CommitDate: 2021-09-14 08:32:46 +0000 netpfil tests: Basic dummynet pipe test Test dummynet pipes (i.e. bandwidth limitation) with ipfw. This is put in the common tests because we hope to add dummynet support to pf in the near future. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D30380 (cherry picked from commit ea3eca5cb6dbcb4deb7c7277a65c48911f0475d1) (cherry picked from commit 1f4a6403969271885d1c37fd642820d5a6562791) --- tests/sys/netpfil/common/Makefile | 1 + tests/sys/netpfil/common/dummynet.sh | 75 ++++++++++++++++++++++++++++++++++++ tests/sys/netpfil/common/utils.subr | 15 ++++++++ 3 files changed, 91 insertions(+) diff --git a/tests/sys/netpfil/common/Makefile b/tests/sys/netpfil/common/Makefile index c0e42b8f1286..8347d817a61c 100644 --- a/tests/sys/netpfil/common/Makefile +++ b/tests/sys/netpfil/common/Makefile @@ -5,6 +5,7 @@ PACKAGE= tests TESTSDIR= ${TESTSBASE}/sys/netpfil/common ATF_TESTS_SH+= \ + dummynet \ forward \ fragments \ nat \ diff --git a/tests/sys/netpfil/common/dummynet.sh b/tests/sys/netpfil/common/dummynet.sh new file mode 100644 index 000000000000..82cd22b77fef --- /dev/null +++ b/tests/sys/netpfil/common/dummynet.sh @@ -0,0 +1,75 @@ +# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Rubicon Communications, LLC (Netgate) +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +. $(atf_get_srcdir)/utils.subr +. $(atf_get_srcdir)/runner.subr + +pipe_head() +{ + atf_set descr 'Basic pipe test' + atf_set require.user root +} + +pipe_body() +{ + fw=$1 + firewall_init $fw + dummynet_init $fw + + epair=$(vnet_mkepair) + vnet_mkjail alcatraz ${epair}b + + ifconfig ${epair}a 192.0.2.1/24 up + jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up + + # Sanity check + atf_check -s exit:0 -o ignore ping -i .1 -c 3 -s 1200 192.0.2.2 + + jexec alcatraz dnctl pipe 1 config bw 30Byte/s + + firewall_config alcatraz ${fw} \ + "ipfw" \ + "ipfw add 1000 pipe 1 ip from any to any" + + # single ping succeeds just fine + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2 + + # Saturate the link + ping -i .1 -c 5 -s 1200 192.0.2.2 + + # We should now be hitting the limits and get this packet dropped. + atf_check -s exit:2 -o ignore ping -c 1 -s 1200 192.0.2.2 +} + +pipe_cleanup() +{ + firewall_cleanup $1 +} + +setup_tests \ + pipe \ + ipfw diff --git a/tests/sys/netpfil/common/utils.subr b/tests/sys/netpfil/common/utils.subr index 3f9d6b40183a..722271981af4 100644 --- a/tests/sys/netpfil/common/utils.subr +++ b/tests/sys/netpfil/common/utils.subr @@ -103,6 +103,21 @@ firewall_init() } +dummynet_init() +{ + firewall=$1 + + if ! kldstat -q -m dummynet; then + atf_skip "This test requires dummynet" + fi + + if [ ${firewall} == "ipfw" ]; then + # Nothing. This is okay. + else + atf_skip "${firewall} does not support dummynet" + fi +} + nat_init() { firewall=$1 From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:01:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B53C366FD61; Tue, 14 Sep 2021 20:01:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8Dkx2zhCz4q4j; Tue, 14 Sep 2021 20:01:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0960020AD6; Tue, 14 Sep 2021 20:01:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EK1frn089764; Tue, 14 Sep 2021 20:01:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EK1flT089763; Tue, 14 Sep 2021 20:01:41 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:01:41 GMT Message-Id: <202109142001.18EK1flT089763@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: a1d23e697345 - stable/12 - dummynet tests: pipe test for IPv6 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: a1d23e697345695c4b316c49453142e216c54421 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:01:46 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=a1d23e697345695c4b316c49453142e216c54421 commit a1d23e697345695c4b316c49453142e216c54421 Author: Kristof Provost AuthorDate: 2021-06-14 19:24:59 +0000 Commit: Kristof Provost CommitDate: 2021-09-14 08:33:13 +0000 dummynet tests: pipe test for IPv6 MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31787 (cherry picked from commit 5fda5913e16afac72f3f420e227803e33d4c1542) --- tests/sys/netpfil/common/dummynet.sh | 44 ++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/tests/sys/netpfil/common/dummynet.sh b/tests/sys/netpfil/common/dummynet.sh index 82cd22b77fef..42fbd83f297e 100644 --- a/tests/sys/netpfil/common/dummynet.sh +++ b/tests/sys/netpfil/common/dummynet.sh @@ -70,6 +70,50 @@ pipe_cleanup() firewall_cleanup $1 } +pipe_v6_head() +{ + atf_set descr 'Basic IPv6 pipe test' + atf_set require.user root +} + +pipe_v6_body() +{ + fw=$1 + firewall_init $fw + dummynet_init $fw + + epair=$(vnet_mkepair) + vnet_mkjail alcatraz ${epair}b + + ifconfig ${epair}a inet6 2001:db8:42::1/64 up no_dad + jexec alcatraz ifconfig ${epair}b inet6 2001:db8:42::2/64 up no_dad + + # Sanity check + atf_check -s exit:0 -o ignore ping6 -i .1 -c 3 -s 1200 2001:db8:42::2 + + jexec alcatraz dnctl pipe 1 config bw 100Byte/s + + firewall_config alcatraz ${fw} \ + "ipfw" \ + "ipfw add 1000 pipe 1 ip6 from any to any" + + # Single ping succeeds + atf_check -s exit:0 -o ignore ping6 -c 1 2001:db8:42::2 + + # Saturate the link + ping6 -i .1 -c 5 -s 1200 2001:db8:42::2 + + # We should now be hitting the limit and get this packet dropped. + atf_check -s exit:2 -o ignore ping6 -c 1 -s 1200 2001:db8:42::2 +} + +pipe_v6_cleanup() +{ + firewall_cleanup $1 +} + setup_tests \ pipe \ + ipfw \ + pipe_v6 \ ipfw From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:01:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53E9F67003C; Tue, 14 Sep 2021 20:01:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8Dl03Rlvz4ptt; Tue, 14 Sep 2021 20:01:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25D1520B51; Tue, 14 Sep 2021 20:01:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EK1iOl089812; Tue, 14 Sep 2021 20:01:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EK1itu089811; Tue, 14 Sep 2021 20:01:44 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:01:44 GMT Message-Id: <202109142001.18EK1itu089811@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 458e97f5fdbf - stable/12 - netpfil tests: IPv6 dummynet queue test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 458e97f5fdbfe05bbb467837881f8df3849a32c6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:01:49 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=458e97f5fdbfe05bbb467837881f8df3849a32c6 commit 458e97f5fdbfe05bbb467837881f8df3849a32c6 Author: Kristof Provost AuthorDate: 2021-09-02 13:40:51 +0000 Commit: Kristof Provost CommitDate: 2021-09-14 08:33:29 +0000 netpfil tests: IPv6 dummynet queue test Same as the v4 test, but with IPv6. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31789 (cherry picked from commit 12184311c16160464a36ae05b1cd8c5e3c24fbaa) --- tests/sys/netpfil/common/dummynet.sh | 107 +++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/tests/sys/netpfil/common/dummynet.sh b/tests/sys/netpfil/common/dummynet.sh index 4b3d01e124eb..7ff9a1e18fdc 100644 --- a/tests/sys/netpfil/common/dummynet.sh +++ b/tests/sys/netpfil/common/dummynet.sh @@ -214,10 +214,117 @@ queue_cleanup() firewall_cleanup $1 } +queue_v6_head() +{ + atf_set descr 'Basic queue test' + atf_set require.user root +} + +queue_v6_body() +{ + fw=$1 + firewall_init $fw + dummynet_init $fw + + epair=$(vnet_mkepair) + vnet_mkjail alcatraz ${epair}b + + ifconfig ${epair}a inet6 2001:db8:42::1/64 no_dad up + jexec alcatraz ifconfig ${epair}b inet6 2001:db8:42::2 no_dad up + jexec alcatraz /usr/sbin/inetd -p inetd-alcatraz.pid \ + $(atf_get_srcdir)/../pf/echo_inetd.conf + + # Sanity check + atf_check -s exit:0 -o ignore ping6 -i .1 -c 3 -s 1200 2001:db8:42::2 + reply=$(echo "foo" | nc -N 2001:db8:42::2 7) + if [ "$reply" != "foo" ]; + then + atf_fail "Echo sanity check failed" + fi + + jexec alcatraz dnctl pipe 1 config bw 1MByte/s + jexec alcatraz dnctl sched 1 config pipe 1 type wf2q+ + jexec alcatraz dnctl queue 100 config sched 1 weight 99 mask all + jexec alcatraz dnctl queue 200 config sched 1 weight 1 mask all + + firewall_config alcatraz ${fw} \ + "ipfw" \ + "ipfw add 1001 queue 100 tcp from 2001:db8:42::2 to any out" \ + "ipfw add 1000 queue 200 ipv6-icmp from 2001:db8:42::2 to any out" \ + "ipfw add 1002 allow ip6 from any to any" \ + "pf" \ + "pass out proto tcp dnqueue 100" \ + "pass out proto icmp6 dnqueue 200" + + # Single ping succeeds + atf_check -s exit:0 -o ignore ping6 -c 1 2001:db8:42::2 + + # Unsaturated TCP succeeds + reply=$(echo "foo" | nc -w 5 -N 2001:db8:42::2 7) + if [ "$reply" != "foo" ]; + then + atf_fail "Unsaturated echo failed" + fi + + # Saturate the link + ping6 -f -s 1200 2001:db8:42::2 & + + # Allow this to fill the queue + sleep 1 + + # TCP should still just pass + fails=0 + for i in `seq 1 3` + do + result=$(dd if=/dev/zero bs=1024 count=1000 | timeout 3 nc -w 5 -N 2001:db8:42::2 7 | wc -c) + if [ $result -ne 1024000 ]; + then + echo "Failed to prioritise TCP traffic. Got only $result bytes" + fails=$(( ${fails} + 1 )) + fi + done + if [ ${fails} -gt 0 ]; + then + atf_fail "We failed prioritisation ${fails} times" + fi + + # What happens if we prioritise ICMP over TCP? + firewall_config alcatraz ${fw} \ + "ipfw" \ + "ipfw add 1001 queue 200 tcp from 2001:db8:42::2 to any out" \ + "ipfw add 1000 queue 100 ipv6-icmp from 2001:db8:42::2 to any out" \ + "ipfw add 1002 allow ip6 from any to any" \ + "pf" \ + "pass out proto tcp dnqueue 200" \ + "pass out proto icmp6 dnqueue 100" + + fails=0 + for i in `seq 1 3` + do + result=$(dd if=/dev/zero bs=1024 count=1000 | timeout 3 nc -w 5 -N 2001:db8:42::2 7 | wc -c) + if [ $result -ne 1024000 ]; + then + echo "Failed to prioritise TCP traffic. Got only $result bytes" + fails=$(( ${fails} + 1 )) + fi + done + if [ ${fails} -lt 3 ]; + then + atf_fail "We failed reversed prioritisation only ${fails} times." + fi +} + +queue_v6_cleanup() +{ + firewall_cleanup $1 +} + setup_tests \ pipe \ ipfw \ pipe_v6 \ ipfw \ queue \ + ipfw \ + queue_v6 \ ipfw From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:01:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F6AF66FF35; Tue, 14 Sep 2021 20:01:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8Dky3zfLz4q2P; Tue, 14 Sep 2021 20:01:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10ADD208C1; Tue, 14 Sep 2021 20:01:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EK1gNF089788; Tue, 14 Sep 2021 20:01:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EK1gV1089787; Tue, 14 Sep 2021 20:01:42 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:01:42 GMT Message-Id: <202109142001.18EK1gV1089787@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: c31393d326ce - stable/12 - netpfil tests: dummynet queue test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: c31393d326ceb85a85da9d0f55b9eaeedd2550a5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:01:47 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=c31393d326ceb85a85da9d0f55b9eaeedd2550a5 commit c31393d326ceb85a85da9d0f55b9eaeedd2550a5 Author: Kristof Provost AuthorDate: 2021-09-02 13:38:04 +0000 Commit: Kristof Provost CommitDate: 2021-09-14 08:33:21 +0000 netpfil tests: dummynet queue test Test prioritisation and dummynet queues. We need to give the pipe sufficient bandwidth for dummynet to work. Given that we can't rely on the TCP connection failing alltogether, but we can measure the effect of dummynet by imposing a time limit on a larger data transfer. If TCP is prioritised it'll get most of the pipe bandwidth and easily manage to transfer the data in 3 seconds or less. When not prioritised this will not succeed. MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31788 (cherry picked from commit cb6bfef9ca78623e33d2aef347dcee112a639103) --- tests/sys/netpfil/common/dummynet.sh | 104 +++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/tests/sys/netpfil/common/dummynet.sh b/tests/sys/netpfil/common/dummynet.sh index 42fbd83f297e..4b3d01e124eb 100644 --- a/tests/sys/netpfil/common/dummynet.sh +++ b/tests/sys/netpfil/common/dummynet.sh @@ -112,8 +112,112 @@ pipe_v6_cleanup() firewall_cleanup $1 } +queue_head() +{ + atf_set descr 'Basic queue test' + atf_set require.user root +} + +queue_body() +{ + fw=$1 + firewall_init $fw + dummynet_init $fw + + epair=$(vnet_mkepair) + vnet_mkjail alcatraz ${epair}b + + ifconfig ${epair}a 192.0.2.1/24 up + jexec alcatraz ifconfig ${epair}b 192.0.2.2/24 up + jexec alcatraz /usr/sbin/inetd -p inetd-alcatraz.pid \ + $(atf_get_srcdir)/../pf/echo_inetd.conf + + # Sanity check + atf_check -s exit:0 -o ignore ping -i .1 -c 3 -s 1200 192.0.2.2 + reply=$(echo "foo" | nc -N 192.0.2.2 7) + if [ "$reply" != "foo" ]; + then + atf_fail "Echo sanity check failed" + fi + + jexec alcatraz dnctl pipe 1 config bw 1MByte/s + jexec alcatraz dnctl sched 1 config pipe 1 type wf2q+ + jexec alcatraz dnctl queue 100 config sched 1 weight 99 mask all + jexec alcatraz dnctl queue 200 config sched 1 weight 1 mask all + + firewall_config alcatraz ${fw} \ + "ipfw" \ + "ipfw add 1000 queue 100 tcp from 192.0.2.2 to any out" \ + "ipfw add 1001 queue 200 icmp from 192.0.2.2 to any out" \ + "ipfw add 1002 allow ip from any to any" + + # Single ping succeeds + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.2 + + # Unsaturated TCP succeeds + reply=$(echo "foo" | nc -w 5 -N 192.0.2.2 7) + if [ "$reply" != "foo" ]; + then + atf_fail "Unsaturated echo failed" + fi + + # Saturate the link + ping -f -s 1300 192.0.2.2 & + + # Allow this to fill the queue + sleep 1 + + # TCP should still just pass + fails=0 + for i in `seq 1 3` + do + result=$(dd if=/dev/zero bs=1024 count=2000 | timeout 3 nc -w 5 -N 192.0.2.2 7 | wc -c) + if [ $result -ne 2048000 ]; + then + echo "Failed to prioritise TCP traffic. Got only $result bytes" + fails=$(( ${fails} + 1 )) + fi + done + if [ ${fails} -gt 0 ]; + then + atf_fail "We failed prioritisation ${fails} times" + fi + + # This will fail if we reverse the pola^W priority + firewall_config alcatraz ${fw} \ + "ipfw" \ + "ipfw add 1000 queue 200 tcp from 192.0.2.2 to any out" \ + "ipfw add 1001 queue 100 icmp from 192.0.2.2 to any out" \ + "ipfw add 1002 allow ip from any to any" + + jexec alcatraz ping -f -s 1300 192.0.2.1 & + sleep 1 + + fails=0 + for i in `seq 1 3` + do + result=$(dd if=/dev/zero bs=1024 count=2000 | timeout 3 nc -w 5 -N 192.0.2.2 7 | wc -c) + if [ $result -ne 2048000 ]; + then + echo "Failed to prioritise TCP traffic. Got only $result bytes" + fails=$(( ${fails} + 1 )) + fi + done + if [ ${fails} -lt 3 ]; + then + atf_fail "We failed reversed prioritisation only ${fails} times." + fi +} + +queue_cleanup() +{ + firewall_cleanup $1 +} + setup_tests \ pipe \ ipfw \ pipe_v6 \ + ipfw \ + queue \ ipfw From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:40:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3D8B6670C5C; Tue, 14 Sep 2021 20:40:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8FbH0x4qz3GTF; Tue, 14 Sep 2021 20:40:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00613211B3; Tue, 14 Sep 2021 20:40:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EKeAt0034264; Tue, 14 Sep 2021 20:40:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EKeAF1034262; Tue, 14 Sep 2021 20:40:10 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:40:10 GMT Message-Id: <202109142040.18EKeAF1034262@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 6f43f86bf36d - main - tzcode: Fix operation without WITH_DETECT_TZ_CHANGES MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6f43f86bf36dba158355593bab5f81a7f8e2773c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:40:11 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=6f43f86bf36dba158355593bab5f81a7f8e2773c commit 6f43f86bf36dba158355593bab5f81a7f8e2773c Author: Edward Tomasz Napierala AuthorDate: 2021-09-14 20:17:45 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-09-14 20:17:50 +0000 tzcode: Fix operation without WITH_DETECT_TZ_CHANGES Reviewed By: bdrewery, kevans, cy Reported By: lwhsu, bdrewery Fixes: ddedf2a11eb Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D31961 --- contrib/tzcode/stdtime/localtime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/tzcode/stdtime/localtime.c b/contrib/tzcode/stdtime/localtime.c index 926b24470e19..9de1b26d74a0 100644 --- a/contrib/tzcode/stdtime/localtime.c +++ b/contrib/tzcode/stdtime/localtime.c @@ -390,7 +390,7 @@ change_in_tz(const char *name) return 0; } #else /* !DETECT_TZ_CHANGES */ -#define change_in_tz(X) 0 +#define change_in_tz(X) 1 #endif /* !DETECT_TZ_CHANGES */ static int From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:41:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A202670C71; Tue, 14 Sep 2021 20:41:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8FcL28Z6z3GV6; Tue, 14 Sep 2021 20:41:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29CEF214AD; Tue, 14 Sep 2021 20:41:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EKf6Hk040963; Tue, 14 Sep 2021 20:41:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EKf6RU040962; Tue, 14 Sep 2021 20:41:06 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:41:06 GMT Message-Id: <202109142041.18EKf6RU040962@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: bdf0f24bb16d - main - linux: implement PTRACE_GET_SYSCALL_INFO MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bdf0f24bb16d556a5b1e01cdfc087d08e91ac572 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:41:06 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=bdf0f24bb16d556a5b1e01cdfc087d08e91ac572 commit bdf0f24bb16d556a5b1e01cdfc087d08e91ac572 Author: Edward Tomasz Napierala AuthorDate: 2021-09-12 11:31:10 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-09-14 20:19:55 +0000 linux: implement PTRACE_GET_SYSCALL_INFO This is one of the pieces required to make modern (ie Focal) strace(1) work. Reviewed By: jhb (earlier version) Sponsored by: EPSRC Differential Revision: https://reviews.freebsd.org/D28212 --- lib/libsysdecode/mktables | 2 +- sys/amd64/linux/linux_ptrace.c | 98 +++++++++++++++++++++++++++++++++-- sys/compat/freebsd32/freebsd32_misc.c | 3 ++ sys/kern/sys_process.c | 17 ++++++ sys/sys/ptrace.h | 4 ++ 5 files changed, 120 insertions(+), 4 deletions(-) diff --git a/lib/libsysdecode/mktables b/lib/libsysdecode/mktables index 3d152a3a2646..1c263fd3b0b2 100644 --- a/lib/libsysdecode/mktables +++ b/lib/libsysdecode/mktables @@ -116,7 +116,7 @@ gen_table "nfssvcflags" "NFSSVC_[A-Z0-9]+[[:space:]]+0x[0-9]+" "nfs/ gen_table "pathconfname" "_PC_[A-Z4_]+[[:space:]]+[0-9]+" "sys/unistd.h" gen_table "prio" "PRIO_[A-Z]+[[:space:]]+[0-9]" "sys/resource.h" gen_table "procctlcmd" "PROC_[A-Z_]+[[:space:]]+[0-9]" "sys/procctl.h" "PROC_TRACE_CTL_" -gen_table "ptraceop" "PT_[[:alnum:]_]+[[:space:]]+[0-9]+" "sys/ptrace.h" +gen_table "ptraceop" "PT_[[:alnum:]_]+[[:space:]]+[0-9]+" "sys/ptrace.h" "PT_GET_SC_ARGS_ALL" gen_table "quotactlcmds" "Q_[A-Z]+[[:space:]]+0x[0-9]+" "ufs/ufs/quota.h" gen_table "rebootopt" "RB_[A-Z]+[[:space:]]+0x[0-9]+" "sys/reboot.h" gen_table "rforkflags" "RF[A-Z]+[[:space:]]+\([0-9]+<<[0-9]+\)" "sys/unistd.h" diff --git a/sys/amd64/linux/linux_ptrace.c b/sys/amd64/linux/linux_ptrace.c index 3afaded3a203..70e52c528c72 100644 --- a/sys/amd64/linux/linux_ptrace.c +++ b/sys/amd64/linux/linux_ptrace.c @@ -93,6 +93,12 @@ __FBSDID("$FreeBSD$"); LINUX_PTRACE_O_TRACESECCOMP | LINUX_PTRACE_O_EXITKILL | \ LINUX_PTRACE_O_SUSPEND_SECCOMP) +#define LINUX_PTRACE_SYSCALL_INFO_NONE 0 +#define LINUX_PTRACE_SYSCALL_INFO_ENTRY 1 +#define LINUX_PTRACE_SYSCALL_INFO_EXIT 2 + +#define LINUX_ARCH_AMD64 0xc000003e + static int map_signum(int lsig, int *bsigp) { @@ -172,6 +178,28 @@ struct linux_pt_reg { l_ulong ss; }; +struct syscall_info { + uint8_t op; + uint32_t arch; + uint64_t instruction_pointer; + uint64_t stack_pointer; + union { + struct { + uint64_t nr; + uint64_t args[6]; + } entry; + struct { + int64_t rval; + uint8_t is_error; + } exit; + struct { + uint64_t nr; + uint64_t args[6]; + uint32_t ret_data; + } seccomp; + }; +}; + /* * Translate amd64 ptrace registers between Linux and FreeBSD formats. * The translation is pretty straighforward, for all registers but @@ -495,11 +523,75 @@ linux_ptrace_seize(struct thread *td, pid_t pid, l_ulong addr, l_ulong data) } static int -linux_ptrace_get_syscall_info(struct thread *td, pid_t pid, l_ulong addr, l_ulong data) +linux_ptrace_get_syscall_info(struct thread *td, pid_t pid, + l_ulong addr, l_ulong data) { + struct ptrace_lwpinfo lwpinfo; + struct ptrace_sc_ret sr; + struct reg b_reg; + struct syscall_info si; + int error; - linux_msg(td, "PTRACE_GET_SYSCALL_INFO not implemented; returning EINVAL"); - return (EINVAL); + error = kern_ptrace(td, PT_LWPINFO, pid, &lwpinfo, sizeof(lwpinfo)); + if (error != 0) { + linux_msg(td, "PT_LWPINFO failed with error %d", error); + return (error); + } + + memset(&si, 0, sizeof(si)); + + if (lwpinfo.pl_flags & PL_FLAG_SCE) { + si.op = LINUX_PTRACE_SYSCALL_INFO_ENTRY; + si.entry.nr = lwpinfo.pl_syscall_code; + /* + * The reason for using PT_GET_SC_ARGS_ALL instead + * of PT_GET_SC_ARGS is to emulate Linux bug which strace(1) + * depends on: at initialization it tests whether ptrace works + * by calling close(2), or some other single-argument syscall, + * _with six arguments_, and then verifies whether it can + * fetch them all using this API; otherwise it bails out. + */ + error = kern_ptrace(td, PT_GET_SC_ARGS_ALL, pid, + &si.entry.args, sizeof(si.entry.args)); + if (error != 0) { + linux_msg(td, "PT_GET_SC_ARGS_ALL failed with error %d", + error); + return (error); + } + } else if (lwpinfo.pl_flags & PL_FLAG_SCX) { + si.op = LINUX_PTRACE_SYSCALL_INFO_EXIT; + error = kern_ptrace(td, PT_GET_SC_RET, pid, &sr, sizeof(sr)); + + if (error != 0) { + linux_msg(td, "PT_GET_SC_RET failed with error %d", + error); + return (error); + } + + if (sr.sr_error == 0) { + si.exit.rval = sr.sr_retval[0]; + si.exit.is_error = 0; + } else { + si.exit.rval = bsd_to_linux_errno(sr.sr_error); + si.exit.is_error = 1; + } + } else { + si.op = LINUX_PTRACE_SYSCALL_INFO_NONE; + } + + error = kern_ptrace(td, PT_GETREGS, pid, &b_reg, 0); + if (error != 0) + return (error); + + si.arch = LINUX_ARCH_AMD64; + si.instruction_pointer = b_reg.r_rip; + si.stack_pointer = b_reg.r_rsp; + + error = copyout(&si, (void *)data, sizeof(si)); + if (error == 0) + td->td_retval[0] = sizeof(si); + + return (error); } int diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index c417a64d286a..01d772b35ee8 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -1032,6 +1032,9 @@ freebsd32_ptrace(struct thread *td, struct freebsd32_ptrace_args *uap) r.pc.pc_limit = PAIR32TO64(off_t, r32.pc.pc_limit); data = sizeof(r.pc); break; + case PT_GET_SC_ARGS_ALL: + error = EINVAL; + break; default: addr = uap->addr; break; diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 1b97424c58ca..e2d8042744d0 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -527,6 +527,9 @@ sys_ptrace(struct thread *td, struct ptrace_args *uap) else error = copyin(uap->addr, &r.pc, uap->data); break; + case PT_GET_SC_ARGS_ALL: + error = EINVAL; + break; default: addr = uap->addr; break; @@ -708,6 +711,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) case PT_SET_EVENT_MASK: case PT_DETACH: case PT_GET_SC_ARGS: + case PT_GET_SC_ARGS_ALL: sx_xlock(&proctree_lock); proctree_locked = true; break; @@ -1011,6 +1015,19 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) sizeof(register_t)); break; + case PT_GET_SC_ARGS_ALL: + CTR1(KTR_PTRACE, "PT_GET_SC_ARGS_ALL: pid %d", p->p_pid); + if ((td2->td_dbgflags & (TDB_SCE | TDB_SCX)) == 0 +#ifdef COMPAT_FREEBSD32 + || (wrap32 && !safe) +#endif + ) { + error = EINVAL; + break; + } + bcopy(td2->td_sa.args, addr, sizeof(td2->td_sa.args)); + break; + case PT_GET_SC_RET: if ((td2->td_dbgflags & (TDB_SCX)) == 0 #ifdef COMPAT_FREEBSD32 diff --git a/sys/sys/ptrace.h b/sys/sys/ptrace.h index 1e7c1c71056b..066a54f721c8 100644 --- a/sys/sys/ptrace.h +++ b/sys/sys/ptrace.h @@ -86,6 +86,10 @@ #define PT_VM_TIMESTAMP 40 /* Get VM version (timestamp) */ #define PT_VM_ENTRY 41 /* Get VM map (entry) */ +#ifdef _KERNEL +#define PT_GET_SC_ARGS_ALL 42 /* Used by linux(4) */ +#endif + #define PT_FIRSTMACH 64 /* for machine-specific requests */ #include /* machine-specific requests, if any */ From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:46:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 68C1D671106; Tue, 14 Sep 2021 20:46:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8Fkn2CGrz3JHK; Tue, 14 Sep 2021 20:46:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BB6721699; Tue, 14 Sep 2021 20:46:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EKkfM0043872; Tue, 14 Sep 2021 20:46:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EKkfEN043871; Tue, 14 Sep 2021 20:46:41 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:46:41 GMT Message-Id: <202109142046.18EKkfEN043871@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 1ecbc1d8e9d3 - main - cxgbe tom: Don't queue AIO requests on listen sockets. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1ecbc1d8e9d3fbcd8e68fc68f0a32944a12ddb1e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:46:41 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=1ecbc1d8e9d3fbcd8e68fc68f0a32944a12ddb1e commit 1ecbc1d8e9d3fbcd8e68fc68f0a32944a12ddb1e Author: John Baldwin AuthorDate: 2021-09-14 20:46:14 +0000 Commit: John Baldwin CommitDate: 2021-09-14 20:46:14 +0000 cxgbe tom: Don't queue AIO requests on listen sockets. This is similar to the fixes in 141fe2dceeae. One difference is that TOE sockets do not change states (listen vs non-listen) once created, so no lock is needed for SOLISTENING(). Sponsored by: Chelsio Communications --- sys/dev/cxgbe/tom/t4_tom.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/dev/cxgbe/tom/t4_tom.c b/sys/dev/cxgbe/tom/t4_tom.c index a444f0c9d690..41f55fdbd426 100644 --- a/sys/dev/cxgbe/tom/t4_tom.c +++ b/sys/dev/cxgbe/tom/t4_tom.c @@ -1989,6 +1989,13 @@ t4_aio_queue_tom(struct socket *so, struct kaiocb *job) struct toepcb *toep = tp->t_toe; int error; + /* + * No lock is needed as TOE sockets never change between + * active and passive. + */ + if (SOLISTENING(so)) + return (EINVAL); + if (ulp_mode(toep) == ULP_MODE_TCPDDP) { error = t4_aio_queue_ddp(so, job); if (error != EOPNOTSUPP) From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:46:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9CD53671085; Tue, 14 Sep 2021 20:46:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8Fkp34Qvz3JFD; Tue, 14 Sep 2021 20:46:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A791214D9; Tue, 14 Sep 2021 20:46:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EKkgsQ043896; Tue, 14 Sep 2021 20:46:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EKkgFI043895; Tue, 14 Sep 2021 20:46:42 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:46:42 GMT Message-Id: <202109142046.18EKkgFI043895@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 5dbf8c1588da - main - cxgbe tom: Update rcv_nxt for a FIN after handle_ddp_close(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5dbf8c1588da167c17c45bdf78de51fcb4929504 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:46:42 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5dbf8c1588da167c17c45bdf78de51fcb4929504 commit 5dbf8c1588da167c17c45bdf78de51fcb4929504 Author: John Baldwin AuthorDate: 2021-09-14 20:46:14 +0000 Commit: John Baldwin CommitDate: 2021-09-14 20:46:14 +0000 cxgbe tom: Update rcv_nxt for a FIN after handle_ddp_close(). For TCP DDP, handle_ddp_close() needs to see the pre-FIN rcv_nxt to determine how much data was placed in the local buffer before the FIN was received. The changes in d59f1c49e26b broke this by updating rcv_nxt before calling handle_ddp_close(). Fixes: d59f1c49e26b cxgbe tom: Permit rcv_nxt mismatches on FIN for iSCSI connections on T6. Sponsored by: Chelsio Communications --- sys/dev/cxgbe/tom/t4_cpl_io.c | 20 ++++++++++---------- sys/dev/cxgbe/tom/t4_ddp.c | 3 ++- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index ca04cb88b10f..4c558df3f258 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -1374,6 +1374,16 @@ do_peer_close(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) if (toep->flags & TPF_ABORT_SHUTDOWN) goto done; + so = inp->inp_socket; + socantrcvmore(so); + if (ulp_mode(toep) == ULP_MODE_TCPDDP) { + DDP_LOCK(toep); + if (__predict_false(toep->ddp.flags & + (DDP_BUF0_ACTIVE | DDP_BUF1_ACTIVE))) + handle_ddp_close(toep, tp, cpl->rcv_nxt); + DDP_UNLOCK(toep); + } + if (ulp_mode(toep) == ULP_MODE_RDMA || (ulp_mode(toep) == ULP_MODE_ISCSI && chip_id(sc) >= CHELSIO_T6)) { /* @@ -1390,16 +1400,6 @@ do_peer_close(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) tp->rcv_nxt = be32toh(cpl->rcv_nxt); - so = inp->inp_socket; - socantrcvmore(so); - if (ulp_mode(toep) == ULP_MODE_TCPDDP) { - DDP_LOCK(toep); - if (__predict_false(toep->ddp.flags & - (DDP_BUF0_ACTIVE | DDP_BUF1_ACTIVE))) - handle_ddp_close(toep, tp, cpl->rcv_nxt); - DDP_UNLOCK(toep); - } - switch (tp->t_state) { case TCPS_SYN_RECEIVED: tp->t_starttime = ticks; diff --git a/sys/dev/cxgbe/tom/t4_ddp.c b/sys/dev/cxgbe/tom/t4_ddp.c index 2b58cb60d4fd..be142ffb9e4f 100644 --- a/sys/dev/cxgbe/tom/t4_ddp.c +++ b/sys/dev/cxgbe/tom/t4_ddp.c @@ -700,7 +700,8 @@ handle_ddp_close(struct toepcb *toep, struct tcpcb *tp, __be32 rcv_nxt) INP_WLOCK_ASSERT(toep->inp); DDP_ASSERT_LOCKED(toep); - len = be32toh(rcv_nxt) - tp->rcv_nxt; + /* - 1 is to ignore the byte for FIN */ + len = be32toh(rcv_nxt) - tp->rcv_nxt - 1; tp->rcv_nxt += len; while (toep->ddp.active_count > 0) { From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:46:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E7750670E5B; Tue, 14 Sep 2021 20:46:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8Fkq5yCJz3J8c; Tue, 14 Sep 2021 20:46:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CD4121627; Tue, 14 Sep 2021 20:46:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EKkhvD043924; Tue, 14 Sep 2021 20:46:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EKkhh4043923; Tue, 14 Sep 2021 20:46:43 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:46:43 GMT Message-Id: <202109142046.18EKkhh4043923@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 9affbb0f5271 - main - cxgbe tom: Enter network epoch in t4_aiotx_task(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9affbb0f5271b199de8a2203fd7d8b1fbedca2af Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:46:44 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9affbb0f5271b199de8a2203fd7d8b1fbedca2af commit 9affbb0f5271b199de8a2203fd7d8b1fbedca2af Author: John Baldwin AuthorDate: 2021-09-14 20:46:15 +0000 Commit: John Baldwin CommitDate: 2021-09-14 20:46:15 +0000 cxgbe tom: Enter network epoch in t4_aiotx_task(). While here, don't restore the old vnet until after sorele(). Sponsored by: Chelsio Communications --- sys/dev/cxgbe/tom/t4_cpl_io.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/cxgbe/tom/t4_cpl_io.c b/sys/dev/cxgbe/tom/t4_cpl_io.c index 4c558df3f258..686819065863 100644 --- a/sys/dev/cxgbe/tom/t4_cpl_io.c +++ b/sys/dev/cxgbe/tom/t4_cpl_io.c @@ -2353,9 +2353,11 @@ t4_aiotx_task(void *context, int pending) struct toepcb *toep = context; struct socket *so; struct kaiocb *job; + struct epoch_tracker et; so = toep->aiotx_so; CURVNET_SET(toep->vnet); + NET_EPOCH_ENTER(et); SOCKBUF_LOCK(&so->so_snd); while (!TAILQ_EMPTY(&toep->aiotx_jobq) && sowriteable(so)) { job = TAILQ_FIRST(&toep->aiotx_jobq); @@ -2367,11 +2369,12 @@ t4_aiotx_task(void *context, int pending) } toep->aiotx_so = NULL; SOCKBUF_UNLOCK(&so->so_snd); - CURVNET_RESTORE(); + NET_EPOCH_EXIT(et); free_toepcb(toep); SOCK_LOCK(so); sorele(so); + CURVNET_RESTORE(); } static void From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:51:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9437E67132E; Tue, 14 Sep 2021 20:51:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8Fqt3lT0z3JZK; Tue, 14 Sep 2021 20:51:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 609EB215CA; Tue, 14 Sep 2021 20:51:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18EKp6n9052572; Tue, 14 Sep 2021 20:51:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18EKp64w052571; Tue, 14 Sep 2021 20:51:06 GMT (envelope-from git) Date: Tue, 14 Sep 2021 20:51:06 GMT Message-Id: <202109142051.18EKp64w052571@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: 5dc5f849be90 - main - tools/test/upsdl: fix compiler warnings MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5dc5f849be9047309d32c4df8e7ee617c27ec43f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:51:06 -0000 The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=5dc5f849be9047309d32c4df8e7ee617c27ec43f commit 5dc5f849be9047309d32c4df8e7ee617c27ec43f Author: Alan Somers AuthorDate: 2021-09-14 20:50:01 +0000 Commit: Alan Somers CommitDate: 2021-09-14 20:50:01 +0000 tools/test/upsdl: fix compiler warnings MFC after: 2 weeks Sponsored by: Axcient --- tools/test/upsdl/upsdl.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/test/upsdl/upsdl.c b/tools/test/upsdl/upsdl.c index fc4a761e450b..960b034ffcfe 100644 --- a/tools/test/upsdl/upsdl.c +++ b/tools/test/upsdl/upsdl.c @@ -32,20 +32,21 @@ #include #include #include +#include #include -int prepareFile(char* filename,int* fdp); +int prepareFile(const char* filename,int* fdp); int mapBuffer(char** bufferp,int fd1,int fd2); int startIO(int fd,char *buffer); -int pagesize; +static int pagesize; #define FILESIZE (32*1024) -char wbuffer[FILESIZE]; +static char wbuffer[FILESIZE]; /* Create a FILESIZE sized file - then remove file data from the cache*/ -int prepareFile(char* filename,int* fdp) +int prepareFile(const char* filename,int* fdp) { int fd; int len; @@ -134,7 +135,7 @@ int startIO(int fd,char *buffer) } -int main(int argc,char *argv[],char *envp[]) +int main(int argc __unused, char *argv[] __unused) { int fdA,fdB,fdDelayA,fdDelayB; From owner-dev-commits-src-all@freebsd.org Tue Sep 14 20:53:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA40C671172; Tue, 14 Sep 2021 20:53:29 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8Ftd4qjGz3L8R; Tue, 14 Sep 2021 20:53:29 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi1-f176.google.com with SMTP id bd1so1063167oib.5; Tue, 14 Sep 2021 13:53:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=su3faFPazvSp0p9xlGtdC9I1yunW3UbVWIb0oP1yTLI=; b=OPITaAtedDLFhM1elpOBClEXe39nBAYSysgLTVtOCKWJfMhBdJyyqRNAwLnwcUaog0 p1jAO4t+VPHnwefzK26g+8KY4gzzVVcFaHACEe38PU94QD0ZDro+/9CcB4eMN2yOe13E YajnGxVPLFNKm14nJ7b5ddUNO8ZdF3ld3WidNURoE1vHIVY32kCWQnEGGkzX3in0LUT5 LZquChc1K/sgZdwmJ61tnxsslEBUA8X5CHYy5q0phFUIfuEL9xApHJnWaHETnebBBb6V 3u0QMCG/2XUNWv8LBGcVl4uQzJpJ/c06lPsuNLFAzbBSTPYr4Uk0N1zHve3E0Gm/K7qk gSSw== X-Gm-Message-State: AOAM533IJjbscJ30VdFxvb47yIHwzP4REfdSzrbJEKj1hffgEJQfrU4f psz4S9ODcHuDzM9N3aGPNkxd086srSIhmujVLfmC0a6E X-Google-Smtp-Source: ABdhPJxiNWqbu2vPJGuOMonF3aK0FnKDnYKclQqQP1ZGS40JShM66ar9h0GQEHBG4JdermGu/yo6ZfP5+8q7PaGbxZY= X-Received: by 2002:a54:4e94:: with SMTP id c20mr2902901oiy.57.1631652803303; Tue, 14 Sep 2021 13:53:23 -0700 (PDT) MIME-Version: 1.0 References: <202109142046.18EKkfEN043871@gitrepo.freebsd.org> In-Reply-To: <202109142046.18EKkfEN043871@gitrepo.freebsd.org> From: Alan Somers Date: Tue, 14 Sep 2021 14:53:11 -0600 Message-ID: Subject: Re: git: 1ecbc1d8e9d3 - main - cxgbe tom: Don't queue AIO requests on listen sockets. To: John Baldwin Cc: src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4H8Ftd4qjGz3L8R X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:53:29 -0000 On Tue, Sep 14, 2021 at 2:46 PM John Baldwin wrote: > The branch main has been updated by jhb: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=1ecbc1d8e9d3fbcd8e68fc68f0a32944a12ddb1e > > commit 1ecbc1d8e9d3fbcd8e68fc68f0a32944a12ddb1e > Author: John Baldwin > AuthorDate: 2021-09-14 20:46:14 +0000 > Commit: John Baldwin > CommitDate: 2021-09-14 20:46:14 +0000 > > cxgbe tom: Don't queue AIO requests on listen sockets. > > This is similar to the fixes in 141fe2dceeae. One difference is that > TOE sockets do not change states (listen vs non-listen) once created, > so no lock is needed for SOLISTENING(). > > Sponsored by: Chelsio Communications > I've always wondered: what's the point to using AIO with sockets? Can't everything socket-related be done better with non-blocking read/write and kqueue? From owner-dev-commits-src-all@freebsd.org Tue Sep 14 21:40:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7CE616719BE; Tue, 14 Sep 2021 21:40:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8Gx234D5z3n7M; Tue, 14 Sep 2021 21:40:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AC9721FB2; Tue, 14 Sep 2021 21:40:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18ELecfT019277; Tue, 14 Sep 2021 21:40:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ELectS019276; Tue, 14 Sep 2021 21:40:38 GMT (envelope-from git) Date: Tue, 14 Sep 2021 21:40:38 GMT Message-Id: <202109142140.18ELectS019276@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 02d8194012a9 - main - mps/mpr(4): Move xpt_register_async() out of lock. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 02d8194012a9a0e367a92c7f89567b808bf0e9a8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 21:40:38 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=02d8194012a9a0e367a92c7f89567b808bf0e9a8 commit 02d8194012a9a0e367a92c7f89567b808bf0e9a8 Author: Alexander Motin AuthorDate: 2021-09-14 21:37:02 +0000 Commit: Alexander Motin CommitDate: 2021-09-14 21:40:32 +0000 mps/mpr(4): Move xpt_register_async() out of lock. It fixes lock ordere reversal between SIM and device locks. Also remove registration for AC_FOUND_DEVICE, unused for a while now. MFC after: 1 month --- sys/dev/mpr/mpr_sas.c | 21 +++++++++++---------- sys/dev/mps/mps_sas.c | 18 ++++++++++-------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/sys/dev/mpr/mpr_sas.c b/sys/dev/mpr/mpr_sas.c index a8bb7c90b5c4..9b69e0654ae4 100644 --- a/sys/dev/mpr/mpr_sas.c +++ b/sys/dev/mpr/mpr_sas.c @@ -821,6 +821,8 @@ mpr_attach_sas(struct mpr_softc *sc) callout_init(&sassc->discovery_callout, 1 /*mpsafe*/); + mpr_unlock(sc); + /* * Register for async events so we can determine the EEDP * capabilities of devices. @@ -835,7 +837,7 @@ mpr_attach_sas(struct mpr_softc *sc) } else { int event; - event = AC_ADVINFO_CHANGED | AC_FOUND_DEVICE; + event = AC_ADVINFO_CHANGED; status = xpt_register_async(event, mprsas_async, sc, sassc->path); @@ -855,8 +857,6 @@ mpr_attach_sas(struct mpr_softc *sc) mpr_printf(sc, "EEDP capabilities disabled.\n"); } - mpr_unlock(sc); - mprsas_register_events(sc); out: if (error) @@ -890,12 +890,6 @@ mpr_detach_sas(struct mpr_softc *sc) if (sassc->ev_tq != NULL) taskqueue_free(sassc->ev_tq); - /* Make sure CAM doesn't wedge if we had to bail out early. */ - mpr_lock(sc); - - while (sassc->startup_refcount != 0) - mprsas_startup_decrement(sassc); - /* Deregister our async handler */ if (sassc->path != NULL) { xpt_register_async(0, mprsas_async, sc, sassc->path); @@ -903,6 +897,12 @@ mpr_detach_sas(struct mpr_softc *sc) sassc->path = NULL; } + /* Make sure CAM doesn't wedge if we had to bail out early. */ + mpr_lock(sc); + + while (sassc->startup_refcount != 0) + mprsas_startup_decrement(sassc); + if (sassc->flags & MPRSAS_IN_STARTUP) xpt_release_simq(sassc->sim, 1); @@ -3326,6 +3326,7 @@ mprsas_async(void *callback_arg, uint32_t code, struct cam_path *path, sc = (struct mpr_softc *)callback_arg; + mpr_lock(sc); switch (code) { case AC_ADVINFO_CHANGED: { struct mprsas_target *target; @@ -3413,10 +3414,10 @@ mprsas_async(void *callback_arg, uint32_t code, struct cam_path *path, } break; } - case AC_FOUND_DEVICE: default: break; } + mpr_unlock(sc); } /* diff --git a/sys/dev/mps/mps_sas.c b/sys/dev/mps/mps_sas.c index 2413fa532d92..c86cf1850048 100644 --- a/sys/dev/mps/mps_sas.c +++ b/sys/dev/mps/mps_sas.c @@ -779,6 +779,8 @@ mps_attach_sas(struct mps_softc *sc) callout_init(&sassc->discovery_callout, 1 /*mpsafe*/); + mps_unlock(sc); + /* * Register for async events so we can determine the EEDP * capabilities of devices. @@ -812,8 +814,6 @@ mps_attach_sas(struct mps_softc *sc) mps_printf(sc, "EEDP capabilities disabled.\n"); } - mps_unlock(sc); - mpssas_register_events(sc); out: if (error) @@ -847,12 +847,6 @@ mps_detach_sas(struct mps_softc *sc) if (sassc->ev_tq != NULL) taskqueue_free(sassc->ev_tq); - /* Make sure CAM doesn't wedge if we had to bail out early. */ - mps_lock(sc); - - while (sassc->startup_refcount != 0) - mpssas_startup_decrement(sassc); - /* Deregister our async handler */ if (sassc->path != NULL) { xpt_register_async(0, mpssas_async, sc, sassc->path); @@ -860,6 +854,12 @@ mps_detach_sas(struct mps_softc *sc) sassc->path = NULL; } + /* Make sure CAM doesn't wedge if we had to bail out early. */ + mps_lock(sc); + + while (sassc->startup_refcount != 0) + mpssas_startup_decrement(sassc); + if (sassc->flags & MPSSAS_IN_STARTUP) xpt_release_simq(sassc->sim, 1); @@ -3150,6 +3150,7 @@ mpssas_async(void *callback_arg, uint32_t code, struct cam_path *path, sc = (struct mps_softc *)callback_arg; + mps_lock(sc); switch (code) { case AC_ADVINFO_CHANGED: { struct mpssas_target *target; @@ -3241,6 +3242,7 @@ mpssas_async(void *callback_arg, uint32_t code, struct cam_path *path, default: break; } + mps_unlock(sc); } /* From owner-dev-commits-src-all@freebsd.org Tue Sep 14 22:45:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D42A36727AF; Tue, 14 Sep 2021 22:45:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8JMm3CFBz4YDg; Tue, 14 Sep 2021 22:45:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 18EMjG7I004715 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 15 Sep 2021 01:45:19 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 18EMjG7I004715 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 18EMjGYo004712; Wed, 15 Sep 2021 01:45:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 15 Sep 2021 01:45:16 +0300 From: Konstantin Belousov To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: bdf0f24bb16d - main - linux: implement PTRACE_GET_SYSCALL_INFO Message-ID: References: <202109142041.18EKf6RU040962@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202109142041.18EKf6RU040962@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4H8JMm3CFBz4YDg X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 22:45:24 -0000 On Tue, Sep 14, 2021 at 08:41:06PM +0000, Edward Tomasz Napierala wrote: > The branch main has been updated by trasz: > > URL: https://cgit.FreeBSD.org/src/commit/?id=bdf0f24bb16d556a5b1e01cdfc087d08e91ac572 > > commit bdf0f24bb16d556a5b1e01cdfc087d08e91ac572 > Author: Edward Tomasz Napierala > AuthorDate: 2021-09-12 11:31:10 +0000 > Commit: Edward Tomasz Napierala > CommitDate: 2021-09-14 20:19:55 +0000 > > linux: implement PTRACE_GET_SYSCALL_INFO > > This is one of the pieces required to make modern (ie Focal) > strace(1) work. > > Reviewed By: jhb (earlier version) > Sponsored by: EPSRC > Differential Revision: https://reviews.freebsd.org/D28212 > --- > lib/libsysdecode/mktables | 2 +- > sys/amd64/linux/linux_ptrace.c | 98 +++++++++++++++++++++++++++++++++-- > sys/compat/freebsd32/freebsd32_misc.c | 3 ++ > sys/kern/sys_process.c | 17 ++++++ > sys/sys/ptrace.h | 4 ++ > 5 files changed, 120 insertions(+), 4 deletions(-) > > + case PT_GET_SC_ARGS_ALL: > + CTR1(KTR_PTRACE, "PT_GET_SC_ARGS_ALL: pid %d", p->p_pid); > + if ((td2->td_dbgflags & (TDB_SCE | TDB_SCX)) == 0 > +#ifdef COMPAT_FREEBSD32 > + || (wrap32 && !safe) > +#endif > + ) { > + error = EINVAL; > + break; > + } > + bcopy(td2->td_sa.args, addr, sizeof(td2->td_sa.args)); > + break; This is awful, you already got that feedback in review, as I read it. I strongly suggest to remove PT_GET_SC_ARGS_ALL, and instead checks something in the implementation of PT_GET_SC_ARGS to select either full copy or just nargs args. Easiest thing for 'something' would be SV_PROC_ABI(p) == SV_ABI_LINUX. From owner-dev-commits-src-all@freebsd.org Tue Sep 14 22:52:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 519BE672C6A; Tue, 14 Sep 2021 22:52:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8JWr2rWjz4ZcM; Tue, 14 Sep 2021 22:52:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 18EMqH1s006830 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 15 Sep 2021 01:52:20 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 18EMqH1s006830 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 18EMqHwO006829; Wed, 15 Sep 2021 01:52:17 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 15 Sep 2021 01:52:17 +0300 From: Konstantin Belousov To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: bdf0f24bb16d - main - linux: implement PTRACE_GET_SYSCALL_INFO Message-ID: References: <202109142041.18EKf6RU040962@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4H8JWr2rWjz4ZcM X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [-2.22 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.983]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_SPF_SOFTFAIL(0.00)[~all:c]; TO_DN_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.24)[-0.241]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; MIME_TRACE(0.00)[0:+]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 22:52:25 -0000 On Wed, Sep 15, 2021 at 01:45:16AM +0300, Konstantin Belousov wrote: > On Tue, Sep 14, 2021 at 08:41:06PM +0000, Edward Tomasz Napierala wrote: > > The branch main has been updated by trasz: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=bdf0f24bb16d556a5b1e01cdfc087d08e91ac572 > > > > commit bdf0f24bb16d556a5b1e01cdfc087d08e91ac572 > > Author: Edward Tomasz Napierala > > AuthorDate: 2021-09-12 11:31:10 +0000 > > Commit: Edward Tomasz Napierala > > CommitDate: 2021-09-14 20:19:55 +0000 > > > > linux: implement PTRACE_GET_SYSCALL_INFO > > > > This is one of the pieces required to make modern (ie Focal) > > strace(1) work. > > > > Reviewed By: jhb (earlier version) > > Sponsored by: EPSRC > > Differential Revision: https://reviews.freebsd.org/D28212 > > --- > > lib/libsysdecode/mktables | 2 +- > > sys/amd64/linux/linux_ptrace.c | 98 +++++++++++++++++++++++++++++++++-- > > sys/compat/freebsd32/freebsd32_misc.c | 3 ++ > > sys/kern/sys_process.c | 17 ++++++ > > sys/sys/ptrace.h | 4 ++ > > 5 files changed, 120 insertions(+), 4 deletions(-) > > > > + case PT_GET_SC_ARGS_ALL: > > + CTR1(KTR_PTRACE, "PT_GET_SC_ARGS_ALL: pid %d", p->p_pid); > > + if ((td2->td_dbgflags & (TDB_SCE | TDB_SCX)) == 0 > > +#ifdef COMPAT_FREEBSD32 > > + || (wrap32 && !safe) > > +#endif > > + ) { > > + error = EINVAL; > > + break; > > + } > > + bcopy(td2->td_sa.args, addr, sizeof(td2->td_sa.args)); > > + break; > > This is awful, you already got that feedback in review, as I read it. > I strongly suggest to remove PT_GET_SC_ARGS_ALL, and instead checks something > in the implementation of PT_GET_SC_ARGS to select either full copy or just > nargs args. > > Easiest thing for 'something' would be SV_PROC_ABI(p) == SV_ABI_LINUX. It should be SV_PROC_ABI(td->td_proc) == SV_ABI_LINUX. From owner-dev-commits-src-all@freebsd.org Tue Sep 14 22:54:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 297BA672D87 for ; Tue, 14 Sep 2021 22:54:17 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8JZ10Fhrz4bX1 for ; Tue, 14 Sep 2021 22:54:17 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wm1-f46.google.com with SMTP id s24so706001wmh.4 for ; Tue, 14 Sep 2021 15:54:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=DsJU0Jxs0hBwsxAQsLEhhEi7QLH5HrgYZ0H5iQQXB7g=; b=NAYYnJ4Y7bsvas1pLVxLws60Djd6Dlja6/SarXekEA1QlTVEMH+xyHRHGtXSL8suQU bsw7nMB0SYDAKd4pYH6Uoxir80pPT+RVaSa4MVvCI8ezuegnItN3oUiM25EF+n6QbBJL CTPr76czePeHJK93A/QId1s4b8FwhStIyGlqDE+ur91zZOwAtvktWoFhYh9cyeQ8FoyG dJqGlUL9lazwq23ZUfJxl67unwuKNzo8/dr6iLYt9j3VCC1yoMeFDYRWxVcbG3WslOHV NwOjaclvgtPv1+2bHkkVrEUU0XqTtp83LuzCeOLn1ruUZeMZlzHTP4BGNaCBiwmpK2Q+ k69Q== X-Gm-Message-State: AOAM5334naSh8LaCS5xp4z/XsAagBjnWclu6SvSx3QYKp3mS8yWnksAD 7pIPCCWpVZ6Ep536r+MmFpdOKcm1GKJGpizi X-Google-Smtp-Source: ABdhPJwWxSPTMSIMHwYpg9mnK8zI7qwmRbjeLfuz6xz7v9z0ZwSYscvFCiNCgeQxOY2ChhXF8DU+vw== X-Received: by 2002:a7b:c351:: with SMTP id l17mr1344455wmj.120.1631660050144; Tue, 14 Sep 2021 15:54:10 -0700 (PDT) Received: from smtpclient.apple (global-5-143.nat-2.net.cam.ac.uk. [131.111.5.143]) by smtp.gmail.com with ESMTPSA id z17sm6248693wrr.49.2021.09.14.15.54.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Sep 2021 15:54:09 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: bdf0f24bb16d - main - linux: implement PTRACE_GET_SYSCALL_INFO From: Jessica Clarke In-Reply-To: Date: Tue, 14 Sep 2021 23:54:08 +0100 Cc: Edward Tomasz Napierala , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <7C375F3A-889E-440F-A164-959A9A903733@freebsd.org> References: <202109142041.18EKf6RU040962@gitrepo.freebsd.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4H8JZ10Fhrz4bX1 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 22:54:17 -0000 On 14 Sep 2021, at 23:45, Konstantin Belousov = wrote: >=20 > On Tue, Sep 14, 2021 at 08:41:06PM +0000, Edward Tomasz Napierala = wrote: >> The branch main has been updated by trasz: >>=20 >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dbdf0f24bb16d556a5b1e01cdfc087d08= e91ac572 >>=20 >> commit bdf0f24bb16d556a5b1e01cdfc087d08e91ac572 >> Author: Edward Tomasz Napierala >> AuthorDate: 2021-09-12 11:31:10 +0000 >> Commit: Edward Tomasz Napierala >> CommitDate: 2021-09-14 20:19:55 +0000 >>=20 >> linux: implement PTRACE_GET_SYSCALL_INFO >>=20 >> This is one of the pieces required to make modern (ie Focal) >> strace(1) work. >>=20 >> Reviewed By: jhb (earlier version) >> Sponsored by: EPSRC >> Differential Revision: https://reviews.freebsd.org/D28212 >> --- >> lib/libsysdecode/mktables | 2 +- >> sys/amd64/linux/linux_ptrace.c | 98 = +++++++++++++++++++++++++++++++++-- >> sys/compat/freebsd32/freebsd32_misc.c | 3 ++ >> sys/kern/sys_process.c | 17 ++++++ >> sys/sys/ptrace.h | 4 ++ >> 5 files changed, 120 insertions(+), 4 deletions(-) >>=20 >> + case PT_GET_SC_ARGS_ALL: >> + CTR1(KTR_PTRACE, "PT_GET_SC_ARGS_ALL: pid %d", = p->p_pid); >> + if ((td2->td_dbgflags & (TDB_SCE | TDB_SCX)) =3D=3D 0 >> +#ifdef COMPAT_FREEBSD32 >> + || (wrap32 && !safe) >> +#endif >> + ) { >> + error =3D EINVAL; >> + break; >> + } >> + bcopy(td2->td_sa.args, addr, sizeof(td2->td_sa.args)); >> + break; >=20 > This is awful, you already got that feedback in review, as I read it. > I strongly suggest to remove PT_GET_SC_ARGS_ALL, and instead checks = something > in the implementation of PT_GET_SC_ARGS to select either full copy or = just > nargs args. >=20 > Easiest thing for 'something' would be SV_PROC_ABI(p) =3D=3D = SV_ABI_LINUX. That is incorrect. The original review just changed PT_GET_SC_ARGS even for FreeBSD and that was what was described as horrible. John suggested two alternatives: this approach, and having the Linuxulator bypass kern_ptrace entirely by doing its own thing. Your option seems simpler but I don=E2=80=99t know if there=E2=80=99s a = good reason why that wasn=E2=80=99t suggested. Jess From owner-dev-commits-src-all@freebsd.org Tue Sep 14 23:16:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E7086673244; Tue, 14 Sep 2021 23:16:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8K3C4cZzz4hBZ; Tue, 14 Sep 2021 23:16:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 18ENFxNY012877 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 15 Sep 2021 02:16:02 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 18ENFxNY012877 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 18ENFxOS012876; Wed, 15 Sep 2021 02:15:59 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 15 Sep 2021 02:15:59 +0300 From: Konstantin Belousov To: Jessica Clarke Cc: Edward Tomasz Napierala , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: bdf0f24bb16d - main - linux: implement PTRACE_GET_SYSCALL_INFO Message-ID: References: <202109142041.18EKf6RU040962@gitrepo.freebsd.org> <7C375F3A-889E-440F-A164-959A9A903733@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7C375F3A-889E-440F-A164-959A9A903733@freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4H8K3C4cZzz4hBZ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 23:16:08 -0000 On Tue, Sep 14, 2021 at 11:54:08PM +0100, Jessica Clarke wrote: > On 14 Sep 2021, at 23:45, Konstantin Belousov wrote: > > > > On Tue, Sep 14, 2021 at 08:41:06PM +0000, Edward Tomasz Napierala wrote: > >> The branch main has been updated by trasz: > >> > >> URL: https://cgit.FreeBSD.org/src/commit/?id=bdf0f24bb16d556a5b1e01cdfc087d08e91ac572 > >> > >> commit bdf0f24bb16d556a5b1e01cdfc087d08e91ac572 > >> Author: Edward Tomasz Napierala > >> AuthorDate: 2021-09-12 11:31:10 +0000 > >> Commit: Edward Tomasz Napierala > >> CommitDate: 2021-09-14 20:19:55 +0000 > >> > >> linux: implement PTRACE_GET_SYSCALL_INFO > >> > >> This is one of the pieces required to make modern (ie Focal) > >> strace(1) work. > >> > >> Reviewed By: jhb (earlier version) > >> Sponsored by: EPSRC > >> Differential Revision: https://reviews.freebsd.org/D28212 > >> --- > >> lib/libsysdecode/mktables | 2 +- > >> sys/amd64/linux/linux_ptrace.c | 98 +++++++++++++++++++++++++++++++++-- > >> sys/compat/freebsd32/freebsd32_misc.c | 3 ++ > >> sys/kern/sys_process.c | 17 ++++++ > >> sys/sys/ptrace.h | 4 ++ > >> 5 files changed, 120 insertions(+), 4 deletions(-) > >> > >> + case PT_GET_SC_ARGS_ALL: > >> + CTR1(KTR_PTRACE, "PT_GET_SC_ARGS_ALL: pid %d", p->p_pid); > >> + if ((td2->td_dbgflags & (TDB_SCE | TDB_SCX)) == 0 > >> +#ifdef COMPAT_FREEBSD32 > >> + || (wrap32 && !safe) > >> +#endif > >> + ) { > >> + error = EINVAL; > >> + break; > >> + } > >> + bcopy(td2->td_sa.args, addr, sizeof(td2->td_sa.args)); > >> + break; > > > > This is awful, you already got that feedback in review, as I read it. > > I strongly suggest to remove PT_GET_SC_ARGS_ALL, and instead checks something > > in the implementation of PT_GET_SC_ARGS to select either full copy or just > > nargs args. > > > > Easiest thing for 'something' would be SV_PROC_ABI(p) == SV_ABI_LINUX. > > That is incorrect. The original review just changed PT_GET_SC_ARGS even > for FreeBSD and that was what was described as horrible. John suggested > two alternatives: this approach, and having the Linuxulator bypass > kern_ptrace entirely by doing its own thing. My view is that - the whole thing with reading past nargs is horrible - having hidden API interface is horrible, it is obvious layering violation when you need to hide an API: the consumer calls at the wrong level. Another reason to dislike this is that we started to add new PT_ verbs at relatively high rate recently. I am aware of at least to more PT_ ops coming in. In other words, we are not too far from exhausting the MI range and then we would need to make some arrangements. Having one more PT_ value, esp. not useful for anything but for layering violation, is not good. From owner-dev-commits-src-all@freebsd.org Wed Sep 15 01:24:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 35DD2674D87; Wed, 15 Sep 2021 01:24:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8Mty0r6dz3F0p; Wed, 15 Sep 2021 01:24:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F17C624D41; Wed, 15 Sep 2021 01:24:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18F1O9KS014480; Wed, 15 Sep 2021 01:24:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18F1O9Lm014479; Wed, 15 Sep 2021 01:24:09 GMT (envelope-from git) Date: Wed, 15 Sep 2021 01:24:09 GMT Message-Id: <202109150124.18F1O9Lm014479@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 6c2d4404161a - main - ipmi(4): Limit maximum watchdog pre-timeout interval. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6c2d4404161aa2bac1c7992afbf5a763f1a6f66e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 01:24:10 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=6c2d4404161aa2bac1c7992afbf5a763f1a6f66e commit 6c2d4404161aa2bac1c7992afbf5a763f1a6f66e Author: Alexander Motin AuthorDate: 2021-09-15 01:06:39 +0000 Commit: Alexander Motin CommitDate: 2021-09-15 01:06:39 +0000 ipmi(4): Limit maximum watchdog pre-timeout interval. Previous code by default setting pre-timeout interval to 120 seconds made impossible to set timeout interval below that, resulting in error 0xcc (Invalid data field in Request) at least on Supermicro boards. To fix that limit maximum pre-timeout interval to ~1/4 of the timeout interval, that sounds like a reasonable default: not too short to fire too late, but also not too long to give many false reports. MFC after: 2 weeks --- sys/dev/ipmi/ipmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/ipmi/ipmi.c b/sys/dev/ipmi/ipmi.c index 77baf652b4bc..a8f3e7f1be10 100644 --- a/sys/dev/ipmi/ipmi.c +++ b/sys/dev/ipmi/ipmi.c @@ -668,7 +668,8 @@ ipmi_set_watchdog(struct ipmi_softc *sc, unsigned int sec) req->ir_request[0] = IPMI_SET_WD_TIMER_DONT_STOP | IPMI_SET_WD_TIMER_SMS_OS; req->ir_request[1] = (wd_timer_actions & 0xff); - req->ir_request[2] = (wd_pretimeout_countdown & 0xff); + req->ir_request[2] = min(0xff, + min(wd_pretimeout_countdown, (sec + 2) / 4)); req->ir_request[3] = 0; /* Timer use */ req->ir_request[4] = (sec * 10) & 0xff; req->ir_request[5] = (sec * 10) >> 8; From owner-dev-commits-src-all@freebsd.org Wed Sep 15 01:32:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3101675022; Wed, 15 Sep 2021 01:32:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8N4n3sKjz3HgC; Wed, 15 Sep 2021 01:32:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6460424D5E; Wed, 15 Sep 2021 01:32:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18F1WfWY027299; Wed, 15 Sep 2021 01:32:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18F1WfR0027298; Wed, 15 Sep 2021 01:32:41 GMT (envelope-from git) Date: Wed, 15 Sep 2021 01:32:41 GMT Message-Id: <202109150132.18F1WfR0027298@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: c519a52692c7 - stable/13 - Align taskqueue_enqueue_timeout() to hardclock. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c519a52692c71f40a7241b108cd4aa90eb5c5b67 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 01:32:41 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=c519a52692c71f40a7241b108cd4aa90eb5c5b67 commit c519a52692c71f40a7241b108cd4aa90eb5c5b67 Author: Alexander Motin AuthorDate: 2021-09-01 03:47:51 +0000 Commit: Alexander Motin CommitDate: 2021-09-15 01:32:34 +0000 Align taskqueue_enqueue_timeout() to hardclock. It is done for all other KPIs using HZ, but was missed here. MFC after: 2 weeks (cherry picked from commit 706b1a5724d668a8752ac89cd67113e4c6917d54) --- sys/kern/subr_taskqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/subr_taskqueue.c b/sys/kern/subr_taskqueue.c index 0f1503c7f7c7..061361cc06d7 100644 --- a/sys/kern/subr_taskqueue.c +++ b/sys/kern/subr_taskqueue.c @@ -343,7 +343,7 @@ taskqueue_enqueue_timeout(struct taskqueue *queue, { return (taskqueue_enqueue_timeout_sbt(queue, ttask, ticks * tick_sbt, - 0, 0)); + 0, C_HARDCLOCK)); } static void From owner-dev-commits-src-all@freebsd.org Wed Sep 15 01:33:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 195F2675200; Wed, 15 Sep 2021 01:33:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8N5D07xVz3Hky; Wed, 15 Sep 2021 01:33:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D916124FFD; Wed, 15 Sep 2021 01:33:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18F1X3nF027462; Wed, 15 Sep 2021 01:33:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18F1X3wZ027461; Wed, 15 Sep 2021 01:33:03 GMT (envelope-from git) Date: Wed, 15 Sep 2021 01:33:03 GMT Message-Id: <202109150133.18F1X3wZ027461@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: ab96b52907d0 - stable/12 - Align taskqueue_enqueue_timeout() to hardclock. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: ab96b52907d0842ed1abef5ead1ddc40d67ebf80 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 01:33:04 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=ab96b52907d0842ed1abef5ead1ddc40d67ebf80 commit ab96b52907d0842ed1abef5ead1ddc40d67ebf80 Author: Alexander Motin AuthorDate: 2021-09-01 03:47:51 +0000 Commit: Alexander Motin CommitDate: 2021-09-15 01:33:00 +0000 Align taskqueue_enqueue_timeout() to hardclock. It is done for all other KPIs using HZ, but was missed here. MFC after: 2 weeks (cherry picked from commit 706b1a5724d668a8752ac89cd67113e4c6917d54) --- sys/kern/subr_taskqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/subr_taskqueue.c b/sys/kern/subr_taskqueue.c index b643c0150c41..66b08f9426f5 100644 --- a/sys/kern/subr_taskqueue.c +++ b/sys/kern/subr_taskqueue.c @@ -342,7 +342,7 @@ taskqueue_enqueue_timeout(struct taskqueue *queue, { return (taskqueue_enqueue_timeout_sbt(queue, ttask, ticks * tick_sbt, - 0, 0)); + 0, C_HARDCLOCK)); } static void From owner-dev-commits-src-all@freebsd.org Wed Sep 15 01:44:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 52AF66751D8; Wed, 15 Sep 2021 01:44:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8NL11dHZz3LpQ; Wed, 15 Sep 2021 01:44:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 181FB253C8; Wed, 15 Sep 2021 01:44:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18F1i9FN041144; Wed, 15 Sep 2021 01:44:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18F1i9Pf041143; Wed, 15 Sep 2021 01:44:09 GMT (envelope-from git) Date: Wed, 15 Sep 2021 01:44:09 GMT Message-Id: <202109150144.18F1i9Pf041143@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 2198a308aded - stable/13 - openssh: simplify login class restrictions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2198a308adedbd064db696f388e8dd93217366e4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 01:44:09 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2198a308adedbd064db696f388e8dd93217366e4 commit 2198a308adedbd064db696f388e8dd93217366e4 Author: Ed Maste AuthorDate: 2021-08-31 19:30:50 +0000 Commit: Ed Maste CommitDate: 2021-09-15 01:42:06 +0000 openssh: simplify login class restrictions Login class-based restrictions were introduced in 5b400a39b8ad. The code was adapted for sshd's Capsicum sandbox and received many changes over time, including at least fc3c19a9fcee, bd393de91cc3, and e8c56fba2926. During an attempt to upstream the work a much simpler approach was suggested. Adopt it now in the in-tree OpenSSH to reduce conflicts with future updates. Submitted by: Yuchiro Naito (against OpenSSH-portable on GitHub) Obtained from: https://github.com/openssh/openssh-portable/pull/262 Reviewed by: allanjude, kevans MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D31760 (cherry picked from commit 27ceebbc2402e4c98203c7eef9696f4bd3d326f8) --- crypto/openssh/auth.c | 18 +++++++ crypto/openssh/auth2.c | 19 ------- crypto/openssh/config.h | 6 +++ crypto/openssh/configure.ac | 2 + crypto/openssh/monitor.c | 61 +++++---------------- crypto/openssh/monitor.h | 3 +- crypto/openssh/monitor_wrap.c | 77 +++++++-------------------- crypto/openssh/monitor_wrap.h | 4 -- crypto/openssh/ssh_namespace.h | 3 -- crypto/openssh/sshbuf-getput-basic.c | 100 ----------------------------------- crypto/openssh/sshbuf.h | 15 ------ 11 files changed, 58 insertions(+), 250 deletions(-) diff --git a/crypto/openssh/auth.c b/crypto/openssh/auth.c index 83be3cb5cbb5..a2e1fa10ce45 100644 --- a/crypto/openssh/auth.c +++ b/crypto/openssh/auth.c @@ -568,6 +568,9 @@ getpwnamallow(const char *user) struct ssh *ssh = active_state; /* XXX */ #ifdef HAVE_LOGIN_CAP extern login_cap_t *lc; +#ifdef HAVE_AUTH_HOSTOK + const char *from_host, *from_ip; +#endif #ifdef BSD_AUTH auth_session_t *as; #endif @@ -622,6 +625,21 @@ getpwnamallow(const char *user) debug("unable to get login class: %s", user); return (NULL); } +#ifdef HAVE_AUTH_HOSTOK + from_host = auth_get_canonical_hostname(ssh, options.use_dns); + from_ip = ssh_remote_ipaddr(ssh); + if (!auth_hostok(lc, from_host, from_ip)) { + debug("Denied connection for %.200s from %.200s [%.200s].", + pw->pw_name, from_host, from_ip); + return (NULL); + } +#endif /* HAVE_AUTH_HOSTOK */ +#ifdef HAVE_AUTH_TIMEOK + if (!auth_timeok(lc, time(NULL))) { + debug("LOGIN %.200s REFUSED (TIME)", pw->pw_name); + return (NULL); + } +#endif /* HAVE_AUTH_TIMEOK */ #ifdef BSD_AUTH if ((as = auth_open()) == NULL || auth_setpwd(as, pw) != 0 || auth_approval(as, lc, pw->pw_name, "ssh") <= 0) { diff --git a/crypto/openssh/auth2.c b/crypto/openssh/auth2.c index 612cc3f8f2f3..af6fdae97193 100644 --- a/crypto/openssh/auth2.c +++ b/crypto/openssh/auth2.c @@ -314,25 +314,6 @@ input_userauth_request(int type, u_int32_t seq, struct ssh *ssh) authctxt->user, authctxt->service, user, service); } -#ifdef HAVE_LOGIN_CAP - if (authctxt->pw != NULL && - (lc = PRIVSEP(login_getpwclass(authctxt->pw))) != NULL) { - from_host = auth_get_canonical_hostname(ssh, options.use_dns); - from_ip = ssh_remote_ipaddr(ssh); - if (!auth_hostok(lc, from_host, from_ip)) { - logit("Denied connection for %.200s from %.200s [%.200s].", - authctxt->pw->pw_name, from_host, from_ip); - packet_disconnect("Sorry, you are not allowed to connect."); - } - if (!auth_timeok(lc, time(NULL))) { - logit("LOGIN %.200s REFUSED (TIME) FROM %.200s", - authctxt->pw->pw_name, from_host); - packet_disconnect("Logins not available right now."); - } - PRIVSEP(login_close(lc)); - } -#endif /* HAVE_LOGIN_CAP */ - /* reset state */ auth2_challenge_stop(ssh); diff --git a/crypto/openssh/config.h b/crypto/openssh/config.h index 17d7e53666e9..dbdad4faaca1 100644 --- a/crypto/openssh/config.h +++ b/crypto/openssh/config.h @@ -211,6 +211,12 @@ /* Define to 1 if you have the `aug_get_machine' function. */ /* #undef HAVE_AUG_GET_MACHINE */ +/* Define to 1 if you have the `auth_hostok' function. */ +#define HAVE_AUTH_HOSTOK 1 + +/* Define to 1 if you have the `auth_timeok' function. */ +#define HAVE_AUTH_TIMEOK 1 + /* Define to 1 if you have the `b64_ntop' function. */ /* #undef HAVE_B64_NTOP */ diff --git a/crypto/openssh/configure.ac b/crypto/openssh/configure.ac index 60c170285979..538f389c6da3 100644 --- a/crypto/openssh/configure.ac +++ b/crypto/openssh/configure.ac @@ -1751,6 +1751,8 @@ fi dnl Checks for library functions. Please keep in alphabetical order AC_CHECK_FUNCS([ \ + auth_hostok \ + auth_timeok \ Blowfish_initstate \ Blowfish_expandstate \ Blowfish_expand0state \ diff --git a/crypto/openssh/monitor.c b/crypto/openssh/monitor.c index c5e3708c2563..531b2993ab6b 100644 --- a/crypto/openssh/monitor.c +++ b/crypto/openssh/monitor.c @@ -114,9 +114,6 @@ static struct sshbuf *child_state; int mm_answer_moduli(int, struct sshbuf *); int mm_answer_sign(int, struct sshbuf *); -#ifdef HAVE_LOGIN_CAP -int mm_answer_login_getpwclass(int, struct sshbuf *); -#endif int mm_answer_pwnamallow(int, struct sshbuf *); int mm_answer_auth2_read_banner(int, struct sshbuf *); int mm_answer_authserv(int, struct sshbuf *); @@ -192,9 +189,6 @@ struct mon_table mon_dispatch_proto20[] = { {MONITOR_REQ_MODULI, MON_ONCE, mm_answer_moduli}, #endif {MONITOR_REQ_SIGN, MON_ONCE, mm_answer_sign}, -#ifdef HAVE_LOGIN_CAP - {MONITOR_REQ_GETPWCLASS, MON_ISAUTH, mm_answer_login_getpwclass}, -#endif {MONITOR_REQ_PWNAM, MON_ONCE, mm_answer_pwnamallow}, {MONITOR_REQ_AUTHSERV, MON_ONCE, mm_answer_authserv}, {MONITOR_REQ_AUTH2_READ_BANNER, MON_ONCE, mm_answer_auth2_read_banner}, @@ -713,48 +707,6 @@ mm_answer_sign(int sock, struct sshbuf *m) return (0); } -#ifdef HAVE_LOGIN_CAP -int -mm_answer_login_getpwclass(int sock, struct sshbuf *m) -{ - login_cap_t *lc; - struct passwd *pw; - int r; - u_int len; - - debug3("%s", __func__); - - pw = sshbuf_get_passwd(m); - if (pw == NULL) - fatal("%s: receive get struct passwd failed", __func__); - - lc = login_getpwclass(pw); - - sshbuf_reset(m); - - if (lc == NULL) { - if (r = sshbuf_put_u8(m, 0) != 0) - fatal("%s: buffer error: %s", __func__, ssh_err(r)); - goto out; - } - - if ((r = sshbuf_put_u8(m, 1)) != 0 || - (r = sshbuf_put_cstring(m, lc->lc_class)) != 0 || - (r = sshbuf_put_cstring(m, lc->lc_cap)) != 0 || - (r = sshbuf_put_cstring(m, lc->lc_style)) != 0) - fatal("%s: buffer error: %s", __func__, ssh_err(r)); - - login_close(lc); - out: - debug3("%s: sending MONITOR_ANS_GETPWCLASS", __func__); - mm_request_send(sock, MONITOR_ANS_GETPWCLASS, m); - - sshbuf_free_passwd(pw); - - return (0); -} -#endif - /* Retrieves the password entry and also checks if the user is permitted */ int @@ -793,8 +745,19 @@ mm_answer_pwnamallow(int sock, struct sshbuf *m) authctxt->pw = pwent; authctxt->valid = 1; + /* XXX don't sent pwent to unpriv; send fake class/dir/shell too */ if ((r = sshbuf_put_u8(m, 1)) != 0 || - (r = sshbuf_put_passwd(m, pwent)) != 0) + (r = sshbuf_put_string(m, pwent, sizeof(*pwent))) != 0 || + (r = sshbuf_put_cstring(m, pwent->pw_name)) != 0 || + (r = sshbuf_put_cstring(m, "*")) != 0 || +#ifdef HAVE_STRUCT_PASSWD_PW_GECOS + (r = sshbuf_put_cstring(m, pwent->pw_gecos)) != 0 || +#endif +#ifdef HAVE_STRUCT_PASSWD_PW_CLASS + (r = sshbuf_put_cstring(m, pwent->pw_class)) != 0 || +#endif + (r = sshbuf_put_cstring(m, pwent->pw_dir)) != 0 || + (r = sshbuf_put_cstring(m, pwent->pw_shell)) != 0) fatal("%s: buffer error: %s", __func__, ssh_err(r)); out: diff --git a/crypto/openssh/monitor.h b/crypto/openssh/monitor.h index abf2ca4018b4..16047299f882 100644 --- a/crypto/openssh/monitor.h +++ b/crypto/openssh/monitor.h @@ -53,8 +53,7 @@ enum monitor_reqtype { MONITOR_REQ_GSSSTEP = 44, MONITOR_ANS_GSSSTEP = 45, MONITOR_REQ_GSSUSEROK = 46, MONITOR_ANS_GSSUSEROK = 47, MONITOR_REQ_GSSCHECKMIC = 48, MONITOR_ANS_GSSCHECKMIC = 49, - MONITOR_REQ_GETPWCLASS = 50, MONITOR_ANS_GETPWCLASS = 51, - MONITOR_REQ_TERM = 52, + MONITOR_REQ_TERM = 50, MONITOR_REQ_PAM_START = 100, MONITOR_REQ_PAM_ACCOUNT = 102, MONITOR_ANS_PAM_ACCOUNT = 103, diff --git a/crypto/openssh/monitor_wrap.c b/crypto/openssh/monitor_wrap.c index bb458f131483..732fb3476bf0 100644 --- a/crypto/openssh/monitor_wrap.c +++ b/crypto/openssh/monitor_wrap.c @@ -247,61 +247,6 @@ mm_sshkey_sign(struct sshkey *key, u_char **sigp, size_t *lenp, return (0); } -#ifdef HAVE_LOGIN_CAP -login_cap_t * -mm_login_getpwclass(const struct passwd *pwent) -{ - int r; - struct sshbuf *m; - char rc; - login_cap_t *lc; - - debug3("%s entering", __func__); - - if ((m = sshbuf_new()) == NULL) - fatal("%s: sshbuf_new failed", __func__); - if ((r = sshbuf_put_passwd(m, pwent)) != 0) - fatal("%s: buffer error: %s", __func__, ssh_err(r)); - - mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GETPWCLASS, m); - - debug3("%s: waiting for MONITOR_ANS_GETPWCLASS", __func__); - mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GETPWCLASS, m); - - if ((r = sshbuf_get_u8(m, &rc)) != 0) - fatal("%s: buffer error: %s", __func__, ssh_err(r)); - - if (rc == 0) { - lc = NULL; - goto out; - } - - lc = xmalloc(sizeof(*lc)); - if ((r = sshbuf_get_cstring(m, &lc->lc_class, NULL)) != 0 || - (r = sshbuf_get_cstring(m, &lc->lc_cap, NULL)) != 0 || - (r = sshbuf_get_cstring(m, &lc->lc_style, NULL)) != 0) - fatal("%s: buffer error: %s", __func__, ssh_err(r)); - - out: - sshbuf_free(m); - - return (lc); -} -#endif - -#ifdef HAVE_LOGIN_CAP -void -mm_login_close(login_cap_t *lc) -{ - if (lc == NULL) - return; - free(lc->lc_style); - free(lc->lc_class); - free(lc->lc_cap); - free(lc); -} -#endif - struct passwd * mm_getpwnamallow(const char *username) { @@ -334,9 +279,25 @@ mm_getpwnamallow(const char *username) goto out; } - pw = sshbuf_get_passwd(m); - if (pw == NULL) - fatal("%s: receive get struct passwd failed", __func__); + /* XXX don't like passing struct passwd like this */ + pw = xcalloc(sizeof(*pw), 1); + if ((r = sshbuf_get_string_direct(m, &p, &len)) != 0) + fatal("%s: buffer error: %s", __func__, ssh_err(r)); + if (len != sizeof(*pw)) + fatal("%s: struct passwd size mismatch", __func__); + memcpy(pw, p, sizeof(*pw)); + + if ((r = sshbuf_get_cstring(m, &pw->pw_name, NULL)) != 0 || + (r = sshbuf_get_cstring(m, &pw->pw_passwd, NULL)) != 0 || +#ifdef HAVE_STRUCT_PASSWD_PW_GECOS + (r = sshbuf_get_cstring(m, &pw->pw_gecos, NULL)) != 0 || +#endif +#ifdef HAVE_STRUCT_PASSWD_PW_CLASS + (r = sshbuf_get_cstring(m, &pw->pw_class, NULL)) != 0 || +#endif + (r = sshbuf_get_cstring(m, &pw->pw_dir, NULL)) != 0 || + (r = sshbuf_get_cstring(m, &pw->pw_shell, NULL)) != 0) + fatal("%s: buffer error: %s", __func__, ssh_err(r)); out: /* copy options block as a Match directive may have changed some */ diff --git a/crypto/openssh/monitor_wrap.h b/crypto/openssh/monitor_wrap.h index 5b5dea1ed828..644da081db8d 100644 --- a/crypto/openssh/monitor_wrap.h +++ b/crypto/openssh/monitor_wrap.h @@ -44,10 +44,6 @@ DH *mm_choose_dh(int, int, int); int mm_sshkey_sign(struct sshkey *, u_char **, size_t *, const u_char *, size_t, const char *, u_int compat); void mm_inform_authserv(char *, char *); -#ifdef HAVE_LOGIN_CAP -struct login_cap *mm_login_getpwclass(const struct passwd *pwd); -void mm_login_close(struct login_cap *lc); -#endif struct passwd *mm_getpwnamallow(const char *); char *mm_auth2_read_banner(void); int mm_auth_password(struct ssh *, char *); diff --git a/crypto/openssh/ssh_namespace.h b/crypto/openssh/ssh_namespace.h index cbef93df67b9..71accdf4fb59 100644 --- a/crypto/openssh/ssh_namespace.h +++ b/crypto/openssh/ssh_namespace.h @@ -658,7 +658,6 @@ #define sshbuf_dump_data Fssh_sshbuf_dump_data #define sshbuf_dup_string Fssh_sshbuf_dup_string #define sshbuf_free Fssh_sshbuf_free -#define sshbuf_free_passwd Fssh_sshbuf_free_passwd #define sshbuf_from Fssh_sshbuf_from #define sshbuf_fromb Fssh_sshbuf_fromb #define sshbuf_froms Fssh_sshbuf_froms @@ -669,7 +668,6 @@ #define sshbuf_get_cstring Fssh_sshbuf_get_cstring #define sshbuf_get_ec Fssh_sshbuf_get_ec #define sshbuf_get_eckey Fssh_sshbuf_get_eckey -#define sshbuf_get_passwd Fssh_sshbuf_get_passwd #define sshbuf_get_string Fssh_sshbuf_get_string #define sshbuf_get_string_direct Fssh_sshbuf_get_string_direct #define sshbuf_get_stringb Fssh_sshbuf_get_stringb @@ -691,7 +689,6 @@ #define sshbuf_put_cstring Fssh_sshbuf_put_cstring #define sshbuf_put_ec Fssh_sshbuf_put_ec #define sshbuf_put_eckey Fssh_sshbuf_put_eckey -#define sshbuf_put_passwd Fssh_sshbuf_put_passwd #define sshbuf_put_string Fssh_sshbuf_put_string #define sshbuf_put_stringb Fssh_sshbuf_put_stringb #define sshbuf_put_u16 Fssh_sshbuf_put_u16 diff --git a/crypto/openssh/sshbuf-getput-basic.c b/crypto/openssh/sshbuf-getput-basic.c index 70ee303a23e4..9092a7eebf97 100644 --- a/crypto/openssh/sshbuf-getput-basic.c +++ b/crypto/openssh/sshbuf-getput-basic.c @@ -463,103 +463,3 @@ sshbuf_get_bignum2_bytes_direct(struct sshbuf *buf, } return 0; } - -/* - * store struct pwd - */ -int -sshbuf_put_passwd(struct sshbuf *buf, const struct passwd *pwent) -{ - int r; - - /* - * We never send pointer values of struct passwd. - * It is safe from wild pointer even if a new pointer member is added. - */ - - if ((r = sshbuf_put_u64(buf, sizeof(*pwent)) != 0) || - (r = sshbuf_put_cstring(buf, pwent->pw_name)) != 0 || - (r = sshbuf_put_cstring(buf, "*")) != 0 || - (r = sshbuf_put_u32(buf, pwent->pw_uid)) != 0 || - (r = sshbuf_put_u32(buf, pwent->pw_gid)) != 0 || -#ifdef HAVE_STRUCT_PASSWD_PW_CHANGE - (r = sshbuf_put_time(buf, pwent->pw_change)) != 0 || -#endif -#ifdef HAVE_STRUCT_PASSWD_PW_GECOS - (r = sshbuf_put_cstring(buf, pwent->pw_gecos)) != 0 || -#endif -#ifdef HAVE_STRUCT_PASSWD_PW_CLASS - (r = sshbuf_put_cstring(buf, pwent->pw_class)) != 0 || -#endif - (r = sshbuf_put_cstring(buf, pwent->pw_dir)) != 0 || - (r = sshbuf_put_cstring(buf, pwent->pw_shell)) != 0 || -#ifdef HAVE_STRUCT_PASSWD_PW_EXPIRE - (r = sshbuf_put_time(buf, pwent->pw_expire)) != 0 || -#endif - (r = sshbuf_put_u32(buf, pwent->pw_fields)) != 0) { - return r; - } - return 0; -} - -/* - * extract struct pwd - */ -struct passwd * -sshbuf_get_passwd(struct sshbuf *buf) -{ - struct passwd *pw; - u_int64_t len; - int r; - - /* check if size of struct passwd is as same as sender's size */ - r = sshbuf_get_u64(buf, &len); - if (r != 0 || len != sizeof(*pw)) - return NULL; - - pw = xcalloc(1, sizeof(*pw)); - if (sshbuf_get_cstring(buf, &pw->pw_name, NULL) != 0 || - sshbuf_get_cstring(buf, &pw->pw_passwd, NULL) != 0 || - sshbuf_get_u32(buf, &pw->pw_uid) != 0 || - sshbuf_get_u32(buf, &pw->pw_gid) != 0 || -#ifdef HAVE_STRUCT_PASSWD_PW_CHANGE - sshbuf_get_time(buf, &pw->pw_change) != 0 || -#endif -#ifdef HAVE_STRUCT_PASSWD_PW_GECOS - sshbuf_get_cstring(buf, &pw->pw_gecos, NULL) != 0 || -#endif -#ifdef HAVE_STRUCT_PASSWD_PW_CLASS - sshbuf_get_cstring(buf, &pw->pw_class, NULL) != 0 || -#endif - sshbuf_get_cstring(buf, &pw->pw_dir, NULL) != 0 || - sshbuf_get_cstring(buf, &pw->pw_shell, NULL) != 0 || -#ifdef HAVE_STRUCT_PASSWD_PW_EXPIRE - sshbuf_get_time(buf, &pw->pw_expire) != 0 || -#endif - sshbuf_get_u32(buf, &pw->pw_fields) != 0) { - sshbuf_free_passwd(pw); - return NULL; - } - return pw; -} - -/* - * free struct passwd obtained from sshbuf_get_passwd. - */ -void -sshbuf_free_passwd(struct passwd *pwent) -{ - if (pwent == NULL) - return; - free(pwent->pw_shell); - free(pwent->pw_dir); -#ifdef HAVE_STRUCT_PASSWD_PW_CLASS - free(pwent->pw_class); -#endif -#ifdef HAVE_STRUCT_PASSWD_PW_GECOS - free(pwent->pw_gecos); -#endif - free(pwent->pw_passwd); - free(pwent->pw_name); - free(pwent); -} diff --git a/crypto/openssh/sshbuf.h b/crypto/openssh/sshbuf.h index aba18d2aa922..87aa1560eabe 100644 --- a/crypto/openssh/sshbuf.h +++ b/crypto/openssh/sshbuf.h @@ -254,21 +254,6 @@ int sshbuf_b64tod(struct sshbuf *buf, const char *b64); */ char *sshbuf_dup_string(struct sshbuf *buf); -/* - * store struct pwd - */ -int sshbuf_put_passwd(struct sshbuf *buf, const struct passwd *pwent); - -/* - * extract struct pwd - */ -struct passwd *sshbuf_get_passwd(struct sshbuf *buf); - -/* - * free struct passwd obtained from sshbuf_get_passwd. - */ -void sshbuf_free_passwd(struct passwd *pwent); - /* Macros for decoding/encoding integers */ #define PEEK_U64(p) \ (((u_int64_t)(((const u_char *)(p))[0]) << 56) | \ From owner-dev-commits-src-all@freebsd.org Wed Sep 15 01:53:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F07D86753F7; Wed, 15 Sep 2021 01:53:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8NXX6LK9z3NGl; Wed, 15 Sep 2021 01:53:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9B27258A4; Wed, 15 Sep 2021 01:53:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18F1rGPw054231; Wed, 15 Sep 2021 01:53:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18F1rGVl054230; Wed, 15 Sep 2021 01:53:16 GMT (envelope-from git) Date: Wed, 15 Sep 2021 01:53:16 GMT Message-Id: <202109150153.18F1rGVl054230@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: 08703a56498d - stable/13 - kern: drop remaining references to removed makesyscalls.sh MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 08703a56498d3c5468efb930464f684b66b41bbe Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 01:53:17 -0000 The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=08703a56498d3c5468efb930464f684b66b41bbe commit 08703a56498d3c5468efb930464f684b66b41bbe Author: Kyle Evans AuthorDate: 2021-05-13 18:46:17 +0000 Commit: Kyle Evans CommitDate: 2021-09-15 01:53:03 +0000 kern: drop remaining references to removed makesyscalls.sh This was accidentally omitted from the recent removal of makeyscalls.sh. (cherry picked from commit 35aa1d6e4542ce7c8be127b85da2a5c9e8ade3f7) --- sys/cddl/dev/systrace/systrace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/cddl/dev/systrace/systrace.c b/sys/cddl/dev/systrace/systrace.c index c455ea9482dc..3ac3bb80596b 100644 --- a/sys/cddl/dev/systrace/systrace.c +++ b/sys/cddl/dev/systrace/systrace.c @@ -95,7 +95,7 @@ extern struct sysent linux32_sysent[]; #elif defined(FREEBSD32_SYSTRACE) /* * The syscall arguments are processed into a DTrace argument array - * using a generated function. See sys/kern/makesyscalls.sh. + * using a generated function. See sys/tools/makesyscalls.lua. */ #include #include @@ -109,7 +109,7 @@ extern const char *freebsd32_syscallnames[]; #else /* * The syscall arguments are processed into a DTrace argument array - * using a generated function. See sys/kern/makesyscalls.sh. + * using a generated function. See sys/tools/makesyscalls.lua. */ #include #include From owner-dev-commits-src-all@freebsd.org Wed Sep 15 02:03:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 33922675567; Wed, 15 Sep 2021 02:03:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8NmL0qpDz3Qyv; Wed, 15 Sep 2021 02:03:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F268B256A9; Wed, 15 Sep 2021 02:03:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18F23TBL068015; Wed, 15 Sep 2021 02:03:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18F23TV8068014; Wed, 15 Sep 2021 02:03:29 GMT (envelope-from git) Date: Wed, 15 Sep 2021 02:03:29 GMT Message-Id: <202109150203.18F23TV8068014@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: fbdf5e82a0af - stable/12 - apr: Merge r1889604, r1807975 from trunk: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: fbdf5e82a0afc98e14ebb58f4cc8c1c0655b1316 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 02:03:30 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=fbdf5e82a0afc98e14ebb58f4cc8c1c0655b1316 commit fbdf5e82a0afc98e14ebb58f4cc8c1c0655b1316 Author: Joe Orton AuthorDate: 2021-07-02 11:10:33 +0000 Commit: Ed Maste CommitDate: 2021-09-15 01:42:23 +0000 apr: Merge r1889604, r1807975 from trunk: * random/unix/sha2.c (apr__SHA256_Final, apr__SHA256_End): Fix parameter buffer lengths to match declaration, avoiding GCC 11 warning. (no functional change) Bounds-check human-readable date fields (credit: Stefan Sperling) Submitted by: jorton, niq Reviewed by: jorton git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1891198 13f79535-47bb-0310-9956-ffa450edef68 (cherry picked from commit fc1b69d0311e50ed05c00c46ad7dd5d560e57cb6) --- contrib/apr/random/unix/sha2.c | 4 ++-- contrib/apr/time/unix/time.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/apr/random/unix/sha2.c b/contrib/apr/random/unix/sha2.c index 12c257d1fa1b..8059a9d78a71 100644 --- a/contrib/apr/random/unix/sha2.c +++ b/contrib/apr/random/unix/sha2.c @@ -425,7 +425,7 @@ void apr__SHA256_Update(SHA256_CTX* context, const sha2_byte *data, size_t len) usedspace = freespace = 0; } -void apr__SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { +void apr__SHA256_Final(sha2_byte digest[SHA256_DIGEST_LENGTH], SHA256_CTX* context) { sha2_word32 *d = (sha2_word32*)digest; unsigned int usedspace; @@ -496,7 +496,7 @@ void apr__SHA256_Final(sha2_byte digest[], SHA256_CTX* context) { usedspace = 0; } -char *apr__SHA256_End(SHA256_CTX* context, char buffer[]) { +char *apr__SHA256_End(SHA256_CTX* context, char buffer[SHA256_DIGEST_STRING_LENGTH]) { sha2_byte digest[SHA256_DIGEST_LENGTH], *d = digest; int i; diff --git a/contrib/apr/time/unix/time.c b/contrib/apr/time/unix/time.c index dfa45e690c62..7f0958192769 100644 --- a/contrib/apr/time/unix/time.c +++ b/contrib/apr/time/unix/time.c @@ -142,6 +142,9 @@ APR_DECLARE(apr_status_t) apr_time_exp_get(apr_time_t *t, apr_time_exp_t *xt) static const int dayoffset[12] = {306, 337, 0, 31, 61, 92, 122, 153, 184, 214, 245, 275}; + if (xt->tm_mon < 0 || xt->tm_mon >= 12) + return APR_EBADDATE; + /* shift new year to 1st March in order to make leap year calc easy */ if (xt->tm_mon < 2) From owner-dev-commits-src-all@freebsd.org Wed Sep 15 02:03:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C79467556F; Wed, 15 Sep 2021 02:03:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8NmM1sKjz3Qtq; Wed, 15 Sep 2021 02:03:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C072257A8; Wed, 15 Sep 2021 02:03:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18F23VtH068039; Wed, 15 Sep 2021 02:03:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18F23VX3068038; Wed, 15 Sep 2021 02:03:31 GMT (envelope-from git) Date: Wed, 15 Sep 2021 02:03:31 GMT Message-Id: <202109150203.18F23VX3068038@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 719cb45e82be - stable/12 - openssh: simplify login class restrictions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 719cb45e82be5ebd02a4c121d7fcebba492849b8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 02:03:31 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=719cb45e82be5ebd02a4c121d7fcebba492849b8 commit 719cb45e82be5ebd02a4c121d7fcebba492849b8 Author: Ed Maste AuthorDate: 2021-08-31 19:30:50 +0000 Commit: Ed Maste CommitDate: 2021-09-15 01:42:23 +0000 openssh: simplify login class restrictions Login class-based restrictions were introduced in 5b400a39b8ad. The code was adapted for sshd's Capsicum sandbox and received many changes over time, including at least fc3c19a9fcee, bd393de91cc3, and e8c56fba2926. During an attempt to upstream the work a much simpler approach was suggested. Adopt it now in the in-tree OpenSSH to reduce conflicts with future updates. Submitted by: Yuchiro Naito (against OpenSSH-portable on GitHub) Obtained from: https://github.com/openssh/openssh-portable/pull/262 Reviewed by: allanjude, kevans MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D31760 (cherry picked from commit 27ceebbc2402e4c98203c7eef9696f4bd3d326f8) --- crypto/openssh/auth.c | 18 +++++++ crypto/openssh/auth2.c | 19 ------- crypto/openssh/config.h | 6 +++ crypto/openssh/configure.ac | 2 + crypto/openssh/monitor.c | 61 +++++---------------- crypto/openssh/monitor.h | 3 +- crypto/openssh/monitor_wrap.c | 77 +++++++-------------------- crypto/openssh/monitor_wrap.h | 4 -- crypto/openssh/ssh_namespace.h | 3 -- crypto/openssh/sshbuf-getput-basic.c | 100 ----------------------------------- crypto/openssh/sshbuf.h | 15 ------ 11 files changed, 58 insertions(+), 250 deletions(-) diff --git a/crypto/openssh/auth.c b/crypto/openssh/auth.c index 83be3cb5cbb5..a2e1fa10ce45 100644 --- a/crypto/openssh/auth.c +++ b/crypto/openssh/auth.c @@ -568,6 +568,9 @@ getpwnamallow(const char *user) struct ssh *ssh = active_state; /* XXX */ #ifdef HAVE_LOGIN_CAP extern login_cap_t *lc; +#ifdef HAVE_AUTH_HOSTOK + const char *from_host, *from_ip; +#endif #ifdef BSD_AUTH auth_session_t *as; #endif @@ -622,6 +625,21 @@ getpwnamallow(const char *user) debug("unable to get login class: %s", user); return (NULL); } +#ifdef HAVE_AUTH_HOSTOK + from_host = auth_get_canonical_hostname(ssh, options.use_dns); + from_ip = ssh_remote_ipaddr(ssh); + if (!auth_hostok(lc, from_host, from_ip)) { + debug("Denied connection for %.200s from %.200s [%.200s].", + pw->pw_name, from_host, from_ip); + return (NULL); + } +#endif /* HAVE_AUTH_HOSTOK */ +#ifdef HAVE_AUTH_TIMEOK + if (!auth_timeok(lc, time(NULL))) { + debug("LOGIN %.200s REFUSED (TIME)", pw->pw_name); + return (NULL); + } +#endif /* HAVE_AUTH_TIMEOK */ #ifdef BSD_AUTH if ((as = auth_open()) == NULL || auth_setpwd(as, pw) != 0 || auth_approval(as, lc, pw->pw_name, "ssh") <= 0) { diff --git a/crypto/openssh/auth2.c b/crypto/openssh/auth2.c index 612cc3f8f2f3..af6fdae97193 100644 --- a/crypto/openssh/auth2.c +++ b/crypto/openssh/auth2.c @@ -314,25 +314,6 @@ input_userauth_request(int type, u_int32_t seq, struct ssh *ssh) authctxt->user, authctxt->service, user, service); } -#ifdef HAVE_LOGIN_CAP - if (authctxt->pw != NULL && - (lc = PRIVSEP(login_getpwclass(authctxt->pw))) != NULL) { - from_host = auth_get_canonical_hostname(ssh, options.use_dns); - from_ip = ssh_remote_ipaddr(ssh); - if (!auth_hostok(lc, from_host, from_ip)) { - logit("Denied connection for %.200s from %.200s [%.200s].", - authctxt->pw->pw_name, from_host, from_ip); - packet_disconnect("Sorry, you are not allowed to connect."); - } - if (!auth_timeok(lc, time(NULL))) { - logit("LOGIN %.200s REFUSED (TIME) FROM %.200s", - authctxt->pw->pw_name, from_host); - packet_disconnect("Logins not available right now."); - } - PRIVSEP(login_close(lc)); - } -#endif /* HAVE_LOGIN_CAP */ - /* reset state */ auth2_challenge_stop(ssh); diff --git a/crypto/openssh/config.h b/crypto/openssh/config.h index 17d7e53666e9..dbdad4faaca1 100644 --- a/crypto/openssh/config.h +++ b/crypto/openssh/config.h @@ -211,6 +211,12 @@ /* Define to 1 if you have the `aug_get_machine' function. */ /* #undef HAVE_AUG_GET_MACHINE */ +/* Define to 1 if you have the `auth_hostok' function. */ +#define HAVE_AUTH_HOSTOK 1 + +/* Define to 1 if you have the `auth_timeok' function. */ +#define HAVE_AUTH_TIMEOK 1 + /* Define to 1 if you have the `b64_ntop' function. */ /* #undef HAVE_B64_NTOP */ diff --git a/crypto/openssh/configure.ac b/crypto/openssh/configure.ac index 60c170285979..538f389c6da3 100644 --- a/crypto/openssh/configure.ac +++ b/crypto/openssh/configure.ac @@ -1751,6 +1751,8 @@ fi dnl Checks for library functions. Please keep in alphabetical order AC_CHECK_FUNCS([ \ + auth_hostok \ + auth_timeok \ Blowfish_initstate \ Blowfish_expandstate \ Blowfish_expand0state \ diff --git a/crypto/openssh/monitor.c b/crypto/openssh/monitor.c index c5e3708c2563..531b2993ab6b 100644 --- a/crypto/openssh/monitor.c +++ b/crypto/openssh/monitor.c @@ -114,9 +114,6 @@ static struct sshbuf *child_state; int mm_answer_moduli(int, struct sshbuf *); int mm_answer_sign(int, struct sshbuf *); -#ifdef HAVE_LOGIN_CAP -int mm_answer_login_getpwclass(int, struct sshbuf *); -#endif int mm_answer_pwnamallow(int, struct sshbuf *); int mm_answer_auth2_read_banner(int, struct sshbuf *); int mm_answer_authserv(int, struct sshbuf *); @@ -192,9 +189,6 @@ struct mon_table mon_dispatch_proto20[] = { {MONITOR_REQ_MODULI, MON_ONCE, mm_answer_moduli}, #endif {MONITOR_REQ_SIGN, MON_ONCE, mm_answer_sign}, -#ifdef HAVE_LOGIN_CAP - {MONITOR_REQ_GETPWCLASS, MON_ISAUTH, mm_answer_login_getpwclass}, -#endif {MONITOR_REQ_PWNAM, MON_ONCE, mm_answer_pwnamallow}, {MONITOR_REQ_AUTHSERV, MON_ONCE, mm_answer_authserv}, {MONITOR_REQ_AUTH2_READ_BANNER, MON_ONCE, mm_answer_auth2_read_banner}, @@ -713,48 +707,6 @@ mm_answer_sign(int sock, struct sshbuf *m) return (0); } -#ifdef HAVE_LOGIN_CAP -int -mm_answer_login_getpwclass(int sock, struct sshbuf *m) -{ - login_cap_t *lc; - struct passwd *pw; - int r; - u_int len; - - debug3("%s", __func__); - - pw = sshbuf_get_passwd(m); - if (pw == NULL) - fatal("%s: receive get struct passwd failed", __func__); - - lc = login_getpwclass(pw); - - sshbuf_reset(m); - - if (lc == NULL) { - if (r = sshbuf_put_u8(m, 0) != 0) - fatal("%s: buffer error: %s", __func__, ssh_err(r)); - goto out; - } - - if ((r = sshbuf_put_u8(m, 1)) != 0 || - (r = sshbuf_put_cstring(m, lc->lc_class)) != 0 || - (r = sshbuf_put_cstring(m, lc->lc_cap)) != 0 || - (r = sshbuf_put_cstring(m, lc->lc_style)) != 0) - fatal("%s: buffer error: %s", __func__, ssh_err(r)); - - login_close(lc); - out: - debug3("%s: sending MONITOR_ANS_GETPWCLASS", __func__); - mm_request_send(sock, MONITOR_ANS_GETPWCLASS, m); - - sshbuf_free_passwd(pw); - - return (0); -} -#endif - /* Retrieves the password entry and also checks if the user is permitted */ int @@ -793,8 +745,19 @@ mm_answer_pwnamallow(int sock, struct sshbuf *m) authctxt->pw = pwent; authctxt->valid = 1; + /* XXX don't sent pwent to unpriv; send fake class/dir/shell too */ if ((r = sshbuf_put_u8(m, 1)) != 0 || - (r = sshbuf_put_passwd(m, pwent)) != 0) + (r = sshbuf_put_string(m, pwent, sizeof(*pwent))) != 0 || + (r = sshbuf_put_cstring(m, pwent->pw_name)) != 0 || + (r = sshbuf_put_cstring(m, "*")) != 0 || +#ifdef HAVE_STRUCT_PASSWD_PW_GECOS + (r = sshbuf_put_cstring(m, pwent->pw_gecos)) != 0 || +#endif +#ifdef HAVE_STRUCT_PASSWD_PW_CLASS + (r = sshbuf_put_cstring(m, pwent->pw_class)) != 0 || +#endif + (r = sshbuf_put_cstring(m, pwent->pw_dir)) != 0 || + (r = sshbuf_put_cstring(m, pwent->pw_shell)) != 0) fatal("%s: buffer error: %s", __func__, ssh_err(r)); out: diff --git a/crypto/openssh/monitor.h b/crypto/openssh/monitor.h index abf2ca4018b4..16047299f882 100644 --- a/crypto/openssh/monitor.h +++ b/crypto/openssh/monitor.h @@ -53,8 +53,7 @@ enum monitor_reqtype { MONITOR_REQ_GSSSTEP = 44, MONITOR_ANS_GSSSTEP = 45, MONITOR_REQ_GSSUSEROK = 46, MONITOR_ANS_GSSUSEROK = 47, MONITOR_REQ_GSSCHECKMIC = 48, MONITOR_ANS_GSSCHECKMIC = 49, - MONITOR_REQ_GETPWCLASS = 50, MONITOR_ANS_GETPWCLASS = 51, - MONITOR_REQ_TERM = 52, + MONITOR_REQ_TERM = 50, MONITOR_REQ_PAM_START = 100, MONITOR_REQ_PAM_ACCOUNT = 102, MONITOR_ANS_PAM_ACCOUNT = 103, diff --git a/crypto/openssh/monitor_wrap.c b/crypto/openssh/monitor_wrap.c index bb458f131483..732fb3476bf0 100644 --- a/crypto/openssh/monitor_wrap.c +++ b/crypto/openssh/monitor_wrap.c @@ -247,61 +247,6 @@ mm_sshkey_sign(struct sshkey *key, u_char **sigp, size_t *lenp, return (0); } -#ifdef HAVE_LOGIN_CAP -login_cap_t * -mm_login_getpwclass(const struct passwd *pwent) -{ - int r; - struct sshbuf *m; - char rc; - login_cap_t *lc; - - debug3("%s entering", __func__); - - if ((m = sshbuf_new()) == NULL) - fatal("%s: sshbuf_new failed", __func__); - if ((r = sshbuf_put_passwd(m, pwent)) != 0) - fatal("%s: buffer error: %s", __func__, ssh_err(r)); - - mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GETPWCLASS, m); - - debug3("%s: waiting for MONITOR_ANS_GETPWCLASS", __func__); - mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GETPWCLASS, m); - - if ((r = sshbuf_get_u8(m, &rc)) != 0) - fatal("%s: buffer error: %s", __func__, ssh_err(r)); - - if (rc == 0) { - lc = NULL; - goto out; - } - - lc = xmalloc(sizeof(*lc)); - if ((r = sshbuf_get_cstring(m, &lc->lc_class, NULL)) != 0 || - (r = sshbuf_get_cstring(m, &lc->lc_cap, NULL)) != 0 || - (r = sshbuf_get_cstring(m, &lc->lc_style, NULL)) != 0) - fatal("%s: buffer error: %s", __func__, ssh_err(r)); - - out: - sshbuf_free(m); - - return (lc); -} -#endif - -#ifdef HAVE_LOGIN_CAP -void -mm_login_close(login_cap_t *lc) -{ - if (lc == NULL) - return; - free(lc->lc_style); - free(lc->lc_class); - free(lc->lc_cap); - free(lc); -} -#endif - struct passwd * mm_getpwnamallow(const char *username) { @@ -334,9 +279,25 @@ mm_getpwnamallow(const char *username) goto out; } - pw = sshbuf_get_passwd(m); - if (pw == NULL) - fatal("%s: receive get struct passwd failed", __func__); + /* XXX don't like passing struct passwd like this */ + pw = xcalloc(sizeof(*pw), 1); + if ((r = sshbuf_get_string_direct(m, &p, &len)) != 0) + fatal("%s: buffer error: %s", __func__, ssh_err(r)); + if (len != sizeof(*pw)) + fatal("%s: struct passwd size mismatch", __func__); + memcpy(pw, p, sizeof(*pw)); + + if ((r = sshbuf_get_cstring(m, &pw->pw_name, NULL)) != 0 || + (r = sshbuf_get_cstring(m, &pw->pw_passwd, NULL)) != 0 || +#ifdef HAVE_STRUCT_PASSWD_PW_GECOS + (r = sshbuf_get_cstring(m, &pw->pw_gecos, NULL)) != 0 || +#endif +#ifdef HAVE_STRUCT_PASSWD_PW_CLASS + (r = sshbuf_get_cstring(m, &pw->pw_class, NULL)) != 0 || +#endif + (r = sshbuf_get_cstring(m, &pw->pw_dir, NULL)) != 0 || + (r = sshbuf_get_cstring(m, &pw->pw_shell, NULL)) != 0) + fatal("%s: buffer error: %s", __func__, ssh_err(r)); out: /* copy options block as a Match directive may have changed some */ diff --git a/crypto/openssh/monitor_wrap.h b/crypto/openssh/monitor_wrap.h index 5b5dea1ed828..644da081db8d 100644 --- a/crypto/openssh/monitor_wrap.h +++ b/crypto/openssh/monitor_wrap.h @@ -44,10 +44,6 @@ DH *mm_choose_dh(int, int, int); int mm_sshkey_sign(struct sshkey *, u_char **, size_t *, const u_char *, size_t, const char *, u_int compat); void mm_inform_authserv(char *, char *); -#ifdef HAVE_LOGIN_CAP -struct login_cap *mm_login_getpwclass(const struct passwd *pwd); -void mm_login_close(struct login_cap *lc); -#endif struct passwd *mm_getpwnamallow(const char *); char *mm_auth2_read_banner(void); int mm_auth_password(struct ssh *, char *); diff --git a/crypto/openssh/ssh_namespace.h b/crypto/openssh/ssh_namespace.h index cbef93df67b9..71accdf4fb59 100644 --- a/crypto/openssh/ssh_namespace.h +++ b/crypto/openssh/ssh_namespace.h @@ -658,7 +658,6 @@ #define sshbuf_dump_data Fssh_sshbuf_dump_data #define sshbuf_dup_string Fssh_sshbuf_dup_string #define sshbuf_free Fssh_sshbuf_free -#define sshbuf_free_passwd Fssh_sshbuf_free_passwd #define sshbuf_from Fssh_sshbuf_from #define sshbuf_fromb Fssh_sshbuf_fromb #define sshbuf_froms Fssh_sshbuf_froms @@ -669,7 +668,6 @@ #define sshbuf_get_cstring Fssh_sshbuf_get_cstring #define sshbuf_get_ec Fssh_sshbuf_get_ec #define sshbuf_get_eckey Fssh_sshbuf_get_eckey -#define sshbuf_get_passwd Fssh_sshbuf_get_passwd #define sshbuf_get_string Fssh_sshbuf_get_string #define sshbuf_get_string_direct Fssh_sshbuf_get_string_direct #define sshbuf_get_stringb Fssh_sshbuf_get_stringb @@ -691,7 +689,6 @@ #define sshbuf_put_cstring Fssh_sshbuf_put_cstring #define sshbuf_put_ec Fssh_sshbuf_put_ec #define sshbuf_put_eckey Fssh_sshbuf_put_eckey -#define sshbuf_put_passwd Fssh_sshbuf_put_passwd #define sshbuf_put_string Fssh_sshbuf_put_string #define sshbuf_put_stringb Fssh_sshbuf_put_stringb #define sshbuf_put_u16 Fssh_sshbuf_put_u16 diff --git a/crypto/openssh/sshbuf-getput-basic.c b/crypto/openssh/sshbuf-getput-basic.c index 70ee303a23e4..9092a7eebf97 100644 --- a/crypto/openssh/sshbuf-getput-basic.c +++ b/crypto/openssh/sshbuf-getput-basic.c @@ -463,103 +463,3 @@ sshbuf_get_bignum2_bytes_direct(struct sshbuf *buf, } return 0; } - -/* - * store struct pwd - */ -int -sshbuf_put_passwd(struct sshbuf *buf, const struct passwd *pwent) -{ - int r; - - /* - * We never send pointer values of struct passwd. - * It is safe from wild pointer even if a new pointer member is added. - */ - - if ((r = sshbuf_put_u64(buf, sizeof(*pwent)) != 0) || - (r = sshbuf_put_cstring(buf, pwent->pw_name)) != 0 || - (r = sshbuf_put_cstring(buf, "*")) != 0 || - (r = sshbuf_put_u32(buf, pwent->pw_uid)) != 0 || - (r = sshbuf_put_u32(buf, pwent->pw_gid)) != 0 || -#ifdef HAVE_STRUCT_PASSWD_PW_CHANGE - (r = sshbuf_put_time(buf, pwent->pw_change)) != 0 || -#endif -#ifdef HAVE_STRUCT_PASSWD_PW_GECOS - (r = sshbuf_put_cstring(buf, pwent->pw_gecos)) != 0 || -#endif -#ifdef HAVE_STRUCT_PASSWD_PW_CLASS - (r = sshbuf_put_cstring(buf, pwent->pw_class)) != 0 || -#endif - (r = sshbuf_put_cstring(buf, pwent->pw_dir)) != 0 || - (r = sshbuf_put_cstring(buf, pwent->pw_shell)) != 0 || -#ifdef HAVE_STRUCT_PASSWD_PW_EXPIRE - (r = sshbuf_put_time(buf, pwent->pw_expire)) != 0 || -#endif - (r = sshbuf_put_u32(buf, pwent->pw_fields)) != 0) { - return r; - } - return 0; -} - -/* - * extract struct pwd - */ -struct passwd * -sshbuf_get_passwd(struct sshbuf *buf) -{ - struct passwd *pw; - u_int64_t len; - int r; - - /* check if size of struct passwd is as same as sender's size */ - r = sshbuf_get_u64(buf, &len); - if (r != 0 || len != sizeof(*pw)) - return NULL; - - pw = xcalloc(1, sizeof(*pw)); - if (sshbuf_get_cstring(buf, &pw->pw_name, NULL) != 0 || - sshbuf_get_cstring(buf, &pw->pw_passwd, NULL) != 0 || - sshbuf_get_u32(buf, &pw->pw_uid) != 0 || - sshbuf_get_u32(buf, &pw->pw_gid) != 0 || -#ifdef HAVE_STRUCT_PASSWD_PW_CHANGE - sshbuf_get_time(buf, &pw->pw_change) != 0 || -#endif -#ifdef HAVE_STRUCT_PASSWD_PW_GECOS - sshbuf_get_cstring(buf, &pw->pw_gecos, NULL) != 0 || -#endif -#ifdef HAVE_STRUCT_PASSWD_PW_CLASS - sshbuf_get_cstring(buf, &pw->pw_class, NULL) != 0 || -#endif - sshbuf_get_cstring(buf, &pw->pw_dir, NULL) != 0 || - sshbuf_get_cstring(buf, &pw->pw_shell, NULL) != 0 || -#ifdef HAVE_STRUCT_PASSWD_PW_EXPIRE - sshbuf_get_time(buf, &pw->pw_expire) != 0 || -#endif - sshbuf_get_u32(buf, &pw->pw_fields) != 0) { - sshbuf_free_passwd(pw); - return NULL; - } - return pw; -} - -/* - * free struct passwd obtained from sshbuf_get_passwd. - */ -void -sshbuf_free_passwd(struct passwd *pwent) -{ - if (pwent == NULL) - return; - free(pwent->pw_shell); - free(pwent->pw_dir); -#ifdef HAVE_STRUCT_PASSWD_PW_CLASS - free(pwent->pw_class); -#endif -#ifdef HAVE_STRUCT_PASSWD_PW_GECOS - free(pwent->pw_gecos); -#endif - free(pwent->pw_passwd); - free(pwent->pw_name); - free(pwent); -} diff --git a/crypto/openssh/sshbuf.h b/crypto/openssh/sshbuf.h index aba18d2aa922..87aa1560eabe 100644 --- a/crypto/openssh/sshbuf.h +++ b/crypto/openssh/sshbuf.h @@ -254,21 +254,6 @@ int sshbuf_b64tod(struct sshbuf *buf, const char *b64); */ char *sshbuf_dup_string(struct sshbuf *buf); -/* - * store struct pwd - */ -int sshbuf_put_passwd(struct sshbuf *buf, const struct passwd *pwent); - -/* - * extract struct pwd - */ -struct passwd *sshbuf_get_passwd(struct sshbuf *buf); - -/* - * free struct passwd obtained from sshbuf_get_passwd. - */ -void sshbuf_free_passwd(struct passwd *pwent); - /* Macros for decoding/encoding integers */ #define PEEK_U64(p) \ (((u_int64_t)(((const u_char *)(p))[0]) << 56) | \ From owner-dev-commits-src-all@freebsd.org Wed Sep 15 03:08:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E22F6676134; Wed, 15 Sep 2021 03:08:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8QCb5qH2z4RHP; Wed, 15 Sep 2021 03:08:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A7F132653A; Wed, 15 Sep 2021 03:08:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18F38hMu049148; Wed, 15 Sep 2021 03:08:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18F38hLE049147; Wed, 15 Sep 2021 03:08:43 GMT (envelope-from git) Date: Wed, 15 Sep 2021 03:08:43 GMT Message-Id: <202109150308.18F38hLE049147@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 8edd7155aa1f - stable/13 - Hide acpi_timer_test behind a tunable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8edd7155aa1f477f366c080cd9634620af00e49f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 03:08:44 -0000 The branch stable/13 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=8edd7155aa1f477f366c080cd9634620af00e49f commit 8edd7155aa1f477f366c080cd9634620af00e49f Author: Colin Percival AuthorDate: 2021-09-07 23:58:18 +0000 Commit: Colin Percival CommitDate: 2021-09-15 02:22:10 +0000 Hide acpi_timer_test behind a tunable When hw.acpi.timer_test_enabled is set to 0, this makes acpi_timer_test return 1 without actually testing the ACPI timer; this results in the ACPI-fast timecounter always being used rather than potentially using ACPI-safe. The ACPI timer testing was introduced in 2002 as a workaround for errata in Pentium II and Pentium III chipsets, and is unlikely to be needed in 2021. While I'm here, add TSENTER/TSEXIT to make it easier to see the time spent on the test (if it is enabled). Reviewed by: allanjude, imp MFC After: 1 week (cherry picked from commit 3c253d03d94e89cf1a26716b58fc27653df2a4f3) --- sys/dev/acpica/acpi_timer.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/dev/acpica/acpi_timer.c b/sys/dev/acpica/acpi_timer.c index 763a47a1a959..8be6e0edea7f 100644 --- a/sys/dev/acpica/acpi_timer.c +++ b/sys/dev/acpica/acpi_timer.c @@ -79,6 +79,8 @@ static int acpi_timer_sysctl_freq(SYSCTL_HANDLER_ARGS); static void acpi_timer_boot_test(void); static int acpi_timer_test(void); +static int acpi_timer_test_enabled = 1; +TUNABLE_INT("hw.acpi.timer_test_enabled", &acpi_timer_test_enabled); static device_method_t acpi_timer_methods[] = { DEVMETHOD(device_identify, acpi_timer_identify), @@ -404,6 +406,12 @@ acpi_timer_test() int delta, max, max2, min, n; register_t s; + /* Skip the test based on the hw.acpi.timer_test_enabled tunable. */ + if (!acpi_timer_test_enabled) + return (1); + + TSENTER(); + min = INT32_MAX; max = max2 = 0; @@ -434,6 +442,8 @@ acpi_timer_test() if (bootverbose) printf(" %d/%d", n, delta); + TSEXIT(); + return (n); } #undef N From owner-dev-commits-src-all@freebsd.org Wed Sep 15 03:08:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF20F67641C; Wed, 15 Sep 2021 03:08:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8QCc636Tz4RVS; Wed, 15 Sep 2021 03:08:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B0E5E26349; Wed, 15 Sep 2021 03:08:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18F38ijg049172; Wed, 15 Sep 2021 03:08:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18F38iGw049171; Wed, 15 Sep 2021 03:08:44 GMT (envelope-from git) Date: Wed, 15 Sep 2021 03:08:44 GMT Message-Id: <202109150308.18F38iGw049171@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 34a3091cc3b6 - stable/13 - Turn off acpi_timer_test on !i386 by default MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 34a3091cc3b6e09efe480c7e9e9e72fa9db00d89 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 03:08:45 -0000 The branch stable/13 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=34a3091cc3b6e09efe480c7e9e9e72fa9db00d89 commit 34a3091cc3b6e09efe480c7e9e9e72fa9db00d89 Author: Colin Percival AuthorDate: 2021-09-15 02:42:14 +0000 Commit: Colin Percival CommitDate: 2021-09-15 02:42:14 +0000 Turn off acpi_timer_test on !i386 by default The ACPI timer test was introduced in 2002 to detect an erratum in chipsets used with Pentium II and Pentium III processors. No other hardware is known to be affected, so on non-i386 systems it should be safe to skip the test. Turning off this test speeds up the FreeBSD boot process by roughly 140 ms on an EC2 c5.xlarge instance. The previous behaviour can be restored by setting hw.acpi.timer_test_enabled=1 in /boot/loader.conf. Requested by: jhb, imp Sponsored by: https://www.patreon.com/cperciva --- sys/dev/acpica/acpi_timer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/acpica/acpi_timer.c b/sys/dev/acpica/acpi_timer.c index 8be6e0edea7f..e9e488f9022a 100644 --- a/sys/dev/acpica/acpi_timer.c +++ b/sys/dev/acpica/acpi_timer.c @@ -79,7 +79,11 @@ static int acpi_timer_sysctl_freq(SYSCTL_HANDLER_ARGS); static void acpi_timer_boot_test(void); static int acpi_timer_test(void); +#ifdef __i386__ static int acpi_timer_test_enabled = 1; +#else +static int acpi_timer_test_enabled = 0; +#endif TUNABLE_INT("hw.acpi.timer_test_enabled", &acpi_timer_test_enabled); static device_method_t acpi_timer_methods[] = { From owner-dev-commits-src-all@freebsd.org Wed Sep 15 03:10:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9461D6763F4 for ; Wed, 15 Sep 2021 03:10:56 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: from mail.tarsnap.com (mail.tarsnap.com [54.86.246.204]) by mx1.freebsd.org (Postfix) with SMTP id 4H8QG82B7qz4RW9 for ; Wed, 15 Sep 2021 03:10:56 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: (qmail 57341 invoked from network); 15 Sep 2021 03:10:50 -0000 Received: from unknown (HELO dell7390.daemonology.net) (127.0.0.1) by mail.tarsnap.com with SMTP; 15 Sep 2021 03:10:50 -0000 Received: (qmail 86736 invoked from network); 15 Sep 2021 03:10:49 -0000 Received: from unknown (HELO dell7390.daemonology.net) (127.0.0.1) by localhost with SMTP; 15 Sep 2021 03:10:49 -0000 Subject: Re: git: 34a3091cc3b6 - stable/13 - Turn off acpi_timer_test on !i386 by default From: Colin Percival To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org References: <202109150308.18F38iGw049171@gitrepo.freebsd.org> Message-ID: <2670421f-189f-0769-4d3f-68f44ba7af24@freebsd.org> Date: Tue, 14 Sep 2021 20:10:49 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <202109150308.18F38iGw049171@gitrepo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4H8QG82B7qz4RW9 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; ASN(0.00)[asn:14618, ipnet:54.86.0.0/16, country:US]; local_wl_from(0.00)[freebsd.org] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 03:10:56 -0000 On 9/14/21 8:08 PM, Colin Percival wrote: > The branch stable/13 has been updated by cperciva: > > URL: https://cgit.FreeBSD.org/src/commit/?id=34a3091cc3b6e09efe480c7e9e9e72fa9db00d89 > > commit 34a3091cc3b6e09efe480c7e9e9e72fa9db00d89 > Author: Colin Percival > AuthorDate: 2021-09-15 02:42:14 +0000 > Commit: Colin Percival > CommitDate: 2021-09-15 02:42:14 +0000 > > Turn off acpi_timer_test on !i386 by default Forgot to add, this was a direct commit to stable/13 because acpi_timer_test is turned off by default on all platforms in HEAD. -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-dev-commits-src-all@freebsd.org Wed Sep 15 08:18:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D8DF67AD8F; Wed, 15 Sep 2021 08:18:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8Y5V0mGpz4qP8; Wed, 15 Sep 2021 08:18:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF6931E7E; Wed, 15 Sep 2021 08:18:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18F8IrcR060255; Wed, 15 Sep 2021 08:18:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18F8IrXv060254; Wed, 15 Sep 2021 08:18:53 GMT (envelope-from git) Date: Wed, 15 Sep 2021 08:18:53 GMT Message-Id: <202109150818.18F8IrXv060254@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: 454216468583 - main - sctp: cleanup, no functional change intended MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 454216468583481746845a1c8a45a8c18898ee72 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 08:18:54 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=454216468583481746845a1c8a45a8c18898ee72 commit 454216468583481746845a1c8a45a8c18898ee72 Author: Michael Tuexen AuthorDate: 2021-09-15 08:18:11 +0000 Commit: Michael Tuexen CommitDate: 2021-09-15 08:18:11 +0000 sctp: cleanup, no functional change intended MFC after: 1 week --- sys/netinet/sctp_asconf.c | 1 - sys/netinet/sctp_input.c | 5 ++--- sys/netinet/sctp_timer.c | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/netinet/sctp_asconf.c b/sys/netinet/sctp_asconf.c index 0915e187ee40..2250d084ca06 100644 --- a/sys/netinet/sctp_asconf.c +++ b/sys/netinet/sctp_asconf.c @@ -2195,7 +2195,6 @@ sctp_asconf_iterator_stcb(struct sctp_inpcb *inp, struct sctp_tcb *stcb, return; else continue; - break; } if (type == SCTP_ADD_IP_ADDRESS) { diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c index 6c4bb529fbb8..e2cd2cf87ac9 100644 --- a/sys/netinet/sctp_input.c +++ b/sys/netinet/sctp_input.c @@ -1975,7 +1975,6 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset, union sctp_sockstore store; struct sctp_association *asoc; int init_offset, initack_offset, initack_limit; - int retval; int error = 0; uint8_t auth_chunk_buf[SCTP_CHUNK_BUFFER_SIZE]; @@ -2088,9 +2087,9 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset, return (NULL); } /* load all addresses */ - if ((retval = sctp_load_addresses_from_init(stcb, m, + if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), - initack_offset, src, dst, init_src, port)) < 0) { + initack_offset, src, dst, init_src, port) < 0) { (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_20); return (NULL); diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c index 4866356bdf5c..e657bc280ccc 100644 --- a/sys/netinet/sctp_timer.c +++ b/sys/netinet/sctp_timer.c @@ -330,7 +330,7 @@ sctp_find_alternate_net(struct sctp_tcb *stcb, } /* Look for an alternate net, which is active. */ if ((net != NULL) && ((net->dest_state & SCTP_ADDR_BEING_DELETED) == 0)) { - alt = TAILQ_NEXT(net, sctp_next);; + alt = TAILQ_NEXT(net, sctp_next); } else { alt = TAILQ_FIRST(&stcb->asoc.nets); } @@ -369,7 +369,7 @@ sctp_find_alternate_net(struct sctp_tcb *stcb, * an alternate net, which is confirmed. */ if ((net != NULL) && ((net->dest_state & SCTP_ADDR_BEING_DELETED) == 0)) { - alt = TAILQ_NEXT(net, sctp_next);; + alt = TAILQ_NEXT(net, sctp_next); } else { alt = TAILQ_FIRST(&stcb->asoc.nets); } From owner-dev-commits-src-all@freebsd.org Wed Sep 15 08:37:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B5F8F67AECC for ; Wed, 15 Sep 2021 08:37:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8YWH2gWLz3C0l; Wed, 15 Sep 2021 08:37:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CF6C2B3F; Wed, 15 Sep 2021 08:37:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18F8blba086840; Wed, 15 Sep 2021 08:37:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18F8blmp086839; Wed, 15 Sep 2021 08:37:47 GMT (envelope-from git) Date: Wed, 15 Sep 2021 08:37:47 GMT Message-Id: <202109150837.18F8blmp086839@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Martin Matuska Subject: git: 3b89d9518df2..4a1195ca5041 - vendor/openzfs/master - vendor branch updated MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/vendor/openzfs/master X-Git-Reftype: branch X-Git-Commit: 4a1195ca5041cbff2a6b025a31937fef84876c52 X-Git-Oldrev: 3b89d9518df2c7fd747e349873a3d4d498beb20e X-Git-Newrev: 4a1195ca5041cbff2a6b025a31937fef84876c52 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 08:37:47 -0000 The branch vendor/openzfs/master has been updated by mm: URL: https://cgit.FreeBSD.org/src/log/?id=3b89d9518df2..4a1195ca5041 3e8d5e4ff3a6 Add zpool_disable_datasets_os() / zfs_unmount_os() c27c124a88b2 ZTS: Remove exceptions for flaky zhack on FreeBSD 157a4d05bd73 autoconf: allow Release to contain hyphen a9655fc2bd1f Check for libabigail version d510924520dd CI: use fresh libabigail via docker image 1aaebea2f587 Libabigail: make .abi files more consistent 6ea058da16cc Update ABI files via new libabigail version 3eb3e4d14cf0 CI: don't install abigail-tools ab15b1fc0e71 Detect iSCSI in the zpool cmd vdev media script f61660582197 Linux 5.15 compat: block device readahead a3588c68f702 Linux 5.15 compat: standalone c634320e51df Compressed receive with different ashift can result in incorrect PSIZE on disk 49d8a99a4d65 Upstream: zdb inode mapping 7676ffc51f5e arc: Drop an incorrect assert a68e4b5919dc Allow sending corrupt snapshots even if metadata is corrupted 2079111f42a9 Linux 5.15 compat: get_acl() 5a54a4e05179 Upstream: Add snapshot and zvol events b9ec4a15e5ab Verify embedded blkptr's in arc_read() 695d4ae81551 ZTS: Waiting for zvols to be available f82f0279ed58 Fixed data integrity issue when underlying disk returns error 7443299fe0b8 Iterate encrypted clones at zvol_create_minor 6954c22f35cc Use fallthrough macro 4a1195ca5041 Temporarily use root credentials to mount snapshots in .zfs From owner-dev-commits-src-all@freebsd.org Wed Sep 15 09:22:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7B41967B9D5; Wed, 15 Sep 2021 09:22:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8ZVJ2RgTz3Nm7; Wed, 15 Sep 2021 09:22:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 342503429; Wed, 15 Sep 2021 09:22:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18F9M0eD050302; Wed, 15 Sep 2021 09:22:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18F9M0Gk050301; Wed, 15 Sep 2021 09:22:00 GMT (envelope-from git) Date: Wed, 15 Sep 2021 09:22:00 GMT Message-Id: <202109150922.18F9M0Gk050301@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 1896a0094317 - main - Use a 64 bit read to access GICR_TYPER MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1896a0094317c80d46beff5ad42b68215513c996 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 09:22:00 -0000 The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=1896a0094317c80d46beff5ad42b68215513c996 commit 1896a0094317c80d46beff5ad42b68215513c996 Author: Andrew Turner AuthorDate: 2021-09-15 09:13:41 +0000 Commit: Andrew Turner CommitDate: 2021-09-15 09:13:41 +0000 Use a 64 bit read to access GICR_TYPER The GICv3 ITS only needs to implement 32 bit access to the GICR_TYPER when the CPU implements AArch32. As this may not always be the case use a 64 bit read when checking if the ITS is enabled on the CPU. PR: 258217 Reported by: Olivier Delande Sponsored by: The FreeBSD Foundation --- sys/arm64/arm64/gicv3_its.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/arm64/gicv3_its.c b/sys/arm64/arm64/gicv3_its.c index af587247626b..1a0e7a79e76b 100644 --- a/sys/arm64/arm64/gicv3_its.c +++ b/sys/arm64/arm64/gicv3_its.c @@ -710,7 +710,7 @@ its_init_cpu(device_t dev, struct gicv3_its_softc *sc) return (0); /* Check if the ITS is enabled on this CPU */ - if ((gic_r_read_4(gicv3, GICR_TYPER) & GICR_TYPER_PLPIS) == 0) + if ((gic_r_read_8(gicv3, GICR_TYPER) & GICR_TYPER_PLPIS) == 0) return (ENXIO); rpcpu = gicv3_get_redist(dev); From owner-dev-commits-src-all@freebsd.org Wed Sep 15 10:31:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 813BE67C62E; Wed, 15 Sep 2021 10:31:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8c2W3226z3wNY; Wed, 15 Sep 2021 10:31:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 490E942FB; Wed, 15 Sep 2021 10:31:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FAVVr8041708; Wed, 15 Sep 2021 10:31:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FAVVmo041707; Wed, 15 Sep 2021 10:31:31 GMT (envelope-from git) Date: Wed, 15 Sep 2021 10:31:31 GMT Message-Id: <202109151031.18FAVVmo041707@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 6d8f2277dee6 - stable/13 - i386 loaders: avoid lld 13 garbage collecting linker sets MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 6d8f2277dee6ea50b6567fc6ce6816ba02362ae9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 10:31:31 -0000 The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=6d8f2277dee6ea50b6567fc6ce6816ba02362ae9 commit 6d8f2277dee6ea50b6567fc6ce6816ba02362ae9 Author: Dimitry Andric AuthorDate: 2021-09-08 12:04:13 +0000 Commit: Dimitry Andric CommitDate: 2021-09-15 10:28:44 +0000 i386 loaders: avoid lld 13 garbage collecting linker sets Because lld 13 and higher default to garbage collecting start/stop symbols when using --gc-sections, the linker sets used in the i386 boot loaders will disappear. This leads to the loaders not recognizing any commands, and failure to boot. Until we have a good set of linker scripts for the loaders, work around it by disabling the start-stop-gc feature. (cherry picked from commit c90cab0d668af5d947054e47184d4f8dcb874ec8) --- stand/i386/loader/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stand/i386/loader/Makefile b/stand/i386/loader/Makefile index 0abf6120c1e3..571e3b2cb653 100644 --- a/stand/i386/loader/Makefile +++ b/stand/i386/loader/Makefile @@ -61,6 +61,12 @@ ORG= 0x0 CFLAGS+= -Wall LDFLAGS+= -static ${LDFLAGS_ORG} -Wl,--gc-sections +.if ${LINKER_TYPE} == "lld" && ${LINKER_VERSION} >= 130000 +# lld 13 and higher default to garbage collecting start/stop symbols, +# completely ruining our linker sets. For now, work around it by +# disabling this un-feature. +LDFLAGS+= -Wl,-z,nostart-stop-gc +.endif # i386 standalone support library LIBI386= ${BOOTOBJ}/i386/libi386/libi386.a From owner-dev-commits-src-all@freebsd.org Wed Sep 15 10:32:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F09D67C649; Wed, 15 Sep 2021 10:32:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8c3r1nB4z4QxS; Wed, 15 Sep 2021 10:32:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D6FE4519; Wed, 15 Sep 2021 10:32:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FAWe0h045996; Wed, 15 Sep 2021 10:32:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FAWeUC045994; Wed, 15 Sep 2021 10:32:40 GMT (envelope-from git) Date: Wed, 15 Sep 2021 10:32:40 GMT Message-Id: <202109151032.18FAWeUC045994@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 8e732dbd37ff - stable/12 - i386 loaders: avoid lld 13 garbage collecting linker sets MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 8e732dbd37ff11276cc552edf5b1a6f484b9ab2d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 10:32:40 -0000 The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=8e732dbd37ff11276cc552edf5b1a6f484b9ab2d commit 8e732dbd37ff11276cc552edf5b1a6f484b9ab2d Author: Dimitry Andric AuthorDate: 2021-09-08 12:04:13 +0000 Commit: Dimitry Andric CommitDate: 2021-09-15 10:32:16 +0000 i386 loaders: avoid lld 13 garbage collecting linker sets Because lld 13 and higher default to garbage collecting start/stop symbols when using --gc-sections, the linker sets used in the i386 boot loaders will disappear. This leads to the loaders not recognizing any commands, and failure to boot. Until we have a good set of linker scripts for the loaders, work around it by disabling the start-stop-gc feature. (cherry picked from commit c90cab0d668af5d947054e47184d4f8dcb874ec8) --- stand/i386/loader/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/stand/i386/loader/Makefile b/stand/i386/loader/Makefile index d332ea0530c7..5ac9db2b7216 100644 --- a/stand/i386/loader/Makefile +++ b/stand/i386/loader/Makefile @@ -50,6 +50,12 @@ ORG= 0x0 CFLAGS+= -Wall LDFLAGS+= -static ${LDFLAGS_ORG} -Wl,--gc-sections +.if ${LINKER_TYPE} == "lld" && ${LINKER_VERSION} >= 130000 +# lld 13 and higher default to garbage collecting start/stop symbols, +# completely ruining our linker sets. For now, work around it by +# disabling this un-feature. +LDFLAGS+= -Wl,-z,nostart-stop-gc +.endif # i386 standalone support library LIBI386= ${BOOTOBJ}/i386/libi386/libi386.a From owner-dev-commits-src-all@freebsd.org Wed Sep 15 11:04:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C730A67CCED; Wed, 15 Sep 2021 11:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8cmg50DNz4ZTb; Wed, 15 Sep 2021 11:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 872714567; Wed, 15 Sep 2021 11:04:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FB4Zph086663; Wed, 15 Sep 2021 11:04:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FB4Zvg086662; Wed, 15 Sep 2021 11:04:35 GMT (envelope-from git) Date: Wed, 15 Sep 2021 11:04:35 GMT Message-Id: <202109151104.18FB4Zvg086662@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Pietro Cerutti Subject: git: 41ba691f9209 - main - tee: use queue(9) in place of a custom linked list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: gahr X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 41ba691f9209c37cb245c8d2df0f312e8dc855bd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 11:04:35 -0000 The branch main has been updated by gahr (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=41ba691f9209c37cb245c8d2df0f312e8dc855bd commit 41ba691f9209c37cb245c8d2df0f312e8dc855bd Author: Pietro Cerutti AuthorDate: 2021-09-15 11:04:24 +0000 Commit: Pietro Cerutti CommitDate: 2021-09-15 11:04:24 +0000 tee: use queue(9) in place of a custom linked list Approved by: cognet --- usr.bin/tee/tee.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/usr.bin/tee/tee.c b/usr.bin/tee/tee.c index b55aa84d2f63..bc338e14bd66 100644 --- a/usr.bin/tee/tee.c +++ b/usr.bin/tee/tee.c @@ -44,6 +44,7 @@ static const char rcsid[] = #endif /* not lint */ #include +#include #include #include @@ -57,12 +58,12 @@ static const char rcsid[] = #include #include -typedef struct _list { - struct _list *next; +struct entry { int fd; const char *name; -} LIST; -static LIST *head; + STAILQ_ENTRY(entry) entries; +}; +static STAILQ_HEAD(, entry) head = STAILQ_HEAD_INITIALIZER(head); static void add(int, const char *); static void usage(void); @@ -70,7 +71,7 @@ static void usage(void); int main(int argc, char *argv[]) { - LIST *p; + struct entry *p; int n, fd, rval, wval; char *bp; int append, ch, exitval; @@ -112,7 +113,7 @@ main(int argc, char *argv[]) if (caph_enter() < 0) err(EXIT_FAILURE, "unable to enter capability mode"); while ((rval = read(STDIN_FILENO, buf, BSIZE)) > 0) - for (p = head; p; p = p->next) { + STAILQ_FOREACH(p, &head, entries) { n = rval; bp = buf; do { @@ -139,7 +140,7 @@ usage(void) static void add(int fd, const char *name) { - LIST *p; + struct entry *p; cap_rights_t rights; if (fd == STDOUT_FILENO) { @@ -151,10 +152,9 @@ add(int fd, const char *name) err(EXIT_FAILURE, "unable to limit rights"); } - if ((p = malloc(sizeof(LIST))) == NULL) + if ((p = malloc(sizeof(struct entry))) == NULL) err(1, "malloc"); p->fd = fd; p->name = name; - p->next = head; - head = p; + STAILQ_INSERT_HEAD(&head, p, entries); } From owner-dev-commits-src-all@freebsd.org Wed Sep 15 13:09:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 16AD967E861; Wed, 15 Sep 2021 13:09:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8gY201Hsz3h81; Wed, 15 Sep 2021 13:09:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D45FD6655; Wed, 15 Sep 2021 13:09:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FD9fs2046077; Wed, 15 Sep 2021 13:09:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FD9f4U046076; Wed, 15 Sep 2021 13:09:41 GMT (envelope-from git) Date: Wed, 15 Sep 2021 13:09:41 GMT Message-Id: <202109151309.18FD9f4U046076@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 91533b4cd4a8 - stable/13 - path_test: Fix the unix socket test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 91533b4cd4a8da84b11e926dfa625024a5744183 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 13:09:42 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=91533b4cd4a8da84b11e926dfa625024a5744183 commit 91533b4cd4a8da84b11e926dfa625024a5744183 Author: Mark Johnston AuthorDate: 2021-09-08 14:57:04 +0000 Commit: Mark Johnston CommitDate: 2021-09-15 13:09:18 +0000 path_test: Fix the unix socket test The intent was to specify O_PATH to open(2). Sponsored by: The FreeBSD Foundation (cherry picked from commit 8b83b656a507ee767fcb6921985720d1df61101b) --- tests/sys/file/path_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/sys/file/path_test.c b/tests/sys/file/path_test.c index 50a77f16736c..0265aa095720 100644 --- a/tests/sys/file/path_test.c +++ b/tests/sys/file/path_test.c @@ -865,7 +865,7 @@ ATF_TC_BODY(path_unix, tc) ATF_REQUIRE_MSG(bind(sd, (struct sockaddr *)&sun, SUN_LEN(&sun)) == 0, FMT_ERR("bind")); - pathfd = open(path, O_RDONLY); + pathfd = open(path, O_PATH); ATF_REQUIRE_ERRNO(EOPNOTSUPP, pathfd < 0); CHECKED_CLOSE(sd); From owner-dev-commits-src-all@freebsd.org Wed Sep 15 13:09:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F84E67E8A6; Wed, 15 Sep 2021 13:09:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8gY31CL3z3h12; Wed, 15 Sep 2021 13:09:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A3F26908; Wed, 15 Sep 2021 13:09:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FD9ghr046102; Wed, 15 Sep 2021 13:09:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FD9gvp046101; Wed, 15 Sep 2021 13:09:42 GMT (envelope-from git) Date: Wed, 15 Sep 2021 13:09:42 GMT Message-Id: <202109151309.18FD9gvp046101@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 4bfe0d4059b5 - stable/13 - path_test: Fix test sorting MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4bfe0d4059b59719ce813eec6619df7d9f2147de Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 13:09:43 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4bfe0d4059b59719ce813eec6619df7d9f2147de commit 4bfe0d4059b59719ce813eec6619df7d9f2147de Author: Mark Johnston AuthorDate: 2021-09-08 14:59:42 +0000 Commit: Mark Johnston CommitDate: 2021-09-15 13:09:32 +0000 path_test: Fix test sorting Sponsored by: The FreeBSD Foundation (cherry picked from commit c4c66153243896f9de49474c817fe450584a3bf3) --- tests/sys/file/path_test.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/tests/sys/file/path_test.c b/tests/sys/file/path_test.c index 0265aa095720..ad88c691a914 100644 --- a/tests/sys/file/path_test.c +++ b/tests/sys/file/path_test.c @@ -63,25 +63,6 @@ #define CHECKED_CLOSE(fd) \ ATF_REQUIRE_MSG(close(fd) == 0, FMT_ERR("close")) -/* - * Verify fstatat(AT_EMPTY_PATH) on non-regular dirfd. - * Verify that fstatat(AT_EMPTY_PATH) on NULL path returns EFAULT. - */ -ATF_TC_WITHOUT_HEAD(path_pipe_fstatat); -ATF_TC_BODY(path_pipe_fstatat, tc) -{ - struct stat sb; - int fd[2]; - - ATF_REQUIRE_MSG(pipe(fd) == 0, FMT_ERR("pipe")); - ATF_REQUIRE_MSG(fstatat(fd[0], "", &sb, AT_EMPTY_PATH) == 0, - FMT_ERR("fstatat pipe")); - ATF_REQUIRE_ERRNO(EFAULT, fstatat(fd[0], NULL, &sb, - AT_EMPTY_PATH) == -1); - CHECKED_CLOSE(fd[0]); - CHECKED_CLOSE(fd[1]); -} - /* Create a temporary regular file containing some data. */ static void mktfile(char path[PATH_MAX], const char *template) @@ -776,6 +757,25 @@ ATF_TC_BODY(path_lock, tc) CHECKED_CLOSE(pathfd); } +/* + * Verify fstatat(AT_EMPTY_PATH) on non-regular dirfd. + * Verify that fstatat(AT_EMPTY_PATH) on NULL path returns EFAULT. + */ +ATF_TC_WITHOUT_HEAD(path_pipe_fstatat); +ATF_TC_BODY(path_pipe_fstatat, tc) +{ + struct stat sb; + int fd[2]; + + ATF_REQUIRE_MSG(pipe(fd) == 0, FMT_ERR("pipe")); + ATF_REQUIRE_MSG(fstatat(fd[0], "", &sb, AT_EMPTY_PATH) == 0, + FMT_ERR("fstatat pipe")); + ATF_REQUIRE_ERRNO(EFAULT, fstatat(fd[0], NULL, &sb, + AT_EMPTY_PATH) == -1); + CHECKED_CLOSE(fd[0]); + CHECKED_CLOSE(fd[1]); +} + /* Verify that we can send an O_PATH descriptor over a unix socket. */ ATF_TC_WITHOUT_HEAD(path_rights); ATF_TC_BODY(path_rights, tc) @@ -890,9 +890,9 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, path_io); ATF_TP_ADD_TC(tp, path_ioctl); ATF_TP_ADD_TC(tp, path_lock); + ATF_TP_ADD_TC(tp, path_pipe_fstatat); ATF_TP_ADD_TC(tp, path_rights); ATF_TP_ADD_TC(tp, path_unix); - ATF_TP_ADD_TC(tp, path_pipe_fstatat); return (atf_no_error()); } From owner-dev-commits-src-all@freebsd.org Wed Sep 15 13:18:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5070067EE05; Wed, 15 Sep 2021 13:18:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8glb61Qsz3k0P; Wed, 15 Sep 2021 13:18:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A91A8689C; Wed, 15 Sep 2021 13:18:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FDIp8B059879; Wed, 15 Sep 2021 13:18:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FDIppM059878; Wed, 15 Sep 2021 13:18:51 GMT (envelope-from git) Date: Wed, 15 Sep 2021 13:18:51 GMT Message-Id: <202109151318.18FDIppM059878@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: 2de4c7f6d087 - main - pci_host_generic: Add Synopsys Designware PCIe controller quirk MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2de4c7f6d08798fb6269582907155703d1ab5ef4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 13:18:52 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=2de4c7f6d08798fb6269582907155703d1ab5ef4 commit 2de4c7f6d08798fb6269582907155703d1ab5ef4 Author: Pawel Anikiel AuthorDate: 2021-09-13 14:59:40 +0000 Commit: Marcin Wojtas CommitDate: 2021-09-15 13:17:40 +0000 pci_host_generic: Add Synopsys Designware PCIe controller quirk Due to the quirky nature of the Synopsys Designware PCIe IP, the type 0 configuration is broadcast and whatever device is plugged into slot, will appear at each 32 device positions of bus0. Mitigate the issue by filtering out duplicated devices on this bus for both DT and ACPI cases. Reviewed by: mw Sponsored by: Semihalf MFC: after 3 weeks Differential revision: https://reviews.freebsd.org/D31887 --- sys/dev/pci/pci_host_generic.c | 2 ++ sys/dev/pci/pci_host_generic.h | 4 ++++ sys/dev/pci/pci_host_generic_acpi.c | 33 +++++++++++++++++++++++++++++++++ sys/dev/pci/pci_host_generic_fdt.c | 7 +++++++ 4 files changed, 46 insertions(+) diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c index 0c45f5d316ed..22b3ccdc17b1 100644 --- a/sys/dev/pci/pci_host_generic.c +++ b/sys/dev/pci/pci_host_generic.c @@ -185,6 +185,8 @@ generic_pcie_read_config(device_t dev, u_int bus, u_int slot, if ((slot > PCI_SLOTMAX) || (func > PCI_FUNCMAX) || (reg > PCIE_REGMAX)) return (~0U); + if ((sc->quirks & PCIE_ECAM_DESIGNWARE_QUIRK) && bus == 0 && slot > 0) + return (~0U); offset = PCIE_ADDR_OFFSET(bus - sc->bus_start, slot, func, reg); t = sc->bst; diff --git a/sys/dev/pci/pci_host_generic.h b/sys/dev/pci/pci_host_generic.h index 36a12b9559ba..20117cbe32e3 100644 --- a/sys/dev/pci/pci_host_generic.h +++ b/sys/dev/pci/pci_host_generic.h @@ -85,8 +85,12 @@ struct generic_pcie_core_softc { device_t dev; bus_space_handle_t ioh; bus_dma_tag_t dmat; + uint32_t quirks; }; +/* Quirks */ +#define PCIE_ECAM_DESIGNWARE_QUIRK (1 << 0) + DECLARE_CLASS(generic_pcie_core_driver); int pci_host_generic_core_attach(device_t); diff --git a/sys/dev/pci/pci_host_generic_acpi.c b/sys/dev/pci/pci_host_generic_acpi.c index 763a84d2fd53..3c32abc5007a 100644 --- a/sys/dev/pci/pci_host_generic_acpi.c +++ b/sys/dev/pci/pci_host_generic_acpi.c @@ -89,6 +89,21 @@ __FBSDID("$FreeBSD$"); #define PROPS_CELL_SIZE 1 #define PCI_ADDR_CELL_SIZE 2 +static struct { + char oem_id[ACPI_OEM_ID_SIZE + 1]; + char oem_table_id[ACPI_OEM_TABLE_ID_SIZE + 1]; + uint32_t quirks; +} pci_acpi_quirks[] = { + { "MRVL ", "CN9130 ", PCIE_ECAM_DESIGNWARE_QUIRK }, + { "MRVL ", "CN913X ", PCIE_ECAM_DESIGNWARE_QUIRK }, + { "MVEBU ", "ARMADA7K", PCIE_ECAM_DESIGNWARE_QUIRK }, + { "MVEBU ", "ARMADA8K", PCIE_ECAM_DESIGNWARE_QUIRK }, + { "MVEBU ", "CN9130 ", PCIE_ECAM_DESIGNWARE_QUIRK }, + { "MVEBU ", "CN9131 ", PCIE_ECAM_DESIGNWARE_QUIRK }, + { "MVEBU ", "CN9132 ", PCIE_ECAM_DESIGNWARE_QUIRK }, + { 0 }, +}; + /* Forward prototypes */ static int generic_pcie_acpi_probe(device_t dev); @@ -170,6 +185,23 @@ pci_host_generic_acpi_parse_resource(ACPI_RESOURCE *res, void *arg) return (AE_OK); } +static void +pci_host_acpi_get_oem_quirks(struct generic_pcie_acpi_softc *sc, + ACPI_TABLE_HEADER *hdr) +{ + int i; + + for (i = 0; pci_acpi_quirks[i].quirks; i++) { + if (memcmp(hdr->OemId, pci_acpi_quirks[i].oem_id, + ACPI_OEM_ID_SIZE) != 0) + continue; + if (memcmp(hdr->OemTableId, pci_acpi_quirks[i].oem_table_id, + ACPI_OEM_TABLE_ID_SIZE) != 0) + continue; + sc->base.quirks |= pci_acpi_quirks[i].quirks; + } +} + static int pci_host_acpi_get_ecam_resource(device_t dev) { @@ -209,6 +241,7 @@ pci_host_acpi_get_ecam_resource(device_t dev) sc->base.bus_start, sc->base.bus_end); return (ENXIO); } + pci_host_acpi_get_oem_quirks(sc, hdr); } else { status = acpi_GetInteger(handle, "_CBA", &val); if (ACPI_SUCCESS(status)) diff --git a/sys/dev/pci/pci_host_generic_fdt.c b/sys/dev/pci/pci_host_generic_fdt.c index 91ffaf7357b9..249637019137 100644 --- a/sys/dev/pci/pci_host_generic_fdt.c +++ b/sys/dev/pci/pci_host_generic_fdt.c @@ -151,6 +151,13 @@ pci_host_generic_setup_fdt(device_t dev) if (error != 0) return (error); + if (ofw_bus_is_compatible(dev, "marvell,armada8k-pcie-ecam") || + ofw_bus_is_compatible(dev, "socionext,synquacer-pcie-ecam") || + ofw_bus_is_compatible(dev, "snps,dw-pcie-ecam")) { + device_set_desc(dev, "Synopsys DesignWare PCIe Controller"); + sc->base.quirks |= PCIE_ECAM_DESIGNWARE_QUIRK; + } + ofw_bus_setup_iinfo(node, &sc->pci_iinfo, sizeof(cell_t)); return (0); From owner-dev-commits-src-all@freebsd.org Wed Sep 15 13:21:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2E4FE67EA7C for ; Wed, 15 Sep 2021 13:21:08 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8gpD0clLz3l89 for ; Wed, 15 Sep 2021 13:21:08 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f41.google.com with SMTP id u15so3876171wru.6 for ; Wed, 15 Sep 2021 06:21:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=tI08zHBmt3DSlD8uL1cSShXRCTjTmaiHhAu/CspMGv0=; b=aCndYojcNPzp7Lf04BiYyLuGP+HtgccQjPdbnBr8m3FQpIZWn+mCqY0mmv4obslLt7 GymuXLhG6XRsCWduR+iXhL3GfaQ1Wrt9EfMdSIyS0ayNRQgteL0B2sxpQgEZh/fvSdEw FOqTwdPM7mcF7n2rOuYLse4rCtbilFl0Z3IVW/JovEw+AuJM7uxhjBgea+RH9AoUOszB aVKTsWDCprhhYy9HN4lT0Fbseh3tP/JHM2ZecijGKh1oceKuwRWmxrR4GfpntKcEedaQ iE1ZoOzXBzOx4ieaDKHGipiS/KB5e8le+6grqqxGDAwbBjjIzz7ttaSw9T5psBVxtYTJ rzHQ== X-Gm-Message-State: AOAM533XIKLOasxxYwdn4E1/XKu9zoWa0lXmvSqv8IiXmGx2JZn9RYdY YMnWvECJNadQf7D6Pe6Wv0zjng== X-Google-Smtp-Source: ABdhPJwNqPRFdP1nIHMiGkWpAk2T1rU18DlX/18PrsdUmeJ1ktE4jV3hXLAAH5fZALVKeWtzntCsow== X-Received: by 2002:adf:f507:: with SMTP id q7mr5235096wro.7.1631712060928; Wed, 15 Sep 2021 06:21:00 -0700 (PDT) Received: from smtpclient.apple (global-5-143.nat-2.net.cam.ac.uk. [131.111.5.143]) by smtp.gmail.com with ESMTPSA id j23sm15477wmo.14.2021.09.15.06.21.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Sep 2021 06:21:00 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: git: 2de4c7f6d087 - main - pci_host_generic: Add Synopsys Designware PCIe controller quirk From: Jessica Clarke In-Reply-To: <202109151318.18FDIppM059878@gitrepo.freebsd.org> Date: Wed, 15 Sep 2021 14:20:59 +0100 Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <202109151318.18FDIppM059878@gitrepo.freebsd.org> To: Marcin Wojtas X-Mailer: Apple Mail (2.3654.120.0.1.13) X-Rspamd-Queue-Id: 4H8gpD0clLz3l89 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 13:21:08 -0000 On 15 Sep 2021, at 14:18, Marcin Wojtas wrote: >=20 > The branch main has been updated by mw: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D2de4c7f6d08798fb6269582907155703= d1ab5ef4 >=20 > commit 2de4c7f6d08798fb6269582907155703d1ab5ef4 > Author: Pawel Anikiel > AuthorDate: 2021-09-13 14:59:40 +0000 > Commit: Marcin Wojtas > CommitDate: 2021-09-15 13:17:40 +0000 >=20 > pci_host_generic: Add Synopsys Designware PCIe controller quirk >=20 > Due to the quirky nature of the Synopsys Designware PCIe IP, > the type 0 configuration is broadcast and whatever device > is plugged into slot, will appear at each 32 device > positions of bus0. Mitigate the issue by filtering out > duplicated devices on this bus for both DT and ACPI cases. >=20 > Reviewed by: mw > Sponsored by: Semihalf > MFC: after 3 weeks > Differential revision: https://reviews.freebsd.org/D31887 > --- > sys/dev/pci/pci_host_generic.c | 2 ++ > sys/dev/pci/pci_host_generic.h | 4 ++++ > sys/dev/pci/pci_host_generic_acpi.c | 33 = +++++++++++++++++++++++++++++++++ > sys/dev/pci/pci_host_generic_fdt.c | 7 +++++++ > 4 files changed, 46 insertions(+) >=20 > diff --git a/sys/dev/pci/pci_host_generic.c = b/sys/dev/pci/pci_host_generic.c > index 0c45f5d316ed..22b3ccdc17b1 100644 > --- a/sys/dev/pci/pci_host_generic.c > +++ b/sys/dev/pci/pci_host_generic.c > @@ -185,6 +185,8 @@ generic_pcie_read_config(device_t dev, u_int bus, = u_int slot, > if ((slot > PCI_SLOTMAX) || (func > PCI_FUNCMAX) || > (reg > PCIE_REGMAX)) > return (~0U); > + if ((sc->quirks & PCIE_ECAM_DESIGNWARE_QUIRK) && bus =3D=3D 0 && = slot > 0) > + return (~0U); >=20 > offset =3D PCIE_ADDR_OFFSET(bus - sc->bus_start, slot, func, = reg); > t =3D sc->bst; > diff --git a/sys/dev/pci/pci_host_generic.h = b/sys/dev/pci/pci_host_generic.h > index 36a12b9559ba..20117cbe32e3 100644 > --- a/sys/dev/pci/pci_host_generic.h > +++ b/sys/dev/pci/pci_host_generic.h > @@ -85,8 +85,12 @@ struct generic_pcie_core_softc { > device_t dev; > bus_space_handle_t ioh; > bus_dma_tag_t dmat; > + uint32_t quirks; > }; >=20 > +/* Quirks */ > +#define PCIE_ECAM_DESIGNWARE_QUIRK (1 << 0) > + > DECLARE_CLASS(generic_pcie_core_driver); >=20 > int pci_host_generic_core_attach(device_t); > diff --git a/sys/dev/pci/pci_host_generic_acpi.c = b/sys/dev/pci/pci_host_generic_acpi.c > index 763a84d2fd53..3c32abc5007a 100644 > --- a/sys/dev/pci/pci_host_generic_acpi.c > +++ b/sys/dev/pci/pci_host_generic_acpi.c > @@ -89,6 +89,21 @@ __FBSDID("$FreeBSD$"); > #define PROPS_CELL_SIZE 1 > #define PCI_ADDR_CELL_SIZE 2 >=20 > +static struct { > + char oem_id[ACPI_OEM_ID_SIZE + 1]; > + char oem_table_id[ACPI_OEM_TABLE_ID_SIZE + 1]; > + uint32_t quirks; > +} pci_acpi_quirks[] =3D { > + { "MRVL ", "CN9130 ", PCIE_ECAM_DESIGNWARE_QUIRK }, > + { "MRVL ", "CN913X ", PCIE_ECAM_DESIGNWARE_QUIRK }, > + { "MVEBU ", "ARMADA7K", PCIE_ECAM_DESIGNWARE_QUIRK }, > + { "MVEBU ", "ARMADA8K", PCIE_ECAM_DESIGNWARE_QUIRK }, > + { "MVEBU ", "CN9130 ", PCIE_ECAM_DESIGNWARE_QUIRK }, > + { "MVEBU ", "CN9131 ", PCIE_ECAM_DESIGNWARE_QUIRK }, > + { "MVEBU ", "CN9132 ", PCIE_ECAM_DESIGNWARE_QUIRK }, > + { 0 }, > +}; > + > /* Forward prototypes */ >=20 > static int generic_pcie_acpi_probe(device_t dev); > @@ -170,6 +185,23 @@ = pci_host_generic_acpi_parse_resource(ACPI_RESOURCE *res, void *arg) > return (AE_OK); > } >=20 > +static void > +pci_host_acpi_get_oem_quirks(struct generic_pcie_acpi_softc *sc, > + ACPI_TABLE_HEADER *hdr) > +{ > + int i; > + > + for (i =3D 0; pci_acpi_quirks[i].quirks; i++) { > + if (memcmp(hdr->OemId, pci_acpi_quirks[i].oem_id, > + ACPI_OEM_ID_SIZE) !=3D 0) > + continue; > + if (memcmp(hdr->OemTableId, = pci_acpi_quirks[i].oem_table_id, > + ACPI_OEM_TABLE_ID_SIZE) !=3D 0) > + continue; > + sc->base.quirks |=3D pci_acpi_quirks[i].quirks; > + } > +} > + > static int > pci_host_acpi_get_ecam_resource(device_t dev) > { > @@ -209,6 +241,7 @@ pci_host_acpi_get_ecam_resource(device_t dev) > sc->base.bus_start, sc->base.bus_end); > return (ENXIO); > } > + pci_host_acpi_get_oem_quirks(sc, hdr); > } else { > status =3D acpi_GetInteger(handle, "_CBA", &val); > if (ACPI_SUCCESS(status)) > diff --git a/sys/dev/pci/pci_host_generic_fdt.c = b/sys/dev/pci/pci_host_generic_fdt.c > index 91ffaf7357b9..249637019137 100644 > --- a/sys/dev/pci/pci_host_generic_fdt.c > +++ b/sys/dev/pci/pci_host_generic_fdt.c > @@ -151,6 +151,13 @@ pci_host_generic_setup_fdt(device_t dev) > if (error !=3D 0) > return (error); >=20 > + if (ofw_bus_is_compatible(dev, "marvell,armada8k-pcie-ecam") || > + ofw_bus_is_compatible(dev, "socionext,synquacer-pcie-ecam") = || > + ofw_bus_is_compatible(dev, "snps,dw-pcie-ecam")) { > + device_set_desc(dev, "Synopsys DesignWare PCIe = Controller"); It seems inconsistent to set this for _fdt but not _acpi? Jess From owner-dev-commits-src-all@freebsd.org Wed Sep 15 13:30:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75D0167EDD0; Wed, 15 Sep 2021 13:30:20 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8h0q48wtz3n3J; Wed, 15 Sep 2021 13:30:19 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.16.1/8.16.1) with ESMTPS id 18FDU5NE023847 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 15 Sep 2021 16:30:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 18FDU5NE023847 Received: (from kostik@localhost) by tom.home (8.16.1/8.16.1/Submit) id 18FDU5hT023846; Wed, 15 Sep 2021 16:30:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 15 Sep 2021 16:30:05 +0300 From: Konstantin Belousov To: Jessica Clarke Cc: Edward Tomasz Napierala , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: bdf0f24bb16d - main - linux: implement PTRACE_GET_SYSCALL_INFO Message-ID: References: <202109142041.18EKf6RU040962@gitrepo.freebsd.org> <7C375F3A-889E-440F-A164-959A9A903733@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.5 X-Spam-Checker-Version: SpamAssassin 3.4.5 (2021-03-20) on tom.home X-Rspamd-Queue-Id: 4H8h0q48wtz3n3J X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=gmail.com (policy=none); spf=softfail (mx1.freebsd.org: 2001:470:d5e7:1::1 is neither permitted nor denied by domain of kostikbel@gmail.com) smtp.mailfrom=kostikbel@gmail.com X-Spamd-Result: default: False [-2.29 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : No valid SPF, No valid DKIM,none]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_SPF_SOFTFAIL(0.00)[~all:c]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_SHORT(-0.29)[-0.292]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; MIME_TRACE(0.00)[0:+]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 13:30:20 -0000 On Wed, Sep 15, 2021 at 02:15:59AM +0300, Konstantin Belousov wrote: > On Tue, Sep 14, 2021 at 11:54:08PM +0100, Jessica Clarke wrote: > > On 14 Sep 2021, at 23:45, Konstantin Belousov wrote: > > > > > > On Tue, Sep 14, 2021 at 08:41:06PM +0000, Edward Tomasz Napierala wrote: > > >> The branch main has been updated by trasz: > > >> > > >> URL: https://cgit.FreeBSD.org/src/commit/?id=bdf0f24bb16d556a5b1e01cdfc087d08e91ac572 > > >> > > >> commit bdf0f24bb16d556a5b1e01cdfc087d08e91ac572 > > >> Author: Edward Tomasz Napierala > > >> AuthorDate: 2021-09-12 11:31:10 +0000 > > >> Commit: Edward Tomasz Napierala > > >> CommitDate: 2021-09-14 20:19:55 +0000 > > >> > > >> linux: implement PTRACE_GET_SYSCALL_INFO > > >> > > >> This is one of the pieces required to make modern (ie Focal) > > >> strace(1) work. > > >> > > >> Reviewed By: jhb (earlier version) > > >> Sponsored by: EPSRC > > >> Differential Revision: https://reviews.freebsd.org/D28212 > > >> --- > > >> lib/libsysdecode/mktables | 2 +- > > >> sys/amd64/linux/linux_ptrace.c | 98 +++++++++++++++++++++++++++++++++-- > > >> sys/compat/freebsd32/freebsd32_misc.c | 3 ++ > > >> sys/kern/sys_process.c | 17 ++++++ > > >> sys/sys/ptrace.h | 4 ++ > > >> 5 files changed, 120 insertions(+), 4 deletions(-) > > >> > > >> + case PT_GET_SC_ARGS_ALL: > > >> + CTR1(KTR_PTRACE, "PT_GET_SC_ARGS_ALL: pid %d", p->p_pid); > > >> + if ((td2->td_dbgflags & (TDB_SCE | TDB_SCX)) == 0 > > >> +#ifdef COMPAT_FREEBSD32 > > >> + || (wrap32 && !safe) > > >> +#endif > > >> + ) { > > >> + error = EINVAL; > > >> + break; > > >> + } > > >> + bcopy(td2->td_sa.args, addr, sizeof(td2->td_sa.args)); > > >> + break; > > > > > > This is awful, you already got that feedback in review, as I read it. > > > I strongly suggest to remove PT_GET_SC_ARGS_ALL, and instead checks something > > > in the implementation of PT_GET_SC_ARGS to select either full copy or just > > > nargs args. > > > > > > Easiest thing for 'something' would be SV_PROC_ABI(p) == SV_ABI_LINUX. > > > > That is incorrect. The original review just changed PT_GET_SC_ARGS even > > for FreeBSD and that was what was described as horrible. John suggested > > two alternatives: this approach, and having the Linuxulator bypass > > kern_ptrace entirely by doing its own thing. > My view is that > - the whole thing with reading past nargs is horrible > - having hidden API interface is horrible, it is obvious layering violation > when you need to hide an API: the consumer calls at the wrong level. > > Another reason to dislike this is that we started to add new PT_ verbs > at relatively high rate recently. I am aware of at least to more PT_ > ops coming in. In other words, we are not too far from exhausting the > MI range and then we would need to make some arrangements. Having one > more PT_ value, esp. not useful for anything but for layering violation, > is not good. https://reviews.freebsd.org/D31968 From owner-dev-commits-src-all@freebsd.org Wed Sep 15 14:33:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 19C5467FBBC; Wed, 15 Sep 2021 14:33:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8jPK6hQhz4Z60; Wed, 15 Sep 2021 14:33:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6E667C02; Wed, 15 Sep 2021 14:33:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FEX9sn065180; Wed, 15 Sep 2021 14:33:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FEX9NF065179; Wed, 15 Sep 2021 14:33:09 GMT (envelope-from git) Date: Wed, 15 Sep 2021 14:33:09 GMT Message-Id: <202109151433.18FEX9NF065179@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 6e8272f317b8 - main - mount: improve error message for invalid filesystem names MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6e8272f317b899438165108a72fa04a4995611bd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 14:33:10 -0000 The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=6e8272f317b899438165108a72fa04a4995611bd commit 6e8272f317b899438165108a72fa04a4995611bd Author: Piotr Pawel Stefaniak AuthorDate: 2021-08-14 20:06:08 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-15 14:25:31 +0000 mount: improve error message for invalid filesystem names For an invalid filesystem name used like this: mount -t asdfs /dev/ada1p5 /usr/obj emit an error message like this: mount: /dev/ada1p5: Invalid fstype: Invalid argument instead of: mount: /dev/ada1p5: Operation not supported by device Differential Revision: https://reviews.freebsd.org/D31540 --- sys/kern/vfs_mount.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 73fd8321c9da..55c62b7fe491 100644 --- a/sys/kern/vfs_mount.c +++ b/sys/kern/vfs_mount.c @@ -966,6 +966,12 @@ vfs_donmount(struct thread *td, uint64_t fsflags, struct uio *fsoptions) } error = vfs_domount(td, fstype, fspath, fsflags, &optlist); + if (error == ENOENT) { + error = EINVAL; + if (errmsg != NULL) + strncpy(errmsg, "Invalid fstype", errmsg_len); + goto bail; + } /* * See if we can mount in the read-only mode if the error code suggests @@ -1525,12 +1531,13 @@ vfs_domount( vfsp = NULL; if ((fsflags & MNT_UPDATE) == 0) { /* Don't try to load KLDs if we're mounting the root. */ - if (fsflags & MNT_ROOTFS) - vfsp = vfs_byname(fstype); - else - vfsp = vfs_byname_kld(fstype, td, &error); - if (vfsp == NULL) - return (ENODEV); + if (fsflags & MNT_ROOTFS) { + if ((vfsp = vfs_byname(fstype)) == NULL) + return (ENODEV); + } else { + if ((vfsp = vfs_byname_kld(fstype, td, &error)) == NULL) + return (error); + } } /* From owner-dev-commits-src-all@freebsd.org Wed Sep 15 15:20:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 69BBA66835C; Wed, 15 Sep 2021 15:20:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8kSW24ZGz4m71; Wed, 15 Sep 2021 15:20:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id A640B258BF; Wed, 15 Sep 2021 15:20:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: 1ecbc1d8e9d3 - main - cxgbe tom: Don't queue AIO requests on listen sockets. To: Alan Somers Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202109142046.18EKkfEN043871@gitrepo.freebsd.org> From: John Baldwin Message-ID: Date: Wed, 15 Sep 2021 08:20:56 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 15:20:59 -0000 On 9/14/21 1:53 PM, Alan Somers wrote: > On Tue, Sep 14, 2021 at 2:46 PM John Baldwin wrote: > >> The branch main has been updated by jhb: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=1ecbc1d8e9d3fbcd8e68fc68f0a32944a12ddb1e >> >> commit 1ecbc1d8e9d3fbcd8e68fc68f0a32944a12ddb1e >> Author: John Baldwin >> AuthorDate: 2021-09-14 20:46:14 +0000 >> Commit: John Baldwin >> CommitDate: 2021-09-14 20:46:14 +0000 >> >> cxgbe tom: Don't queue AIO requests on listen sockets. >> >> This is similar to the fixes in 141fe2dceeae. One difference is that >> TOE sockets do not change states (listen vs non-listen) once created, >> so no lock is needed for SOLISTENING(). >> >> Sponsored by: Chelsio Communications >> > > I've always wondered: what's the point to using AIO with sockets? Can't > everything socket-related be done better with non-blocking read/write and > kqueue? Zero-copy operation with TOE is why TOE uses AIO. Zero-copy of user buffers can't really work with the non-AIO APIs because the user buffer is free to be reused immediately after write(2) (and on the read side you don't know the buffer in advance to allow the NIC to write directly into the use buffer). In theory we could support zero-copy using mb_ext_pgs for aio_write() for the non-TOE case similar to what sendfile() does. -- John Baldwin From owner-dev-commits-src-all@freebsd.org Wed Sep 15 15:31:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8539F6686D9; Wed, 15 Sep 2021 15:31:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8khx3Kb5z4pxj; Wed, 15 Sep 2021 15:31:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5291610571; Wed, 15 Sep 2021 15:31:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FFVjJ5045223; Wed, 15 Sep 2021 15:31:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FFVj3k045222; Wed, 15 Sep 2021 15:31:45 GMT (envelope-from git) Date: Wed, 15 Sep 2021 15:31:45 GMT Message-Id: <202109151531.18FFVj3k045222@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Martin Matuska Subject: git: 53b70c86d93c - main - zfs: merge openzfs/zfs@4a1195ca5 (master) into main MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 53b70c86d93c1e4d3c76f1282e94154e88780d7e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 15:31:45 -0000 The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=53b70c86d93c1e4d3c76f1282e94154e88780d7e commit 53b70c86d93c1e4d3c76f1282e94154e88780d7e Merge: 6e8272f317b8 4a1195ca5041 Author: Martin Matuska AuthorDate: 2021-09-15 15:30:07 +0000 Commit: Martin Matuska CommitDate: 2021-09-15 15:30:53 +0000 zfs: merge openzfs/zfs@4a1195ca5 (master) into main Notable upstream pull request merges: #11312 Temporarily use root credentials to mount snapshots in .zfs #12246 arc: Drop an incorrect assert #12443 Fixed data integrity issue when underlying disk returns error to zfs #12522 Compressed receive with different ashift can result in incorrect PSIZE on disk #12535 Verify embedded blkptr's in arc_read() #12541 Allow sending corrupt snapshots even if metadata is corrupted Obtained from: OpenZFS OpenZFS commit: 4a1195ca5041cbff2a6b025a31937fef84876c52 .../openzfs/.github/workflows/checkstyle.yaml | 6 +- sys/contrib/openzfs/Makefile.am | 14 +- sys/contrib/openzfs/cmd/mount_zfs/mount_zfs.c | 2 +- sys/contrib/openzfs/cmd/zdb/zdb.c | 13 +- sys/contrib/openzfs/cmd/zed/agents/zfs_retire.c | 1 + sys/contrib/openzfs/cmd/zed/zed.c | 2 +- sys/contrib/openzfs/cmd/zed/zed_conf.c | 1 + sys/contrib/openzfs/cmd/zed/zed_exec.c | 2 + sys/contrib/openzfs/cmd/zfs/zfs_main.c | 1 + sys/contrib/openzfs/cmd/zpool/zpool.d/media | 9 +- .../openzfs/cmd/zpool_influxdb/zpool_influxdb.c | 2 +- sys/contrib/openzfs/config/Abigail.am | 2 + sys/contrib/openzfs/config/Rules.am | 1 + .../openzfs/config/always-compiler-options.m4 | 23 + sys/contrib/openzfs/config/kernel-acl.m4 | 23 +- sys/contrib/openzfs/config/kernel-blk-queue.m4 | 40 + sys/contrib/openzfs/config/kernel-stdarg.m4 | 32 + sys/contrib/openzfs/config/kernel.m4 | 2 + sys/contrib/openzfs/config/zfs-build.m4 | 1 + sys/contrib/openzfs/config/zfs-meta.m4 | 4 +- sys/contrib/openzfs/include/libzfs.h | 4 +- .../openzfs/include/os/freebsd/linux/compiler.h | 1 + .../include/os/linux/kernel/linux/blkdev_compat.h | 3 + .../os/linux/kernel/linux/compiler_compat.h | 8 + .../openzfs/include/os/linux/spl/sys/cmn_err.h | 4 + .../include/os/linux/zfs/sys/zfs_context_os.h | 1 + sys/contrib/openzfs/include/os/linux/zfs/sys/zpl.h | 4 + sys/contrib/openzfs/include/sys/fm/fs/zfs.h | 9 + sys/contrib/openzfs/include/sys/spa.h | 2 + sys/contrib/openzfs/include/sys/zfs_context.h | 1 - sys/contrib/openzfs/include/sys/zio.h | 2 + sys/contrib/openzfs/lib/libnvpair/libnvpair.abi | 5257 +++++++------- .../openzfs/lib/libspl/include/sys/feature_tests.h | 11 +- sys/contrib/openzfs/lib/libuutil/libuutil.abi | 2778 ++++--- sys/contrib/openzfs/lib/libzfs/libzfs.abi | 7642 ++++++++------------ sys/contrib/openzfs/lib/libzfs/libzfs_dataset.c | 5 +- sys/contrib/openzfs/lib/libzfs/libzfs_mount.c | 4 + sys/contrib/openzfs/lib/libzfs/libzfs_pool.c | 4 +- sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c | 2 +- sys/contrib/openzfs/lib/libzfs/libzfs_util.c | 2 +- .../openzfs/lib/libzfs/os/freebsd/libzfs_zmount.c | 12 + .../openzfs/lib/libzfs/os/linux/libzfs_mount_os.c | 12 + .../openzfs/lib/libzfs_core/libzfs_core.abi | 5040 ++++++------- .../openzfs/lib/libzfsbootenv/libzfsbootenv.abi | 361 +- .../openzfs/lib/libzfsbootenv/lzbe_device.c | 2 +- sys/contrib/openzfs/lib/libzutil/zutil_import.c | 3 +- .../openzfs/module/icp/core/kcf_prov_tabs.c | 2 +- sys/contrib/openzfs/module/icp/io/aes.c | 2 +- sys/contrib/openzfs/module/lua/lcode.c | 4 + sys/contrib/openzfs/module/lua/lgc.c | 2 +- sys/contrib/openzfs/module/lua/llex.c | 2 +- sys/contrib/openzfs/module/lua/lstrlib.c | 2 +- sys/contrib/openzfs/module/lua/ltable.c | 2 +- .../openzfs/module/os/freebsd/spl/spl_vfs.c | 10 +- .../openzfs/module/os/freebsd/zfs/zfs_acl.c | 4 +- .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 2 +- sys/contrib/openzfs/module/os/linux/zfs/zfs_acl.c | 4 +- .../openzfs/module/os/linux/zfs/zfs_znode.c | 2 +- .../openzfs/module/os/linux/zfs/zpl_xattr.c | 34 +- sys/contrib/openzfs/module/zfs/abd.c | 8 +- sys/contrib/openzfs/module/zfs/arc.c | 20 +- sys/contrib/openzfs/module/zfs/dmu_send.c | 2 + sys/contrib/openzfs/module/zfs/dsl_prop.c | 2 +- sys/contrib/openzfs/module/zfs/spa.c | 2 +- sys/contrib/openzfs/module/zfs/vdev_label.c | 2 +- .../openzfs/module/zfs/vdev_raidz_math_scalar.c | 2 +- sys/contrib/openzfs/module/zfs/zfs_fm.c | 52 + sys/contrib/openzfs/module/zfs/zfs_replay.c | 8 +- sys/contrib/openzfs/module/zfs/zil.c | 34 +- sys/contrib/openzfs/module/zfs/zio.c | 14 +- sys/contrib/openzfs/module/zfs/zio_compress.c | 2 +- sys/contrib/openzfs/module/zfs/zvol.c | 64 + .../openzfs/tests/test-runner/bin/zts-report.py.in | 7 - .../openzfs/tests/zfs-tests/cmd/mkbusy/mkbusy.c | 2 +- .../cli_root/zfs_copies/zfs_copies.kshlib | 7 +- .../cli_root/zfs_rename/zfs_rename_006_pos.ksh | 2 +- .../cli_root/zpool_import/zpool_import_errata3.ksh | 4 +- .../zvol/zvol_misc/zvol_misc_volmode.ksh | 2 + sys/modules/zfs/zfs_config.h | 4 +- sys/modules/zfs/zfs_gitrev.h | 2 +- 80 files changed, 9815 insertions(+), 11854 deletions(-) diff --cc sys/contrib/openzfs/config/kernel-stdarg.m4 index 000000000000,5bc8dd859d6b..5bc8dd859d6b mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-stdarg.m4 +++ b/sys/contrib/openzfs/config/kernel-stdarg.m4 diff --cc sys/contrib/openzfs/lib/libspl/include/sys/feature_tests.h index 1a68b75f0cdc,000000000000..c9564b2c3269 mode 100644,000000..100644 --- a/sys/contrib/openzfs/lib/libspl/include/sys/feature_tests.h +++ b/sys/contrib/openzfs/lib/libspl/include/sys/feature_tests.h @@@ -1,32 -1,0 +1,41 @@@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License, Version 1.0 only + * (the "License"). You may not use this file except in compliance + * with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ + +#ifndef _SYS_FEATURE_TESTS_H +#define _SYS_FEATURE_TESTS_H + - #define __NORETURN __attribute__((__noreturn__)) ++#define ____cacheline_aligned ++#define __NORETURN __attribute__((__noreturn__)) ++ ++#if !defined(fallthrough) && !defined(_LIBCPP_VERSION) ++#if defined(HAVE_IMPLICIT_FALLTHROUGH) ++#define fallthrough __attribute__((__fallthrough__)) ++#else ++#define fallthrough ((void)0) ++#endif ++#endif + +#endif diff --cc sys/modules/zfs/zfs_config.h index ecc1e2940105,000000000000..82f6d415f966 mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,849 -1,0 +1,849 @@@ +/* + * $FreeBSD$ + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* bio_end_io_t wants 1 arg */ +/* #undef HAVE_1ARG_BIO_END_IO_T */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* submit_bio() wants 1 arg */ +/* #undef HAVE_1ARG_SUBMIT_BIO */ + +/* bdi_setup_and_register() wants 2 args */ +/* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 2 args */ +/* #undef HAVE_2ARGS_VFS_GETATTR */ + +/* zlib_deflate_workspacesize() wants 2 args */ +/* #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */ + +/* bdi_setup_and_register() wants 3 args */ +/* #undef HAVE_3ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 3 args */ +/* #undef HAVE_3ARGS_VFS_GETATTR */ + +/* vfs_getattr wants 4 args */ +/* #undef HAVE_4ARGS_VFS_GETATTR */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* posix_acl has refcount_t */ +/* #undef HAVE_ACL_REFCOUNT */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio->bi_bdev->bd_disk exists */ +/* #undef HAVE_BIO_BDEV_DISK */ + +/* bio->bi_opf is defined */ +/* #undef HAVE_BIO_BI_OPF */ + +/* bio->bi_status exists */ +/* #undef HAVE_BIO_BI_STATUS */ + +/* bio has bi_iter */ +/* #undef HAVE_BIO_BVEC_ITER */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_max_segs() is implemented */ +/* #undef HAVE_BIO_MAX_SEGS */ + +/* bio_set_dev() is available */ +/* #undef HAVE_BIO_SET_DEV */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + +/* blk_alloc_disk() exists */ +/* #undef HAVE_BLK_ALLOC_DISK */ + +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_flag_clear() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_CLEAR */ + +/* blk_queue_flag_set() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_SET */ + +/* blk_queue_flush() is available */ +/* #undef HAVE_BLK_QUEUE_FLUSH */ + +/* blk_queue_flush() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_FLUSH_GPL_ONLY */ + +/* blk_queue_secdiscard() is available */ +/* #undef HAVE_BLK_QUEUE_SECDISCARD */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + +/* blk_queue_write_cache() exists */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE */ + +/* blk_queue_write_cache() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY */ + +/* Define if revalidate_disk() in block_device_operations */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK */ + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + +/* Define to 1 if you have the Mac OS X function + CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES */ + +/* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in + the CoreFoundation framework. */ +/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */ + +/* check_disk_change() exists */ +/* #undef HAVE_CHECK_DISK_CHANGE */ + +/* clear_inode() is available */ +/* #undef HAVE_CLEAR_INODE */ + +/* dentry uses const struct dentry_operations */ +/* #undef HAVE_CONST_DENTRY_OPERATIONS */ + +/* copy_from_iter() is available */ +/* #undef HAVE_COPY_FROM_ITER */ + +/* copy_to_iter() is available */ +/* #undef HAVE_COPY_TO_ITER */ + +/* yes */ +/* #undef HAVE_CPU_HOTPLUG */ + +/* current_time() exists */ +/* #undef HAVE_CURRENT_TIME */ + +/* Define if the GNU dcgettext() function is already present or preinstalled. + */ +/* #undef HAVE_DCGETTEXT */ + +/* DECLARE_EVENT_CLASS() is available */ +/* #undef HAVE_DECLARE_EVENT_CLASS */ + +/* lookup_bdev() wants dev_t arg */ +/* #undef HAVE_DEVT_LOOKUP_BDEV */ + +/* sops->dirty_inode() wants flags */ +/* #undef HAVE_DIRTY_INODE_WITH_FLAGS */ + +/* disk_*_io_acct() available */ +/* #undef HAVE_DISK_IO_ACCT */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* d_make_root() is available */ +/* #undef HAVE_D_MAKE_ROOT */ + +/* d_prune_aliases() is available */ +/* #undef HAVE_D_PRUNE_ALIASES */ + +/* dops->d_revalidate() operation takes nameidata */ +/* #undef HAVE_D_REVALIDATE_NAMEIDATA */ + +/* eops->encode_fh() wants child and parent inodes */ +/* #undef HAVE_ENCODE_FH_WITH_INODE */ + +/* sops->evict_inode() exists */ +/* #undef HAVE_EVICT_INODE */ + +/* fops->aio_fsync() exists */ +/* #undef HAVE_FILE_AIO_FSYNC */ + +/* file_dentry() is available */ +/* #undef HAVE_FILE_DENTRY */ + +/* file_inode() is available */ +/* #undef HAVE_FILE_INODE */ + +/* iops->follow_link() cookie */ +/* #undef HAVE_FOLLOW_LINK_COOKIE */ + +/* iops->follow_link() nameidata */ +/* #undef HAVE_FOLLOW_LINK_NAMEIDATA */ + +/* fops->fsync() with range */ +/* #undef HAVE_FSYNC_RANGE */ + +/* fops->fsync() without dentry */ +/* #undef HAVE_FSYNC_WITHOUT_DENTRY */ + +/* generic_fillattr requires struct user_namespace* */ +/* #undef HAVE_GENERIC_FILLATTR_USERNS */ + +/* generic_*_io_acct() 3 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_3ARG */ + +/* generic_*_io_acct() 4 arg available */ +/* #undef HAVE_GENERIC_IO_ACCT_4ARG */ + +/* generic_readlink is global */ +/* #undef HAVE_GENERIC_READLINK */ + +/* generic_setxattr() exists */ +/* #undef HAVE_GENERIC_SETXATTR */ + +/* generic_write_checks() takes kiocb */ +/* #undef HAVE_GENERIC_WRITE_CHECKS_KIOCB */ + +/* Define if the GNU gettext() function is already present or preinstalled. */ +/* #undef HAVE_GETTEXT */ + +/* iops->get_link() cookie */ +/* #undef HAVE_GET_LINK_COOKIE */ + +/* iops->get_link() delayed */ +/* #undef HAVE_GET_LINK_DELAYED */ + +/* group_info->gid exists */ +/* #undef HAVE_GROUP_INFO_GID */ + +/* has_capability() is available */ +/* #undef HAVE_HAS_CAPABILITY */ + +/* Define if you have the iconv() function and it works. */ +#define HAVE_ICONV 1 + +/* yes */ +/* #undef HAVE_INODE_LOCK_SHARED */ + +/* inode_owner_or_capable() exists */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE */ + +/* inode_owner_or_capable() takes user_ns */ +/* #undef HAVE_INODE_OWNER_OR_CAPABLE_IDMAPPED */ + +/* inode_set_flags() exists */ +/* #undef HAVE_INODE_SET_FLAGS */ + +/* inode_set_iversion() exists */ +/* #undef HAVE_INODE_SET_IVERSION */ + +/* inode->i_*time's are timespec64 */ +/* #undef HAVE_INODE_TIMESPEC64_TIMES */ + +/* timestamp_truncate() exists */ +/* #undef HAVE_INODE_TIMESTAMP_TRUNCATE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* in_compat_syscall() is available */ +/* #undef HAVE_IN_COMPAT_SYSCALL */ + +/* iops->create() takes struct user_namespace* */ +/* #undef HAVE_IOPS_CREATE_USERNS */ + +/* iops->mkdir() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKDIR_USERNS */ + +/* iops->mknod() takes struct user_namespace* */ +/* #undef HAVE_IOPS_MKNOD_USERNS */ + +/* iops->rename() takes struct user_namespace* */ +/* #undef HAVE_IOPS_RENAME_USERNS */ + +/* iops->symlink() takes struct user_namespace* */ +/* #undef HAVE_IOPS_SYMLINK_USERNS */ + +/* iov_iter_advance() is available */ +/* #undef HAVE_IOV_ITER_ADVANCE */ + +/* iov_iter_count() is available */ +/* #undef HAVE_IOV_ITER_COUNT */ + +/* iov_iter_fault_in_readable() is available */ +/* #undef HAVE_IOV_ITER_FAULT_IN_READABLE */ + +/* iov_iter_revert() is available */ +/* #undef HAVE_IOV_ITER_REVERT */ + +/* iov_iter types are available */ +/* #undef HAVE_IOV_ITER_TYPES */ + +/* yes */ +/* #undef HAVE_IO_SCHEDULE_TIMEOUT */ + +/* Define to 1 if you have the `issetugid' function. */ +#define HAVE_ISSETUGID 1 + +/* kernel has kernel_fpu_* functions */ +/* #undef HAVE_KERNEL_FPU */ + +/* kernel has asm/fpu/api.h */ +/* #undef HAVE_KERNEL_FPU_API_HEADER */ + +/* kernel fpu internal */ +/* #undef HAVE_KERNEL_FPU_INTERNAL */ + +/* uncached_acl_sentinel() exists */ +/* #undef HAVE_KERNEL_GET_ACL_HANDLE_CACHE */ + +/* kernel does stack verification */ +/* #undef HAVE_KERNEL_OBJTOOL */ + +/* kernel has linux/objtool.h */ +/* #undef HAVE_KERNEL_OBJTOOL_HEADER */ + +/* kernel_read() take loff_t pointer */ +/* #undef HAVE_KERNEL_READ_PPOS */ + +/* timer_list.function gets a timer_list */ +/* #undef HAVE_KERNEL_TIMER_FUNCTION_TIMER_LIST */ + +/* struct timer_list has a flags member */ +/* #undef HAVE_KERNEL_TIMER_LIST_FLAGS */ + +/* timer_setup() is available */ +/* #undef HAVE_KERNEL_TIMER_SETUP */ + +/* kernel_write() take loff_t pointer */ +/* #undef HAVE_KERNEL_WRITE_PPOS */ + +/* kmem_cache_create_usercopy() exists */ +/* #undef HAVE_KMEM_CACHE_CREATE_USERCOPY */ + +/* kstrtoul() exists */ +/* #undef HAVE_KSTRTOUL */ + +/* ktime_get_coarse_real_ts64() exists */ +/* #undef HAVE_KTIME_GET_COARSE_REAL_TS64 */ + +/* ktime_get_raw_ts64() exists */ +/* #undef HAVE_KTIME_GET_RAW_TS64 */ + +/* kvmalloc exists */ +/* #undef HAVE_KVMALLOC */ + +/* Define if you have [aio] */ +/* #undef HAVE_LIBAIO */ + +/* Define if you have [blkid] */ +/* #undef HAVE_LIBBLKID */ + +/* Define if you have [crypto] */ +#define HAVE_LIBCRYPTO 1 + +/* Define if you have [tirpc] */ +/* #undef HAVE_LIBTIRPC */ + +/* Define if you have [udev] */ +/* #undef HAVE_LIBUDEV */ + +/* Define if you have [uuid] */ +/* #undef HAVE_LIBUUID */ + +/* lseek_execute() is available */ +/* #undef HAVE_LSEEK_EXECUTE */ + +/* makedev() is declared in sys/mkdev.h */ +/* #undef HAVE_MAKEDEV_IN_MKDEV */ + +/* makedev() is declared in sys/sysmacros.h */ +/* #undef HAVE_MAKEDEV_IN_SYSMACROS */ + +/* Noting that make_request_fn() returns blk_qc_t */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_QC */ + +/* Noting that make_request_fn() returns void */ +/* #undef HAVE_MAKE_REQUEST_FN_RET_VOID */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* iops->mkdir() takes umode_t */ +/* #undef HAVE_MKDIR_UMODE_T */ + +/* Define to 1 if you have the `mlockall' function. */ +#define HAVE_MLOCKALL 1 + +/* lookup_bdev() wants mode arg */ +/* #undef HAVE_MODE_LOOKUP_BDEV */ + +/* Define if host toolchain supports MOVBE */ +#define HAVE_MOVBE 1 + +/* new_sync_read()/new_sync_write() are available */ +/* #undef HAVE_NEW_SYNC_READ */ + +/* iops->getattr() takes a path */ +/* #undef HAVE_PATH_IOPS_GETATTR */ + +/* Define if host toolchain supports PCLMULQDQ */ +#define HAVE_PCLMULQDQ 1 + +/* percpu_counter_add_batch() is defined */ +/* #undef HAVE_PERCPU_COUNTER_ADD_BATCH */ + +/* percpu_counter_init() wants gfp_t */ +/* #undef HAVE_PERCPU_COUNTER_INIT_WITH_GFP */ + +/* posix_acl_chmod() exists */ +/* #undef HAVE_POSIX_ACL_CHMOD */ + +/* posix_acl_from_xattr() needs user_ns */ +/* #undef HAVE_POSIX_ACL_FROM_XATTR_USERNS */ + +/* posix_acl_release() is available */ +/* #undef HAVE_POSIX_ACL_RELEASE */ + +/* posix_acl_release() is GPL-only */ +/* #undef HAVE_POSIX_ACL_RELEASE_GPL_ONLY */ + +/* posix_acl_valid() wants user namespace */ +/* #undef HAVE_POSIX_ACL_VALID_WITH_NS */ + +/* proc_ops structure exists */ +/* #undef HAVE_PROC_OPS_STRUCT */ + +/* iops->put_link() cookie */ +/* #undef HAVE_PUT_LINK_COOKIE */ + +/* iops->put_link() delayed */ +/* #undef HAVE_PUT_LINK_DELAYED */ + +/* iops->put_link() nameidata */ +/* #undef HAVE_PUT_LINK_NAMEIDATA */ + +/* If available, contains the Python version number currently in use. */ +#define HAVE_PYTHON "3.7" + +/* qat is enabled and existed */ +/* #undef HAVE_QAT */ + +/* iops->rename() wants flags */ +/* #undef HAVE_RENAME_WANTS_FLAGS */ + +/* REQ_DISCARD is defined */ +/* #undef HAVE_REQ_DISCARD */ + +/* REQ_FLUSH is defined */ +/* #undef HAVE_REQ_FLUSH */ + +/* REQ_OP_DISCARD is defined */ +/* #undef HAVE_REQ_OP_DISCARD */ + +/* REQ_OP_FLUSH is defined */ +/* #undef HAVE_REQ_OP_FLUSH */ + +/* REQ_OP_SECURE_ERASE is defined */ +/* #undef HAVE_REQ_OP_SECURE_ERASE */ + +/* REQ_PREFLUSH is defined */ +/* #undef HAVE_REQ_PREFLUSH */ + +/* revalidate_disk() is available */ +/* #undef HAVE_REVALIDATE_DISK */ + +/* revalidate_disk_size() is available */ +/* #undef HAVE_REVALIDATE_DISK_SIZE */ + +/* struct rw_semaphore has member activity */ +/* #undef HAVE_RWSEM_ACTIVITY */ + +/* struct rw_semaphore has atomic_long_t member count */ +/* #undef HAVE_RWSEM_ATOMIC_LONG_COUNT */ + +/* linux/sched/signal.h exists */ +/* #undef HAVE_SCHED_SIGNAL_HEADER */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SECURITY_PAM_MODULES_H 1 + +/* setattr_prepare() is available, doesn't accept user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_NO_USERNS */ + +/* setattr_prepare() accepts user_namespace */ +/* #undef HAVE_SETATTR_PREPARE_USERNS */ + +/* iops->set_acl() exists, takes 3 args */ +/* #undef HAVE_SET_ACL */ + +/* iops->set_acl() takes 4 args */ +/* #undef HAVE_SET_ACL_USERNS */ + +/* set_cached_acl() is usable */ +/* #undef HAVE_SET_CACHED_ACL_USABLE */ + +/* set_special_state() exists */ +/* #undef HAVE_SET_SPECIAL_STATE */ + +/* struct shrink_control exists */ +/* #undef HAVE_SHRINK_CONTROL_STRUCT */ + +/* kernel_siginfo_t exists */ +/* #undef HAVE_SIGINFO */ + +/* signal_stop() exists */ +/* #undef HAVE_SIGNAL_STOP */ + +/* new shrinker callback wants 2 args */ +/* #undef HAVE_SINGLE_SHRINKER_CALLBACK */ + +/* ->count_objects exists */ +/* #undef HAVE_SPLIT_SHRINKER_CALLBACK */ + +#if defined(__amd64__) || defined(__i386__) +/* Define if host toolchain supports SSE */ +#define HAVE_SSE 1 + +/* Define if host toolchain supports SSE2 */ +#define HAVE_SSE2 1 + +/* Define if host toolchain supports SSE3 */ +#define HAVE_SSE3 1 + +/* Define if host toolchain supports SSE4.1 */ +#define HAVE_SSE4_1 1 + +/* Define if host toolchain supports SSE4.2 */ +#define HAVE_SSE4_2 1 + +/* Define if host toolchain supports SSSE3 */ +#define HAVE_SSSE3 1 +#endif + +/* STACK_FRAME_NON_STANDARD is defined */ +/* #undef HAVE_STACK_FRAME_NON_STANDARD */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strlcat' function. */ +#define HAVE_STRLCAT 1 + +/* Define to 1 if you have the `strlcpy' function. */ +#define HAVE_STRLCPY 1 + +/* submit_bio is member of struct block_device_operations */ +/* #undef HAVE_SUBMIT_BIO_IN_BLOCK_DEVICE_OPERATIONS */ + +/* super_setup_bdi_name() exits */ +/* #undef HAVE_SUPER_SETUP_BDI_NAME */ + +/* super_block->s_user_ns exists */ +/* #undef HAVE_SUPER_USER_NS */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* i_op->tmpfile() exists */ +/* #undef HAVE_TMPFILE */ + +/* i_op->tmpfile() has userns */ +/* #undef HAVE_TMPFILE_USERNS */ + +/* totalhigh_pages() exists */ +/* #undef HAVE_TOTALHIGH_PAGES */ + +/* kernel has totalram_pages() */ +/* #undef HAVE_TOTALRAM_PAGES_FUNC */ + +/* Define to 1 if you have the `udev_device_get_is_initialized' function. */ +/* #undef HAVE_UDEV_DEVICE_GET_IS_INITIALIZED */ + +/* kernel has __kernel_fpu_* functions */ +/* #undef HAVE_UNDERSCORE_KERNEL_FPU */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* iops->getattr() takes struct user_namespace* */ +/* #undef HAVE_USERNS_IOPS_GETATTR */ + +/* iops->getattr() takes a vfsmount */ +/* #undef HAVE_VFSMOUNT_IOPS_GETATTR */ + +/* aops->direct_IO() uses iovec */ +/* #undef HAVE_VFS_DIRECT_IO_IOVEC */ + +/* aops->direct_IO() uses iov_iter without rw */ +/* #undef HAVE_VFS_DIRECT_IO_ITER */ + +/* aops->direct_IO() uses iov_iter with offset */ +/* #undef HAVE_VFS_DIRECT_IO_ITER_OFFSET */ + +/* aops->direct_IO() uses iov_iter with rw and offset */ +/* #undef HAVE_VFS_DIRECT_IO_ITER_RW_OFFSET */ + +/* All required iov_iter interfaces are available */ +/* #undef HAVE_VFS_IOV_ITER */ + +/* fops->iterate() is available */ +/* #undef HAVE_VFS_ITERATE */ + +/* fops->iterate_shared() is available */ +/* #undef HAVE_VFS_ITERATE_SHARED */ + +/* fops->readdir() is available */ +/* #undef HAVE_VFS_READDIR */ + +/* fops->read/write_iter() are available */ +/* #undef HAVE_VFS_RW_ITERATE */ + +/* __set_page_dirty_nobuffers exists */ +/* #undef HAVE_VFS_SET_PAGE_DIRTY_NOBUFFERS */ + +/* __vmalloc page flags exists */ +/* #undef HAVE_VMALLOC_PAGE_KERNEL */ + +/* yes */ +/* #undef HAVE_WAIT_ON_BIT_ACTION */ + +/* wait_queue_entry_t exists */ +/* #undef HAVE_WAIT_QUEUE_ENTRY_T */ + +/* wq_head->head and wq_entry->entry exist */ +/* #undef HAVE_WAIT_QUEUE_HEAD_ENTRY */ + +/* xattr_handler->get() wants dentry */ +/* #undef HAVE_XATTR_GET_DENTRY */ + +/* xattr_handler->get() wants both dentry and inode */ +/* #undef HAVE_XATTR_GET_DENTRY_INODE */ + +/* xattr_handler->get() wants xattr_handler */ +/* #undef HAVE_XATTR_GET_HANDLER */ + +/* xattr_handler has name */ +/* #undef HAVE_XATTR_HANDLER_NAME */ + +/* xattr_handler->list() wants dentry */ +/* #undef HAVE_XATTR_LIST_DENTRY */ + +/* xattr_handler->list() wants xattr_handler */ +/* #undef HAVE_XATTR_LIST_HANDLER */ + +/* xattr_handler->list() wants simple */ +/* #undef HAVE_XATTR_LIST_SIMPLE */ + +/* xattr_handler->set() wants dentry */ +/* #undef HAVE_XATTR_SET_DENTRY */ + +/* xattr_handler->set() wants both dentry and inode */ +/* #undef HAVE_XATTR_SET_DENTRY_INODE */ + +/* xattr_handler->set() wants xattr_handler */ +/* #undef HAVE_XATTR_SET_HANDLER */ + +/* xattr_handler->set() takes user_namespace */ +/* #undef HAVE_XATTR_SET_USERNS */ + +/* Define if you have [z] */ +#define HAVE_ZLIB 1 + +/* __posix_acl_chmod() exists */ +/* #undef HAVE___POSIX_ACL_CHMOD */ + +/* kernel exports FPU functions */ +/* #undef KERNEL_EXPORTS_X86_FPU */ + +/* TBD: fetch(3) support */ +#if 0 +/* whether the chosen libfetch is to be loaded at run-time */ +#define LIBFETCH_DYNAMIC 1 + +/* libfetch is fetch(3) */ +#define LIBFETCH_IS_FETCH 1 + +/* libfetch is libcurl */ +#define LIBFETCH_IS_LIBCURL 0 + +/* soname of chosen libfetch */ +#define LIBFETCH_SONAME "libfetch.so.6" +#endif + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* make_request_fn() return type */ +/* #undef MAKE_REQUEST_FN_RET */ + +/* hardened module_param_call */ +/* #undef MODULE_PARAM_CALL_CONST */ + +/* struct shrink_control has nid */ +/* #undef SHRINK_CONTROL_HAS_NID */ + +/* Defined for legacy compatibility. */ +#define SPL_META_ALIAS ZFS_META_ALIAS + +/* Defined for legacy compatibility. */ +#define SPL_META_RELEASE ZFS_META_RELEASE + +/* Defined for legacy compatibility. */ +#define SPL_META_VERSION ZFS_META_VERSION + +/* True if ZFS is to be compiled for a FreeBSD system */ +#define SYSTEM_FREEBSD 1 + +/* True if ZFS is to be compiled for a Linux system */ +/* #undef SYSTEM_LINUX */ + +/* zfs debugging enabled */ +/* #undef ZFS_DEBUG */ + +/* /dev/zfs minor */ +/* #undef ZFS_DEVICE_MINOR */ + +/* enum node_stat_item contains NR_FILE_PAGES */ +/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_FILE_PAGES */ + +/* enum node_stat_item contains NR_INACTIVE_ANON */ +/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_ANON */ + +/* enum node_stat_item contains NR_INACTIVE_FILE */ +/* #undef ZFS_ENUM_NODE_STAT_ITEM_NR_INACTIVE_FILE */ + +/* enum zone_stat_item contains NR_FILE_PAGES */ +/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_FILE_PAGES */ + +/* enum zone_stat_item contains NR_INACTIVE_ANON */ +/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_INACTIVE_ANON */ + +/* enum zone_stat_item contains NR_INACTIVE_FILE */ +/* #undef ZFS_ENUM_ZONE_STAT_ITEM_NR_INACTIVE_FILE */ + +/* global_node_page_state() exists */ +/* #undef ZFS_GLOBAL_NODE_PAGE_STATE */ + +/* global_zone_page_state() exists */ +/* #undef ZFS_GLOBAL_ZONE_PAGE_STATE */ + +/* Define to 1 if GPL-only symbols can be used */ +/* #undef ZFS_IS_GPL_COMPATIBLE */ + +/* Define the project alias string. */ - #define ZFS_META_ALIAS "zfs-2.1.99-FreeBSD_g3b89d9518" ++#define ZFS_META_ALIAS "zfs-2.1.99-FreeBSD_g4a1195ca5" + +/* Define the project author. */ +#define ZFS_META_AUTHOR "OpenZFS" + +/* Define the project release date. */ +/* #undef ZFS_META_DATA */ + *** 43 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Wed Sep 15 15:39:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D611F668B04; Wed, 15 Sep 2021 15:39:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8ktP5Tgkz4rdP; Wed, 15 Sep 2021 15:39:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DC991092A; Wed, 15 Sep 2021 15:39:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FFdv3C045934; Wed, 15 Sep 2021 15:39:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FFdvlU045933; Wed, 15 Sep 2021 15:39:57 GMT (envelope-from git) Date: Wed, 15 Sep 2021 15:39:57 GMT Message-Id: <202109151539.18FFdvlU045933@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 8fe536177ade - stable/13 - ipmi: New tunable to deactivate IPMI watchdog MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8fe536177ade732f4e44707134dc4a974fcb801c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 15:39:57 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=8fe536177ade732f4e44707134dc4a974fcb801c commit 8fe536177ade732f4e44707134dc4a974fcb801c Author: Wojciech Macek AuthorDate: 2021-08-17 06:28:21 +0000 Commit: Alexander Motin CommitDate: 2021-09-15 15:39:18 +0000 ipmi: New tunable to deactivate IPMI watchdog In case we want to use other WD than IPMI-provided, add sysctl to disable initialization. Obtained from: Semihalf Sponsored by: Stormshield Differential revision: https://reviews.freebsd.org/D31548 (cherry picked from commit e8ad0a0059afe1cd0af39bab49018ae7bc9be937) --- sys/dev/ipmi/ipmi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/ipmi/ipmi.c b/sys/dev/ipmi/ipmi.c index cd2a289b25cb..77fd4b68ae96 100644 --- a/sys/dev/ipmi/ipmi.c +++ b/sys/dev/ipmi/ipmi.c @@ -96,11 +96,14 @@ static int wd_shutdown_countdown = 0; /* sec */ static int wd_startup_countdown = 0; /* sec */ static int wd_pretimeout_countdown = 120; /* sec */ static int cycle_wait = 10; /* sec */ +static int wd_init_disable = 0; static SYSCTL_NODE(_hw, OID_AUTO, ipmi, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "IPMI driver parameters"); SYSCTL_INT(_hw_ipmi, OID_AUTO, on, CTLFLAG_RWTUN, &on, 0, ""); +SYSCTL_INT(_hw_ipmi, OID_AUTO, wd_init_disable, CTLFLAG_RWTUN, + &wd_init_disable, 0, ""); SYSCTL_INT(_hw_ipmi, OID_AUTO, wd_timer_actions, CTLFLAG_RW, &wd_timer_actions, 0, "IPMI watchdog timer actions (including pre-timeout interrupt)"); @@ -909,7 +912,7 @@ ipmi_startup(void *arg) * Probe for watchdog, but only for backends which support * polled driver requests. */ - if (sc->ipmi_driver_requests_polled) { + if (!wd_init_disable && sc->ipmi_driver_requests_polled) { IPMI_INIT_DRIVER_REQUEST(req, IPMI_ADDR(IPMI_APP_REQUEST, 0), IPMI_GET_WDOG, 0, 0); From owner-dev-commits-src-all@freebsd.org Wed Sep 15 15:39:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3224C66887C; Wed, 15 Sep 2021 15:39:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8ktR0Kjsz4rrr; Wed, 15 Sep 2021 15:39:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CD78A1072F; Wed, 15 Sep 2021 15:39:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FFdwxI045964; Wed, 15 Sep 2021 15:39:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FFdwK3045963; Wed, 15 Sep 2021 15:39:58 GMT (envelope-from git) Date: Wed, 15 Sep 2021 15:39:58 GMT Message-Id: <202109151539.18FFdwK3045963@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: aac5428f48ef - stable/13 - ipmi: fix negative logic in watchdog control flag MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: aac5428f48ef8267a77efeffa821d00da86ee705 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 15:39:59 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=aac5428f48ef8267a77efeffa821d00da86ee705 commit aac5428f48ef8267a77efeffa821d00da86ee705 Author: Wojciech Macek AuthorDate: 2021-08-18 06:21:14 +0000 Commit: Alexander Motin CommitDate: 2021-09-15 15:39:19 +0000 ipmi: fix negative logic in watchdog control flag Use wd_enable instead of wd_disable (cherry picked from commit e3500c602b13f8252eb8bb779849c41d47306cee) --- sys/dev/ipmi/ipmi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/ipmi/ipmi.c b/sys/dev/ipmi/ipmi.c index 77fd4b68ae96..77baf652b4bc 100644 --- a/sys/dev/ipmi/ipmi.c +++ b/sys/dev/ipmi/ipmi.c @@ -96,14 +96,14 @@ static int wd_shutdown_countdown = 0; /* sec */ static int wd_startup_countdown = 0; /* sec */ static int wd_pretimeout_countdown = 120; /* sec */ static int cycle_wait = 10; /* sec */ -static int wd_init_disable = 0; +static int wd_init_enable = 1; static SYSCTL_NODE(_hw, OID_AUTO, ipmi, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, "IPMI driver parameters"); SYSCTL_INT(_hw_ipmi, OID_AUTO, on, CTLFLAG_RWTUN, &on, 0, ""); -SYSCTL_INT(_hw_ipmi, OID_AUTO, wd_init_disable, CTLFLAG_RWTUN, - &wd_init_disable, 0, ""); +SYSCTL_INT(_hw_ipmi, OID_AUTO, wd_init_enable, CTLFLAG_RWTUN, + &wd_init_enable, 1, "Enable watchdog initialization"); SYSCTL_INT(_hw_ipmi, OID_AUTO, wd_timer_actions, CTLFLAG_RW, &wd_timer_actions, 0, "IPMI watchdog timer actions (including pre-timeout interrupt)"); @@ -912,7 +912,7 @@ ipmi_startup(void *arg) * Probe for watchdog, but only for backends which support * polled driver requests. */ - if (!wd_init_disable && sc->ipmi_driver_requests_polled) { + if (wd_init_enable && sc->ipmi_driver_requests_polled) { IPMI_INIT_DRIVER_REQUEST(req, IPMI_ADDR(IPMI_APP_REQUEST, 0), IPMI_GET_WDOG, 0, 0); From owner-dev-commits-src-all@freebsd.org Wed Sep 15 15:47:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1AD6668CC7; Wed, 15 Sep 2021 15:47:25 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8l31417gz4vGh; Wed, 15 Sep 2021 15:47:25 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi1-f179.google.com with SMTP id v2so4729308oie.6; Wed, 15 Sep 2021 08:47:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=eqSjJu5+J4GLd99U8MMNOTU4Qc/OtiFED+ir0R27a8o=; b=XEs5dg15VI6d19an30FbD+V2MUgr6xou5q90qSR6WYDLvqL9X0ewkdmbp68vecBH0P 126Ct63f09jF6oPMuYIYb/A5KRDf3vxx3ImUVDXvvYdVYHogZW60DvyZ0WPL4m1gqDZQ mbpXuMqYY1kpIxom4puw0Y+zgWySBJMv+sJ2WhsO6tbd112+Tml6RggSFoEh03TunQgG 3maIKI8LjXd+OI0aMEe3AsCrSe/TCJwy+E7FFcGEXrPFEs8sHv5Si+0CQy2HEBMEmYIg sMWdpn5b3SwG0QjWayHskc6A8MqMefq7wn3ZwnHB1mbYqULYmUEt6QSXvxcsZ53QVczL kpog== X-Gm-Message-State: AOAM5300AsyeRh+fNy8rN1Yx62sn/lJ9xeNrTWjhFmMANWw8A/RpwVjJ 6B/UDxhneLhl+lAx3zW0+r9NIu+mwklX6HzXs5bv+wGW X-Google-Smtp-Source: ABdhPJyVp8yiznXozERg69PZizR+01cYaw/7rQYozlH+c3sy8nLhL+2NR84uE7VBxeWxTm7jgAnAjMoWSZM9TyR3zOo= X-Received: by 2002:a54:4e94:: with SMTP id c20mr225040oiy.57.1631720839235; Wed, 15 Sep 2021 08:47:19 -0700 (PDT) MIME-Version: 1.0 References: <202109142046.18EKkfEN043871@gitrepo.freebsd.org> In-Reply-To: From: Alan Somers Date: Wed, 15 Sep 2021 09:47:08 -0600 Message-ID: Subject: Re: git: 1ecbc1d8e9d3 - main - cxgbe tom: Don't queue AIO requests on listen sockets. To: John Baldwin Cc: src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4H8l31417gz4vGh X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 15:47:25 -0000 On Wed, Sep 15, 2021 at 9:21 AM John Baldwin wrote: > On 9/14/21 1:53 PM, Alan Somers wrote: > > On Tue, Sep 14, 2021 at 2:46 PM John Baldwin wrote: > > > >> The branch main has been updated by jhb: > >> > >> URL: > >> > https://cgit.FreeBSD.org/src/commit/?id=1ecbc1d8e9d3fbcd8e68fc68f0a32944a12ddb1e > >> > >> commit 1ecbc1d8e9d3fbcd8e68fc68f0a32944a12ddb1e > >> Author: John Baldwin > >> AuthorDate: 2021-09-14 20:46:14 +0000 > >> Commit: John Baldwin > >> CommitDate: 2021-09-14 20:46:14 +0000 > >> > >> cxgbe tom: Don't queue AIO requests on listen sockets. > >> > >> This is similar to the fixes in 141fe2dceeae. One difference is > that > >> TOE sockets do not change states (listen vs non-listen) once > created, > >> so no lock is needed for SOLISTENING(). > >> > >> Sponsored by: Chelsio Communications > >> > > > > I've always wondered: what's the point to using AIO with sockets? Can't > > everything socket-related be done better with non-blocking read/write and > > kqueue? > > Zero-copy operation with TOE is why TOE uses AIO. Zero-copy of user > buffers > can't really work with the non-AIO APIs because the user buffer is free to > be reused immediately after write(2) (and on the read side you don't know > the buffer in advance to allow the NIC to write directly into the use > buffer). > > In theory we could support zero-copy using mb_ext_pgs for aio_write() for > the non-TOE case similar to what sendfile() does. > > -- > John Baldwin > Interesting. Do you know of any common applications that include this optimization? I've been working on the AIO ecosystem for Rust. It would be good to ensure that this use case works, especially if zero-copy ever works for non-TOE. From owner-dev-commits-src-all@freebsd.org Wed Sep 15 16:05:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CBD80668BB8; Wed, 15 Sep 2021 16:05:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8lRh5QQQz3G89; Wed, 15 Sep 2021 16:05:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F4EB11299; Wed, 15 Sep 2021 16:05:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FG5KTk086243; Wed, 15 Sep 2021 16:05:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FG5KDn086242; Wed, 15 Sep 2021 16:05:20 GMT (envelope-from git) Date: Wed, 15 Sep 2021 16:05:20 GMT Message-Id: <202109151605.18FG5KDn086242@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 828f257277bd - main - Remove nonexistent include path for arm64 crypto files. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 828f257277bd7418bbc0431bbd78569a2f609af1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 16:05:20 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=828f257277bd7418bbc0431bbd78569a2f609af1 commit 828f257277bd7418bbc0431bbd78569a2f609af1 Author: John Baldwin AuthorDate: 2021-09-15 16:03:17 +0000 Commit: John Baldwin CommitDate: 2021-09-15 16:03:17 +0000 Remove nonexistent include path for arm64 crypto files. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D31932 --- sys/conf/files.arm64 | 4 ++-- sys/modules/armv8crypto/Makefile | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64 index bae23b17cc40..36dea68306f3 100644 --- a/sys/conf/files.arm64 +++ b/sys/conf/files.arm64 @@ -113,12 +113,12 @@ armv8_crypto_wrap.o optional armv8crypto \ clean "armv8_crypto_wrap.o" aesv8-armx.o optional armv8crypto \ dependency "$S/crypto/openssl/aarch64/aesv8-armx.S" \ - compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc:N-mgeneral-regs-only} -I$S/crypto/armv8/ -I$S/crypto/openssl/crypto ${WERROR} ${NO_WCAST_QUAL} -march=armv8-a+crypto ${.IMPSRC}" \ + compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc:N-mgeneral-regs-only} -I$S/crypto/armv8/ ${WERROR} ${NO_WCAST_QUAL} -march=armv8-a+crypto ${.IMPSRC}" \ no-implicit-rule \ clean "aesv8-armx.o" ghashv8-armx.o optional armv8crypto \ dependency "$S/crypto/openssl/aarch64/ghashv8-armx.S" \ - compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc:N-mgeneral-regs-only} -I$S/crypto/armv8/ -I$S/crypto/openssl/crypto ${WERROR} ${NO_WCAST_QUAL} -march=armv8-a+crypto ${.IMPSRC}" \ + compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc:N-mgeneral-regs-only} -I$S/crypto/armv8/ ${WERROR} ${NO_WCAST_QUAL} -march=armv8-a+crypto ${.IMPSRC}" \ no-implicit-rule \ clean "ghashv8-armx.o" diff --git a/sys/modules/armv8crypto/Makefile b/sys/modules/armv8crypto/Makefile index bd38fe039fc9..b252a72609be 100644 --- a/sys/modules/armv8crypto/Makefile +++ b/sys/modules/armv8crypto/Makefile @@ -20,7 +20,6 @@ armv8_crypto_wrap.o: armv8_crypto_wrap.c aesv8-armx.o: aesv8-armx.S ${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc:N-mgeneral-regs-only} \ -I${SRCTOP}/sys/crypto/armv8 \ - -I${SRCTOP}/sys/crypto/openssl/crypto \ ${WERROR} ${PROF} \ -march=armv8-a+crypto ${.IMPSRC} ${CTFCONVERT_CMD} @@ -28,7 +27,6 @@ aesv8-armx.o: aesv8-armx.S ghashv8-armx.o: ghashv8-armx.S ${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc:N-mgeneral-regs-only} \ -I${SRCTOP}/sys/crypto/armv8 \ - -I${SRCTOP}/sys/crypto/openssl/crypto \ ${WERROR} ${PROF} \ -march=armv8-a+crypto ${.IMPSRC} ${CTFCONVERT_CMD} From owner-dev-commits-src-all@freebsd.org Wed Sep 15 16:05:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 28FD7668FA8; Wed, 15 Sep 2021 16:05:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8lRj6JyVz3GNh; Wed, 15 Sep 2021 16:05:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9E8C10DC2; Wed, 15 Sep 2021 16:05:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FG5L1L086267; Wed, 15 Sep 2021 16:05:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FG5LuJ086266; Wed, 15 Sep 2021 16:05:21 GMT (envelope-from git) Date: Wed, 15 Sep 2021 16:05:21 GMT Message-Id: <202109151605.18FG5LuJ086266@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: d2bc7754a226 - main - Assert that invalid bus widths can't be passed to bus_width_str(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d2bc7754a226c031b76184277e32c4d65a763f67 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 16:05:22 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d2bc7754a226c031b76184277e32c4d65a763f67 commit d2bc7754a226c031b76184277e32c4d65a763f67 Author: John Baldwin AuthorDate: 2021-09-15 16:03:17 +0000 Commit: John Baldwin CommitDate: 2021-09-15 16:03:17 +0000 Assert that invalid bus widths can't be passed to bus_width_str(). This appeases a -Wreturn-type warning from GCC. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D31935 --- sys/cam/mmc/mmc_da.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/cam/mmc/mmc_da.c b/sys/cam/mmc/mmc_da.c index e41792dcebc1..4212e2aa805d 100644 --- a/sys/cam/mmc/mmc_da.c +++ b/sys/cam/mmc/mmc_da.c @@ -1178,6 +1178,8 @@ static inline const char return ("4-bit"); case bus_width_8: return ("8-bit"); + default: + __assert_unreachable(); } } From owner-dev-commits-src-all@freebsd.org Wed Sep 15 16:05:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3B322668BB9; Wed, 15 Sep 2021 16:05:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8lRl0CKzz3GF0; Wed, 15 Sep 2021 16:05:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DBE8811118; Wed, 15 Sep 2021 16:05:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FG5Mpo086291; Wed, 15 Sep 2021 16:05:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FG5Mue086290; Wed, 15 Sep 2021 16:05:22 GMT (envelope-from git) Date: Wed, 15 Sep 2021 16:05:22 GMT Message-Id: <202109151605.18FG5Mue086290@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 45cb7671133e - main - Only define sanitizer wrappers for atomic fences once. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 45cb7671133efa52b63f301e8439a71259abe478 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 16:05:23 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=45cb7671133efa52b63f301e8439a71259abe478 commit 45cb7671133efa52b63f301e8439a71259abe478 Author: John Baldwin AuthorDate: 2021-09-15 16:03:17 +0000 Commit: John Baldwin CommitDate: 2021-09-15 16:03:17 +0000 Only define sanitizer wrappers for atomic fences once. Previously, this was defining duplicate definitions for each type. This fixes a redundat definition warning from GCC. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D31965 --- sys/sys/atomic_san.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/sys/atomic_san.h b/sys/sys/atomic_san.h index 30bd01c97cf2..b0790962d8bd 100644 --- a/sys/sys/atomic_san.h +++ b/sys/sys/atomic_san.h @@ -76,13 +76,16 @@ int sp##_atomic_##op##_##name(volatile type *, u_int); \ int sp##_atomic_##op##_acq_##name(volatile type *, u_int) -#define ATOMIC_SAN_THREAD_FENCE(sp) \ +#define _ATOMIC_SAN_THREAD_FENCE(sp) \ void sp##_atomic_thread_fence_acq(void); \ void sp##_atomic_thread_fence_rel(void); \ void sp##_atomic_thread_fence_acq_rel(void); \ void sp##_atomic_thread_fence_seq_cst(void); \ void sp##_atomic_interrupt_fence(void) +#define ATOMIC_SAN_THREAD_FENCE(sp) \ + _ATOMIC_SAN_THREAD_FENCE(sp) + #define _ATOMIC_SAN_FUNCS(sp, name, type) \ ATOMIC_SAN_FUNC_1(sp, add, name, type); \ ATOMIC_SAN_FUNC_1(sp, clear, name, type); \ @@ -96,8 +99,7 @@ ATOMIC_SAN_STORE(sp, name, type); \ ATOMIC_SAN_READ(sp, swap, name, type); \ ATOMIC_SAN_TEST(sp, testandclear, name, type); \ - ATOMIC_SAN_TEST(sp, testandset, name, type); \ - ATOMIC_SAN_THREAD_FENCE(sp); + ATOMIC_SAN_TEST(sp, testandset, name, type) #define ATOMIC_SAN_FUNCS(name, type) \ _ATOMIC_SAN_FUNCS(SAN_INTERCEPTOR_PREFIX, name, type) @@ -111,6 +113,7 @@ ATOMIC_SAN_FUNCS(8, uint8_t); ATOMIC_SAN_FUNCS(16, uint16_t); ATOMIC_SAN_FUNCS(32, uint32_t); ATOMIC_SAN_FUNCS(64, uint64_t); +ATOMIC_SAN_THREAD_FENCE(SAN_INTERCEPTOR_PREFIX); #ifndef SAN_RUNTIME From owner-dev-commits-src-all@freebsd.org Wed Sep 15 16:05:24 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5BAF86693AA; Wed, 15 Sep 2021 16:05:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8lRm1HZ1z3GNt; Wed, 15 Sep 2021 16:05:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0B43D10DC3; Wed, 15 Sep 2021 16:05:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FG5Npf086321; Wed, 15 Sep 2021 16:05:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FG5NsZ086320; Wed, 15 Sep 2021 16:05:23 GMT (envelope-from git) Date: Wed, 15 Sep 2021 16:05:23 GMT Message-Id: <202109151605.18FG5NsZ086320@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 11647befcbb8 - main - Only define sanitizer wrappers for unsized bus space operations once. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 11647befcbb81f2fc89c29020b4be80a251ec321 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 16:05:24 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=11647befcbb81f2fc89c29020b4be80a251ec321 commit 11647befcbb81f2fc89c29020b4be80a251ec321 Author: John Baldwin AuthorDate: 2021-09-15 16:03:17 +0000 Commit: John Baldwin CommitDate: 2021-09-15 16:03:17 +0000 Only define sanitizer wrappers for unsized bus space operations once. Previously, this was defining duplicate definitions for each size. This fixes a redundant definition warning from GCC. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D31966 --- sys/sys/bus_san.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/sys/bus_san.h b/sys/sys/bus_san.h index fd3c4c803675..09feb0660525 100644 --- a/sys/sys/bus_san.h +++ b/sys/sys/bus_san.h @@ -93,7 +93,7 @@ int sp##_bus_space_poke_##width(bus_space_tag_t, \ bus_space_handle_t, bus_size_t, type); -#define BUS_SAN_MISC(sp) \ +#define _BUS_SAN_MISC(sp) \ int sp##_bus_space_map(bus_space_tag_t, bus_addr_t, bus_size_t, \ int, bus_space_handle_t *); \ void sp##_bus_space_unmap(bus_space_tag_t, bus_space_handle_t, \ @@ -108,14 +108,16 @@ void sp##_bus_space_barrier(bus_space_tag_t, bus_space_handle_t,\ bus_size_t, bus_size_t, int); +#define BUS_SAN_MISC(sp) \ + _BUS_SAN_MISC(sp) + #define _BUS_SAN_FUNCS(sp, width, type) \ BUS_SAN_READ(sp, width, type); \ BUS_SAN_WRITE(sp, width, type); \ BUS_SAN_SET(sp, width, type); \ BUS_SAN_COPY(sp, width, type) \ BUS_SAN_PEEK(sp, width, type); \ - BUS_SAN_POKE(sp, width, type); \ - BUS_SAN_MISC(sp); + BUS_SAN_POKE(sp, width, type) #define BUS_SAN_FUNCS(width, type) \ _BUS_SAN_FUNCS(SAN_INTERCEPTOR_PREFIX, width, type) @@ -124,6 +126,7 @@ BUS_SAN_FUNCS(1, uint8_t); BUS_SAN_FUNCS(2, uint16_t); BUS_SAN_FUNCS(4, uint32_t); BUS_SAN_FUNCS(8, uint64_t); +BUS_SAN_MISC(SAN_INTERCEPTOR_PREFIX); #ifndef SAN_RUNTIME From owner-dev-commits-src-all@freebsd.org Wed Sep 15 16:05:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4257669483; Wed, 15 Sep 2021 16:05:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8lRn2wjQz3G8Y; Wed, 15 Sep 2021 16:05:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2953C10DC4; Wed, 15 Sep 2021 16:05:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FG5PUf086348; Wed, 15 Sep 2021 16:05:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FG5PIS086347; Wed, 15 Sep 2021 16:05:25 GMT (envelope-from git) Date: Wed, 15 Sep 2021 16:05:25 GMT Message-Id: <202109151605.18FG5PIS086347@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 5ac4ac85ca20 - main - Remove an always-true check. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5ac4ac85ca20ce1f00c84502a65a3291bf416c18 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 16:05:25 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5ac4ac85ca20ce1f00c84502a65a3291bf416c18 commit 5ac4ac85ca20ce1f00c84502a65a3291bf416c18 Author: John Baldwin AuthorDate: 2021-09-15 16:03:17 +0000 Commit: John Baldwin CommitDate: 2021-09-15 16:03:17 +0000 Remove an always-true check. This fixes a -Wtype-limits error from GCC 9. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D31936 --- lib/libvmmapi/vmmapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libvmmapi/vmmapi.c b/lib/libvmmapi/vmmapi.c index 0543c92f4300..a2d26b1b33b9 100644 --- a/lib/libvmmapi/vmmapi.c +++ b/lib/libvmmapi/vmmapi.c @@ -486,7 +486,7 @@ vm_rev_map_gpa(struct vmctx *ctx, void *addr) offaddr = (char *)addr - ctx->baseaddr; if (ctx->lowmem > 0) - if (offaddr >= 0 && offaddr <= ctx->lowmem) + if (offaddr <= ctx->lowmem) return (offaddr); if (ctx->highmem > 0) From owner-dev-commits-src-all@freebsd.org Wed Sep 15 16:05:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA6CA66904F; Wed, 15 Sep 2021 16:05:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8lRq4TrJz3GHJ; Wed, 15 Sep 2021 16:05:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7376E11193; Wed, 15 Sep 2021 16:05:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FG5RpA086396; Wed, 15 Sep 2021 16:05:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FG5RTK086395; Wed, 15 Sep 2021 16:05:27 GMT (envelope-from git) Date: Wed, 15 Sep 2021 16:05:27 GMT Message-Id: <202109151605.18FG5RTK086395@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: b14cd3a8339e - main - efitable: Don't pass NULL as a format string to xo_err(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b14cd3a8339ea72cf39df4ccc53c830875c5d866 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 16:05:28 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=b14cd3a8339ea72cf39df4ccc53c830875c5d866 commit b14cd3a8339ea72cf39df4ccc53c830875c5d866 Author: John Baldwin AuthorDate: 2021-09-15 16:03:17 +0000 Commit: John Baldwin CommitDate: 2021-09-15 16:03:17 +0000 efitable: Don't pass NULL as a format string to xo_err(). This fixes a -Wformat error reported by GCC 9. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D31939 --- usr.sbin/efitable/efitable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/efitable/efitable.c b/usr.sbin/efitable/efitable.c index 367ce3f033b1..6bd4d96ffd2a 100644 --- a/usr.sbin/efitable/efitable.c +++ b/usr.sbin/efitable/efitable.c @@ -146,13 +146,13 @@ main(int argc, char **argv) table.uuid = efi_table_ops[efi_idx].uuid; if (ioctl(efi_fd, EFIIOC_GET_TABLE, &table) == -1) - xo_err(EX_OSERR, NULL); + xo_err(EX_OSERR, "EFIIOC_GET_TABLE (len == 0)"); table.buf = malloc(table.table_len); table.buf_len = table.table_len; if (ioctl(efi_fd, EFIIOC_GET_TABLE, &table) == -1) - xo_err(EX_OSERR, NULL); + xo_err(EX_OSERR, "EFIIOC_GET_TABLE"); efi_table_ops[efi_idx].parse(table.buf); close(efi_fd); From owner-dev-commits-src-all@freebsd.org Wed Sep 15 16:05:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD94F66904E; Wed, 15 Sep 2021 16:05:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8lRp3Z6Fz3GQW; Wed, 15 Sep 2021 16:05:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 503E010DC5; Wed, 15 Sep 2021 16:05:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FG5QXo086372; Wed, 15 Sep 2021 16:05:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FG5Q5l086371; Wed, 15 Sep 2021 16:05:26 GMT (envelope-from git) Date: Wed, 15 Sep 2021 16:05:26 GMT Message-Id: <202109151605.18FG5Q5l086371@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 4c9cb057bd96 - main - top: Remove a duplicate extern declaration for show_args. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4c9cb057bd96bd10278f5ce7a735fff4c08e3c30 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 16:05:26 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=4c9cb057bd96bd10278f5ce7a735fff4c08e3c30 commit 4c9cb057bd96bd10278f5ce7a735fff4c08e3c30 Author: John Baldwin AuthorDate: 2021-09-15 16:03:17 +0000 Commit: John Baldwin CommitDate: 2021-09-15 16:03:17 +0000 top: Remove a duplicate extern declaration for show_args. This fixes a -Wnested-extern error with GCC 9. There is an existing extern declaration in top.h. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D31937 --- usr.bin/top/machine.c | 1 - 1 file changed, 1 deletion(-) diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index 1fe2a91a655c..315c8be1a4c2 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -895,7 +895,6 @@ get_process_info(struct system_info *si, struct process_select *sel, static int cmd_matches(struct kinfo_proc *proc, const char *term) { - extern int show_args; char **args = NULL; if (!term) { From owner-dev-commits-src-all@freebsd.org Wed Sep 15 16:05:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D3678668FBD; Wed, 15 Sep 2021 16:05:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8lRr51D8z3G5f; Wed, 15 Sep 2021 16:05:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B11B1131C; Wed, 15 Sep 2021 16:05:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FG5SlC086429; Wed, 15 Sep 2021 16:05:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FG5SHQ086428; Wed, 15 Sep 2021 16:05:28 GMT (envelope-from git) Date: Wed, 15 Sep 2021 16:05:28 GMT Message-Id: <202109151605.18FG5SHQ086428@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 9553c6af881e - main - : Don't use __has_builtin(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9553c6af881e1f869cecb11b4476279e0ed6c4e0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 16:05:28 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9553c6af881e1f869cecb11b4476279e0ed6c4e0 commit 9553c6af881e1f869cecb11b4476279e0ed6c4e0 Author: John Baldwin AuthorDate: 2021-09-15 16:03:17 +0000 Commit: John Baldwin CommitDate: 2021-09-15 16:03:17 +0000 : Don't use __has_builtin(). GCC only added support for __has_builtin in GCC 10. However, all supported versions of GCC and clang include these builtins so just use them unconditionally. This fixes the build with GCC 9. Reviewed by: manu, hselasky, imp Differential Revision: https://reviews.freebsd.org/D31942 --- sys/compat/linuxkpi/common/include/linux/overflow.h | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/sys/compat/linuxkpi/common/include/linux/overflow.h b/sys/compat/linuxkpi/common/include/linux/overflow.h index 6f53f0b59384..2d540796cd43 100644 --- a/sys/compat/linuxkpi/common/include/linux/overflow.h +++ b/sys/compat/linuxkpi/common/include/linux/overflow.h @@ -34,18 +34,9 @@ #include #include -#ifndef __has_builtin -#define __has_builtin(x) 0 -#endif - -#if __has_builtin(__builtin_add_overflow) #define check_add_overflow(a, b, c) \ __builtin_add_overflow(a, b, c) -#else -#error "Compiler does not support __builtin_add_overflow" -#endif -#if __has_builtin(__builtin_mul_overflow) #define check_mul_overflow(a, b, c) \ __builtin_mul_overflow(a, b, c) @@ -58,8 +49,5 @@ array_size(size_t x, size_t y) retval = SIZE_MAX; return (retval); } -#else -#error "Compiler does not support __builtin_mul_overflow" -#endif #endif /* __LINUX_OVERFLOW_H__ */ From owner-dev-commits-src-all@freebsd.org Wed Sep 15 16:05:30 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 40A62668FBF; Wed, 15 Sep 2021 16:05:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8lRs6KYlz3GQc; Wed, 15 Sep 2021 16:05:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADC6610DC6; Wed, 15 Sep 2021 16:05:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FG5TSd086453; Wed, 15 Sep 2021 16:05:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FG5Tn7086452; Wed, 15 Sep 2021 16:05:29 GMT (envelope-from git) Date: Wed, 15 Sep 2021 16:05:29 GMT Message-Id: <202109151605.18FG5Tn7086452@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 44126818d2ec - main - infiniband: Disable -Wredundant-decl warnings. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 44126818d2ec96d8247eafcae9b96905a473a264 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 16:05:30 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=44126818d2ec96d8247eafcae9b96905a473a264 commit 44126818d2ec96d8247eafcae9b96905a473a264 Author: John Baldwin AuthorDate: 2021-09-15 16:03:18 +0000 Commit: John Baldwin CommitDate: 2021-09-15 16:03:18 +0000 infiniband: Disable -Wredundant-decl warnings. ib_uverbs_flow_resources_free() is declard in two header files in upstream OFED. Disable the warning to avoid introducing diffs to fix the build on GCC 9. While here, fix the ibcore module to disable the same warnings disabled in OFED_CFLAGS. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D31943 --- sys/conf/kern.pre.mk | 2 +- sys/modules/ibcore/Makefile | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk index d9621273c57b..9d9e32027ec7 100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@ -297,7 +297,7 @@ LINUXKPI_C= ${NORMAL_C} ${LINUXKPI_INCLUDES} # Infiniband C flags. Correct include paths and omit errors that linux # does not honor. OFEDINCLUDES= -I$S/ofed/include -I$S/ofed/include/uapi ${LINUXKPI_INCLUDES} -OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith +OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith -Wno-redundant-decls OFEDCFLAGS= ${CFLAGS:N-I*} -DCONFIG_INFINIBAND_USER_MEM \ ${OFEDINCLUDES} ${CFLAGS:M-I*} ${OFEDNOERR} OFED_C_NOIMP= ${CC} -c -o ${.TARGET} ${OFEDCFLAGS} ${WERROR} diff --git a/sys/modules/ibcore/Makefile b/sys/modules/ibcore/Makefile index 00d7ed976416..951f0abab453 100644 --- a/sys/modules/ibcore/Makefile +++ b/sys/modules/ibcore/Makefile @@ -53,3 +53,5 @@ CFLAGS+= -I${SRCTOP}/sys/compat/linuxkpi/common/include CFLAGS+= -DINET6 -DINET -DCONFIG_INFINIBAND_USER_MEM .include + +CWARNFLAGS+= -Wno-cast-qual -Wno-pointer-arith -Wno-redundant-decls From owner-dev-commits-src-all@freebsd.org Wed Sep 15 16:05:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCB2566951B; Wed, 15 Sep 2021 16:05:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8lRx520hz3GSB; Wed, 15 Sep 2021 16:05:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29AE61131D; Wed, 15 Sep 2021 16:05:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FG5Xmw086531; Wed, 15 Sep 2021 16:05:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FG5XNb086530; Wed, 15 Sep 2021 16:05:33 GMT (envelope-from git) Date: Wed, 15 Sep 2021 16:05:33 GMT Message-Id: <202109151605.18FG5XNb086530@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: d99c87c8d54a - main - evdev: Add parentheses around '-' expression in operand of '&'. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d99c87c8d54a02a229cbeaa19ec8784b1d5afbb9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 16:05:33 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d99c87c8d54a02a229cbeaa19ec8784b1d5afbb9 commit d99c87c8d54a02a229cbeaa19ec8784b1d5afbb9 Author: John Baldwin AuthorDate: 2021-09-15 16:03:18 +0000 Commit: John Baldwin CommitDate: 2021-09-15 16:03:18 +0000 evdev: Add parentheses around '-' expression in operand of '&'. This fixes a -Wparentheses error with GCC 9. Reviewed by: wulf Differential Revision: https://reviews.freebsd.org/D31947 --- sys/dev/evdev/evdev_mt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/evdev/evdev_mt.c b/sys/dev/evdev/evdev_mt.c index a3cb76cbbdb4..1b4ec1233ef2 100644 --- a/sys/dev/evdev/evdev_mt.c +++ b/sys/dev/evdev/evdev_mt.c @@ -101,7 +101,7 @@ static void evdev_mt_replay_events(struct evdev_dev *); static inline int ffc_slot(struct evdev_dev *evdev, slotset_t slots) { - return (ffs(~slots & (2U << MAXIMAL_MT_SLOT(evdev)) - 1) - 1); + return (ffs(~slots & ((2U << MAXIMAL_MT_SLOT(evdev)) - 1)) - 1); } void From owner-dev-commits-src-all@freebsd.org Wed Sep 15 16:05:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3E9A3668FC1; Wed, 15 Sep 2021 16:05:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8lRw11gPz3GQk; Wed, 15 Sep 2021 16:05:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03D9310DC7; Wed, 15 Sep 2021 16:05:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FG5VIx086507; Wed, 15 Sep 2021 16:05:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FG5Vu3086506; Wed, 15 Sep 2021 16:05:31 GMT (envelope-from git) Date: Wed, 15 Sep 2021 16:05:31 GMT Message-Id: <202109151605.18FG5Vu3086506@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: cd16a848d1b3 - main - posixshmtest: Fix various warnings raised by GCC. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cd16a848d1b34016b1a1c663223729a92c247be3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 16:05:32 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=cd16a848d1b34016b1a1c663223729a92c247be3 commit cd16a848d1b34016b1a1c663223729a92c247be3 Author: John Baldwin AuthorDate: 2021-09-15 16:03:18 +0000 Commit: John Baldwin CommitDate: 2021-09-15 16:03:18 +0000 posixshmtest: Fix various warnings raised by GCC. - Remove unused format string arguments. - Remove a set but unused variable. Reviewed by: khng, kib Differential Revision: https://reviews.freebsd.org/D31946 --- tests/sys/posixshm/posixshm_test.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tests/sys/posixshm/posixshm_test.c b/tests/sys/posixshm/posixshm_test.c index eddb1d2d8250..b460639ba647 100644 --- a/tests/sys/posixshm/posixshm_test.c +++ b/tests/sys/posixshm/posixshm_test.c @@ -1105,7 +1105,7 @@ ATF_TC_BODY(fspacectl, tc) ATF_CHECK_MSG(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0, "Aligned fspacectl failed; errno=%d", errno); ATF_CHECK_MSG(check_content_dealloc(fd, offset, length, shm_sz) == 0, - "Aligned fspacectl content checking failed", errno); + "Aligned fspacectl content checking failed"); /* Unaligned fspacectl(fd, SPACECTL_DEALLOC, ...) */ ATF_REQUIRE(shm_fill(fd, 0, shm_sz) == 0); @@ -1115,7 +1115,7 @@ ATF_TC_BODY(fspacectl, tc) ATF_CHECK_MSG(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0, "Unaligned fspacectl failed; errno=%d", errno); ATF_CHECK_MSG(check_content_dealloc(fd, offset, length, shm_sz) == 0, - "Unaligned fspacectl content checking failed", errno); + "Unaligned fspacectl content checking failed"); /* Aligned fspacectl(fd, SPACECTL_DEALLOC, ...) to OFF_MAX */ ATF_REQUIRE(shm_fill(fd, 0, shm_sz) == 0); @@ -1124,7 +1124,7 @@ ATF_TC_BODY(fspacectl, tc) ATF_CHECK_MSG(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0, "Aligned fspacectl to OFF_MAX failed; errno=%d", errno); ATF_CHECK_MSG(check_content_dealloc(fd, offset, length, shm_sz) == 0, - "Aligned fspacectl to OFF_MAX content checking failed", errno); + "Aligned fspacectl to OFF_MAX content checking failed"); /* Unaligned fspacectl(fd, SPACECTL_DEALLOC, ...) to OFF_MAX */ ATF_REQUIRE(shm_fill(fd, 0, shm_sz) == 0); @@ -1133,7 +1133,7 @@ ATF_TC_BODY(fspacectl, tc) ATF_CHECK_MSG(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0, "Unaligned fspacectl to OFF_MAX failed; errno=%d", errno); ATF_CHECK_MSG(check_content_dealloc(fd, offset, length, shm_sz) == 0, - "Unaligned fspacectl to OFF_MAX content checking failed", errno); + "Unaligned fspacectl to OFF_MAX content checking failed"); /* Aligned fspacectl(fd, SPACECTL_DEALLOC, ...) past shm_sz */ ATF_REQUIRE(shm_fill(fd, 0, shm_sz) == 0); @@ -1142,7 +1142,7 @@ ATF_TC_BODY(fspacectl, tc) ATF_CHECK_MSG(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0, "Aligned fspacectl past shm_sz failed; errno=%d", errno); ATF_CHECK_MSG(check_content_dealloc(fd, offset, length, shm_sz) == 0, - "Aligned fspacectl past shm_sz content checking failed", errno); + "Aligned fspacectl past shm_sz content checking failed"); /* Unaligned fspacectl(fd, SPACECTL_DEALLOC, ...) past shm_sz */ ATF_REQUIRE(shm_fill(fd, 0, shm_sz) == 0); @@ -1151,7 +1151,7 @@ ATF_TC_BODY(fspacectl, tc) ATF_CHECK_MSG(fspacectl(fd, SPACECTL_DEALLOC, &range, 0, &range) == 0, "Unaligned fspacectl past shm_sz failed; errno=%d", errno); ATF_CHECK_MSG(check_content_dealloc(fd, offset, length, shm_sz) == 0, - "Unaligned fspacectl past shm_sz content checking failed", errno); + "Unaligned fspacectl past shm_sz content checking failed"); ATF_REQUIRE(close(fd) == 0); } @@ -1251,9 +1251,7 @@ ATF_TC_BODY(largepage_config, tc) struct shm_largepage_conf lpc; char *addr, *buf; size_t ps[MAXPAGESIZES + 1]; /* silence warnings if MAXPAGESIZES == 1 */ - int error, fd, pscnt; - - pscnt = pagesizes(ps); + int error, fd; fd = shm_open(SHM_ANON, O_CREAT | O_RDWR, 0); ATF_REQUIRE_MSG(fd >= 0, "shm_open failed; error=%d", errno); From owner-dev-commits-src-all@freebsd.org Wed Sep 15 16:05:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0F7366906E; Wed, 15 Sep 2021 16:05:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8lRz4CXGz3GYH; Wed, 15 Sep 2021 16:05:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 657CD1131E; Wed, 15 Sep 2021 16:05:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FG5Z7E086581; Wed, 15 Sep 2021 16:05:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FG5ZBu086580; Wed, 15 Sep 2021 16:05:35 GMT (envelope-from git) Date: Wed, 15 Sep 2021 16:05:35 GMT Message-Id: <202109151605.18FG5ZBu086580@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 857dc1c0ecfb - main - arm64: Pass the right label to END() for handle_empty_exception. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 857dc1c0ecfbf40509706b87de832a3f6d7338b2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 16:05:36 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=857dc1c0ecfbf40509706b87de832a3f6d7338b2 commit 857dc1c0ecfbf40509706b87de832a3f6d7338b2 Author: John Baldwin AuthorDate: 2021-09-15 16:03:18 +0000 Commit: John Baldwin CommitDate: 2021-09-15 16:03:18 +0000 arm64: Pass the right label to END() for handle_empty_exception. GNU as reported an error for the argument to .size not being a constant. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D31950 --- sys/arm64/arm64/exception.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/arm64/exception.S b/sys/arm64/arm64/exception.S index 413b9523eb06..22f6b7ce6145 100644 --- a/sys/arm64/arm64/exception.S +++ b/sys/arm64/arm64/exception.S @@ -225,7 +225,7 @@ ENTRY(handle_empty_exception) mov x0, sp 1: bl unhandled_exception b 1b -END(handle_unhandled_exception) +END(handle_empty_exception) .macro vempty .align 7 From owner-dev-commits-src-all@freebsd.org Wed Sep 15 16:05:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57B7166948F; Wed, 15 Sep 2021 16:05:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8lRv15l1z3GVj; Wed, 15 Sep 2021 16:05:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA4DD11119; Wed, 15 Sep 2021 16:05:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FG5U6g086483; Wed, 15 Sep 2021 16:05:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FG5Ujj086482; Wed, 15 Sep 2021 16:05:30 GMT (envelope-from git) Date: Wed, 15 Sep 2021 16:05:30 GMT Message-Id: <202109151605.18FG5Ujj086482@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: df005aa9b3d8 - main - pf: Remove duplicate declaration of pf_ioctl_maxcount. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: df005aa9b3d8d5bf78bff749b261e9ae5bea80a3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 16:05:32 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=df005aa9b3d8d5bf78bff749b261e9ae5bea80a3 commit df005aa9b3d8d5bf78bff749b261e9ae5bea80a3 Author: John Baldwin AuthorDate: 2021-09-15 16:03:18 +0000 Commit: John Baldwin CommitDate: 2021-09-15 16:03:18 +0000 pf: Remove duplicate declaration of pf_ioctl_maxcount. Fixes a -Wredundant-decls warning with GCC 9. Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D31944 --- sys/netpfil/pf/pf_ioctl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 6d240326361e..e7e37d5a6d5a 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -273,8 +273,6 @@ pfsync_detach_ifnet_t *pfsync_detach_ifnet_ptr; /* pflog */ pflog_packet_t *pflog_packet_ptr = NULL; -extern u_long pf_ioctl_maxcount; - /* * Copy a user-provided string, returning an error if truncation would occur. * Avoid scanning past "sz" bytes in the source string since there's no From owner-dev-commits-src-all@freebsd.org Wed Sep 15 16:05:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D604B66951E; Wed, 15 Sep 2021 16:05:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8lRy50K1z3GSG; Wed, 15 Sep 2021 16:05:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AA3A1101D; Wed, 15 Sep 2021 16:05:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FG5Y1j086557; Wed, 15 Sep 2021 16:05:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FG5YvK086556; Wed, 15 Sep 2021 16:05:34 GMT (envelope-from git) Date: Wed, 15 Sep 2021 16:05:34 GMT Message-Id: <202109151605.18FG5YvK086556@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 8753039a8f23 - main - arm64: Fix a logic bug in is_load_instr(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8753039a8f231ab04c7f3db9eaa5d9144d73440d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 16:05:35 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8753039a8f231ab04c7f3db9eaa5d9144d73440d commit 8753039a8f231ab04c7f3db9eaa5d9144d73440d Author: John Baldwin AuthorDate: 2021-09-15 16:03:18 +0000 Commit: John Baldwin CommitDate: 2021-09-15 16:03:18 +0000 arm64: Fix a logic bug in is_load_instr(). Logical and ('&&') was used to join two conditions instead of logical or ('||') causing some store instructions to not be recognized. Reported by: GCC 9 -Wparentheses Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D31949 --- sys/arm64/include/db_machdep.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/arm64/include/db_machdep.h b/sys/arm64/include/db_machdep.h index 105e8e507ce3..9ec0b6402a91 100644 --- a/sys/arm64/include/db_machdep.h +++ b/sys/arm64/include/db_machdep.h @@ -97,7 +97,7 @@ typedef long db_expr_t; (((ins) & 0xffe00c00u) != 0x3c800000u)) || /* unscaled immediate */ \ ((((ins) & 0x3b000000u) == 0x39000000u) && \ (((ins) & 0x3bc00000u) != 0x39000000u) && \ - (((ins) & 0xffc00000u) != 0x3d800000u)) && /* unsigned immediate */ \ + (((ins) & 0xffc00000u) != 0x3d800000u)) || /* unsigned immediate */ \ (((ins) & 0x3bc00000u) == 0x28400000u) || /* pair (offset) */ \ (((ins) & 0x3bc00000u) == 0x28c00000u) || /* pair (post-indexed) */ \ (((ins) & 0x3bc00000u) == 0x29800000u)) /* pair (pre-indexed) */ From owner-dev-commits-src-all@freebsd.org Wed Sep 15 16:06:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D3CBF6697B9; Wed, 15 Sep 2021 16:06:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8lSj5DVTz3GrX; Wed, 15 Sep 2021 16:06:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8CDEF110C0; Wed, 15 Sep 2021 16:06:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FG6DGu086812; Wed, 15 Sep 2021 16:06:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FG6D4K086811; Wed, 15 Sep 2021 16:06:13 GMT (envelope-from git) Date: Wed, 15 Sep 2021 16:06:13 GMT Message-Id: <202109151606.18FG6D4K086811@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: e3e7d953323c - main - tcp: Avoid division by zero when KERN_TLS is enabled in tcp_account_for_send(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e3e7d953323c450dbe3ecbb21f9741f049ee3017 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 16:06:14 -0000 The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=e3e7d953323c450dbe3ecbb21f9741f049ee3017 commit e3e7d953323c450dbe3ecbb21f9741f049ee3017 Author: Hans Petter Selasky AuthorDate: 2021-09-15 16:03:38 +0000 Commit: Hans Petter Selasky CommitDate: 2021-09-15 16:05:31 +0000 tcp: Avoid division by zero when KERN_TLS is enabled in tcp_account_for_send(). If the "len" variable is non-zero, we can assume that the sum of "tp->t_snd_rxt_bytes + tp->t_sndbytes" is also non-zero. It is also assumed that the 64-bit byte counters will never wrap around. Differential Revision: https://reviews.freebsd.org/D31959 Reviewed by: gallatin, rrs and tuexen Found by: "I told you so", also called hselasky MFC after: 1 week Sponsored by: NVIDIA Networking --- sys/netinet/tcp_var.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/netinet/tcp_var.h b/sys/netinet/tcp_var.h index 64e954cf4ad5..c26f503f4a1d 100644 --- a/sys/netinet/tcp_var.h +++ b/sys/netinet/tcp_var.h @@ -1155,7 +1155,7 @@ tcp_account_for_send(struct tcpcb *tp, uint32_t len, uint8_t is_rxt, tp->t_sndbytes += len; #ifdef KERN_TLS - if (hw_tls && is_rxt) { + if (hw_tls && is_rxt && len != 0) { uint64_t rexmit_percent = (1000ULL * tp->t_snd_rxt_bytes) / (10ULL * (tp->t_snd_rxt_bytes + tp->t_sndbytes)); if (rexmit_percent > ktls_ifnet_max_rexmit_pct) ktls_disable_ifnet(tp); From owner-dev-commits-src-all@freebsd.org Wed Sep 15 16:52:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CC4AC66A78D; Wed, 15 Sep 2021 16:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8mTz58Yyz3m0B; Wed, 15 Sep 2021 16:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9135411840; Wed, 15 Sep 2021 16:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FGqNB9052481; Wed, 15 Sep 2021 16:52:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FGqNQx052480; Wed, 15 Sep 2021 16:52:23 GMT (envelope-from git) Date: Wed, 15 Sep 2021 16:52:23 GMT Message-Id: <202109151652.18FGqNQx052480@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 731e418bd748 - main - arm64: rockchip: clk_mux: Add support for mux in GRF type clock MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 731e418bd748f6602bb184ca3a35bab8af241cf1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 16:52:23 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=731e418bd748f6602bb184ca3a35bab8af241cf1 commit 731e418bd748f6602bb184ca3a35bab8af241cf1 Author: Emmanuel Vadot AuthorDate: 2021-09-09 16:24:33 +0000 Commit: Emmanuel Vadot CommitDate: 2021-09-15 16:43:04 +0000 arm64: rockchip: clk_mux: Add support for mux in GRF type clock Some clocks have their mux register in the GRF and not in the CRU. Add support for that in the rk_clk_mux clock type. --- sys/arm64/rockchip/clk/rk_clk_mux.c | 50 ++++++++++++++++++++++++++++++++++--- sys/arm64/rockchip/clk/rk_clk_mux.h | 1 + sys/arm64/rockchip/clk/rk_cru.h | 17 +++++++++++++ 3 files changed, 64 insertions(+), 4 deletions(-) diff --git a/sys/arm64/rockchip/clk/rk_clk_mux.c b/sys/arm64/rockchip/clk/rk_clk_mux.c index eb3cdeb99f4b..20e612b8c764 100644 --- a/sys/arm64/rockchip/clk/rk_clk_mux.c +++ b/sys/arm64/rockchip/clk/rk_clk_mux.c @@ -38,11 +38,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include "clkdev_if.h" +#include "syscon_if.h" #define WR4(_clk, off, val) \ CLKDEV_WRITE_4(clknode_get_device(_clk), off, val) @@ -72,6 +74,7 @@ struct rk_clk_mux_sc { uint32_t shift; uint32_t mask; int mux_flags; + struct syscon *grf; }; static clknode_method_t rk_clk_mux_methods[] = { @@ -84,6 +87,25 @@ static clknode_method_t rk_clk_mux_methods[] = { DEFINE_CLASS_1(rk_clk_mux, rk_clk_mux_class, rk_clk_mux_methods, sizeof(struct rk_clk_mux_sc), clknode_class); +static struct syscon * +rk_clk_mux_get_grf(struct clknode *clk) +{ + device_t dev; + phandle_t node; + struct syscon *grf; + + grf = NULL; + dev = clknode_get_device(clk); + node = ofw_bus_get_node(dev); + if (OF_hasprop(node, "rockchip,grf") && + syscon_get_by_ofw_property(dev, node, + "rockchip,grf", &grf) != 0) { + return (NULL); + } + + return (grf); +} + static int rk_clk_mux_init(struct clknode *clk, device_t dev) { @@ -93,8 +115,19 @@ rk_clk_mux_init(struct clknode *clk, device_t dev) sc = clknode_get_softc(clk); + if ((sc->mux_flags & RK_CLK_MUX_GRF) != 0) { + sc->grf = rk_clk_mux_get_grf(clk); + if (sc->grf == NULL) + panic("clock %s has GRF flag set but no syscon is available", + clknode_get_name(clk)); + } + DEVICE_LOCK(clk); - rv = RD4(clk, sc->offset, ®); + if (sc->grf) { + reg = SYSCON_READ_4(sc->grf, sc->offset); + rv = 0; + } else + rv = RD4(clk, sc->offset, ®); DEVICE_UNLOCK(clk); if (rv != 0) { return (rv); @@ -114,13 +147,18 @@ rk_clk_mux_set_mux(struct clknode *clk, int idx) sc = clknode_get_softc(clk); DEVICE_LOCK(clk); - rv = MD4(clk, sc->offset, sc->mask << sc->shift, - ((idx & sc->mask) << sc->shift) | RK_CLK_MUX_MASK); + if (sc->grf) + rv = SYSCON_MODIFY_4(sc->grf, sc->offset, sc->mask << sc->shift, + ((idx & sc->mask) << sc->shift) | RK_CLK_MUX_MASK); + else + rv = MD4(clk, sc->offset, sc->mask << sc->shift, + ((idx & sc->mask) << sc->shift) | RK_CLK_MUX_MASK); if (rv != 0) { DEVICE_UNLOCK(clk); return (rv); } - RD4(clk, sc->offset, ®); + if (sc->grf == NULL) + RD4(clk, sc->offset, ®); DEVICE_UNLOCK(clk); return(0); @@ -138,6 +176,10 @@ rk_clk_mux_set_freq(struct clknode *clk, uint64_t fparent, uint64_t *fout, sc = clknode_get_softc(clk); + if ((sc->mux_flags & RK_CLK_MUX_GRF) != 0) { + *stop = 1; + return (ENOTSUP); + } if ((sc->mux_flags & RK_CLK_MUX_REPARENT) == 0) { *stop = 0; return (0); diff --git a/sys/arm64/rockchip/clk/rk_clk_mux.h b/sys/arm64/rockchip/clk/rk_clk_mux.h index 7825f8892ac3..c2b5f9cdad69 100644 --- a/sys/arm64/rockchip/clk/rk_clk_mux.h +++ b/sys/arm64/rockchip/clk/rk_clk_mux.h @@ -42,6 +42,7 @@ struct rk_clk_mux_def { #define RK_CLK_MUX_MASK 0xFFFF0000 #define RK_CLK_MUX_REPARENT (1 << 0) +#define RK_CLK_MUX_GRF (1 << 1) int rk_clk_mux_register(struct clkdom *clkdom, struct rk_clk_mux_def *clkdef); diff --git a/sys/arm64/rockchip/clk/rk_cru.h b/sys/arm64/rockchip/clk/rk_cru.h index 0d1c49f01290..1c749d1d2c87 100644 --- a/sys/arm64/rockchip/clk/rk_cru.h +++ b/sys/arm64/rockchip/clk/rk_cru.h @@ -186,6 +186,23 @@ }, \ } +/* Complex clock without divider (multiplexer only in GRF). */ +#define MUXGRF(_id, _name, _pn, _f, _mo, _ms, _mw) \ +{ \ + .type = RK_CLK_MUX, \ + .clk.mux = &(struct rk_clk_mux_def) { \ + .clkdef.id = _id, \ + .clkdef.name = _name, \ + .clkdef.parent_names = _pn, \ + .clkdef.parent_cnt = nitems(_pn), \ + .clkdef.flags = CLK_NODE_STATIC_STRINGS, \ + .offset = _mo, \ + .shift = _ms, \ + .width = _mw, \ + .mux_flags = RK_CLK_MUX_GRF | _f, \ + }, \ +} + struct rk_cru_gate { const char *name; const char *parent_name; From owner-dev-commits-src-all@freebsd.org Wed Sep 15 16:52:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 45FBB66A451; Wed, 15 Sep 2021 16:52:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8mV06mslz3m65; Wed, 15 Sep 2021 16:52:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAF1211C94; Wed, 15 Sep 2021 16:52:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FGqOKD052505; Wed, 15 Sep 2021 16:52:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FGqO7P052504; Wed, 15 Sep 2021 16:52:24 GMT (envelope-from git) Date: Wed, 15 Sep 2021 16:52:24 GMT Message-Id: <202109151652.18FGqO7P052504@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: deff1fb3dccb - main - arm64: rockchip: clk: Add MUXRAW macros MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: deff1fb3dccb13b6961b1e8595f74a2134e65b93 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 16:52:25 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=deff1fb3dccb13b6961b1e8595f74a2134e65b93 commit deff1fb3dccb13b6961b1e8595f74a2134e65b93 Author: Emmanuel Vadot AuthorDate: 2021-09-15 16:25:09 +0000 Commit: Emmanuel Vadot CommitDate: 2021-09-15 16:43:07 +0000 arm64: rockchip: clk: Add MUXRAW macros Some clocks in the RK3328 SoC (and possibly others) have registers not in the CLKSEL_CON range. Add a macros for muxes which lives not in the range of CLKSEL_CON which just takes a raw offset. --- sys/arm64/rockchip/clk/rk_cru.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/arm64/rockchip/clk/rk_cru.h b/sys/arm64/rockchip/clk/rk_cru.h index 1c749d1d2c87..fc838fc11d19 100644 --- a/sys/arm64/rockchip/clk/rk_cru.h +++ b/sys/arm64/rockchip/clk/rk_cru.h @@ -170,7 +170,7 @@ } /* Complex clock without divider (multiplexer only). */ -#define MUX(_id, _name, _pn, _f, _mo, _ms, _mw) \ +#define MUXRAW(_id, _name, _pn, _f, _mo, _ms, _mw) \ { \ .type = RK_CLK_MUX, \ .clk.mux = &(struct rk_clk_mux_def) { \ @@ -179,13 +179,16 @@ .clkdef.parent_names = _pn, \ .clkdef.parent_cnt = nitems(_pn), \ .clkdef.flags = CLK_NODE_STATIC_STRINGS, \ - .offset = CRU_CLKSEL_CON(_mo), \ + .offset = _mo, \ .shift = _ms, \ .width = _mw, \ - .mux_flags = _f, \ + .mux_flags = _f, \ }, \ } +#define MUX(_id, _name, _pn, _f, _mo, _ms, _mw) \ + MUXRAW(_id, _name, _pn, _f, CRU_CLKSEL_CON(_mo), _ms, _mw) + /* Complex clock without divider (multiplexer only in GRF). */ #define MUXGRF(_id, _name, _pn, _f, _mo, _ms, _mw) \ { \ From owner-dev-commits-src-all@freebsd.org Wed Sep 15 16:52:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 47A2B66A452; Wed, 15 Sep 2021 16:52:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8mV20dtvz3mF1; Wed, 15 Sep 2021 16:52:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D864611DB3; Wed, 15 Sep 2021 16:52:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FGqPiO052529; Wed, 15 Sep 2021 16:52:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FGqP2a052528; Wed, 15 Sep 2021 16:52:25 GMT (envelope-from git) Date: Wed, 15 Sep 2021 16:52:25 GMT Message-Id: <202109151652.18FGqP2a052528@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: cc2f9bbbad3b - main - arm64: rockchip: rk3328: Finish implementing clocks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cc2f9bbbad3b9cd81b8e66d57f9d34d8a42048dd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 16:52:26 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=cc2f9bbbad3b9cd81b8e66d57f9d34d8a42048dd commit cc2f9bbbad3b9cd81b8e66d57f9d34d8a42048dd Author: Emmanuel Vadot AuthorDate: 2021-09-15 16:33:38 +0000 Commit: Emmanuel Vadot CommitDate: 2021-09-15 16:43:10 +0000 arm64: rockchip: rk3328: Finish implementing clocks This finish (almost) the clocks implementations for the RK3328 SoC. The clocks are now correctly implemented respecting the clock hiearchy. The missing clocks are mostly the DDR clocks, implementing those is only useful for debugging as we will never set them in the kernel. The ARMCLK still needs to be rewritten so it looks closer to how the hardware is done. Tested-on: Rock64 --- sys/arm64/rockchip/clk/rk3328_cru.c | 2096 ++++++++++++----------------------- 1 file changed, 712 insertions(+), 1384 deletions(-) diff --git a/sys/arm64/rockchip/clk/rk3328_cru.c b/sys/arm64/rockchip/clk/rk3328_cru.c index 95a87cfd0e00..344bf3bcd7aa 100644 --- a/sys/arm64/rockchip/clk/rk3328_cru.c +++ b/sys/arm64/rockchip/clk/rk3328_cru.c @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 2018 Emmanuel Vadot + * Copyright (c) 2018-2021 Emmanuel Vadot * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -49,18 +49,76 @@ __FBSDID("$FreeBSD$"); #include +#define CRU_CLKSEL_CON(x) (0x100 + (x) * 0x4) + /* Registers */ #define RK3328_GRF_SOC_CON4 0x410 #define RK3328_GRF_MAC_CON1 0x904 #define RK3328_GRF_MAC_CON2 0x908 -/* GATES */ - +/* Exported clocks */ + +#define PLL_APLL 1 +#define PLL_DPLL 2 +#define PLL_CPLL 3 +#define PLL_GPLL 4 +#define PLL_NPLL 5 +#define ARMCLK 6 + +/* SCLK */ +#define SCLK_RTC32K 30 +#define SCLK_SDMMC_EXT 31 +#define SCLK_SPI 32 +#define SCLK_SDMMC 33 +#define SCLK_SDIO 34 +#define SCLK_EMMC 35 +#define SCLK_TSADC 36 +#define SCLK_SARADC 37 +#define SCLK_UART0 38 +#define SCLK_UART1 39 +#define SCLK_UART2 40 #define SCLK_I2S0 41 #define SCLK_I2S1 42 #define SCLK_I2S2 43 #define SCLK_I2S1_OUT 44 #define SCLK_I2S2_OUT 45 +#define SCLK_SPDIF 46 +#define SCLK_TIMER0 47 +#define SCLK_TIMER1 48 +#define SCLK_TIMER2 49 +#define SCLK_TIMER3 50 +#define SCLK_TIMER4 51 +#define SCLK_TIMER5 52 +#define SCLK_WIFI 53 +#define SCLK_CIF_OUT 54 +#define SCLK_I2C0 55 +#define SCLK_I2C1 56 +#define SCLK_I2C2 57 +#define SCLK_I2C3 58 +#define SCLK_CRYPTO 59 +#define SCLK_PWM 60 +#define SCLK_PDM 61 +#define SCLK_EFUSE 62 +#define SCLK_OTP 63 +#define SCLK_DDRCLK 64 +#define SCLK_VDEC_CABAC 65 +#define SCLK_VDEC_CORE 66 +#define SCLK_VENC_DSP 67 +#define SCLK_VENC_CORE 68 +#define SCLK_RGA 69 +#define SCLK_HDMI_SFC 70 +#define SCLK_HDMI_CEC 71 /* Unused ? */ +#define SCLK_USB3_REF 72 +#define SCLK_USB3_SUSPEND 73 +#define SCLK_SDMMC_DRV 74 +#define SCLK_SDIO_DRV 75 +#define SCLK_EMMC_DRV 76 +#define SCLK_SDMMC_EXT_DRV 77 +#define SCLK_SDMMC_SAMPLE 78 +#define SCLK_SDIO_SAMPLE 79 +#define SCLK_EMMC_SAMPLE 80 +#define SCLK_SDMMC_EXT_SAMPLE 81 +#define SCLK_VOP 82 #define SCLK_MAC2PHY_RXTX 83 #define SCLK_MAC2PHY_SRC 84 #define SCLK_MAC2PHY_REF 85 @@ -70,528 +128,553 @@ __FBSDID("$FreeBSD$"); #define SCLK_MAC2IO_REFOUT 89 #define SCLK_MAC2IO_REF 90 #define SCLK_MAC2IO_OUT 91 +#define SCLK_TSP 92 +#define SCLK_HSADC_TSP 93 +#define SCLK_USB3PHY_REF 94 +#define SCLK_REF_USB3OTG 95 #define SCLK_USB3OTG_REF 96 +#define SCLK_USB3OTG_SUSPEND 97 +#define SCLK_REF_USB3OTG_SRC 98 #define SCLK_MAC2IO_SRC 99 #define SCLK_MAC2IO 100 #define SCLK_MAC2PHY 101 #define SCLK_MAC2IO_EXT 102 + +/* DCLK */ +#define DCLK_LCDC 120 +#define DCLK_HDMIPHY 121 +#define HDMIPHY 122 +#define USB480M 123 +#define DCLK_LCDC_SRC 124 + +/* ACLK */ +#define ACLK_AXISRAM 130 /* Unused */ +#define ACLK_VOP_PRE 131 #define ACLK_USB3OTG 132 -#define ACLK_GMAC 146 -#define ACLK_MAC2PHY 149 -#define ACLK_MAC2IO 150 +#define ACLK_RGA_PRE 133 +#define ACLK_DMAC 134 /* Unused */ +#define ACLK_GPU 135 +#define ACLK_BUS_PRE 136 +#define ACLK_PERI_PRE 137 +#define ACLK_RKVDEC_PRE 138 +#define ACLK_RKVDEC 139 +#define ACLK_RKVENC 140 +#define ACLK_VPU_PRE 141 +#define ACLK_VIO_PRE 142 +#define ACLK_VPU 143 +#define ACLK_VIO 144 +#define ACLK_VOP 145 +#define ACLK_GMAC 146 +#define ACLK_H265 147 +#define ACLK_H264 148 +#define ACLK_MAC2PHY 149 +#define ACLK_MAC2IO 150 +#define ACLK_DCF 151 +#define ACLK_TSP 152 #define ACLK_PERI 153 +#define ACLK_RGA 154 +#define ACLK_IEP 155 +#define ACLK_CIF 156 +#define ACLK_HDCP 157 + +/* PCLK */ #define PCLK_GPIO0 200 #define PCLK_GPIO1 201 #define PCLK_GPIO2 202 #define PCLK_GPIO3 203 +#define PCLK_GRF 204 #define PCLK_I2C0 205 #define PCLK_I2C1 206 #define PCLK_I2C2 207 #define PCLK_I2C3 208 +#define PCLK_SPI 209 +#define PCLK_UART0 210 +#define PCLK_UART1 211 +#define PCLK_UART2 212 #define PCLK_TSADC 213 -#define PCLK_GMAC 220 -#define PCLK_MAC2PHY 222 -#define PCLK_MAC2IO 223 +#define PCLK_PWM 214 +#define PCLK_TIMER 215 +#define PCLK_BUS_PRE 216 +#define PCLK_PERI_PRE 217 /* Unused */ +#define PCLK_HDMI_CTRL 218 /* Unused */ +#define PCLK_HDMI_PHY 219 /* Unused */ +#define PCLK_GMAC 220 +#define PCLK_H265 221 +#define PCLK_MAC2PHY 222 +#define PCLK_MAC2IO 223 #define PCLK_USB3PHY_OTG 224 #define PCLK_USB3PHY_PIPE 225 #define PCLK_USB3_GRF 226 +#define PCLK_USB2_GRF 227 +#define PCLK_HDMIPHY 228 +#define PCLK_DDR 229 +#define PCLK_PERI 230 +#define PCLK_HDMI 231 +#define PCLK_HDCP 232 +#define PCLK_DCF 233 +#define PCLK_SARADC 234 #define PCLK_ACODECPHY 235 +#define PCLK_WDT 236 /* Controlled from the secure GRF */ + +/* HCLK */ +#define HCLK_PERI 308 +#define HCLK_TSP 309 +#define HCLK_GMAC 310 /* Unused */ #define HCLK_I2S0_8CH 311 #define HCLK_I2S1_8CH 312 #define HCLK_I2S2_2CH 313 +#define HCLK_SPDIF_8CH 314 +#define HCLK_VOP 315 +#define HCLK_NANDC 316 /* Unused */ #define HCLK_SDMMC 317 #define HCLK_SDIO 318 #define HCLK_EMMC 319 #define HCLK_SDMMC_EXT 320 +#define HCLK_RKVDEC_PRE 321 +#define HCLK_RKVDEC 322 +#define HCLK_RKVENC 323 +#define HCLK_VPU_PRE 324 +#define HCLK_VIO_PRE 325 +#define HCLK_VPU 326 +/* 327 doesn't exists */ +#define HCLK_BUS_PRE 328 +#define HCLK_PERI_PRE 329 /* Unused */ +#define HCLK_H264 330 +#define HCLK_CIF 331 +#define HCLK_OTG_PMU 332 +#define HCLK_OTG 333 +#define HCLK_HOST0 334 +#define HCLK_HOST0_ARB 335 +#define HCLK_CRYPTO_MST 336 +#define HCLK_CRYPTO_SLV 337 +#define HCLK_PDM 338 +#define HCLK_IEP 339 +#define HCLK_RGA 340 +#define HCLK_HDCP 341 static struct rk_cru_gate rk3328_gates[] = { /* CRU_CLKGATE_CON0 */ - CRU_GATE(0, "apll_core", "apll", 0x200, 0) - CRU_GATE(0, "dpll_core", "dpll", 0x200, 1) - CRU_GATE(0, "gpll_core", "gpll", 0x200, 2) - CRU_GATE(0, "npll_core", "npll", 0x200, 12) + CRU_GATE(0, "core_apll_clk", "apll", 0x200, 0) + CRU_GATE(0, "core_dpll_clk", "dpll", 0x200, 1) + CRU_GATE(0, "core_gpll_clk", "gpll", 0x200, 2) + /* Bit 3 bus_src_clk_en */ + /* Bit 4 clk_ddrphy_src_en */ + /* Bit 5 clk_ddrpd_src_en */ + /* Bit 6 clk_ddrmon_en */ + /* Bit 7-8 unused */ + /* Bit 9 testclk_en */ + CRU_GATE(SCLK_WIFI, "sclk_wifi", "sclk_wifi_c", 0x200, 10) + CRU_GATE(SCLK_RTC32K, "clk_rtc32k", "clk_rtc32k_c", 0x200, 11) + CRU_GATE(0, "core_npll_clk", "npll", 0x200, 12) + /* Bit 13-15 unused */ /* CRU_CLKGATE_CON1 */ + /* Bit 0 unused */ + CRU_GATE(0, "clk_i2s0_div", "clk_i2s0_div_c", 0x204, 1) + CRU_GATE(0, "clk_i2s0_frac", "clk_i2s0_frac_f", 0x204, 2) CRU_GATE(SCLK_I2S0, "clk_i2s0", "clk_i2s0_mux", 0x204, 3) + CRU_GATE(0, "clk_i2s1_div", "clk_i2s1_div_c", 0x204, 4) + CRU_GATE(0, "clk_i2s1_frac", "clk_i2s1_frac_f", 0x204, 5) CRU_GATE(SCLK_I2S1, "clk_i2s1", "clk_i2s1_mux", 0x204, 6) + CRU_GATE(0, "clk_i2s1_out", "clk_i2s1_mux", 0x204, 7) + CRU_GATE(0, "clk_i2s2_div", "clk_i2s2_div_c", 0x204, 8) + CRU_GATE(0, "clk_i2s2_frac", "clk_i2s2_frac_f", 0x204, 9) CRU_GATE(SCLK_I2S2, "clk_i2s2", "clk_i2s2_mux", 0x204, 10) + CRU_GATE(0, "clk_i2s2_out", "clk_i2s2_mux", 0x204, 11) + CRU_GATE(0, "clk_spdif_div", "clk_spdif_div_c", 0x204, 12) + CRU_GATE(0, "clk_spdif_frac", "clk_spdif_frac_f", 0x204, 13) + CRU_GATE(0, "clk_uart0_div", "clk_uart0_div_c", 0x204, 14) + CRU_GATE(0, "clk_uart0_frac", "clk_uart0_frac_f", 0x204, 15) + + /* CRU_CLKGATE_CON2 */ + CRU_GATE(0, "clk_uart1_div", "clk_uart1_div_c", 0x208, 0) + CRU_GATE(0, "clk_uart1_frac", "clk_uart1_frac_f", 0x208, 1) + CRU_GATE(0, "clk_uart2_div", "clk_uart2_div_c", 0x208, 2) + CRU_GATE(0, "clk_uart2_frac", "clk_uart2_frac_f", 0x208, 3) + CRU_GATE(SCLK_CRYPTO, "clk_crypto", "clk_crypto_c", 0x208, 4) + CRU_GATE(SCLK_TSP, "clk_tsp", "clk_tsp_c", 0x208, 5) + CRU_GATE(SCLK_TSADC, "clk_tsadc_src", "clk_tsadc_c", 0x208, 6) + CRU_GATE(SCLK_SPI, "clk_spi", "clk_spi_c", 0x208, 7) + CRU_GATE(SCLK_PWM, "clk_pwm", "clk_pwm_c", 0x208, 8) + CRU_GATE(SCLK_I2C0, "clk_i2c0_src", "clk_i2c0_c", 0x208, 9) + CRU_GATE(SCLK_I2C1, "clk_i2c1_src", "clk_i2c1_c", 0x208, 10) + CRU_GATE(SCLK_I2C2, "clk_i2c2_src", "clk_i2c2_c", 0x208, 11) + CRU_GATE(SCLK_I2C3, "clk_i2c3_src", "clk_i2c3_c", 0x208, 12) + CRU_GATE(SCLK_EFUSE, "clk_efuse", "clk_efuse_c", 0x208, 13) + CRU_GATE(SCLK_SARADC, "clk_saradc", "clk_saradc_c", 0x208, 14) + CRU_GATE(SCLK_PDM, "clk_pdm", "clk_pdm_c", 0x208, 15) + + /* CRU_CLKGATE_CON3 */ + CRU_GATE(SCLK_MAC2PHY_SRC, "clk_mac2phy_src", "clk_mac2phy_src_c", 0x20c, 0) + CRU_GATE(SCLK_MAC2IO_SRC, "clk_mac2io_src", "clk_mac2io_src_c", 0x20c, 1) + CRU_GATE(ACLK_GMAC, "aclk_gmac", "aclk_gmac_c", 0x20c, 2) + /* Bit 3 gmac_gpll_src_en Unused ? */ + /* Bit 4 gmac_vpll_src_en Unused ? */ + CRU_GATE(SCLK_MAC2IO_OUT, "clk_mac2io_out", "clk_mac2io_out_c", 0x20c, 5) + /* Bit 6-7 unused */ + CRU_GATE(SCLK_OTP, "clk_otp", "clk_otp_c", 0x20c, 8) + /* Bit 9-15 unused */ /* CRU_CLKGATE_CON4 */ - CRU_GATE(0, "gpll_peri", "gpll", 0x210, 0) - CRU_GATE(0, "cpll_peri", "cpll", 0x210, 1) - CRU_GATE(SCLK_USB3OTG_REF, "clk_usb3otg_ref", "xin24m", 0x210, 7) + CRU_GATE(0, "periph_gclk_src", "gpll", 0x210, 0) + CRU_GATE(0, "periph_cclk_src", "cpll", 0x210, 1) + CRU_GATE(0, "hdmiphy_peri", "hdmiphy", 0x210, 2) + CRU_GATE(SCLK_SDMMC, "clk_mmc0_src", "clk_sdmmc_c", 0x210, 3) + CRU_GATE(SCLK_SDIO, "clk_sdio_src", "clk_sdio_c", 0x210, 4) + CRU_GATE(SCLK_EMMC, "clk_emmc_src", "clk_emmc_c", 0x210, 5) + CRU_GATE(SCLK_REF_USB3OTG_SRC, "clk_ref_usb3otg_src", "clk_ref_usb3otg_src_c", 0x210, 6) + CRU_GATE(SCLK_USB3OTG_REF, "clk_usb3_otg0_ref", "xin24m", 0x210, 7) + CRU_GATE(SCLK_USB3OTG_SUSPEND, "clk_usb3otg_suspend", "clk_usb3otg_suspend_c", 0x210, 8) + /* Bit 9 clk_usb3phy_ref_25m_en */ + CRU_GATE(SCLK_SDMMC_EXT, "clk_sdmmc_ext", "clk_sdmmc_ext_c", 0x210, 10) + /* Bit 11-15 unused */ + + /* CRU_CLKGATE_CON5 */ + CRU_GATE(ACLK_RGA_PRE, "aclk_rga_pre", "aclk_rga_pre_c", 0x214, 0) + CRU_GATE(SCLK_RGA, "sclk_rga", "sclk_rga_c", 0x214, 0) + CRU_GATE(ACLK_VIO_PRE, "aclk_vio_pre", "aclk_vio_pre_c", 0x214, 2) + CRU_GATE(SCLK_CIF_OUT, "clk_cif_src", "clk_cif_src_c", 0x214, 3) + CRU_GATE(SCLK_HDMI_SFC, "clk_hdmi_sfc", "xin24m", 0x214, 4) + CRU_GATE(ACLK_VOP_PRE, "aclk_vop_pre", "aclk_vop_pre_c", 0x214, 5) + CRU_GATE(DCLK_LCDC_SRC, "vop_dclk_src", "vop_dclk_src_c", 0x214, 6) + /* Bit 7-15 unused */ + + /* CRU_CLKGATE_CON6 */ + CRU_GATE(ACLK_RKVDEC_PRE, "aclk_rkvdec_pre", "aclk_rkvdec_c", 0x218, 0) + CRU_GATE(SCLK_VDEC_CABAC, "sclk_cabac", "sclk_cabac_c", 0x218, 1) + CRU_GATE(SCLK_VDEC_CORE, "sclk_vdec_core", "sclk_vdec_core_c", 0x218, 2) + CRU_GATE(ACLK_RKVENC, "aclk_rkvenc", "aclk_rkvenc_c", 0x218, 3) + CRU_GATE(SCLK_VENC_CORE, "sclk_venc", "sclk_venc_c", 0x218, 4) + CRU_GATE(ACLK_VPU_PRE, "aclk_vpu_pre", "aclk_vpu_pre_c", 0x218, 5) + CRU_GATE(0, "aclk_gpu_pre", "aclk_gpu_pre_c", 0x218, 6) + CRU_GATE(SCLK_VENC_DSP, "sclk_venc_dsp", "sclk_venc_dsp_c", 0x218, 7) + /* Bit 8-15 unused */ + + /* CRU_CLKGATE_CON7 */ + /* Bit 0 aclk_core_en */ + /* Bit 1 clk_core_periph_en */ + /* Bit 2 clk_jtag_en */ + /* Bit 3 unused */ + /* Bit 4 pclk_ddr_en */ + /* Bit 5-15 unused */ /* CRU_CLKGATE_CON8 */ + CRU_GATE(ACLK_BUS_PRE, "aclk_bus_pre", "aclk_bus_pre_c", 0x220, 0) + CRU_GATE(HCLK_BUS_PRE, "hclk_bus_pre", "hclk_bus_pre_c", 0x220, 1) + CRU_GATE(PCLK_BUS_PRE, "pclk_bus_pre", "pclk_bus_pre_c", 0x220, 2) CRU_GATE(0, "pclk_bus", "pclk_bus_pre", 0x220, 3) - CRU_GATE(0, "pclk_phy_pre", "pclk_bus_pre", 0x220, 4) + CRU_GATE(0, "pclk_phy", "pclk_bus_pre", 0x220, 4) + CRU_GATE(SCLK_TIMER0, "sclk_timer0", "xin24m", 0x220, 5) + CRU_GATE(SCLK_TIMER1, "sclk_timer1", "xin24m", 0x220, 6) + CRU_GATE(SCLK_TIMER2, "sclk_timer2", "xin24m", 0x220, 7) + CRU_GATE(SCLK_TIMER3, "sclk_timer3", "xin24m", 0x220, 8) + CRU_GATE(SCLK_TIMER4, "sclk_timer4", "xin24m", 0x220, 9) + CRU_GATE(SCLK_TIMER5, "sclk_timer5", "xin24m", 0x220, 10) + /* Bit 11-15 unused */ - /* CRU_CLKGATE_CON8 */ - CRU_GATE(SCLK_MAC2IO_REF, "clk_mac2io_ref", "clk_mac2io", 0x224, 7) - CRU_GATE(SCLK_MAC2IO_REFOUT, "clk_mac2io_refout", "clk_mac2io", 0x224, 6) - CRU_GATE(SCLK_MAC2IO_TX, "clk_mac2io_tx", "clk_mac2io", 0x224, 5) - CRU_GATE(SCLK_MAC2IO_RX, "clk_mac2io_rx", "clk_mac2io", 0x224, 4) - CRU_GATE(SCLK_MAC2PHY_REF, "clk_mac2phy_ref", "clk_mac2phy", 0x224, 3) - CRU_GATE(SCLK_MAC2PHY_RXTX, "clk_mac2phy_rxtx", "clk_mac2phy", 0x224, 1) + /* CRU_CLKGATE_CON9 */ + CRU_GATE(PCLK_GMAC, "pclk_gmac", "aclk_gmac", 0x224, 0) + CRU_GATE(SCLK_MAC2PHY_RXTX, "clk_gmac2phy_rx", "clk_mac2phy", 0x224, 1) + CRU_GATE(SCLK_MAC2PHY_OUT, "clk_mac2phy_out", "clk_mac2phy_out_c", 0x224, 2) + CRU_GATE(SCLK_MAC2PHY_REF, "clk_gmac2phy_ref", "clk_mac2phy", 0x224, 3) + CRU_GATE(SCLK_MAC2IO_RX, "clk_gmac2io_rx", "clk_mac2io", 0x224, 4) + CRU_GATE(SCLK_MAC2IO_TX, "clk_gmac2io_tx", "clk_mac2io", 0x224, 5) + CRU_GATE(SCLK_MAC2IO_REFOUT, "clk_gmac2io_refout", "clk_mac2io", 0x224, 6) + CRU_GATE(SCLK_MAC2IO_REF, "clk_gmac2io_ref", "clk_mac2io", 0x224, 7) + /* Bit 8-15 unused */ /* CRU_CLKGATE_CON10 */ CRU_GATE(ACLK_PERI, "aclk_peri", "aclk_peri_pre", 0x228, 0) + CRU_GATE(HCLK_PERI, "hclk_peri", "hclk_peri_c", 0x228, 1) + CRU_GATE(PCLK_PERI, "pclk_peri", "pclk_peri_c", 0x228, 2) + /* Bit 3-15 unused */ + + /* CRU_CLKGATE_CON11 */ + CRU_GATE(HCLK_RKVDEC_PRE, "hclk_rkvdec_pre", "aclk_rkvdec_pre", 0x22C, 0) + /* Bit 1-3 unused */ + CRU_GATE(HCLK_RKVENC, "hclk_rkvenc", "aclk_rkvenc", 0x22C, 4) + /* Bit 5-7 unused */ + CRU_GATE(HCLK_VPU_PRE, "hclk_vpu_pre", "aclk_vpu_pre", 0x22C, 8) + /* Bit 9-15 unused */ + + /* CRU_CLKGATE_CON12 */ + /* unused */ + + /* CRU_CLKGATE_CON13 */ + /* Bit 0 aclk_core_niu_en */ + /* Bit 1 aclk_gic400_en */ + /* Bit 2-15 unused */ + + /* CRU_CLKGATE_CON14 */ + CRU_GATE(ACLK_GPU, "aclk_gpu", "aclk_gpu_pre", 0x238, 0) + CRU_GATE(0, "aclk_gpu_niu", "aclk_gpu_pre", 0x238, 1) + /* Bit 2-15 unused */ /* CRU_CLKGATE_CON15*/ + /* Bit 0 aclk_intmem_en Unused */ + /* Bit 1 aclk_dmac_bus_en Unused */ + /* Bit 2 hclk_rom_en Unused */ CRU_GATE(HCLK_I2S0_8CH, "hclk_i2s0_8ch", "hclk_bus_pre", 0x23C, 3) CRU_GATE(HCLK_I2S1_8CH, "hclk_i2s1_8ch", "hclk_bus_pre", 0x23C, 4) CRU_GATE(HCLK_I2S2_2CH, "hclk_i2s2_2ch", "hclk_bus_pre", 0x23C, 5) + CRU_GATE(HCLK_SPDIF_8CH, "hclk_spdif_8ch", "hclk_bus_pre", 0x23C, 6) + CRU_GATE(HCLK_CRYPTO_MST, "hclk_crypto_mst", "hclk_bus_pre", 0x23C, 7) + CRU_GATE(HCLK_CRYPTO_SLV, "hclk_crypto_slv", "hclk_bus_pre", 0x23C, 8) + CRU_GATE(0, "pclk_efuse", "pclk_bus", 0x23C, 9) CRU_GATE(PCLK_I2C0, "pclk_i2c0", "pclk_bus", 0x23C, 10) + CRU_GATE(ACLK_DCF, "aclk_dcf", "aclk_bus_pre", 0x23C, 11) + CRU_GATE(0, "aclk_bus_niu", "aclk_bus_pre", 0x23C, 12) + CRU_GATE(0, "hclk_bus_niu", "hclk_bus_pre", 0x23C, 13) + CRU_GATE(0, "pclk_bus_niu", "pclk_bus_pre", 0x23C, 14) + CRU_GATE(0, "pclk_phy_niu", "pclk_phy", 0x23C, 14) + /* Bit 15 pclk_phy_niu_en */ /* CRU_CLKGATE_CON16 */ - CRU_GATE(PCLK_I2C1, "pclk_i2c1", "pclk_bus", 0x23C, 0) - CRU_GATE(PCLK_I2C2, "pclk_i2c2", "pclk_bus", 0x23C, 1) - CRU_GATE(PCLK_I2C3, "pclk_i2c3", "pclk_bus", 0x23C, 2) - CRU_GATE(PCLK_TSADC, "pclk_tsadc", "pclk_bus", 0x23C, 14) - + CRU_GATE(PCLK_I2C1, "pclk_i2c1", "pclk_bus", 0x240, 0) + CRU_GATE(PCLK_I2C2, "pclk_i2c2", "pclk_bus", 0x240, 1) + CRU_GATE(PCLK_I2C3, "pclk_i2c3", "pclk_bus", 0x240, 2) + CRU_GATE(PCLK_TIMER, "pclk_timer0", "pclk_bus", 0x240, 3) + CRU_GATE(0, "pclk_stimer", "pclk_bus", 0x240, 4) + CRU_GATE(PCLK_SPI, "pclk_spi", "pclk_bus", 0x240, 5) + CRU_GATE(PCLK_PWM, "pclk_pwm", "pclk_bus", 0x240, 6) CRU_GATE(PCLK_GPIO0, "pclk_gpio0", "pclk_bus", 0x240, 7) CRU_GATE(PCLK_GPIO1, "pclk_gpio1", "pclk_bus", 0x240, 8) CRU_GATE(PCLK_GPIO2, "pclk_gpio2", "pclk_bus", 0x240, 9) CRU_GATE(PCLK_GPIO3, "pclk_gpio3", "pclk_bus", 0x240, 10) + CRU_GATE(PCLK_UART0, "pclk_uart0", "pclk_bus", 0x240, 11) + CRU_GATE(PCLK_UART1, "pclk_uart1", "pclk_bus", 0x240, 12) + CRU_GATE(PCLK_UART2, "pclk_uart2", "pclk_bus", 0x240, 13) + CRU_GATE(PCLK_TSADC, "pclk_tsadc", "pclk_bus", 0x240, 14) + CRU_GATE(PCLK_DCF, "pclk_dcf", "pclk_bus", 0x240, 15) /* CRU_CLKGATE_CON17 */ - CRU_GATE(PCLK_USB3_GRF, "pclk_usb3_grf", "pclk_phy_pre", 0x244, 2) - CRU_GATE(PCLK_ACODECPHY, "pclk_acodecphy", "pclk_phy_pre", 0x244, 5) + CRU_GATE(PCLK_GRF, "pclk_grf", "pclk_bus", 0x244, 0) + /* Bit 1 unused */ + CRU_GATE(PCLK_USB3_GRF, "pclk_usb3grf", "pclk_phy", 0x244, 2) + CRU_GATE(0, "pclk_ddrphy", "pclk_phy", 0x244, 3) + CRU_GATE(0, "pclk_cru", "pclk_bus", 0x244, 4) + CRU_GATE(PCLK_ACODECPHY, "pclk_acodecphy", "pclk_phy", 0x244, 5) + CRU_GATE(0, "pclk_sgrf", "pclk_bus", 0x244, 6) + CRU_GATE(PCLK_HDMIPHY, "pclk_hdmiphy", "pclk_phy", 0x244, 7) + CRU_GATE(0, "pclk_vdacphy", "pclk_bus", 0x244, 8) + /* Bit 9 unused */ + CRU_GATE(0, "pclk_sim", "pclk_bus", 0x244, 10) + CRU_GATE(HCLK_TSP, "hclk_tsp", "hclk_bus_pre", 0x244, 11) + CRU_GATE(ACLK_TSP, "aclk_tsp", "aclk_bus_pre", 0x244, 12) + /* Bit 13 clk_hsadc_0_tsp_en Depend on a gpio clock ? */ + CRU_GATE(PCLK_USB2_GRF, "pclk_usb2grf", "pclk_phy", 0x244, 14) + CRU_GATE(PCLK_SARADC, "pclk_saradc", "pclk_bus", 0x244, 15) + + /* CRU_CLKGATE_CON18 */ + /* Bit 0 unused */ + /* Bit 1 pclk_ddr_upctl_en */ + /* Bit 2 pclk_ddr_msch_en */ + /* Bit 3 pclk_ddr_mon_en */ + /* Bit 4 aclk_ddr_upctl_en */ + /* Bit 5 clk_ddr_upctl_en */ + /* Bit 6 clk_ddr_msch_en */ + /* Bit 7 pclk_ddrstdby_en */ + /* Bit 8-15 unused */ /* CRU_CLKGATE_CON19 */ CRU_GATE(HCLK_SDMMC, "hclk_sdmmc", "hclk_peri", 0x24C, 0) CRU_GATE(HCLK_SDIO, "hclk_sdio", "hclk_peri", 0x24C, 1) CRU_GATE(HCLK_EMMC, "hclk_emmc", "hclk_peri", 0x24C, 2) + /* Bit 3-5 unused */ + CRU_GATE(HCLK_HOST0, "hclk_host0", "hclk_peri", 0x24C, 6) + CRU_GATE(HCLK_HOST0_ARB, "hclk_host0_arg", "hclk_peri", 0x24C, 7) + CRU_GATE(HCLK_OTG, "hclk_otg", "hclk_peri", 0x24C, 8) + CRU_GATE(HCLK_OTG_PMU, "hclk_otg_pmu", "hclk_peri", 0x24C, 9) + /* Bit 10 unused */ + CRU_GATE(0, "aclk_peri_niu", "aclk_peri", 0x24C, 11) CRU_GATE(0, "hclk_peri_niu", "hclk_peri", 0x24C, 12) CRU_GATE(0, "pclk_peri_niu", "hclk_peri", 0x24C, 13) CRU_GATE(ACLK_USB3OTG, "aclk_usb3otg", "aclk_peri", 0x24C, 14) CRU_GATE(HCLK_SDMMC_EXT, "hclk_sdmmc_ext", "hclk_peri", 0x24C, 15) + /* CRU_CLKGATE_CON20 */ + /* unused */ + + /* CRU_CLKGATE_CON21 */ + /* Bit 0-1 unused */ + CRU_GATE(ACLK_VOP, "aclk_vop", "aclk_vop_pre", 0x254, 2) + CRU_GATE(HCLK_VOP, "hclk_vop", "hclk_vio_pre", 0x254, 3) + CRU_GATE(0, "aclk_vop_niu", "aclk_vop_pre", 0x254, 4) + CRU_GATE(0, "hclk_vop_niu", "hclk_vio_pre", 0x254, 5) + CRU_GATE(ACLK_IEP, "aclk_iep", "aclk_vio_pre", 0x254, 6) + CRU_GATE(HCLK_IEP, "hclk_iep", "hclk_vio_pre", 0x254, 7) + CRU_GATE(ACLK_CIF, "aclk_cif", "aclk_vio_pre", 0x254, 8) + CRU_GATE(HCLK_CIF, "hclk_cif", "hclk_vio_pre", 0x254, 9) + CRU_GATE(ACLK_RGA, "aclk_rga", "aclk_rga_pre", 0x254, 10) + CRU_GATE(HCLK_RGA, "hclk_rga", "hclk_vio_pre", 0x254, 11) + CRU_GATE(0, "hclk_ahb1tom", "hclk_vio_pre", 0x254, 12) + CRU_GATE(0, "pclk_vio_h2p", "hclk_vio_pre", 0x254, 13) + CRU_GATE(0, "hclk_vio_h2p", "hclk_vio_pre", 0x254, 14) + CRU_GATE(ACLK_HDCP, "aclk_hdcp", "aclk_vio_pre", 0x254, 15) + + /* CRU_CLKGATE_CON22 */ + CRU_GATE(HCLK_HDCP, "hclk_hdcp", "hclk_vio_pre", 0x258, 0) + CRU_GATE(0, "hclk_vio_niu", "hclk_vio_pre", 0x258, 1) + CRU_GATE(0, "aclk_vio_niu", "aclk_vio_pre", 0x258, 2) + CRU_GATE(0, "aclk_rga_niu", "aclk_rga_pre", 0x258, 3) + CRU_GATE(PCLK_HDMI, "pclk_hdmi", "hclk_vio_pre", 0x258, 4) + CRU_GATE(PCLK_HDCP, "pclk_hdcp", "hclk_vio_pre", 0x258, 5) + /* Bit 6-15 unused */ + + /* CRU_CLKGATE_CON23 */ + CRU_GATE(ACLK_VPU, "aclk_vpu", "aclk_vpu_pre", 0x25C, 0) + CRU_GATE(HCLK_VPU, "hclk_vpu", "hclk_vpu_pre", 0x25C, 1) + CRU_GATE(0, "aclk_vpu_niu", "aclk_vpu_pre", 0x25C, 2) + CRU_GATE(0, "hclk_vpu_niu", "hclk_vpu_pre", 0x25C, 3) + /* Bit 4-15 unused */ + + /* CRU_CLKGATE_CON24 */ + CRU_GATE(ACLK_RKVDEC, "aclk_rkvdec", "aclk_rkvdec_pre", 0x260, 0) + CRU_GATE(HCLK_RKVDEC, "hclk_rkvdec", "hclk_rkvdec_pre", 0x260, 1) + CRU_GATE(0, "aclk_rkvdec_niu", "aclk_rkvdec_pre", 0x260, 2) + CRU_GATE(0, "hclk_rkvdec_niu", "hclk_rkvdec_pre", 0x260, 3) + /* Bit 4-15 unused */ + + /* CRU_CLKGATE_CON25 */ + CRU_GATE(0, "aclk_rkvenc_niu", "aclk_rkvenc", 0x264, 0) + CRU_GATE(0, "hclk_rkvenc_niu", "hclk_rkvenc", 0x264, 1) + CRU_GATE(ACLK_H265, "aclk_h265", "aclk_rkvenc", 0x264, 2) + CRU_GATE(PCLK_H265, "pclk_h265", "hclk_rkvenc", 0x264, 3) + CRU_GATE(ACLK_H264, "aclk_h264", "aclk_rkvenc", 0x264, 4) + CRU_GATE(HCLK_H264, "hclk_h264", "hclk_rkvenc", 0x264, 5) + CRU_GATE(0, "aclk_axisram", "hclk_rkvenc", 0x264, 6) + /* Bit 7-15 unused */ + /* CRU_CLKGATE_CON26 */ - CRU_GATE(ACLK_MAC2PHY, "aclk_mac2phy", "aclk_gmac", 0x268, 0) - CRU_GATE(PCLK_MAC2PHY, "pclk_mac2phy", "pclk_gmac", 0x268, 1) - CRU_GATE(ACLK_MAC2IO, "aclk_mac2io", "aclk_gmac", 0x268, 2) - CRU_GATE(PCLK_MAC2IO, "pclk_mac2io", "pclk_gmac", 0x268, 3) + CRU_GATE(ACLK_MAC2PHY, "aclk_gmac2phy", "aclk_gmac", 0x268, 0) + CRU_GATE(PCLK_MAC2PHY, "pclk_gmac2phy", "pclk_gmac", 0x268, 1) + CRU_GATE(ACLK_MAC2IO, "aclk_gmac2io", "aclk_gmac", 0x268, 2) + CRU_GATE(PCLK_MAC2IO, "pclk_gmac2io", "pclk_gmac", 0x268, 3) + CRU_GATE(0, "aclk_gmac_niu", "aclk_gmac", 0x268, 4) + CRU_GATE(0, "pclk_gmac_niu", "pclk_gmac", 0x268, 5) + /* Bit 6-15 unused */ + + /* CRU_CLKGATE_CON27 */ + /* Bit 0 clk_ddrphy_en */ + /* Bit 1 clk4x_ddrphy_en */ /* CRU_CLKGATE_CON28 */ - CRU_GATE(PCLK_USB3PHY_OTG, "pclk_usb3phy_otg", "pclk_phy_pre", 0x270, 1) - CRU_GATE(PCLK_USB3PHY_PIPE, "pclk_usb3phy_pipe", "pclk_phy_pre", 0x270, 2) + CRU_GATE(HCLK_PDM, "hclk_pdm", "hclk_bus_pre", 0x270, 0) + CRU_GATE(PCLK_USB3PHY_OTG, "pclk_usb3phy_otg", "pclk_phy", 0x270, 1) + CRU_GATE(PCLK_USB3PHY_PIPE, "pclk_usb3phy_pipe", "pclk_phy", 0x270, 2) + CRU_GATE(0, "pclk_pmu", "pclk_bus", 0x270, 3) + CRU_GATE(0, "pclk_otp", "pclk_bus", 0x270, 4) + /* Bit 5-15 unused */ }; /* * PLLs */ -#define PLL_APLL 1 -#define PLL_DPLL 2 -#define PLL_CPLL 3 -#define PLL_GPLL 4 -#define PLL_NPLL 5 +#define PLL_RATE(_hz, _ref, _fb, _post1, _post2, _dspd, _frac) \ +{ \ + .freq = _hz, \ + .refdiv = _ref, \ + .fbdiv = _fb, \ + .postdiv1 = _post1, \ + .postdiv2 = _post2, \ + .dsmpd = _dspd, \ + .frac = _frac, \ +} static struct rk_clk_pll_rate rk3328_pll_rates[] = { - { - .freq = 1608000000, - .refdiv = 1, - .fbdiv = 67, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1584000000, - .refdiv = 1, - .fbdiv = 66, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1560000000, - .refdiv = 1, - .fbdiv = 65, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1536000000, - .refdiv = 1, - .fbdiv = 64, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1512000000, - .refdiv = 1, - .fbdiv = 63, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1488000000, - .refdiv = 1, - .fbdiv = 62, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1464000000, - .refdiv = 1, - .fbdiv = 61, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1440000000, - .refdiv = 1, - .fbdiv = 60, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1416000000, - .refdiv = 1, - .fbdiv = 59, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1392000000, - .refdiv = 1, - .fbdiv = 58, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1368000000, - .refdiv = 1, - .fbdiv = 57, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1344000000, - .refdiv = 1, - .fbdiv = 56, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1320000000, - .refdiv = 1, - .fbdiv = 55, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1296000000, - .refdiv = 1, - .fbdiv = 54, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1272000000, - .refdiv = 1, - .fbdiv = 53, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1248000000, - .refdiv = 1, - .fbdiv = 52, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1200000000, - .refdiv = 1, - .fbdiv = 50, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1188000000, - .refdiv = 2, - .fbdiv = 99, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1104000000, - .refdiv = 1, - .fbdiv = 46, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1100000000, - .refdiv = 12, - .fbdiv = 550, - .postdiv1 = 1, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1008000000, - .refdiv = 1, - .fbdiv = 84, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 1000000000, - .refdiv = 6, - .fbdiv = 500, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 984000000, - .refdiv = 1, - .fbdiv = 82, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 960000000, - .refdiv = 1, - .fbdiv = 80, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 936000000, - .refdiv = 1, - .fbdiv = 78, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 912000000, - .refdiv = 1, - .fbdiv = 76, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 900000000, - .refdiv = 4, - .fbdiv = 300, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 888000000, - .refdiv = 1, - .fbdiv = 74, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 864000000, - .refdiv = 1, - .fbdiv = 72, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 840000000, - .refdiv = 1, - .fbdiv = 70, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 816000000, - .refdiv = 1, - .fbdiv = 68, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 800000000, - .refdiv = 6, - .fbdiv = 400, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 700000000, - .refdiv = 6, - .fbdiv = 350, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 696000000, - .refdiv = 1, - .fbdiv = 58, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 600000000, - .refdiv = 1, - .fbdiv = 75, - .postdiv1 = 3, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 594000000, - .refdiv = 2, - .fbdiv = 99, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 504000000, - .refdiv = 1, - .fbdiv = 63, - .postdiv1 = 3, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 500000000, - .refdiv = 6, - .fbdiv = 250, - .postdiv1 = 2, - .postdiv2 = 1, - .dsmpd = 1, - }, - { - .freq = 408000000, - .refdiv = 1, - .fbdiv = 68, - .postdiv1 = 2, - .postdiv2 = 2, - .dsmpd = 1, - }, - { - .freq = 312000000, - .refdiv = 1, - .fbdiv = 52, - .postdiv1 = 2, - .postdiv2 = 2, - .dsmpd = 1, - }, - { - .freq = 216000000, - .refdiv = 1, - .fbdiv = 72, - .postdiv1 = 4, - .postdiv2 = 2, - .dsmpd = 1, - }, - { - .freq = 96000000, - .refdiv = 1, - .fbdiv = 64, - .postdiv1 = 4, - .postdiv2 = 4, - .dsmpd = 1, - }, + /* _mhz, _refdiv, _fbdiv, _postdiv1, _postdiv2, _dsmpd, _frac */ + PLL_RATE(1608000000, 1, 67, 1, 1, 1, 0), + PLL_RATE(1584000000, 1, 66, 1, 1, 1, 0), + PLL_RATE(1560000000, 1, 65, 1, 1, 1, 0), + PLL_RATE(1536000000, 1, 64, 1, 1, 1, 0), + PLL_RATE(1512000000, 1, 63, 1, 1, 1, 0), + PLL_RATE(1488000000, 1, 62, 1, 1, 1, 0), + PLL_RATE(1464000000, 1, 61, 1, 1, 1, 0), + PLL_RATE(1440000000, 1, 60, 1, 1, 1, 0), + PLL_RATE(1416000000, 1, 59, 1, 1, 1, 0), + PLL_RATE(1392000000, 1, 58, 1, 1, 1, 0), + PLL_RATE(1368000000, 1, 57, 1, 1, 1, 0), + PLL_RATE(1344000000, 1, 56, 1, 1, 1, 0), + PLL_RATE(1320000000, 1, 55, 1, 1, 1, 0), + PLL_RATE(1296000000, 1, 54, 1, 1, 1, 0), + PLL_RATE(1272000000, 1, 53, 1, 1, 1, 0), + PLL_RATE(1248000000, 1, 52, 1, 1, 1, 0), + PLL_RATE(1200000000, 1, 50, 1, 1, 1, 0), + PLL_RATE(1188000000, 2, 99, 1, 1, 1, 0), + PLL_RATE(1104000000, 1, 46, 1, 1, 1, 0), + PLL_RATE(1100000000, 12, 550, 1, 1, 1, 0), + PLL_RATE(1008000000, 1, 84, 2, 1, 1, 0), + PLL_RATE(1000000000, 6, 500, 2, 1, 1, 0), + PLL_RATE(984000000, 1, 82, 2, 1, 1, 0), + PLL_RATE(960000000, 1, 80, 2, 1, 1, 0), + PLL_RATE(936000000, 1, 78, 2, 1, 1, 0), + PLL_RATE(912000000, 1, 76, 2, 1, 1, 0), + PLL_RATE(900000000, 4, 300, 2, 1, 1, 0), + PLL_RATE(888000000, 1, 74, 2, 1, 1, 0), + PLL_RATE(864000000, 1, 72, 2, 1, 1, 0), + PLL_RATE(840000000, 1, 70, 2, 1, 1, 0), + PLL_RATE(816000000, 1, 68, 2, 1, 1, 0), + PLL_RATE(800000000, 6, 400, 2, 1, 1, 0), + PLL_RATE(700000000, 6, 350, 2, 1, 1, 0), + PLL_RATE(696000000, 1, 58, 2, 1, 1, 0), + PLL_RATE(600000000, 1, 75, 3, 1, 1, 0), + PLL_RATE(594000000, 2, 99, 2, 1, 1, 0), *** 1373 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Wed Sep 15 17:11:07 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5795266AD9B; Wed, 15 Sep 2021 17:11:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8mvb1xNQz3q5R; Wed, 15 Sep 2021 17:11:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 230B511E42; Wed, 15 Sep 2021 17:11:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FHB77Q075915; Wed, 15 Sep 2021 17:11:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FHB7Mo075914; Wed, 15 Sep 2021 17:11:07 GMT (envelope-from git) Date: Wed, 15 Sep 2021 17:11:07 GMT Message-Id: <202109151711.18FHB7Mo075914@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 548a706608d7 - main - arm64: rockchip: rk3328: Add watchdog clock MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 548a706608d7291a72ed37e6c400654ee1ceadef Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 17:11:07 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=548a706608d7291a72ed37e6c400654ee1ceadef commit 548a706608d7291a72ed37e6c400654ee1ceadef Author: Emmanuel Vadot AuthorDate: 2021-09-15 17:09:56 +0000 Commit: Emmanuel Vadot CommitDate: 2021-09-15 17:09:56 +0000 arm64: rockchip: rk3328: Add watchdog clock The watchdog clock is controlled by the secure world but we need a clock to sastify the driver so add a fixed clock for it. Reported by: avg --- sys/arm64/rockchip/clk/rk3328_cru.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/arm64/rockchip/clk/rk3328_cru.c b/sys/arm64/rockchip/clk/rk3328_cru.c index 344bf3bcd7aa..63c8797f6b44 100644 --- a/sys/arm64/rockchip/clk/rk3328_cru.c +++ b/sys/arm64/rockchip/clk/rk3328_cru.c @@ -1064,6 +1064,11 @@ static struct rk_clk rk3328_clks[] = { /* GRF_MAC_CON2 */ MUXGRF(SCLK_MAC2PHY, "clk_mac2phy", mux_mac2phy_p, 0, RK3328_GRF_MAC_CON2, 10, 1), + + /* + * This clock is controlled in the secure world + */ + FFACT(PCLK_WDT, "pclk_wdt", "pclk_bus", 1, 1), }; static int From owner-dev-commits-src-all@freebsd.org Wed Sep 15 17:32:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 63D0266AEA6; Wed, 15 Sep 2021 17:32:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8nN92MLJz4Qy1; Wed, 15 Sep 2021 17:32:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 96E0826970; Wed, 15 Sep 2021 17:32:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: 1ecbc1d8e9d3 - main - cxgbe tom: Don't queue AIO requests on listen sockets. To: Alan Somers Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202109142046.18EKkfEN043871@gitrepo.freebsd.org> From: John Baldwin Message-ID: <0cec1c04-0b42-6297-37c5-43d1dcb0f8d5@FreeBSD.org> Date: Wed, 15 Sep 2021 10:32:23 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 17:32:25 -0000 On 9/15/21 8:47 AM, Alan Somers wrote: > On Wed, Sep 15, 2021 at 9:21 AM John Baldwin wrote: > >> On 9/14/21 1:53 PM, Alan Somers wrote: >>> On Tue, Sep 14, 2021 at 2:46 PM John Baldwin wrote: >>> >>>> The branch main has been updated by jhb: >>>> >>>> URL: >>>> >> https://cgit.FreeBSD.org/src/commit/?id=1ecbc1d8e9d3fbcd8e68fc68f0a32944a12ddb1e >>>> >>>> commit 1ecbc1d8e9d3fbcd8e68fc68f0a32944a12ddb1e >>>> Author: John Baldwin >>>> AuthorDate: 2021-09-14 20:46:14 +0000 >>>> Commit: John Baldwin >>>> CommitDate: 2021-09-14 20:46:14 +0000 >>>> >>>> cxgbe tom: Don't queue AIO requests on listen sockets. >>>> >>>> This is similar to the fixes in 141fe2dceeae. One difference is >> that >>>> TOE sockets do not change states (listen vs non-listen) once >> created, >>>> so no lock is needed for SOLISTENING(). >>>> >>>> Sponsored by: Chelsio Communications >>>> >>> >>> I've always wondered: what's the point to using AIO with sockets? Can't >>> everything socket-related be done better with non-blocking read/write and >>> kqueue? >> >> Zero-copy operation with TOE is why TOE uses AIO. Zero-copy of user >> buffers >> can't really work with the non-AIO APIs because the user buffer is free to >> be reused immediately after write(2) (and on the read side you don't know >> the buffer in advance to allow the NIC to write directly into the use >> buffer). >> >> In theory we could support zero-copy using mb_ext_pgs for aio_write() for >> the non-TOE case similar to what sendfile() does. >> >> -- >> John Baldwin >> > > Interesting. Do you know of any common applications that include this > optimization? I've been working on the AIO ecosystem for Rust. It would > be good to ensure that this use case works, especially if zero-copy ever > works for non-TOE. I do not, and I rely on patches I merged upstream to netperf (-a and -A flags) to test it. I believe there might be some proprietary bits in some FreeBSD downstreams that might make use of this. -- John Baldwin From owner-dev-commits-src-all@freebsd.org Wed Sep 15 18:05:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C011066B8E8; Wed, 15 Sep 2021 18:05:37 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8p6T4tDVz4Zlc; Wed, 15 Sep 2021 18:05:37 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ot1-f46.google.com with SMTP id c19-20020a9d6153000000b0051829acbfc7so4695370otk.9; Wed, 15 Sep 2021 11:05:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Rhv3BGY+iQs7Qdr6kHU4pe9RrH2U5GQzNe4ywNrGZeA=; b=xIe6Vaf11N6Tpd6ck4dAlrGHHVfUD5Bcryoy+wW8vR266ka+unfXXzY2n+fFmIUsbJ g2Mm7Ot1b3YQmvjiBwaLdQKKQFThQMpcSF07IKA7TSEA2bGnCEpkxOLf8khQpK5didPB rP7TdDQ5OPK05LSLCcrJ7FiSc2znk2a1quuVfD4Zh37wI9uJfQIaKzV3/ErsQtkoZqS1 IbY3V4yet+Iw24qbv8+in1wYGYUv0jC1/HKl1z2Ub3p55RmqigXbZtibM0/tYozbVCQH SBEioEkxH0JBJRznjvB3UF+iNnzq8h8wSRlN48vaEorEG6Rj2pnuw1vBsw/zcm2tJ4LK vZ/A== X-Gm-Message-State: AOAM532ZDWTlKLda2n1MiG2zBYHPfa3GlEjtYe4pu6mx1lR4XeC0QhFB T6Rdimz/nOQcNUSyxvAbw4ghQbaL1nHmWlwC9FIHKLy9k5Q= X-Google-Smtp-Source: ABdhPJxbl642Pxm4oeR/MJkGybc5ZoyI1DuO3xtzbdHoLq7DgvnefwJAQDNwFZ9MR7s1DYmmj2FhXdGLPWaSzca3dps= X-Received: by 2002:a9d:7159:: with SMTP id y25mr1100127otj.371.1631729130789; Wed, 15 Sep 2021 11:05:30 -0700 (PDT) MIME-Version: 1.0 References: <202109142046.18EKkfEN043871@gitrepo.freebsd.org> <0cec1c04-0b42-6297-37c5-43d1dcb0f8d5@FreeBSD.org> In-Reply-To: <0cec1c04-0b42-6297-37c5-43d1dcb0f8d5@FreeBSD.org> From: Alan Somers Date: Wed, 15 Sep 2021 12:05:19 -0600 Message-ID: Subject: Re: git: 1ecbc1d8e9d3 - main - cxgbe tom: Don't queue AIO requests on listen sockets. To: John Baldwin Cc: src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4H8p6T4tDVz4Zlc X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 18:05:37 -0000 On Wed, Sep 15, 2021 at 11:32 AM John Baldwin wrote: > On 9/15/21 8:47 AM, Alan Somers wrote: > > On Wed, Sep 15, 2021 at 9:21 AM John Baldwin wrote: > > > >> On 9/14/21 1:53 PM, Alan Somers wrote: > >>> On Tue, Sep 14, 2021 at 2:46 PM John Baldwin wrote: > >>> > >>>> The branch main has been updated by jhb: > >>>> > >>>> URL: > >>>> > >> > https://cgit.FreeBSD.org/src/commit/?id=1ecbc1d8e9d3fbcd8e68fc68f0a32944a12ddb1e > >>>> > >>>> commit 1ecbc1d8e9d3fbcd8e68fc68f0a32944a12ddb1e > >>>> Author: John Baldwin > >>>> AuthorDate: 2021-09-14 20:46:14 +0000 > >>>> Commit: John Baldwin > >>>> CommitDate: 2021-09-14 20:46:14 +0000 > >>>> > >>>> cxgbe tom: Don't queue AIO requests on listen sockets. > >>>> > >>>> This is similar to the fixes in 141fe2dceeae. One difference is > >> that > >>>> TOE sockets do not change states (listen vs non-listen) once > >> created, > >>>> so no lock is needed for SOLISTENING(). > >>>> > >>>> Sponsored by: Chelsio Communications > >>>> > >>> > >>> I've always wondered: what's the point to using AIO with sockets? > Can't > >>> everything socket-related be done better with non-blocking read/write > and > >>> kqueue? > >> > >> Zero-copy operation with TOE is why TOE uses AIO. Zero-copy of user > >> buffers > >> can't really work with the non-AIO APIs because the user buffer is free > to > >> be reused immediately after write(2) (and on the read side you don't > know > >> the buffer in advance to allow the NIC to write directly into the use > >> buffer). > >> > >> In theory we could support zero-copy using mb_ext_pgs for aio_write() > for > >> the non-TOE case similar to what sendfile() does. > >> > >> -- > >> John Baldwin > >> > > > > Interesting. Do you know of any common applications that include this > > optimization? I've been working on the AIO ecosystem for Rust. It would > > be good to ensure that this use case works, especially if zero-copy ever > > works for non-TOE. > > I do not, and I rely on patches I merged upstream to netperf (-a and -A > flags) > to test it. I believe there might be some proprietary bits in some FreeBSD > downstreams that might make use of this. > > -- > John Baldwin > Do you mean these -a and -A flags, or am I looking in the wrong place? -a sizespec Alter the send and receive buffer alignments on the local system. This defaults to 8 bytes. -A sizespec As -a, but for the remote system. From owner-dev-commits-src-all@freebsd.org Wed Sep 15 18:11:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD37A66B922; Wed, 15 Sep 2021 18:11:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8pF65TY9z4c0q; Wed, 15 Sep 2021 18:11:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CBED12D0B; Wed, 15 Sep 2021 18:11:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FIBMqe058303; Wed, 15 Sep 2021 18:11:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FIBMps058298; Wed, 15 Sep 2021 18:11:22 GMT (envelope-from git) Date: Wed, 15 Sep 2021 18:11:22 GMT Message-Id: <202109151811.18FIBMps058298@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Emmanuel Vadot Subject: git: 78bf40e10c5a - main - arm: rockchip: rk3288: Use the macros that already exists in rk_cru.h MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: manu X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 78bf40e10c5a1504ba364abc068893de431263d4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 18:11:22 -0000 The branch main has been updated by manu: URL: https://cgit.FreeBSD.org/src/commit/?id=78bf40e10c5a1504ba364abc068893de431263d4 commit 78bf40e10c5a1504ba364abc068893de431263d4 Author: Emmanuel Vadot AuthorDate: 2021-09-15 18:10:42 +0000 Commit: Emmanuel Vadot CommitDate: 2021-09-15 18:10:42 +0000 arm: rockchip: rk3288: Use the macros that already exists in rk_cru.h --- sys/arm64/rockchip/clk/rk3288_cru.c | 103 +----------------------------------- 1 file changed, 2 insertions(+), 101 deletions(-) diff --git a/sys/arm64/rockchip/clk/rk3288_cru.c b/sys/arm64/rockchip/clk/rk3288_cru.c index 6a8c63137df7..3f4a59864545 100644 --- a/sys/arm64/rockchip/clk/rk3288_cru.c +++ b/sys/arm64/rockchip/clk/rk3288_cru.c @@ -491,36 +491,6 @@ static struct rk_clk_armclk_rates rk3288_armclk_rates[] = { { 126000000, 1}, }; - -/* Fixed rate clock. */ -#define FRATE(_id, _name, _freq) \ -{ \ - .type = RK_CLK_FIXED, \ - .clk.fixed = &(struct clk_fixed_def) { \ - .clkdef.id = _id, \ - .clkdef.name = _name, \ - .clkdef.parent_names = NULL, \ - .clkdef.parent_cnt = 0, \ - .clkdef.flags = CLK_NODE_STATIC_STRINGS, \ - .freq = _freq, \ - }, \ -} - -/* Fixed rate multipier/divider. */ -#define FACT(_id, _name, _pname, _mult, _div) \ -{ \ - .type = RK_CLK_FIXED, \ - .clk.fixed = &(struct clk_fixed_def) { \ - .clkdef.id = _id, \ - .clkdef.name = _name, \ - .clkdef.parent_names = (const char *[]){_pname}, \ - .clkdef.parent_cnt = 1, \ - .clkdef.flags = CLK_NODE_STATIC_STRINGS, \ - .mult = _mult, \ - .div = _div, \ - }, \ -} - /* Standard PLL. */ #define PLL(_id, _name, _base, _shift) \ { \ @@ -538,23 +508,6 @@ static struct rk_clk_armclk_rates rk3288_armclk_rates[] = { }, \ } -/* Multiplexer. */ -#define MUX(_id, _name, _pn, _f, _mo, _ms, _mw) \ -{ \ - .type = RK_CLK_MUX, \ - .clk.mux = &(struct rk_clk_mux_def) { \ - .clkdef.id = _id, \ - .clkdef.name = _name, \ - .clkdef.parent_names = _pn, \ - .clkdef.parent_cnt = nitems(_pn), \ - .clkdef.flags = CLK_NODE_STATIC_STRINGS, \ - .offset = CRU_CLKSEL_CON(_mo), \ - .shift = _ms, \ - .width = _mw, \ - .mux_flags = _f, \ - }, \ -} - #define ARMDIV(_id, _name, _pn, _r, _o, _ds, _dw, _ms, _mw, _mp, _ap) \ { \ .type = RK_CLK_ARMCLK, \ @@ -576,58 +529,6 @@ static struct rk_clk_armclk_rates rk3288_armclk_rates[] = { }, \ } -/* Fixed rate multipier/divider. */ -#define FRACT(_id, _name, _pname, _f, _o) \ -{ \ - .type = RK_CLK_FRACT, \ - .clk.fract = &(struct rk_clk_fract_def) { \ - .clkdef.id = _id, \ - .clkdef.name = _name, \ - .clkdef.parent_names = (const char *[]){_pname}, \ - .clkdef.parent_cnt = 1, \ - .clkdef.flags = CLK_NODE_STATIC_STRINGS, \ - .offset = CRU_CLKSEL_CON(_o), \ - .flags = _f, \ - }, \ -} - -/* Full composite clock. */ -#define COMP(_id, _name, _pnames, _f, _o, _ds, _dw, _ms, _mw) \ -{ \ - .type = RK_CLK_COMPOSITE, \ - .clk.composite = &(struct rk_clk_composite_def) { \ - .clkdef.id = _id, \ - .clkdef.name = _name, \ - .clkdef.parent_names = _pnames, \ - .clkdef.parent_cnt = nitems(_pnames), \ - .clkdef.flags = CLK_NODE_STATIC_STRINGS, \ - .muxdiv_offset = CRU_CLKSEL_CON(_o), \ - .mux_shift = _ms, \ - .mux_width = _mw, \ - .div_shift = _ds, \ - .div_width = _dw, \ - .flags = RK_CLK_COMPOSITE_HAVE_MUX | _f, \ - }, \ -} - -/* Composite clock without mux (divider olnly). */ -#define CDIV(_id, _name, _pname, _f, _o, _ds, _dw) \ -{ \ - .type = RK_CLK_COMPOSITE, \ - .clk.composite = &(struct rk_clk_composite_def) { \ - .clkdef.id = _id, \ - .clkdef.name = _name, \ - .clkdef.parent_names = (const char *[]){_pname}, \ - .clkdef.parent_cnt = 1, \ - .clkdef.flags = CLK_NODE_STATIC_STRINGS, \ - .muxdiv_offset = CRU_CLKSEL_CON(_o), \ - .div_shift = _ds, \ - .div_width = _dw, \ - .flags = _f, \ - }, \ -} - - #define PLIST(_name) static const char *_name[] PLIST(pll_src_p) = {"xin24m", "xin24m", "xin32k"}; PLIST(armclk_p)= {"apll_core", "gpll_core"}; @@ -680,8 +581,8 @@ static struct rk_clk rk3288_clks[] = { FRATE(0, "aclk_vcodec_pre", 0), /* Fixed dividers */ - FACT(0, "xin12m", "xin24m", 1, 2), - FACT(0, "hclk_vcodec_pre_s", "aclk_vcodec_pre", 1, 4), + FFACT(0, "xin12m", "xin24m", 1, 2), + FFACT(0, "hclk_vcodec_pre_s", "aclk_vcodec_pre", 1, 4), PLL(PLL_APLL, "apll", CRU_APLL_CON(0), 0), PLL(PLL_DPLL, "dpll", CRU_DPLL_CON(0), 4), From owner-dev-commits-src-all@freebsd.org Wed Sep 15 18:25:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77E8766BA26; Wed, 15 Sep 2021 18:25:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8pYT1vr0z4gJF; Wed, 15 Sep 2021 18:25:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 221C712BB9; Wed, 15 Sep 2021 18:25:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FIPXgd072944; Wed, 15 Sep 2021 18:25:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FIPXNd072943; Wed, 15 Sep 2021 18:25:33 GMT (envelope-from git) Date: Wed, 15 Sep 2021 18:25:33 GMT Message-Id: <202109151825.18FIPXNd072943@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Leandro Lupori Subject: git: a58abcde2c83 - main - powerpc64: change CAS to support Radix MMU MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: luporl X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a58abcde2c83b71e5bf19575750564f7bff78833 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 18:25:33 -0000 The branch main has been updated by luporl: URL: https://cgit.FreeBSD.org/src/commit/?id=a58abcde2c83b71e5bf19575750564f7bff78833 commit a58abcde2c83b71e5bf19575750564f7bff78833 Author: Leandro Lupori AuthorDate: 2021-09-15 18:12:37 +0000 Commit: Leandro Lupori CommitDate: 2021-09-15 18:24:40 +0000 powerpc64: change CAS to support Radix MMU Use radix_mmu environment variable to select between Hash or Radix MMU, when performing the CAS method call. This matches kernel's behavior, by selecting Hash MMU by default and Radix if radix_mmu is not zero, to make sure that both loader and kernel always select the same MMU. The device tree is queried to detect Radix/GTSE support and to find out if CAS is supported, making the old CPU version and HV bit checks unnecessary now. Reviewed by: jhibbits MFC after: 2 weeks Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D31951 --- stand/powerpc/ofw/cas.c | 120 +++++++++++++++++++++++++++++------------------- 1 file changed, 74 insertions(+), 46 deletions(-) diff --git a/stand/powerpc/ofw/cas.c b/stand/powerpc/ofw/cas.c index 96d276386b71..4f36a147f36d 100644 --- a/stand/powerpc/ofw/cas.c +++ b/stand/powerpc/ofw/cas.c @@ -29,6 +29,13 @@ __FBSDID("$FreeBSD$"); #include #include +/* #define CAS_DEBUG */ +#ifdef CAS_DEBUG +#define DPRINTF(fmt, ...) printf(fmt, ## __VA_ARGS__) +#else +#define DPRINTF(fmt, ...) do { ; } while (0) +#endif + /* PVR */ #define PVR_CPU_P8E 0x004b0000 #define PVR_CPU_P8NVL 0x004c0000 @@ -83,13 +90,19 @@ __FBSDID("$FreeBSD$"); #define OV5_INTC_XICS 0 /* byte 24: MMU */ +#define OV5_MMU_INDEX 24 #define OV5_MMU_HPT 0 +#define OV5_MMU_RADIX 0x40 +#define OV5_MMU_EITHER 0x80 +#define OV5_MMU_DYNAMIC 0xc0 /* byte 25: HPT MMU Extensions */ -#define OV5_HPT_EXT_NONE 0 +#define OV5_HPT_EXT_INDEX 25 +#define OV5_HPT_GTSE 0x40 /* byte 26: Radix MMU Extensions */ -#define OV5_RPT_EXT_NONE 0 +#define OV5_RADIX_EXT_INDEX 26 +#define OV5_RADIX_GTSE 0x40 struct pvr { @@ -163,69 +176,84 @@ static struct ibm_arch_vec { 0, /* DRMEM_V2 */ OV5_INTC_XICS, OV5_MMU_HPT, - OV5_HPT_EXT_NONE, - OV5_RPT_EXT_NONE + 0, + 0 } }; -static __inline register_t -mfpvr(void) -{ - register_t value; - - __asm __volatile ("mfpvr %0" : "=r"(value)); - - return (value); -} - -static __inline int -ppc64_hv(void) -{ - int hv; - - /* PSL_HV is bit 3 of 64-bit MSR */ - __asm __volatile ("mfmsr %0\n\t" - "rldicl %0,%0,4,63" : "=r"(hv)); - - return (hv); -} - int ppc64_cas(void) { - int rc; - ihandle_t ihandle; + phandle_t pkg; + ihandle_t inst; cell_t err; + uint8_t buf[16], idx, val; + int i, len, rc, radix_mmu; + const char *var; + char *ov5; + + pkg = OF_finddevice("/chosen"); + if (pkg == -1) { + printf("cas: couldn't find /chosen\n"); + return (-1); + } + + len = OF_getprop(pkg, "ibm,arch-vec-5-platform-support", buf, + sizeof(buf)); + if (len == -1) + /* CAS not supported */ + return (0); - /* Perform CAS only for POWER8 and later cores */ - switch (mfpvr() & PVR_CPU_MASK) { - case PVR_CPU_P8: - case PVR_CPU_P8E: - case PVR_CPU_P8NVL: - case PVR_CPU_P9: + radix_mmu = 0; + ov5 = ibm_arch_vec.vec5.data; + for (i = 0; i < len; i += 2) { + idx = buf[i]; + val = buf[i + 1]; + DPRINTF("idx 0x%02x val 0x%02x\n", idx, val); + + switch (idx) { + case OV5_MMU_INDEX: + /* + * Note that testing for OV5_MMU_RADIX/OV5_MMU_EITHER + * also covers OV5_MMU_DYNAMIC. + */ + if ((val & OV5_MMU_RADIX) || (val & OV5_MMU_EITHER)) + radix_mmu = 1; break; + + case OV5_RADIX_EXT_INDEX: + if (val & OV5_RADIX_GTSE) + ov5[idx] = OV5_RADIX_GTSE; + break; + + case OV5_HPT_EXT_INDEX: default: - return (0); + break; + } } - /* Skip CAS when running on PowerNV */ - if (ppc64_hv()) - return (0); + if (radix_mmu && (var = getenv("radix_mmu")) != NULL && var[0] != '0') + ov5[OV5_MMU_INDEX] = OV5_MMU_RADIX; + else + radix_mmu = 0; - ihandle = OF_open("/"); - if (ihandle == -1) { + inst = OF_open("/"); + if (inst == -1) { printf("cas: failed to open / node\n"); return (-1); } - if (rc = OF_call_method("ibm,client-architecture-support", - ihandle, 1, 1, &ibm_arch_vec, &err)) - printf("cas: failed to call CAS method\n"); - else if (err) { - printf("cas: error: 0x%08lX\n", err); + DPRINTF("MMU 0x%02x RADIX_EXT 0x%02x\n", + ov5[OV5_MMU_INDEX], ov5[OV5_RADIX_EXT_INDEX]); + rc = OF_call_method("ibm,client-architecture-support", + inst, 1, 1, &ibm_arch_vec, &err); + if (rc != 0 || err) { + printf("cas: CAS method returned an error: rc %d err %jd\n", + rc, (intmax_t)err); rc = -1; } - OF_close(ihandle); + OF_close(inst); + printf("cas: selected %s MMU\n", radix_mmu ? "radix" : "hash"); return (rc); } From owner-dev-commits-src-all@freebsd.org Wed Sep 15 19:00:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3F8E66C6A9; Wed, 15 Sep 2021 19:00:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8qKX47Zfz4qGS; Wed, 15 Sep 2021 19:00:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E56C135D8; Wed, 15 Sep 2021 19:00:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FJ0G99019651; Wed, 15 Sep 2021 19:00:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FJ0Ghl019644; Wed, 15 Sep 2021 19:00:16 GMT (envelope-from git) Date: Wed, 15 Sep 2021 19:00:16 GMT Message-Id: <202109151900.18FJ0Ghl019644@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alan Somers Subject: git: ff33e5c83fa8 - main - stress2: replace fuse.ko with fusefs.ko MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: asomers X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ff33e5c83fa8448aa9a594783f20f501942087f0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 19:00:16 -0000 The branch main has been updated by asomers: URL: https://cgit.FreeBSD.org/src/commit/?id=ff33e5c83fa8448aa9a594783f20f501942087f0 commit ff33e5c83fa8448aa9a594783f20f501942087f0 Author: Alan Somers AuthorDate: 2021-09-14 22:00:53 +0000 Commit: Alan Somers CommitDate: 2021-09-15 18:59:21 +0000 stress2: replace fuse.ko with fusefs.ko It got renamed in FreeBSD 13 Reviewed by: pho MFC after: 2 weeks Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D31963 --- tools/test/stress2/misc/fuse.sh | 2 +- tools/test/stress2/misc/fuse2.sh | 4 ++-- tools/test/stress2/misc/fuse3.sh | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/test/stress2/misc/fuse.sh b/tools/test/stress2/misc/fuse.sh index 682fdb122845..08c63996a81b 100755 --- a/tools/test/stress2/misc/fuse.sh +++ b/tools/test/stress2/misc/fuse.sh @@ -33,7 +33,7 @@ . ../default.cfg [ -z "`type mkntfs 2>/dev/null`" ] && exit 0 -[ -c /dev/fuse ] || kldload fuse.ko +[ -c /dev/fuse ] || kldload fusefs.ko MOUNT=/usr/local/bin/ntfs-3g diff --git a/tools/test/stress2/misc/fuse2.sh b/tools/test/stress2/misc/fuse2.sh index 3bd54fa080f5..d155386972c1 100755 --- a/tools/test/stress2/misc/fuse2.sh +++ b/tools/test/stress2/misc/fuse2.sh @@ -32,11 +32,11 @@ [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 [ -z "`type mkntfs 2>/dev/null`" ] && exit 0 -[ -c /dev/fuse ] || kldload fuse.ko +[ -c /dev/fuse ] || kldload fusefs.ko . ../default.cfg -[ -c /dev/fuse ] || kldload fuse.ko +[ -c /dev/fuse ] || kldload fusefs.ko MOUNT=/usr/local/bin/ntfs-3g mounts=15 # Number of parallel scripts mdstart=$mdstart # Use md unit numbers from this point diff --git a/tools/test/stress2/misc/fuse3.sh b/tools/test/stress2/misc/fuse3.sh index d11e9f4140f7..9da6f92b175f 100755 --- a/tools/test/stress2/misc/fuse3.sh +++ b/tools/test/stress2/misc/fuse3.sh @@ -36,7 +36,7 @@ sleep 10 while pgrep -q swap; do - kldload fuse.ko - kldunload fuse.ko + kldload fusefs.ko + kldunload fusefs.ko done wait From owner-dev-commits-src-all@freebsd.org Wed Sep 15 19:20:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 530BF66CC09; Wed, 15 Sep 2021 19:20:53 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8qnK11XSz3C6r; Wed, 15 Sep 2021 19:20:53 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by mail-pl1-x62f.google.com with SMTP id d18so2230384pll.11; Wed, 15 Sep 2021 12:20:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=NRaYvUmtdIz9Cg5c1vWT0Sj1Hh9plnsyXaItoGi+kXA=; b=dtduJffXb9IBko8BuCejD3aQm8xV+9WMXECYtFpruHQxLpHIVv/6Y1GhxOeBwzPx/m Tvn3otepGUl2/8jYuT4x+dVrDBjISBmdfkye8+kZsnBnh5G+zkP03407JdVfvG2jUhT/ lV03BX1Qw1JbhqhnkovRPOu4omdI57jqGHj23CFByqzeeSpRf0TGG9/I1z/dS6NDHAvo KqldvsCLwnUvm6zxfPK6HL9M08YXfYhAFJW9Lki82KSqwuExMqIPk3MiG+o3xqezUHin r2voh+CsSD3GVRheTMHFVXfYziamqwECiwVogI6yc6uXsOaZVXDRUWQSJ4iTdETxv6TJ MdUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=NRaYvUmtdIz9Cg5c1vWT0Sj1Hh9plnsyXaItoGi+kXA=; b=7BUDmKoTnUUUt40PGV7nSxvzpuIl/OJLQ7mv1sVWwM0L5CuQmbILXFNKJEaqe5Emej 6/Qdco3C9loIG3KYR8+O/0bC36I1WQ/DZfi/4QDSwwNumRq1vXoqtBSYYg+7felDtBg6 D2U67r9Q9L3c/gAljOUUyqlyW4yZzU7ocgfrP0zPZk4Vt6uLZrMVzIuP1Q9bCv7q/hMs 9W8KptflV7KVrmxBsiZj3j2pGLu5ZtuIqDPQlCFDnkrWMybMqUK38XjbOEKwePw2Dw5Y rwtCLxmcN4mUtyfFdk67HCNAwAgplnX+vqeaAPztMIf6MHX+WEAkxN1Kg9NutzYhENu3 GaJw== X-Gm-Message-State: AOAM533d2IZKt5c9TUAfXz07BDJawKuaQKytXkYgrC1MddNSiNOmPtkO UK4xPbexdI/VA+XWQuBVyDNL2vRQGyM= X-Google-Smtp-Source: ABdhPJyfqlvrimhuON4TVP7VY6iIZCiHwtLTkTVpXh7A3UChMLE+E/2+v667daKF8bgpL0yetURyLQ== X-Received: by 2002:a17:90b:80a:: with SMTP id bk10mr1415805pjb.127.1631733651792; Wed, 15 Sep 2021 12:20:51 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [12.32.117.8]) by smtp.googlemail.com with ESMTPSA id c23sm645447pgb.74.2021.09.15.12.20.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Sep 2021 12:20:51 -0700 (PDT) Sender: Navdeep Parhar Subject: Re: git: 1ecbc1d8e9d3 - main - cxgbe tom: Don't queue AIO requests on listen sockets. To: Alan Somers , John Baldwin Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202109142046.18EKkfEN043871@gitrepo.freebsd.org> <0cec1c04-0b42-6297-37c5-43d1dcb0f8d5@FreeBSD.org> From: Navdeep Parhar Message-ID: Date: Wed, 15 Sep 2021 12:20:45 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4H8qnK11XSz3C6r X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 19:20:53 -0000 On 9/15/21 11:05 AM, Alan Somers wrote: > On Wed, Sep 15, 2021 at 11:32 AM John Baldwin > wrote: >=20 > On 9/15/21 8:47 AM, Alan Somers wrote: > > On Wed, Sep 15, 2021 at 9:21 AM John Baldwin > wrote: > > > >> On 9/14/21 1:53 PM, Alan Somers wrote: > >>> On Tue, Sep 14, 2021 at 2:46 PM John Baldwin > wrote: > >>> > >>>> The branch main has been updated by jhb: > >>>> > >>>> URL: > >>>> > >> > https://cgit.FreeBSD.org/src/commit/?id=3D1ecbc1d8e9d3fbcd8e68fc68f= 0a32944a12ddb1e > > >>>> > >>>> commit 1ecbc1d8e9d3fbcd8e68fc68f0a32944a12ddb1e > >>>> Author:=C2=A0 =C2=A0 =C2=A0John Baldwin > >>>> AuthorDate: 2021-09-14 20:46:14 +0000 > >>>> Commit:=C2=A0 =C2=A0 =C2=A0John Baldwin > >>>> CommitDate: 2021-09-14 20:46:14 +0000 > >>>> > >>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0cxgbe tom: Don't queue AIO requests= on listen sockets. > >>>> > >>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0This is similar to the fixes in 141= fe2dceeae.=C2=A0 One > difference is > >> that > >>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0TOE sockets do not change states (l= isten vs non-listen) once > >> created, > >>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0so no lock is needed for SOLISTENIN= G(). > >>>> > >>>>=C2=A0 =C2=A0 =C2=A0 =C2=A0Sponsored by:=C2=A0 =C2=A0Chelsio C= ommunications > >>>> > >>> > >>> I've always wondered: what's the point to using AIO with > sockets?=C2=A0 Can't > >>> everything socket-related be done better with non-blocking > read/write and > >>> kqueue? > >> > >> Zero-copy operation with TOE is why TOE uses AIO.=C2=A0 Zero-co= py of user > >> buffers > >> can't really work with the non-AIO APIs because the user buffer= > is free to > >> be reused immediately after write(2) (and on the read side you > don't know > >> the buffer in advance to allow the NIC to write directly into > the use > >> buffer). > >> > >> In theory we could support zero-copy using mb_ext_pgs for > aio_write() for > >> the non-TOE case similar to what sendfile() does. > >> > >> -- > >> John Baldwin > >> > > > > Interesting.=C2=A0 Do you know of any common applications that i= nclude > this > > optimization?=C2=A0 I've been working on the AIO ecosystem for R= ust.=20 > It would > > be good to ensure that this use case works, especially if > zero-copy ever > > works for non-TOE. >=20 > I do not, and I rely on patches I merged upstream to netperf (-a an= d > -A flags) > to test it.=C2=A0 I believe there might be some proprietary bits in= some > FreeBSD > downstreams that might make use of this. >=20 > --=20 > John Baldwin >=20 >=20 > Do you mean these -a and -A flags, or am I looking in the wrong place? > =C2=A0 =C2=A0 =C2=A0=C2=A0 -a sizespec > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Alter the send and re= ceive buffer alignments on the local > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 system.=C2=A0 This de= faults to 8 bytes. >=20 > =C2=A0 =C2=A0 =C2=A0 =C2=A0-A sizespec > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 As -a, but for the re= mote system. The aio options are available for the TCP tests but you might have to=20 build netperf with a non-default option (that's what I had to do a long=20 time back and I haven't checked if it's still needed). # netperf -t TCP_STREAM -- -h =2E.. TCP/UDP BSD Sockets Test Options: -a Use aio_write(2) -A Use aio_read(2) =2E.. # pkg options netperf netperf - EXAMPLES: off netperf - EXS: on netperf - HISTOGRAM: on netperf - INFO: off netperf - OMNI: off netperf - SCTP: on netperf - SOCKETS: on Regards, Navdeep From owner-dev-commits-src-all@freebsd.org Wed Sep 15 20:29:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E29D166D70E; Wed, 15 Sep 2021 20:29:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8sJJ5jnVz3m13; Wed, 15 Sep 2021 20:29:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C1AF14570; Wed, 15 Sep 2021 20:29:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FKTKZ3033174; Wed, 15 Sep 2021 20:29:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FKTKF4033173; Wed, 15 Sep 2021 20:29:20 GMT (envelope-from git) Date: Wed, 15 Sep 2021 20:29:20 GMT Message-Id: <202109152029.18FKTKF4033173@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 529364b032d7 - main - iscsi: Add a helper routine to abort a data-out task. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 529364b032d774bff4dc818ff23d20be482f9d99 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 20:29:21 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=529364b032d774bff4dc818ff23d20be482f9d99 commit 529364b032d774bff4dc818ff23d20be482f9d99 Author: John Baldwin AuthorDate: 2021-09-15 20:25:04 +0000 Commit: John Baldwin CommitDate: 2021-09-15 20:25:04 +0000 iscsi: Add a helper routine to abort a data-out task. Reviewed by: mav Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D31891 --- sys/cam/ctl/ctl_frontend_iscsi.c | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/sys/cam/ctl/ctl_frontend_iscsi.c b/sys/cam/ctl/ctl_frontend_iscsi.c index 0cbe3bcefc73..ac94a786a701 100644 --- a/sys/cam/ctl/ctl_frontend_iscsi.c +++ b/sys/cam/ctl/ctl_frontend_iscsi.c @@ -1108,11 +1108,30 @@ cfiscsi_data_wait_free(struct cfiscsi_session *cs, uma_zfree(cfiscsi_data_wait_zone, cdw); } +static void +cfiscsi_data_wait_abort(struct cfiscsi_session *cs, + struct cfiscsi_data_wait *cdw, int status) +{ + union ctl_io *cdw_io; + + /* + * Set nonzero port status; this prevents backends from + * assuming that the data transfer actually succeeded + * and writing uninitialized data to disk. + */ + MPASS(status != 0); + cdw_io = cdw->cdw_ctl_io; + cdw_io->io_hdr.flags &= ~CTL_FLAG_DMA_INPROG; + cdw_io->scsiio.io_hdr.port_status = status; + cfiscsi_data_wait_free(cs, cdw); + ctl_datamove_done(cdw_io, false); +} + static void cfiscsi_session_terminate_tasks(struct cfiscsi_session *cs) { struct cfiscsi_data_wait *cdw; - union ctl_io *io, *cdw_io; + union ctl_io *io; int error, last, wait; if (cs->cs_target == NULL) @@ -1139,16 +1158,7 @@ cfiscsi_session_terminate_tasks(struct cfiscsi_session *cs) while ((cdw = TAILQ_FIRST(&cs->cs_waiting_for_data_out)) != NULL) { TAILQ_REMOVE(&cs->cs_waiting_for_data_out, cdw, cdw_next); CFISCSI_SESSION_UNLOCK(cs); - /* - * Set nonzero port status; this prevents backends from - * assuming that the data transfer actually succeeded - * and writing uninitialized data to disk. - */ - cdw_io = cdw->cdw_ctl_io; - cdw_io->io_hdr.flags &= ~CTL_FLAG_DMA_INPROG; - cdw_io->scsiio.io_hdr.port_status = 42; - cfiscsi_data_wait_free(cs, cdw); - ctl_datamove_done(cdw_io, false); + cfiscsi_data_wait_abort(cs, cdw, 42); CFISCSI_SESSION_LOCK(cs); } CFISCSI_SESSION_UNLOCK(cs); @@ -2931,7 +2941,6 @@ cfiscsi_task_management_done(union ctl_io *io) struct cfiscsi_data_wait *cdw, *tmpcdw; struct cfiscsi_session *cs, *tcs; struct cfiscsi_softc *softc; - union ctl_io *cdw_io; int cold_reset = 0; request = PRIV_REQUEST(io); @@ -2965,11 +2974,7 @@ cfiscsi_task_management_done(union ctl_io *io) #endif TAILQ_REMOVE(&cs->cs_waiting_for_data_out, cdw, cdw_next); - cdw_io = cdw->cdw_ctl_io; - cdw_io->io_hdr.flags &= ~CTL_FLAG_DMA_INPROG; - cdw_io->scsiio.io_hdr.port_status = 43; - cfiscsi_data_wait_free(cs, cdw); - ctl_datamove_done(cdw_io, false); + cfiscsi_data_wait_abort(cs, cdw, 43); } CFISCSI_SESSION_UNLOCK(cs); } From owner-dev-commits-src-all@freebsd.org Wed Sep 15 20:29:22 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50F9A66DA33; Wed, 15 Sep 2021 20:29:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8sJK6kd0z3lnG; Wed, 15 Sep 2021 20:29:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B176714A8A; Wed, 15 Sep 2021 20:29:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FKTLBx033198; Wed, 15 Sep 2021 20:29:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FKTL5M033197; Wed, 15 Sep 2021 20:29:21 GMT (envelope-from git) Date: Wed, 15 Sep 2021 20:29:21 GMT Message-Id: <202109152029.18FKTL5M033197@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 0cd6e85e242b - main - iscsi: Abort data-out tasks queued on a terminating session. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0cd6e85e242bb07a33df9a6314e90bcb0ba99576 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 20:29:22 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0cd6e85e242bb07a33df9a6314e90bcb0ba99576 commit 0cd6e85e242bb07a33df9a6314e90bcb0ba99576 Author: John Baldwin AuthorDate: 2021-09-15 20:25:30 +0000 Commit: John Baldwin CommitDate: 2021-09-15 20:25:30 +0000 iscsi: Abort data-out tasks queued on a terminating session. cfiscsi_datamove_out() can race with cfiscsi_session_terminate_tasks() and enqueue a new task after the latter function has aborted existing tasks. This could result in a deadlock as cfiscsi_session_terminate_tasks() waited forever for this task to complete. Reviewed by: mav Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D31892 --- sys/cam/ctl/ctl_frontend_iscsi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/cam/ctl/ctl_frontend_iscsi.c b/sys/cam/ctl/ctl_frontend_iscsi.c index ac94a786a701..b8ab25e89eb9 100644 --- a/sys/cam/ctl/ctl_frontend_iscsi.c +++ b/sys/cam/ctl/ctl_frontend_iscsi.c @@ -2783,6 +2783,11 @@ cfiscsi_datamove_out(union ctl_io *io) cdw->cdw_r2t_end = io->scsiio.ext_data_filled + r2t_len; CFISCSI_SESSION_LOCK(cs); + if (cs->cs_terminating) { + CFISCSI_SESSION_UNLOCK(cs); + cfiscsi_data_wait_abort(cs, cdw, 44); + return; + } TAILQ_INSERT_TAIL(&cs->cs_waiting_for_data_out, cdw, cdw_next); CFISCSI_SESSION_UNLOCK(cs); From owner-dev-commits-src-all@freebsd.org Wed Sep 15 20:50:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB1E366DD34; Wed, 15 Sep 2021 20:50:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8smK4NHTz3rNC; Wed, 15 Sep 2021 20:50:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7668B14BEB; Wed, 15 Sep 2021 20:50:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FKo9ZH062155; Wed, 15 Sep 2021 20:50:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FKo9Xq062152; Wed, 15 Sep 2021 20:50:09 GMT (envelope-from git) Date: Wed, 15 Sep 2021 20:50:09 GMT Message-Id: <202109152050.18FKo9Xq062152@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marko Zec Subject: git: 442c8a245ee3 - main - [fib algo][dxr] Fix undefined behavior. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 442c8a245ee3c6640fc9321e18e8316edf469805 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 20:50:09 -0000 The branch main has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=442c8a245ee3c6640fc9321e18e8316edf469805 commit 442c8a245ee3c6640fc9321e18e8316edf469805 Author: Marko Zec AuthorDate: 2021-09-15 20:23:17 +0000 Commit: Marko Zec CommitDate: 2021-09-15 20:42:48 +0000 [fib algo][dxr] Fix undefined behavior. The result of shifting uint32_t by 32 (or more) is undefined: fix it. --- sys/netinet/in_fib_dxr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index ec32819a5a6d..7afe2a3da024 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1150,7 +1150,10 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, #endif plen = q->entries[ui].plen; ip = ntohl(q->entries[ui].addr4.s_addr); - hmask = 0xffffffffU >> plen; + if (plen < 32) + hmask = 0xffffffffU >> plen; + else + hmask = 0; start = (ip & ~hmask) >> DXR_RANGE_SHIFT; end = (ip | hmask) >> DXR_RANGE_SHIFT; From owner-dev-commits-src-all@freebsd.org Wed Sep 15 20:50:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF5C066D16C; Wed, 15 Sep 2021 20:50:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8smL50Gwz3r4c; Wed, 15 Sep 2021 20:50:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 899CB14A6C; Wed, 15 Sep 2021 20:50:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FKoAV1062371; Wed, 15 Sep 2021 20:50:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FKoAb5062368; Wed, 15 Sep 2021 20:50:10 GMT (envelope-from git) Date: Wed, 15 Sep 2021 20:50:10 GMT Message-Id: <202109152050.18FKoAb5062368@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marko Zec Subject: git: b51f8bae570b - main - [fib algo][dxr] Optimize trie updating. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b51f8bae570b4e908191a1dae9da38aacf8c0fab Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 20:50:10 -0000 The branch main has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=b51f8bae570b4e908191a1dae9da38aacf8c0fab commit b51f8bae570b4e908191a1dae9da38aacf8c0fab Author: Marko Zec AuthorDate: 2021-09-15 20:36:59 +0000 Commit: Marko Zec CommitDate: 2021-09-15 20:42:49 +0000 [fib algo][dxr] Optimize trie updating. Don't rebuild in vain trie parts unaffected by accumulated incremental RIB updates. PR: 257965 Tested by: Konrad Kreciwilk MFC after: 3 days --- sys/netinet/in_fib_dxr.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 7afe2a3da024..3c4e5700cd6c 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -915,7 +915,14 @@ dxr2_try_squeeze: for (i = da->updates_low >> dxr_x; i <= da->updates_high >> dxr_x; i++) { - trie_unref(da, i); + if (!trie_rebuild) { + m = 0; + for (int j = 0; j < (1 << dxr_x); j += 32) + m |= da->updates_mask[((i << dxr_x) + j) >> 5]; + if (m == 0) + continue; + trie_unref(da, i); + } ti = trie_ref(da, i); if (ti < 0) return; From owner-dev-commits-src-all@freebsd.org Wed Sep 15 22:33:02 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C2D5866F88C; Wed, 15 Sep 2021 22:33:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8w3257Ttz4ntk; Wed, 15 Sep 2021 22:33:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FC04163CE; Wed, 15 Sep 2021 22:33:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FMX2mL004741; Wed, 15 Sep 2021 22:33:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FMX2qw004740; Wed, 15 Sep 2021 22:33:02 GMT (envelope-from git) Date: Wed, 15 Sep 2021 22:33:02 GMT Message-Id: <202109152233.18FMX2qw004740@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 2796f7cab107 - main - e1000: Fix up HW vlan ops MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2796f7cab10785ef40efbba97ef67ab319c96e9c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 22:33:02 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=2796f7cab10785ef40efbba97ef67ab319c96e9c commit 2796f7cab10785ef40efbba97ef67ab319c96e9c Author: Kevin Bowling AuthorDate: 2021-09-15 14:47:19 +0000 Commit: Kevin Bowling CommitDate: 2021-09-15 15:03:01 +0000 e1000: Fix up HW vlan ops * Don't reset the entire adapter for vlan changes, fix up the problems * Add some functions for vlan filter (vfta) manipulation * Don't muck with the vfta if we aren't doing HW vlan filtering * Disable interrupts when manipulating vfta on lem(4)-class NICs * On the I350 there is a specification update (2.4.20) in which the suggested workaround is to write to the vfta 10 times (if at first you don't succeed, try, try again). Our shared code has the goods, use it * Increase a VF's frame receive size in the case of vlans From the referenced PR, this reduced vlan configuration from minutes to seconds with hundreds or thousands of vlans and prevents wedging the adapter with needless adapter reinitialization for each vlan ID. PR: 230996 Reviewed by: markj Tested by: Ozkan KIRIK MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D30002 --- sys/dev/e1000/if_em.c | 166 ++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 126 insertions(+), 40 deletions(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 6e3a8f73190f..7900e550c55f 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -297,6 +297,11 @@ static void em_if_debug(if_ctx_t ctx); static void em_update_stats_counters(struct adapter *); static void em_add_hw_stats(struct adapter *adapter); static int em_if_set_promisc(if_ctx_t ctx, int flags); +static bool em_if_vlan_filter_capable(struct adapter *); +static bool em_if_vlan_filter_used(struct adapter *); +static void em_if_vlan_filter_enable(struct adapter *); +static void em_if_vlan_filter_disable(struct adapter *); +static void em_if_vlan_filter_write(struct adapter *); static void em_setup_vlan_hw_support(struct adapter *); static int em_sysctl_nvm_info(SYSCTL_HANDLER_ARGS); static void em_print_nvm_info(struct adapter *); @@ -906,6 +911,9 @@ em_if_attach_pre(if_ctx_t ctx) scctx->isc_capabilities = scctx->isc_capenable = LEM_CAPS; if (hw->mac.type < e1000_82543) scctx->isc_capenable &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM); + /* 82541ER doesn't do HW tagging */ + if (hw->device_id == E1000_DEV_ID_82541ER || hw->device_id == E1000_DEV_ID_82541ER_LOM) + scctx->isc_capenable &= ~IFCAP_VLAN_HWTAGGING; /* INTx only */ scctx->isc_msix_bar = 0; } @@ -1335,23 +1343,8 @@ em_if_init(if_ctx_t ctx) adapter->rx_mbuf_sz = iflib_get_rx_mbuf_sz(ctx); em_initialize_receive_unit(ctx); - /* Use real VLAN Filter support? */ - if (if_getcapenable(ifp) & IFCAP_VLAN_HWTAGGING) { - if (if_getcapenable(ifp) & IFCAP_VLAN_HWFILTER) - /* Use real VLAN Filter support */ - em_setup_vlan_hw_support(adapter); - else { - u32 ctrl; - ctrl = E1000_READ_REG(&adapter->hw, E1000_CTRL); - ctrl |= E1000_CTRL_VME; - E1000_WRITE_REG(&adapter->hw, E1000_CTRL, ctrl); - } - } else { - u32 ctrl; - ctrl = E1000_READ_REG(&adapter->hw, E1000_CTRL); - ctrl &= ~E1000_CTRL_VME; - E1000_WRITE_REG(&adapter->hw, E1000_CTRL, ctrl); - } + /* Set up VLAN support and filter */ + em_setup_vlan_hw_support(adapter); /* Don't lose promiscuous settings */ em_if_set_promisc(ctx, if_getflags(ifp)); @@ -1670,14 +1663,19 @@ em_if_set_promisc(if_ctx_t ctx, int flags) if (flags & IFF_PROMISC) { reg_rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE); + em_if_vlan_filter_disable(adapter); /* Turn this on if you want to see bad packets */ if (em_debug_sbp) reg_rctl |= E1000_RCTL_SBP; E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); - } else if (flags & IFF_ALLMULTI) { - reg_rctl |= E1000_RCTL_MPE; - reg_rctl &= ~E1000_RCTL_UPE; - E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); + } else { + if (flags & IFF_ALLMULTI) { + reg_rctl |= E1000_RCTL_MPE; + reg_rctl &= ~E1000_RCTL_UPE; + E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); + } + if (em_if_vlan_filter_used(adapter)) + em_if_vlan_filter_enable(adapter); } return (0); } @@ -3323,7 +3321,11 @@ em_initialize_receive_unit(if_ctx_t ctx) /* are we on a vlan? */ if (ifp->if_vlantrunk != NULL) psize += VLAN_TAG_SIZE; - E1000_WRITE_REG(hw, E1000_RLPML, psize); + + if (adapter->vf_ifp) + e1000_rlpml_set_vf(hw, pszie); + else + E1000_WRITE_REG(hw, E1000_RLPML, psize); } /* Set maximum packet buffer len */ @@ -3420,6 +3422,7 @@ em_if_vlan_register(if_ctx_t ctx, u16 vtag) bit = vtag & 0x1F; adapter->shadow_vfta[index] |= (1 << bit); ++adapter->num_vlans; + em_if_vlan_filter_write(adapter); } static void @@ -3432,41 +3435,121 @@ em_if_vlan_unregister(if_ctx_t ctx, u16 vtag) bit = vtag & 0x1F; adapter->shadow_vfta[index] &= ~(1 << bit); --adapter->num_vlans; + em_if_vlan_filter_write(adapter); +} + +static bool +em_if_vlan_filter_capable(struct adapter *adapter) +{ + if_softc_ctx_t scctx = adapter->shared; + + if ((scctx->isc_capenable & IFCAP_VLAN_HWFILTER) && + !em_disable_crc_stripping) + return (true); + + return (false); +} + +static bool +em_if_vlan_filter_used(struct adapter *adapter) +{ + if (!em_if_vlan_filter_capable(adapter)) + return (false); + + for (int i = 0; i < EM_VFTA_SIZE; i++) + if (adapter->shadow_vfta[i] != 0) + return (true); + + return (false); +} + +static void +em_if_vlan_filter_enable(struct adapter *adapter) +{ + struct e1000_hw *hw = &adapter->hw; + u32 reg; + + reg = E1000_READ_REG(hw, E1000_RCTL); + reg &= ~E1000_RCTL_CFIEN; + reg |= E1000_RCTL_VFE; + E1000_WRITE_REG(hw, E1000_RCTL, reg); +} + +static void +em_if_vlan_filter_disable(struct adapter *adapter) +{ + struct e1000_hw *hw = &adapter->hw; + u32 reg; + + reg = E1000_READ_REG(hw, E1000_RCTL); + reg &= ~(E1000_RCTL_VFE | E1000_RCTL_CFIEN); + E1000_WRITE_REG(hw, E1000_RCTL, reg); +} + +static void +em_if_vlan_filter_write(struct adapter *adapter) +{ + struct e1000_hw *hw = &adapter->hw; + + if (adapter->vf_ifp) + return; + + /* Disable interrupts for lem-class devices during the filter change */ + if (hw->mac.type < em_mac_min) + em_if_intr_disable(adapter->ctx); + + for (int i = 0; i < EM_VFTA_SIZE; i++) + if (adapter->shadow_vfta[i] != 0) { + /* XXXKB: incomplete VF support, we return early above */ + if (adapter->vf_ifp) + e1000_vfta_set_vf(hw, adapter->shadow_vfta[i], TRUE); + else + e1000_write_vfta(hw, i, adapter->shadow_vfta[i]); + } + + /* Re-enable interrupts for lem-class devices */ + if (hw->mac.type < em_mac_min) + em_if_intr_enable(adapter->ctx); } static void em_setup_vlan_hw_support(struct adapter *adapter) { + if_softc_ctx_t scctx = adapter->shared; struct e1000_hw *hw = &adapter->hw; u32 reg; - /* - * We get here thru init_locked, meaning - * a soft reset, this has already cleared - * the VFTA and other state, so if there - * have been no vlan's registered do nothing. + /* XXXKB: Return early if we are a VF until VF decap and filter management + * is ready and tested. */ - if (adapter->num_vlans == 0) + if (adapter->vf_ifp) + return; + + if (scctx->isc_capenable & IFCAP_VLAN_HWTAGGING && + !em_disable_crc_stripping) { + reg = E1000_READ_REG(hw, E1000_CTRL); + reg |= E1000_CTRL_VME; + E1000_WRITE_REG(hw, E1000_CTRL, reg); + } else { + reg = E1000_READ_REG(hw, E1000_CTRL); + reg &= ~E1000_CTRL_VME; + E1000_WRITE_REG(hw, E1000_CTRL, reg); + } + + /* If we aren't doing HW filtering, we're done */ + if (!em_if_vlan_filter_capable(adapter)) { + em_if_vlan_filter_disable(adapter); return; + } /* * A soft reset zero's out the VFTA, so * we need to repopulate it now. */ - for (int i = 0; i < EM_VFTA_SIZE; i++) - if (adapter->shadow_vfta[i] != 0) - E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, - i, adapter->shadow_vfta[i]); - - reg = E1000_READ_REG(hw, E1000_CTRL); - reg |= E1000_CTRL_VME; - E1000_WRITE_REG(hw, E1000_CTRL, reg); + em_if_vlan_filter_write(adapter); /* Enable the Filter Table */ - reg = E1000_READ_REG(hw, E1000_RCTL); - reg &= ~E1000_RCTL_CFIEN; - reg |= E1000_RCTL_VFE; - E1000_WRITE_REG(hw, E1000_RCTL, reg); + em_if_vlan_filter_enable(adapter); } static void @@ -3481,6 +3564,7 @@ em_if_intr_enable(if_ctx_t ctx) ims_mask |= adapter->ims; } E1000_WRITE_REG(hw, E1000_IMS, ims_mask); + E1000_WRITE_FLUSH(hw); } static void @@ -3492,6 +3576,7 @@ em_if_intr_disable(if_ctx_t ctx) if (adapter->intr_type == IFLIB_INTR_MSIX) E1000_WRITE_REG(hw, EM_EIAC, 0); E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); + E1000_WRITE_FLUSH(hw); } static void @@ -4101,6 +4186,7 @@ em_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) { switch (event) { case IFLIB_RESTART_VLAN_CONFIG: + return (false); default: return (true); } From owner-dev-commits-src-all@freebsd.org Wed Sep 15 23:05:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A3A866FEC9; Wed, 15 Sep 2021 23:05:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8wmD16K3z3Fkd; Wed, 15 Sep 2021 23:05:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0428F16964; Wed, 15 Sep 2021 23:05:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FN5FiI045199; Wed, 15 Sep 2021 23:05:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FN5FVG045197; Wed, 15 Sep 2021 23:05:15 GMT (envelope-from git) Date: Wed, 15 Sep 2021 23:05:15 GMT Message-Id: <202109152305.18FN5FVG045197@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Rick Macklem Subject: git: e5d000b33383 - stable/13 - nfsd: Make loop calling VOP_ALLOCATE() iterate until done MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e5d000b333830ad2795ec3a265b3d2f499b4065c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 23:05:16 -0000 The branch stable/13 has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=e5d000b333830ad2795ec3a265b3d2f499b4065c commit e5d000b333830ad2795ec3a265b3d2f499b4065c Author: Rick Macklem AuthorDate: 2021-08-29 23:46:27 +0000 Commit: Rick Macklem CommitDate: 2021-09-15 23:01:41 +0000 nfsd: Make loop calling VOP_ALLOCATE() iterate until done The NFSv4.2 Deallocate operation loops on VOP_DEALLOCATE() while progress is being made (remaining length decreasing). This patch changes the loop on VOP_ALLOCATE() for the NFSv4.2 Allocate operation do the same, instead of stopping after an arbitrary 20 iterations. (cherry picked from commit 13914e51eb8de6fe9f627c9c1d48c09880b2607e) --- sys/fs/nfsserver/nfs_nfsdport.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index efe9aac7a136..f48e57e449c9 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -6399,7 +6399,8 @@ int nfsvno_allocate(struct vnode *vp, off_t off, off_t len, struct ucred *cred, NFSPROC_T *p) { - int error, trycnt; + int error; + off_t olen; ASSERT_VOP_ELOCKED(vp, "nfsvno_allocate vp"); /* @@ -6410,15 +6411,17 @@ nfsvno_allocate(struct vnode *vp, off_t off, off_t len, struct ucred *cred, NULL, NULL, NULL, NULL, &len, 0, NULL); if (error != ENOENT) return (error); - error = 0; /* - * Do the actual VOP_ALLOCATE(), looping a reasonable number of - * times to achieve completion. + * Do the actual VOP_ALLOCATE(), looping so long as + * progress is being made, to achieve completion. */ - trycnt = 0; - while (error == 0 && len > 0 && trycnt++ < 20) + do { + olen = len; error = VOP_ALLOCATE(vp, &off, &len); + if (error == 0 && len > 0 && olen > len) + maybe_yield(); + } while (error == 0 && len > 0 && olen > len); if (error == 0 && len > 0) error = NFSERR_IO; NFSEXITCODE(error); From owner-dev-commits-src-all@freebsd.org Wed Sep 15 23:23:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D9A3767059F; Wed, 15 Sep 2021 23:23:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8x8l52vQz3Lsq; Wed, 15 Sep 2021 23:23:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D1471712E; Wed, 15 Sep 2021 23:23:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FNN3Q5071006; Wed, 15 Sep 2021 23:23:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FNN3Nv071005; Wed, 15 Sep 2021 23:23:03 GMT (envelope-from git) Date: Wed, 15 Sep 2021 23:23:03 GMT Message-Id: <202109152323.18FNN3Nv071005@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 22b20b45c911 - main - e1000: Fix variable typo MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 22b20b45c9118bf6ef313c074cdb107a1eaca78e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 23:23:03 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=22b20b45c9118bf6ef313c074cdb107a1eaca78e commit 22b20b45c9118bf6ef313c074cdb107a1eaca78e Author: Kevin Bowling AuthorDate: 2021-09-15 16:18:59 +0000 Commit: Kevin Bowling CommitDate: 2021-09-15 16:18:59 +0000 e1000: Fix variable typo Forgot to git add this in last commit Reported by: jenkins Fixes: 2796f7cab107 MFC after: 2 week --- sys/dev/e1000/if_em.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 7900e550c55f..b533ee3962c2 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -3323,7 +3323,7 @@ em_initialize_receive_unit(if_ctx_t ctx) psize += VLAN_TAG_SIZE; if (adapter->vf_ifp) - e1000_rlpml_set_vf(hw, pszie); + e1000_rlpml_set_vf(hw, psize); else E1000_WRITE_REG(hw, E1000_RLPML, psize); } From owner-dev-commits-src-all@freebsd.org Wed Sep 15 23:59:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 155D3670B07; Wed, 15 Sep 2021 23:59:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8xz86wDwz3mwH; Wed, 15 Sep 2021 23:59:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C98CB172EE; Wed, 15 Sep 2021 23:59:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FNxmL8011070; Wed, 15 Sep 2021 23:59:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FNxmYR011069; Wed, 15 Sep 2021 23:59:48 GMT (envelope-from git) Date: Wed, 15 Sep 2021 23:59:48 GMT Message-Id: <202109152359.18FNxmYR011069@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 03582021117f - main - diff: improve code style MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 03582021117f05fa562a2a43028b931ec21c5237 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 23:59:49 -0000 The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=03582021117f05fa562a2a43028b931ec21c5237 commit 03582021117f05fa562a2a43028b931ec21c5237 Author: Piotr Pawel Stefaniak AuthorDate: 2021-08-29 09:15:45 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-15 23:36:41 +0000 diff: improve code style Reflow comments, strip trailing space, improve wrapping of lines. --- usr.bin/diff/diff.c | 18 ++-- usr.bin/diff/diff.h | 4 +- usr.bin/diff/diffreg.c | 251 ++++++++++++++++++++++--------------------------- 3 files changed, 123 insertions(+), 150 deletions(-) diff --git a/usr.bin/diff/diff.c b/usr.bin/diff/diff.c index 1bad6226f49d..bfd391a4e3dd 100644 --- a/usr.bin/diff/diff.c +++ b/usr.bin/diff/diff.c @@ -362,9 +362,9 @@ main(int argc, char **argv) } if (dflags & D_EMPTY1 && dflags & D_EMPTY2){ - warn("%s", argv[0]); + warn("%s", argv[0]); warn("%s", argv[1]); - exit(2); + exit(2); } if (stb1.st_mode == 0) @@ -477,8 +477,10 @@ print_only(const char *path, size_t dirlen, const char *entry) void print_status(int val, char *path1, char *path2, const char *entry) { - if (label[0] != NULL) path1 = label[0]; - if (label[1] != NULL) path2 = label[1]; + if (label[0] != NULL) + path1 = label[0]; + if (label[1] != NULL) + path2 = label[1]; switch (val) { case D_BINARY: @@ -535,10 +537,10 @@ usage(void) " [--no-ignore-case] [--normal] [--tabsize] [-I pattern] [-L label]\n" " [-S name] [-X file] [-x pattern] dir1 dir2\n" " diff [-aBbditwW] [--expand-tabs] [--ignore-all-blanks]\n" - " [--ignore-blank-lines] [--ignore-case] [--minimal]\n" - " [--no-ignore-file-name-case] [--strip-trailing-cr]\n" - " [--suppress-common-lines] [--tabsize] [--text] [--width]\n" - " -y | --side-by-side file1 file2\n"); + " [--ignore-blank-lines] [--ignore-case] [--minimal]\n" + " [--no-ignore-file-name-case] [--strip-trailing-cr]\n" + " [--suppress-common-lines] [--tabsize] [--text] [--width]\n" + " -y | --side-by-side file1 file2\n"); exit(2); } diff --git a/usr.bin/diff/diff.h b/usr.bin/diff/diff.h index b5536bd7bf77..28d08288e1e9 100644 --- a/usr.bin/diff/diff.h +++ b/usr.bin/diff/diff.h @@ -1,6 +1,6 @@ +/* $OpenBSD: diff.h,v 1.34 2020/11/01 18:16:08 jcs Exp $ */ - -/*ROR +/*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. * diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index e728441c2cb2..94026007a1bf 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -95,66 +95,54 @@ __FBSDID("$FreeBSD$"); */ /* - * Uses an algorithm due to Harold Stone, which finds - * a pair of longest identical subsequences in the two - * files. + * Uses an algorithm due to Harold Stone, which finds a pair of longest + * identical subsequences in the two files. * - * The major goal is to generate the match vector J. - * J[i] is the index of the line in file1 corresponding - * to line i file0. J[i] = 0 if there is no + * The major goal is to generate the match vector J. J[i] is the index of + * the line in file1 corresponding to line i file0. J[i] = 0 if there is no * such line in file1. * - * Lines are hashed so as to work in core. All potential - * matches are located by sorting the lines of each file - * on the hash (called ``value''). In particular, this - * collects the equivalence classes in file1 together. - * Subroutine equiv replaces the value of each line in - * file0 by the index of the first element of its - * matching equivalence in (the reordered) file1. - * To save space equiv squeezes file1 into a single - * array member in which the equivalence classes - * are simply concatenated, except that their first - * members are flagged by changing sign. + * Lines are hashed so as to work in core. All potential matches are + * located by sorting the lines of each file on the hash (called + * ``value''). In particular, this collects the equivalence classes in + * file1 together. Subroutine equiv replaces the value of each line in + * file0 by the index of the first element of its matching equivalence in + * (the reordered) file1. To save space equiv squeezes file1 into a single + * array member in which the equivalence classes are simply concatenated, + * except that their first members are flagged by changing sign. * - * Next the indices that point into member are unsorted into - * array class according to the original order of file0. + * Next the indices that point into member are unsorted into array class + * according to the original order of file0. * - * The cleverness lies in routine stone. This marches - * through the lines of file0, developing a vector klist - * of "k-candidates". At step i a k-candidate is a matched - * pair of lines x,y (x in file0 y in file1) such that - * there is a common subsequence of length k - * between the first i lines of file0 and the first y - * lines of file1, but there is no such subsequence for - * any smaller y. x is the earliest possible mate to y - * that occurs in such a subsequence. + * The cleverness lies in routine stone. This marches through the lines of + * file0, developing a vector klist of "k-candidates". At step i + * a k-candidate is a matched pair of lines x,y (x in file0 y in file1) + * such that there is a common subsequence of length k between the first + * i lines of file0 and the first y lines of file1, but there is no such + * subsequence for any smaller y. x is the earliest possible mate to y that + * occurs in such a subsequence. * - * Whenever any of the members of the equivalence class of - * lines in file1 matable to a line in file0 has serial number - * less than the y of some k-candidate, that k-candidate - * with the smallest such y is replaced. The new - * k-candidate is chained (via pred) to the current - * k-1 candidate so that the actual subsequence can - * be recovered. When a member has serial number greater - * that the y of all k-candidates, the klist is extended. - * At the end, the longest subsequence is pulled out - * and placed in the array J by unravel + * Whenever any of the members of the equivalence class of lines in file1 + * matable to a line in file0 has serial number less than the y of some + * k-candidate, that k-candidate with the smallest such y is replaced. The + * new k-candidate is chained (via pred) to the current k-1 candidate so + * that the actual subsequence can be recovered. When a member has serial + * number greater that the y of all k-candidates, the klist is extended. At + * the end, the longest subsequence is pulled out and placed in the array J + * by unravel. * - * With J in hand, the matches there recorded are - * check'ed against reality to assure that no spurious - * matches have crept in due to hashing. If they have, - * they are broken, and "jackpot" is recorded--a harmless - * matter except that a true match for a spuriously - * mated line may now be unnecessarily reported as a change. + * With J in hand, the matches there recorded are check'ed against reality + * to assure that no spurious matches have crept in due to hashing. If they + * have, they are broken, and "jackpot" is recorded -- a harmless matter + * except that a true match for a spuriously mated line may now be + * unnecessarily reported as a change. * - * Much of the complexity of the program comes simply - * from trying to minimize core utilization and - * maximize the range of doable problems by dynamically - * allocating what is needed and reusing what is not. - * The core requirements for problems larger than somewhat - * are (in words) 2*length(file0) + length(file1) + - * 3*(number of k-candidates installed), typically about - * 6n words for files of length n. + * Much of the complexity of the program comes simply from trying to + * minimize core utilization and maximize the range of doable problems by + * dynamically allocating what is needed and reusing what is not. The core + * requirements for problems larger than somewhat are (in words) + * 2*length(file0) + length(file1) + 3*(number of k-candidates installed), + * typically about 6n words for files of length n. */ struct cand { @@ -213,24 +201,24 @@ static int files_differ(FILE *, FILE *, int); static char *match_function(const long *, int, FILE *); static char *preadline(int, size_t, off_t); -static int *J; /* will be overlaid on class */ -static int *class; /* will be overlaid on file[0] */ -static int *klist; /* will be overlaid on file[0] after class */ -static int *member; /* will be overlaid on file[1] */ -static int clen; -static int inifdef; /* whether or not we are in a #ifdef block */ -static int len[2]; -static int pref, suff; /* length of prefix and suffix */ -static int slen[2]; -static int anychange; -static int hw, padding; /* half width and padding */ -static int edoffset; -static long *ixnew; /* will be overlaid on file[1] */ -static long *ixold; /* will be overlaid on klist */ +static int *J; /* will be overlaid on class */ +static int *class; /* will be overlaid on file[0] */ +static int *klist; /* will be overlaid on file[0] after class */ +static int *member; /* will be overlaid on file[1] */ +static int clen; +static int inifdef; /* whether or not we are in a #ifdef block */ +static int len[2]; +static int pref, suff; /* length of prefix and suffix */ +static int slen[2]; +static int anychange; +static int hw, padding; /* half width and padding */ +static int edoffset; +static long *ixnew; /* will be overlaid on file[1] */ +static long *ixold; /* will be overlaid on klist */ static struct cand *clist; /* merely a free storage pot for candidates */ -static int clistlen; /* the length of clist */ +static int clistlen; /* the length of clist */ static struct line *sfile[2]; /* shortened by pruning common prefix/suffix */ -static int (*chrtran)(int); /* translation table for case-folding */ +static int (*chrtran)(int); /* translation table for case-folding */ static struct context_vec *context_vec_start; static struct context_vec *context_vec_end; static struct context_vec *context_vec_ptr; @@ -251,7 +239,7 @@ static int cup2low(int c) { - return tolower(c); + return (tolower(c)); } int @@ -278,11 +266,11 @@ diffreg(char *file1, char *file2, int flags, int capsicum) padding = tabsize - (hw % tabsize); if ((flags & D_EXPANDTABS) != 0 || (padding % tabsize == 0)) padding = MIN_PAD; - + hw = (width >> 1) - ((padding == MIN_PAD) ? (padding << 1) : padding) - 1; } - + if (flags & D_IGNORECASE) chrtran = cup2low; @@ -622,7 +610,7 @@ stone(int *a, int n, int *b, int *c, int flags) { int i, k, y, j, l; int oldc, tc, oldl, sq; - u_int numtries, bound; + unsigned numtries, bound; if (flags & D_MINIMAL) bound = UINT_MAX; @@ -720,9 +708,9 @@ unravel(int p) /* * Check does double duty: - * 1. ferret out any fortuitous correspondences due - * to confounding by hashing (which result in "jackpot") - * 2. collect random access indexes to the two files + * 1. ferret out any fortuitous correspondences due to confounding by + * hashing (which result in "jackpot") + * 2. collect random access indexes to the two files */ static void check(FILE *f1, FILE *f2, int flags) @@ -745,7 +733,7 @@ check(FILE *f1, FILE *f2, int flags) ixnew[j] = ctnew += skipline(f2); j++; } - if (flags & (D_FOLDBLANKS|D_IGNOREBLANKS|D_IGNORECASE|D_STRIPCR)) { + if (flags & (D_FOLDBLANKS | D_IGNOREBLANKS | D_IGNORECASE | D_STRIPCR)) { for (;;) { c = getc(f1); d = getc(f2); @@ -753,7 +741,7 @@ check(FILE *f1, FILE *f2, int flags) * GNU diff ignores a missing newline * in one file for -b or -w. */ - if (flags & (D_FOLDBLANKS|D_IGNOREBLANKS)) { + if (flags & (D_FOLDBLANKS | D_IGNOREBLANKS)) { if (c == EOF && d == '\n') { ctnew++; break; @@ -793,7 +781,7 @@ check(FILE *f1, FILE *f2, int flags) break; ctnew++; } while (isspace(d = getc(f2))); - } else if ((flags & D_IGNOREBLANKS)) { + } else if (flags & D_IGNOREBLANKS) { while (isspace(c) && c != '\n') { c = getc(f1); ctold++; @@ -913,16 +901,11 @@ output(char *file1, FILE *f1, char *file2, FILE *f2, int flags) J[m + 1] = len[1] + 1; if (diff_format != D_EDIT) { for (i0 = 1; i0 <= m; i0 = i1 + 1) { - while (i0 <= m && J[i0] == J[i0 - 1] + 1){ - if (diff_format == D_SIDEBYSIDE && - suppress_common != 1) { - nc = fetch(ixold, i0, i0, f1, '\0', - 1, flags); - print_space(nc, - (hw - nc) + (padding << 1) + 1, - flags); - fetch(ixnew, J[i0], J[i0], f2, '\0', - 0, flags); + while (i0 <= m && J[i0] == J[i0 - 1] + 1) { + if (diff_format == D_SIDEBYSIDE && suppress_common != 1) { + nc = fetch(ixold, i0, i0, f1, '\0', 1, flags); + print_space(nc, (hw - nc) + (padding << 1) + 1, flags); + fetch(ixnew, J[i0], J[i0], f2, '\0', 0, flags); printf("\n"); } i0++; @@ -935,33 +918,28 @@ output(char *file1, FILE *f1, char *file2, FILE *f2, int flags) J[i1] = j1; /* - * When using side-by-side, lines from both of the - * files are printed. The algorithm used by diff(1) - * identifies the ranges in which two files differ. + * When using side-by-side, lines from both of the files are + * printed. The algorithm used by diff(1) identifies the ranges + * in which two files differ. * See the change() function below. - * The for loop below consumes the shorter range, - * whereas one of the while loops deals with the - * longer one. + * The for loop below consumes the shorter range, whereas one of + * the while loops deals with the longer one. */ if (diff_format == D_SIDEBYSIDE) { - for (i=i0, j=j0; i<=i1 && j<=j1; i++, j++) - change(file1, f1, file2, f2, i, i, - j, j, &flags); + for (i = i0, j = j0; i <= i1 && j <= j1; i++, j++) + change(file1, f1, file2, f2, i, i, j, j, &flags); while (i <= i1) { - change(file1, f1, file2, f2, - i, i, j+1, j, &flags); + change(file1, f1, file2, f2, i, i, j + 1, j, &flags); i++; } while (j <= j1) { - change(file1, f1, file2, f2, - i+1, i, j, j, &flags); + change(file1, f1, file2, f2, i + 1, i, j, j, &flags); j++; } } else - change(file1, f1, file2, f2, i0, i1, j0, - j1, &flags); + change(file1, f1, file2, f2, i0, i1, j0, j1, &flags); } } else { for (i0 = m; i0 >= 1; i0 = i1 - 1) { @@ -1078,9 +1056,8 @@ restart: if (ignore_pats != NULL || skip_blanks) { char *line; /* - * All lines in the change, insert, or delete must - * match an ignore pattern for the change to be - * ignored. + * All lines in the change, insert, or delete must match an ignore + * pattern for the change to be ignored. */ if (a <= b) { /* Changes and deletes. */ for (i = a; i <= b; i++) { @@ -1202,7 +1179,7 @@ proceed: nc = fetch(ixold, a, b, f1, '\0', 1, *pflags); print_space(nc, hw - nc + padding, *pflags); } - printf("%c", (a>b)? '>' : ((c>d)? '<' : '|')); + printf("%c", (a > b) ? '>' : ((c > d) ? '<' : '|')); print_space(hw + padding + 1 , padding, *pflags); fetch(ixnew, c, d, f2, '\0', 0, *pflags); printf("\n"); @@ -1216,11 +1193,11 @@ proceed: fetch(ixnew, c, d, f2, diff_format == D_NORMAL ? '>' : '\0', 0, *pflags); if (edoffset != 0 && diff_format == D_EDIT) { /* - * A non-zero edoffset value for D_EDIT indicates that the - * last line printed was a bare dot (".") that has been - * escaped as ".." to prevent ed(1) from misinterpreting - * it. We have to add a substitute command to change this - * back and restart where we left off. + * A non-zero edoffset value for D_EDIT indicates that the last line + * printed was a bare dot (".") that has been escaped as ".." to + * prevent ed(1) from misinterpreting it. We have to add a + * substitute command to change this back and restart where we left + * off. */ printf(".\n"); printf("%ds/.//\n", a + edoffset - 1); @@ -1271,10 +1248,10 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) } for (i = a; i <= b; i++) { fseek(lb, f[i - 1], SEEK_SET); - nc = (f[i] - f[i - 1]); + nc = f[i] - f[i - 1]; if (diff_format == D_SIDEBYSIDE && hw < nc) nc = hw; - if ((diff_format != D_IFDEF && diff_format != D_GFORMAT) && + if (diff_format != D_IFDEF && diff_format != D_GFORMAT && ch != '\0') { printf("%c", ch); if (Tflag && (diff_format == D_NORMAL || @@ -1301,9 +1278,8 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) diff_format == D_NREVERSE) warnx("No newline at end of file"); else - printf("\n\\ No newline at end of " - "file\n"); - return col; + printf("\n\\ No newline at end of file\n"); + return (col); } /* * when using --side-by-side, col needs to be increased @@ -1311,8 +1287,8 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) */ if (c == '\t') { if (flags & D_EXPANDTABS) { - newcol = ((col/tabsize)+1)*tabsize; - do { + newcol = ((col / tabsize) + 1) * tabsize; + do { if (diff_format == D_SIDEBYSIDE) j++; printf(" "); @@ -1320,8 +1296,7 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) } else { if (diff_format == D_SIDEBYSIDE) { if ((j + tabsize) > nc) { - printf("%*s", - nc - j,""); + printf("%*s", nc - j, ""); j = col = nc; } else { printf("\t"); @@ -1334,20 +1309,17 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) } } } else { - if (diff_format == D_EDIT && j == 1 && c == '\n' - && lastc == '.') { + if (diff_format == D_EDIT && j == 1 && c == '\n' && + lastc == '.') { /* - * Don't print a bare "." line - * since that will confuse ed(1). - * Print ".." instead and set the, - * global variable edoffset to an - * offset from which to restart. - * The caller must check the value - * of edoffset + * Don't print a bare "." line since that will confuse + * ed(1). Print ".." instead and set the, global variable + * edoffset to an offset from which to restart. The + * caller must check the value of edoffset */ printf(".\n"); edoffset = i - a + 1; - return edoffset; + return (edoffset); } /* when side-by-side, do not print a newline */ if (diff_format != D_SIDEBYSIDE || c != '\n') { @@ -1357,7 +1329,7 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) } } } - return col; + return (col); } /* @@ -1428,7 +1400,7 @@ asciifile(FILE *f) return (memchr(buf, '\0', cnt) == NULL); } -#define begins_with(s, pre) (strncmp(s, pre, sizeof(pre)-1) == 0) +#define begins_with(s, pre) (strncmp(s, pre, sizeof(pre) - 1) == 0) static char * match_function(const long *f, int pos, FILE *fp) @@ -1459,18 +1431,17 @@ match_function(const long *f, int pos, FILE *fp) if (!state) state = " (public)"; } else { - strlcpy(lastbuf, buf, sizeof lastbuf); + strlcpy(lastbuf, buf, sizeof(lastbuf)); if (state) - strlcat(lastbuf, state, - sizeof lastbuf); + strlcat(lastbuf, state, sizeof(lastbuf)); lastmatchline = pos; - return lastbuf; + return (lastbuf); } } } pos--; } - return lastmatchline > 0 ? lastbuf : NULL; + return (lastmatchline > 0 ? lastbuf : NULL); } /* dump accumulated "context" diff changes */ @@ -1493,7 +1464,7 @@ dump_context_vec(FILE *f1, FILE *f2, int flags) printf("***************"); if ((flags & D_PROTOTYPE)) { - f = match_function(ixold, lowa-1, f1); + f = match_function(ixold, lowa - 1, f1); if (f != NULL) printf(" %s", f); } @@ -1600,7 +1571,7 @@ dump_unified_vec(FILE *f1, FILE *f2, int flags) uni_range(lowc, upd); printf(" @@"); if ((flags & D_PROTOTYPE)) { - f = match_function(ixold, lowa-1, f1); + f = match_function(ixold, lowa - 1, f1); if (f != NULL) printf(" %s", f); } From owner-dev-commits-src-all@freebsd.org Wed Sep 15 23:59:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2383B670C1D; Wed, 15 Sep 2021 23:59:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8xzB0RYFz3mnG; Wed, 15 Sep 2021 23:59:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E2AC117468; Wed, 15 Sep 2021 23:59:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FNxnHw011094; Wed, 15 Sep 2021 23:59:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FNxnij011093; Wed, 15 Sep 2021 23:59:49 GMT (envelope-from git) Date: Wed, 15 Sep 2021 23:59:49 GMT Message-Id: <202109152359.18FNxnij011093@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: b5541f456d64 - main - diff: convert boolean flag variables to bool MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b5541f456d641d23e0c46874daff0b62552bf3cb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 23:59:50 -0000 The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=b5541f456d641d23e0c46874daff0b62552bf3cb commit b5541f456d641d23e0c46874daff0b62552bf3cb Author: Piotr Pawel Stefaniak AuthorDate: 2021-09-04 23:44:26 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-15 23:36:41 +0000 diff: convert boolean flag variables to bool There will be more boolean flags added in upcoming commits and they would have to be stored in ints in order to be consistent with existing code. Change the existing code to use the bool type. --- usr.bin/diff/diff.c | 23 +++++++++++------------ usr.bin/diff/diff.h | 8 +++++--- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/usr.bin/diff/diff.c b/usr.bin/diff/diff.c index bfd391a4e3dd..03eb16211e86 100644 --- a/usr.bin/diff/diff.c +++ b/usr.bin/diff/diff.c @@ -38,8 +38,9 @@ __FBSDID("$FreeBSD$"); #include "diff.h" #include "xmalloc.h" -int lflag, Nflag, Pflag, rflag, sflag, Tflag, cflag, Wflag; -int diff_format, diff_context, status, ignore_file_case, suppress_common; +bool lflag, Nflag, Pflag, rflag, sflag, Tflag, cflag; +bool ignore_file_case, suppress_common; +int diff_format, diff_context, status; int tabsize = 8, width = 130; char *start, *ifdefname, *diffargs, *label[2], *ignore_pats; char *group_format = NULL; @@ -147,7 +148,6 @@ main(int argc, char **argv) case 'c': if (FORMAT_MISMATCHED(D_CONTEXT)) conflicting_format(); - cflag = 1; diff_format = D_CONTEXT; if (optarg != NULL) { l = strtol(optarg, &ep, 10); @@ -199,10 +199,10 @@ main(int argc, char **argv) usage(); break; case 'l': - lflag = 1; + lflag = true; break; case 'N': - Nflag = 1; + Nflag = true; break; case 'n': if (FORMAT_MISMATCHED(D_NREVERSE)) @@ -213,10 +213,10 @@ main(int argc, char **argv) dflags |= D_PROTOTYPE; break; case 'P': - Pflag = 1; + Pflag = true; break; case 'r': - rflag = 1; + rflag = true; break; case 'q': if (FORMAT_MISMATCHED(D_BRIEF)) @@ -227,10 +227,10 @@ main(int argc, char **argv) start = optarg; break; case 's': - sflag = 1; + sflag = true; break; case 'T': - Tflag = 1; + Tflag = true; break; case 't': dflags |= D_EXPANDTABS; @@ -251,7 +251,6 @@ main(int argc, char **argv) dflags |= D_IGNOREBLANKS; break; case 'W': - Wflag = 1; width = (int) strtonum(optarg, 1, INT_MAX, &errstr); if (errstr) { warnx("Invalid argument for width"); @@ -278,10 +277,10 @@ main(int argc, char **argv) case OPT_HORIZON_LINES: break; /* XXX TODO for compatibility with GNU diff3 */ case OPT_IGN_FN_CASE: - ignore_file_case = 1; + ignore_file_case = true; break; case OPT_NO_IGN_FN_CASE: - ignore_file_case = 0; + ignore_file_case = false; break; case OPT_NORMAL: if (FORMAT_MISMATCHED(D_NORMAL)) diff --git a/usr.bin/diff/diff.h b/usr.bin/diff/diff.h index 28d08288e1e9..04e75e631954 100644 --- a/usr.bin/diff/diff.h +++ b/usr.bin/diff/diff.h @@ -33,6 +33,8 @@ */ #include + +#include #include /* @@ -90,9 +92,9 @@ struct excludes { struct excludes *next; }; -extern int lflag, Nflag, Pflag, rflag, sflag, Tflag, cflag, Wflag; -extern int diff_format, diff_context, status, ignore_file_case; -extern int suppress_common; +extern bool lflag, Nflag, Pflag, rflag, sflag, Tflag, cflag; +extern bool ignore_file_case, suppress_common; +extern int diff_format, diff_context, status; extern int tabsize, width; extern char *start, *ifdefname, *diffargs, *label[2], *ignore_pats; extern char *group_format; From owner-dev-commits-src-all@freebsd.org Wed Sep 15 23:59:51 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6DE896706DA; Wed, 15 Sep 2021 23:59:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8xzC2S3nz3mm3; Wed, 15 Sep 2021 23:59:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BFA4177A6; Wed, 15 Sep 2021 23:59:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FNxoxD011118; Wed, 15 Sep 2021 23:59:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FNxof1011117; Wed, 15 Sep 2021 23:59:50 GMT (envelope-from git) Date: Wed, 15 Sep 2021 23:59:50 GMT Message-Id: <202109152359.18FNxof1011117@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: e43df07e3725 - main - diff: move functions around and reduce their visibility MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e43df07e3725ef6d14a2ca635598c18295b1b481 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 23:59:52 -0000 The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=e43df07e3725ef6d14a2ca635598c18295b1b481 commit e43df07e3725ef6d14a2ca635598c18295b1b481 Author: Piotr Pawel Stefaniak AuthorDate: 2021-09-04 23:50:58 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-15 23:36:41 +0000 diff: move functions around and reduce their visibility Most of them become static. There will be more such functions added in upcoming commits, so they would be inconsistent with existing code. Improve the existing code instead of reinforcing the unwanted pattern. --- usr.bin/diff/diff.c | 50 ++++++++++++++++++++++++++++++-------------------- usr.bin/diff/diff.h | 2 -- usr.bin/diff/diffdir.c | 9 +++++++++ usr.bin/diff/diffreg.c | 17 ----------------- 4 files changed, 39 insertions(+), 39 deletions(-) diff --git a/usr.bin/diff/diff.c b/usr.bin/diff/diff.c index 03eb16211e86..a5966e74dbcc 100644 --- a/usr.bin/diff/diff.c +++ b/usr.bin/diff/diff.c @@ -101,12 +101,13 @@ static struct option longopts[] = { { NULL, 0, 0, '\0'} }; -void usage(void) __dead2; -void conflicting_format(void) __dead2; -void push_excludes(char *); -void push_ignore_pats(char *); -void read_excludes_file(char *file); -void set_argstr(char **, char **); +static void usage(void) __dead2; +static void conflicting_format(void) __dead2; +static void push_excludes(char *); +static void push_ignore_pats(char *); +static void read_excludes_file(char *file); +static void set_argstr(char **, char **); +static char *splice(char *, char *); int main(int argc, char **argv) @@ -393,7 +394,7 @@ main(int argc, char **argv) exit(status); } -void +static void set_argstr(char **av, char **ave) { size_t argsize; @@ -413,7 +414,7 @@ set_argstr(char **av, char **ave) /* * Read in an excludes file and push each line. */ -void +static void read_excludes_file(char *file) { FILE *fp; @@ -438,7 +439,7 @@ read_excludes_file(char *file) /* * Push a pattern onto the excludes list. */ -void +static void push_excludes(char *pattern) { struct excludes *entry; @@ -449,7 +450,7 @@ push_excludes(char *pattern) excludes_list = entry; } -void +static void push_ignore_pats(char *pattern) { size_t len; @@ -465,14 +466,6 @@ push_ignore_pats(char *pattern) } } -void -print_only(const char *path, size_t dirlen, const char *entry) -{ - if (dirlen > 1) - dirlen--; - printf("Only in %.*s: %s\n", (int)dirlen, path, entry); -} - void print_status(int val, char *path1, char *path2, const char *entry) { @@ -517,7 +510,7 @@ print_status(int val, char *path1, char *path2, const char *entry) } } -void +static void usage(void) { (void)fprintf(stderr, @@ -544,10 +537,27 @@ usage(void) exit(2); } -void +static void conflicting_format(void) { fprintf(stderr, "error: conflicting output format options.\n"); usage(); } + +static char * +splice(char *dir, char *path) +{ + char *tail, *buf; + size_t dirlen; + + dirlen = strlen(dir); + while (dirlen != 0 && dir[dirlen - 1] == '/') + dirlen--; + if ((tail = strrchr(path, '/')) == NULL) + tail = path; + else + tail++; + xasprintf(&buf, "%.*s/%s", (int)dirlen, dir, tail); + return (buf); +} diff --git a/usr.bin/diff/diff.h b/usr.bin/diff/diff.h index 04e75e631954..7ae700810fc6 100644 --- a/usr.bin/diff/diff.h +++ b/usr.bin/diff/diff.h @@ -102,8 +102,6 @@ extern struct stat stb1, stb2; extern struct excludes *excludes_list; extern regex_t ignore_re; -char *splice(char *, char *); int diffreg(char *, char *, int, int); void diffdir(char *, char *, int); -void print_only(const char *, size_t, const char *); void print_status(int, char *, char *, const char *); diff --git a/usr.bin/diff/diffdir.c b/usr.bin/diff/diffdir.c index 2b6e5f366454..ecb7c4a6c4ee 100644 --- a/usr.bin/diff/diffdir.c +++ b/usr.bin/diff/diffdir.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); static int selectfile(const struct dirent *); static void diffit(struct dirent *, char *, size_t, char *, size_t, int); +static void print_only(const char *, size_t, const char *); #define d_status d_type /* we need to store status for -l */ @@ -237,3 +238,11 @@ selectfile(const struct dirent *dp) return (1); } + +void +print_only(const char *path, size_t dirlen, const char *entry) +{ + if (dirlen > 1) + dirlen--; + printf("Only in %.*s: %s\n", (int)dirlen, path, entry); +} diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 94026007a1bf..45821ad96e8c 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -486,23 +486,6 @@ opentemp(const char *f) return (fdopen(ofd, "r")); } -char * -splice(char *dir, char *path) -{ - char *tail, *buf; - size_t dirlen; - - dirlen = strlen(dir); - while (dirlen != 0 && dir[dirlen - 1] == '/') - dirlen--; - if ((tail = strrchr(path, '/')) == NULL) - tail = path; - else - tail++; - xasprintf(&buf, "%.*s/%s", (int)dirlen, dir, tail); - return (buf); -} - static bool prepare(int i, FILE *fd, size_t filesize, int flags) { From owner-dev-commits-src-all@freebsd.org Wed Sep 15 23:59:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7C024670B9D; Wed, 15 Sep 2021 23:59:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8xzD2hmgz3mwN; Wed, 15 Sep 2021 23:59:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 323C8175AB; Wed, 15 Sep 2021 23:59:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FNxqc1011145; Wed, 15 Sep 2021 23:59:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FNxqpg011144; Wed, 15 Sep 2021 23:59:52 GMT (envelope-from git) Date: Wed, 15 Sep 2021 23:59:52 GMT Message-Id: <202109152359.18FNxqpg011144@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: bcf2e78dc483 - main - diff: replace isqrt() with sqrt() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bcf2e78dc48378456798191f1c15cb76d6221a65 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 23:59:52 -0000 The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=bcf2e78dc48378456798191f1c15cb76d6221a65 commit bcf2e78dc48378456798191f1c15cb76d6221a65 Author: Piotr Pawel Stefaniak AuthorDate: 2021-09-05 00:42:56 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-15 23:46:43 +0000 diff: replace isqrt() with sqrt() Remove cruft and use a system-provided and maintained function instead. --- usr.bin/diff/diffreg.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 45821ad96e8c..c743c862f2d6 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -194,7 +195,6 @@ static int fetch(long *, int, int, FILE *, int, int, int); static int newcand(int, int, int); static int search(int *, int, int); static int skipline(FILE *); -static int isqrt(int); static int stone(int *, int, int *, int *, int); static enum readhash readhash(FILE *, int, unsigned *); static int files_differ(FILE *, FILE *, int); @@ -569,25 +569,6 @@ equiv(struct line *a, int n, struct line *b, int m, int *c) c[j] = -1; } -/* Code taken from ping.c */ -static int -isqrt(int n) -{ - int y, x = 1; - - if (n == 0) - return (0); - - do { /* newton was a stinker */ - y = x; - x = n / x; - x += y; - x /= 2; - } while ((x - y) > 1 || (x - y) < -1); - - return (x); -} - static int stone(int *a, int n, int *b, int *c, int flags) { @@ -598,7 +579,7 @@ stone(int *a, int n, int *b, int *c, int flags) if (flags & D_MINIMAL) bound = UINT_MAX; else { - sq = isqrt(n); + sq = sqrt(n); bound = MAX(256, sq); } From owner-dev-commits-src-all@freebsd.org Wed Sep 15 23:59:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B8C98670674; Wed, 15 Sep 2021 23:59:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8xzG4RfPz3mwW; Wed, 15 Sep 2021 23:59:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E44F17337; Wed, 15 Sep 2021 23:59:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FNxshd011197; Wed, 15 Sep 2021 23:59:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FNxskV011196; Wed, 15 Sep 2021 23:59:54 GMT (envelope-from git) Date: Wed, 15 Sep 2021 23:59:54 GMT Message-Id: <202109152359.18FNxskV011196@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 7760b8541418 - main - diff: decrease indent level MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7760b85414189789c792c92c66bb3ddb877deae1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 23:59:55 -0000 The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=7760b85414189789c792c92c66bb3ddb877deae1 commit 7760b85414189789c792c92c66bb3ddb877deae1 Author: Piotr Pawel Stefaniak AuthorDate: 2021-09-05 14:26:23 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-15 23:46:44 +0000 diff: decrease indent level An upcoming change will add more code in the loop. --- usr.bin/diff/diffreg.c | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 4a00aff9243b..c9095ec46e88 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -1378,35 +1378,34 @@ match_function(const long *f, int pos, FILE *fp) const char *state = NULL; lastline = pos; - while (pos > last) { + for (; pos > last; pos--) { fseek(fp, f[pos - 1], SEEK_SET); nc = f[pos] - f[pos - 1]; if (nc >= sizeof(buf)) nc = sizeof(buf) - 1; nc = fread(buf, 1, nc, fp); - if (nc > 0) { - buf[nc] = '\0'; - buf[strcspn(buf, "\n")] = '\0'; - if (isalpha(buf[0]) || buf[0] == '_' || buf[0] == '$') { - if (begins_with(buf, "private:")) { - if (!state) - state = " (private)"; - } else if (begins_with(buf, "protected:")) { - if (!state) - state = " (protected)"; - } else if (begins_with(buf, "public:")) { - if (!state) - state = " (public)"; - } else { - strlcpy(lastbuf, buf, sizeof(lastbuf)); - if (state) - strlcat(lastbuf, state, sizeof(lastbuf)); - lastmatchline = pos; - return (lastbuf); - } + if (nc == 0) + continue; + buf[nc] = '\0'; + buf[strcspn(buf, "\n")] = '\0'; + if (isalpha(buf[0]) || buf[0] == '_' || buf[0] == '$') { + if (begins_with(buf, "private:")) { + if (!state) + state = " (private)"; + } else if (begins_with(buf, "protected:")) { + if (!state) + state = " (protected)"; + } else if (begins_with(buf, "public:")) { + if (!state) + state = " (public)"; + } else { + strlcpy(lastbuf, buf, sizeof(lastbuf)); + if (state) + strlcat(lastbuf, state, sizeof(lastbuf)); + lastmatchline = pos; + return (lastbuf); } } - pos--; } return (lastmatchline > 0 ? lastbuf : NULL); } From owner-dev-commits-src-all@freebsd.org Wed Sep 15 23:59:57 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C153670BAA; Wed, 15 Sep 2021 23:59:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8xzK0sqfz3n2P; Wed, 15 Sep 2021 23:59:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFCB8173C1; Wed, 15 Sep 2021 23:59:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FNxu08011245; Wed, 15 Sep 2021 23:59:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FNxuAB011244; Wed, 15 Sep 2021 23:59:56 GMT (envelope-from git) Date: Wed, 15 Sep 2021 23:59:56 GMT Message-Id: <202109152359.18FNxuAB011244@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: e51aabf8cbb9 - main - diff: implement option -F (--show-function-line) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e51aabf8cbb9b412c725c4c9c727ca6faa0630c6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 23:59:57 -0000 The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=e51aabf8cbb9b412c725c4c9c727ca6faa0630c6 commit e51aabf8cbb9b412c725c4c9c727ca6faa0630c6 Author: Piotr Pawel Stefaniak AuthorDate: 2021-09-05 14:54:07 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-15 23:46:44 +0000 diff: implement option -F (--show-function-line) With unified and context diffs, show the last line that matches the provided pattern before the context. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D31714 --- usr.bin/diff/diff.1 | 8 +++++++ usr.bin/diff/diff.c | 59 +++++++++++++++++++++++++++++++++----------------- usr.bin/diff/diff.h | 6 +++-- usr.bin/diff/diffreg.c | 14 +++++++++--- 4 files changed, 62 insertions(+), 25 deletions(-) diff --git a/usr.bin/diff/diff.1 b/usr.bin/diff/diff.1 index 6056ddd3ac76..dea01bf918f4 100644 --- a/usr.bin/diff/diff.1 +++ b/usr.bin/diff/diff.1 @@ -65,11 +65,13 @@ .Op Fl -text .Op Fl -unified .Op Fl I Ar pattern | Fl -ignore-matching-lines Ar pattern +.Op Fl F Ar pattern | Fl -show-function-line Ar pattern .Op Fl L Ar label | Fl -label Ar label .Ar file1 file2 .Nm diff .Op Fl aBbdilpTtw .Op Fl I Ar pattern | Fl -ignore-matching-lines Ar pattern +.Op Fl F Ar pattern | Fl -show-function-line Ar pattern .Op Fl L Ar label | Fl -label Ar label .Op Fl -brief .Op Fl -color Ns = Ns Ar when @@ -123,6 +125,7 @@ .Nm diff .Op Fl aBbdilpTtw .Op Fl I Ar pattern | Fl -ignore-matching-lines Ar pattern +.Op Fl F Ar pattern | Fl -show-function-line Ar pattern .Op Fl L Ar label | Fl -label Ar label .Op Fl -brief .Op Fl -color Ns = Ns Ar when @@ -180,6 +183,7 @@ .Op Fl -unidirectional-new-file .Op Fl -unified .Op Fl I Ar pattern | Fl -ignore-matching-lines Ar pattern +.Op Fl F Ar pattern | Fl -show-function-line Ar pattern .Bk -words .Op Fl L Ar label | Fl -label Ar label .Op Fl S Ar name | Fl -starting-file Ar name @@ -357,6 +361,10 @@ environment variable is set to a non-empty string. Try very hard to produce a diff as small as possible. This may consume a lot of processing power and memory when processing large files with many changes. +.It Fl F Ar pattern, Fl -show-function-line Ar pattern +Like +.Fl p, +but display the last line that matches provided pattern. .It Fl I Ar pattern Fl -ignore-matching-lines Ar pattern Ignores changes, insertions, and deletions whose lines match the extended regular expression diff --git a/usr.bin/diff/diff.c b/usr.bin/diff/diff.c index 4fc3094035d9..8074261742ae 100644 --- a/usr.bin/diff/diff.c +++ b/usr.bin/diff/diff.c @@ -43,14 +43,15 @@ bool ignore_file_case, suppress_common, color; int diff_format, diff_context, status; int tabsize = 8, width = 130; static int colorflag = COLORFLAG_NEVER; -char *start, *ifdefname, *diffargs, *label[2], *ignore_pats; +char *start, *ifdefname, *diffargs, *label[2]; +char *ignore_pats, *most_recent_pat; char *group_format = NULL; const char *add_code, *del_code; struct stat stb1, stb2; struct excludes *excludes_list; -regex_t ignore_re; +regex_t ignore_re, most_recent_re; -#define OPTIONS "0123456789aBbC:cdD:efHhI:iL:lnNPpqrS:sTtU:uwW:X:x:y" +#define OPTIONS "0123456789aBbC:cdD:efF:HhI:iL:lnNPpqrS:sTtU:uwW:X:x:y" enum { OPT_TSIZE = CHAR_MAX + 1, OPT_STRIPCR, @@ -71,6 +72,7 @@ static struct option longopts[] = { { "minimal", no_argument, 0, 'd' }, { "ed", no_argument, 0, 'e' }, { "forward-ed", no_argument, 0, 'f' }, + { "show-function-line", required_argument, 0, 'F' }, { "speed-large-files", no_argument, NULL, 'H' }, { "ignore-blank-lines", no_argument, 0, 'B' }, { "ignore-matching-lines", required_argument, 0, 'I' }, @@ -105,6 +107,7 @@ static struct option longopts[] = { { NULL, 0, 0, '\0'} }; +static void checked_regcomp(char const *, regex_t *); static void usage(void) __dead2; static void conflicting_format(void) __dead2; static void push_excludes(char *); @@ -190,6 +193,12 @@ main(int argc, char **argv) case 'B': dflags |= D_SKIPBLANKLINES; break; + case 'F': + if (dflags & D_PROTOTYPE) + conflicting_format(); + dflags |= D_MATCHLAST; + most_recent_pat = xstrdup(optarg); + break; case 'I': push_ignore_pats(optarg); break; @@ -216,6 +225,8 @@ main(int argc, char **argv) diff_format = D_NREVERSE; break; case 'p': + if (dflags & D_MATCHLAST) + conflicting_format(); dflags |= D_PROTOTYPE; break; case 'P': @@ -359,19 +370,8 @@ main(int argc, char **argv) */ if (argc != 2) usage(); - if (ignore_pats != NULL) { - char buf[BUFSIZ]; - int error; - - if ((error = regcomp(&ignore_re, ignore_pats, - REG_NEWLINE | REG_EXTENDED)) != 0) { - regerror(error, &ignore_re, buf, sizeof(buf)); - if (*ignore_pats != '\0') - errx(2, "%s: %s", ignore_pats, buf); - else - errx(2, "%s", buf); - } - } + checked_regcomp(ignore_pats, &ignore_re); + checked_regcomp(most_recent_pat, &most_recent_re); if (strcmp(argv[0], "-") == 0) { fstat(STDIN_FILENO, &stb1); gotstdin = 1; @@ -426,6 +426,25 @@ main(int argc, char **argv) exit(status); } +static void +checked_regcomp(char const *pattern, regex_t *comp) +{ + char buf[BUFSIZ]; + int error; + + if (pattern == NULL) + return; + + error = regcomp(comp, pattern, REG_NEWLINE | REG_EXTENDED); + if (error != 0) { + regerror(error, comp, buf, sizeof(buf)); + if (*pattern != '\0') + errx(2, "%s: %s", pattern, buf); + else + errx(2, "%s", buf); + } +} + static void set_argstr(char **av, char **ave) { @@ -548,18 +567,18 @@ usage(void) (void)fprintf(stderr, "usage: diff [-aBbdilpTtw] [-c | -e | -f | -n | -q | -u] [--ignore-case]\n" " [--no-ignore-case] [--normal] [--strip-trailing-cr] [--tabsize]\n" - " [-I pattern] [-L label] file1 file2\n" + " [-I pattern] [-F pattern] [-L label] file1 file2\n" " diff [-aBbdilpTtw] [-I pattern] [-L label] [--ignore-case]\n" " [--no-ignore-case] [--normal] [--strip-trailing-cr] [--tabsize]\n" - " -C number file1 file2\n" + " [-F pattern] -C number file1 file2\n" " diff [-aBbdiltw] [-I pattern] [--ignore-case] [--no-ignore-case]\n" " [--normal] [--strip-trailing-cr] [--tabsize] -D string file1 file2\n" " diff [-aBbdilpTtw] [-I pattern] [-L label] [--ignore-case]\n" " [--no-ignore-case] [--normal] [--tabsize] [--strip-trailing-cr]\n" - " -U number file1 file2\n" + " [-F pattern] -U number file1 file2\n" " diff [-aBbdilNPprsTtw] [-c | -e | -f | -n | -q | -u] [--ignore-case]\n" " [--no-ignore-case] [--normal] [--tabsize] [-I pattern] [-L label]\n" - " [-S name] [-X file] [-x pattern] dir1 dir2\n" + " [-F pattern] [-S name] [-X file] [-x pattern] dir1 dir2\n" " diff [-aBbditwW] [--expand-tabs] [--ignore-all-blanks]\n" " [--ignore-blank-lines] [--ignore-case] [--minimal]\n" " [--no-ignore-file-name-case] [--strip-trailing-cr]\n" diff --git a/usr.bin/diff/diff.h b/usr.bin/diff/diff.h index 5164fe22ace4..4a7d19ee8982 100644 --- a/usr.bin/diff/diff.h +++ b/usr.bin/diff/diff.h @@ -74,6 +74,7 @@ #define D_IGNOREBLANKS 0x200 /* Ignore white space changes */ #define D_STRIPCR 0x400 /* Strip trailing cr */ #define D_SKIPBLANKLINES 0x800 /* Skip blank lines */ +#define D_MATCHLAST 0x1000 /* Display last line matching provided regex */ /* * Status values for print_status() and diffreg() return values @@ -103,12 +104,13 @@ extern bool lflag, Nflag, Pflag, rflag, sflag, Tflag, cflag; extern bool ignore_file_case, suppress_common, color; extern int diff_format, diff_context, status; extern int tabsize, width; -extern char *start, *ifdefname, *diffargs, *label[2], *ignore_pats; +extern char *start, *ifdefname, *diffargs, *label[2]; +extern char *ignore_pats, *most_recent_pat; extern char *group_format; extern const char *add_code, *del_code; extern struct stat stb1, stb2; extern struct excludes *excludes_list; -extern regex_t ignore_re; +extern regex_t ignore_re, most_recent_re; int diffreg(char *, char *, int, int); void diffdir(char *, char *, int); diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index 47c1934a6a65..fc3c3406a073 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -1407,7 +1407,15 @@ match_function(const long *f, int pos, FILE *fp) continue; buf[nc] = '\0'; buf[strcspn(buf, "\n")] = '\0'; - if (isalpha(buf[0]) || buf[0] == '_' || buf[0] == '$') { + if (most_recent_pat != NULL) { + int ret = regexec(&most_recent_re, buf, 0, NULL, 0); + + if (ret != 0) + continue; + strlcpy(lastbuf, buf, sizeof(lastbuf)); + lastmatchline = pos; + return (lastbuf); + } else if (isalpha(buf[0]) || buf[0] == '_' || buf[0] == '$') { if (begins_with(buf, "private:")) { if (!state) state = " (private)"; @@ -1448,7 +1456,7 @@ dump_context_vec(FILE *f1, FILE *f2, int flags) upd = MIN(len[1], context_vec_ptr->d + diff_context); printf("***************"); - if ((flags & D_PROTOTYPE)) { + if (flags & (D_PROTOTYPE | D_MATCHLAST)) { f = match_function(ixold, lowa - 1, f1); if (f != NULL) printf(" %s", f); @@ -1555,7 +1563,7 @@ dump_unified_vec(FILE *f1, FILE *f2, int flags) printf(" +"); uni_range(lowc, upd); printf(" @@"); - if ((flags & D_PROTOTYPE)) { + if (flags & (D_PROTOTYPE | D_MATCHLAST)) { f = match_function(ixold, lowa - 1, f1); if (f != NULL) printf(" %s", f); From owner-dev-commits-src-all@freebsd.org Wed Sep 15 23:59:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D6297670B18; Wed, 15 Sep 2021 23:59:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8xzF3LYWz3mtZ; Wed, 15 Sep 2021 23:59:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CC5C172EF; Wed, 15 Sep 2021 23:59:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FNxrLO011173; Wed, 15 Sep 2021 23:59:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FNxr2N011172; Wed, 15 Sep 2021 23:59:53 GMT (envelope-from git) Date: Wed, 15 Sep 2021 23:59:53 GMT Message-Id: <202109152359.18FNxr2N011172@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 2171b2cbe084 - main - diff: avoid applying offsets to null pointer MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2171b2cbe084118e0e8f7de658f0302d0feb8827 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 23:59:54 -0000 The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=2171b2cbe084118e0e8f7de658f0302d0feb8827 commit 2171b2cbe084118e0e8f7de658f0302d0feb8827 Author: Piotr Pawel Stefaniak AuthorDate: 2021-09-05 16:59:08 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-15 23:46:44 +0000 diff: avoid applying offsets to null pointer This was the only instance of undefined behavior I could find so far. --- usr.bin/diff/diffreg.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index c743c862f2d6..4a00aff9243b 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -255,7 +255,6 @@ diffreg(char *file1, char *file2, int flags, int capsicum) anychange = 0; lastline = 0; lastmatchline = 0; - context_vec_ptr = context_vec_start - 1; /* * hw excludes padding and make sure when -t is not used, @@ -1050,8 +1049,12 @@ proceed: /* * Allocate change records as needed. */ - if (context_vec_ptr == context_vec_end - 1) { - ptrdiff_t offset = context_vec_ptr - context_vec_start; + if (context_vec_start == NULL || + context_vec_ptr == context_vec_end - 1) { + ptrdiff_t offset = -1; + + if (context_vec_start != NULL) + offset = context_vec_ptr - context_vec_start; max_context <<= 1; context_vec_start = xreallocarray(context_vec_start, max_context, sizeof(*context_vec_start)); From owner-dev-commits-src-all@freebsd.org Wed Sep 15 23:59:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E81FC6709C0; Wed, 15 Sep 2021 23:59:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8xzH5965z3mtl; Wed, 15 Sep 2021 23:59:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85E8A17469; Wed, 15 Sep 2021 23:59:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18FNxtFi011221; Wed, 15 Sep 2021 23:59:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18FNxtbP011220; Wed, 15 Sep 2021 23:59:55 GMT (envelope-from git) Date: Wed, 15 Sep 2021 23:59:55 GMT Message-Id: <202109152359.18FNxtbP011220@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: f38702e5a52e - main - diff(1): Add --color support MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f38702e5a52e1350b9349bc297ccd0b50b1941c3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 23:59:56 -0000 The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=f38702e5a52e1350b9349bc297ccd0b50b1941c3 commit f38702e5a52e1350b9349bc297ccd0b50b1941c3 Author: Cameron Katri AuthorDate: 2021-09-05 00:10:41 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-15 23:46:44 +0000 diff(1): Add --color support Adds a --color flag to diff(1) that supports the same options as GNU's diff(1). The colors are customizable with the env var DIFFCOLORS in a format similar to grep(1)'s GREPCOLORS. An example would be 04;36:41 for additions to be underlined light blue, and deletions have a red background. Differential Revision: https://reviews.freebsd.org/D30545 --- usr.bin/diff/diff.1 | 35 ++++++++++++++++++++++++++++++++ usr.bin/diff/diff.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++- usr.bin/diff/diff.h | 10 ++++++++- usr.bin/diff/diffreg.c | 21 ++++++++++++++++++- 4 files changed, 118 insertions(+), 3 deletions(-) diff --git a/usr.bin/diff/diff.1 b/usr.bin/diff/diff.1 index e0a790f6efb6..6056ddd3ac76 100644 --- a/usr.bin/diff/diff.1 +++ b/usr.bin/diff/diff.1 @@ -44,6 +44,7 @@ .Fl n | q | u | y .Oc .Op Fl -brief +.Op Fl -color Ns = Ns Ar when .Op Fl -changed-group-format Ar GFMT .Op Fl -ed .Op Fl -expand-tabs @@ -71,6 +72,7 @@ .Op Fl I Ar pattern | Fl -ignore-matching-lines Ar pattern .Op Fl L Ar label | Fl -label Ar label .Op Fl -brief +.Op Fl -color Ns = Ns Ar when .Op Fl -changed-group-format Ar GFMT .Op Fl -ed .Op Fl -expand-tabs @@ -96,6 +98,7 @@ .Op Fl aBbdiltw .Op Fl I Ar pattern | Fl -ignore-matching-lines Ar pattern .Op Fl -brief +.Op Fl -color Ns = Ns Ar when .Op Fl -changed-group-format Ar GFMT .Op Fl -ed .Op Fl -expand-tabs @@ -122,6 +125,7 @@ .Op Fl I Ar pattern | Fl -ignore-matching-lines Ar pattern .Op Fl L Ar label | Fl -label Ar label .Op Fl -brief +.Op Fl -color Ns = Ns Ar when .Op Fl -changed-group-format Ar GFMT .Op Fl -ed .Op Fl -expand-tabs @@ -150,6 +154,7 @@ .Fl n | q | u .Oc .Op Fl -brief +.Op Fl -color Ns = Ns Ar when .Op Fl -changed-group-format Ar GFMT .Op Fl -context .Op Fl -ed @@ -184,6 +189,7 @@ .Ar dir1 dir2 .Nm diff .Op Fl aBbditwW +.Op Fl -color Ns = Ns Ar when .Op Fl -expand-tabs .Op Fl -ignore-all-blanks .Op Fl -ignore-blank-lines @@ -332,6 +338,21 @@ Causes chunks that include only blank lines to be ignored. .It Fl b -ignore-space-change Causes trailing blanks (spaces and tabs) to be ignored, and other strings of blanks to compare equal. +.It Fl -color= Ns Oo Ar when Oc +Color the additions green, and removals red, or the value in the +.Ev DIFFCOLORS +environment variable. +The possible values of +.Ar when +are +.Dq Cm never , +.Dq Cm always +and +.Dq Cm auto . +.Cm auto +will use color if the output is a tty and the +.Ev COLORTERM +environment variable is set to a non-empty string. .It Fl d -minimal Try very hard to produce a diff as small as possible. This may consume a lot of processing power and memory when processing @@ -592,6 +613,20 @@ As in identical pairs (where num1 = num2) are abbreviated as a single number. +.Sh ENVIRONMENT +.Bl -tag -width DIFFCOLORS +.It Ev DIFFCOLORS +The value of this variable is the form +.Ar add Ns : Ns Ar rm , +where +.Ar add +is the ASCII escape sequence for additions and +.Ar rm +is the ASCII escape sequence for deletions. +If this is unset, +.Nm +uses green for additions and red for removals. +.El .Sh FILES .Bl -tag -width /tmp/diff.XXXXXXXX -compact .It Pa /tmp/diff.XXXXXXXX diff --git a/usr.bin/diff/diff.c b/usr.bin/diff/diff.c index a5966e74dbcc..4fc3094035d9 100644 --- a/usr.bin/diff/diff.c +++ b/usr.bin/diff/diff.c @@ -39,11 +39,13 @@ __FBSDID("$FreeBSD$"); #include "xmalloc.h" bool lflag, Nflag, Pflag, rflag, sflag, Tflag, cflag; -bool ignore_file_case, suppress_common; +bool ignore_file_case, suppress_common, color; int diff_format, diff_context, status; int tabsize = 8, width = 130; +static int colorflag = COLORFLAG_NEVER; char *start, *ifdefname, *diffargs, *label[2], *ignore_pats; char *group_format = NULL; +const char *add_code, *del_code; struct stat stb1, stb2; struct excludes *excludes_list; regex_t ignore_re; @@ -58,6 +60,7 @@ enum { OPT_HORIZON_LINES, OPT_CHANGED_GROUP_FORMAT, OPT_SUPPRESS_COMMON, + OPT_COLOR, }; static struct option longopts[] = { @@ -98,6 +101,7 @@ static struct option longopts[] = { { "tabsize", required_argument, NULL, OPT_TSIZE }, { "changed-group-format", required_argument, NULL, OPT_CHANGED_GROUP_FORMAT}, { "suppress-common-lines", no_argument, NULL, OPT_SUPPRESS_COMMON }, + { "color", optional_argument, NULL, OPT_COLOR }, { NULL, 0, 0, '\0'} }; @@ -108,6 +112,7 @@ static void push_ignore_pats(char *); static void read_excludes_file(char *file); static void set_argstr(char **, char **); static char *splice(char *, char *); +static bool do_color(void); int main(int argc, char **argv) @@ -301,6 +306,17 @@ main(int argc, char **argv) case OPT_SUPPRESS_COMMON: suppress_common = 1; break; + case OPT_COLOR: + if (optarg == NULL || strncmp(optarg, "auto", 4) == 0) + colorflag = COLORFLAG_AUTO; + else if (strncmp(optarg, "always", 6) == 0) + colorflag = COLORFLAG_ALWAYS; + else if (strncmp(optarg, "never", 5) == 0) + colorflag = COLORFLAG_NEVER; + else + errx(2, "unsupported --color value '%s' (must be always, auto, or never)", + optarg); + break; default: usage(); break; @@ -316,6 +332,22 @@ main(int argc, char **argv) argc -= optind; argv += optind; + if (do_color()) { + char *p; + const char *env; + + color = true; + add_code = "32"; + del_code = "31"; + env = getenv("DIFFCOLORS"); + if (env != NULL && *env != '\0' && (p = strdup(env))) { + add_code = p; + strsep(&p, ":"); + if (p != NULL) + del_code = p; + } + } + #ifdef __OpenBSD__ if (pledge("stdio rpath tmppath", NULL) == -1) err(2, "pledge"); @@ -545,6 +577,27 @@ conflicting_format(void) usage(); } +static bool +do_color(void) +{ + const char *p, *p2; + + switch (colorflag) { + case COLORFLAG_AUTO: + p = getenv("CLICOLOR"); + p2 = getenv("COLORTERM"); + if ((p != NULL && *p != '\0') || (p2 != NULL && *p2 != '\0')) + return isatty(STDOUT_FILENO); + break; + case COLORFLAG_ALWAYS: + return (true); + case COLORFLAG_NEVER: + return (false); + } + + return (false); +} + static char * splice(char *dir, char *path) { diff --git a/usr.bin/diff/diff.h b/usr.bin/diff/diff.h index 7ae700810fc6..5164fe22ace4 100644 --- a/usr.bin/diff/diff.h +++ b/usr.bin/diff/diff.h @@ -87,17 +87,25 @@ #define D_SKIPPED2 6 /* path2 was a special file */ #define D_ERROR 7 /* A file access error occurred */ +/* + * Color options + */ +#define COLORFLAG_NEVER 0 +#define COLORFLAG_AUTO 1 +#define COLORFLAG_ALWAYS 2 + struct excludes { char *pattern; struct excludes *next; }; extern bool lflag, Nflag, Pflag, rflag, sflag, Tflag, cflag; -extern bool ignore_file_case, suppress_common; +extern bool ignore_file_case, suppress_common, color; extern int diff_format, diff_context, status; extern int tabsize, width; extern char *start, *ifdefname, *diffargs, *label[2], *ignore_pats; extern char *group_format; +extern const char *add_code, *del_code; extern struct stat stb1, stb2; extern struct excludes *excludes_list; extern regex_t ignore_re; diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c index c9095ec46e88..47c1934a6a65 100644 --- a/usr.bin/diff/diffreg.c +++ b/usr.bin/diff/diffreg.c @@ -1140,13 +1140,23 @@ proceed: } } if (diff_format == D_SIDEBYSIDE) { + if (color && a > b) + printf("\033[%sm", add_code); + else if (color && c > d) + printf("\033[%sm", del_code); if (a > b) { print_space(0, hw + padding , *pflags); } else { nc = fetch(ixold, a, b, f1, '\0', 1, *pflags); print_space(nc, hw - nc + padding, *pflags); } + if (color && a > b) + printf("\033[%sm", add_code); + else if (color && c > d) + printf("\033[%sm", del_code); printf("%c", (a > b) ? '>' : ((c > d) ? '<' : '|')); + if (color && c > d) + printf("\033[m"); print_space(hw + padding + 1 , padding, *pflags); fetch(ixnew, c, d, f2, '\0', 0, *pflags); printf("\n"); @@ -1220,6 +1230,10 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) nc = hw; if (diff_format != D_IFDEF && diff_format != D_GFORMAT && ch != '\0') { + if (color && (ch == '>' || ch == '+')) + printf("\033[%sm", add_code); + else if (color && (ch == '<' || ch == '-')) + printf("\033[%sm", del_code); printf("%c", ch); if (Tflag && (diff_format == D_NORMAL || diff_format == D_CONTEXT || @@ -1290,12 +1304,17 @@ fetch(long *f, int a, int b, FILE *lb, int ch, int oldfile, int flags) } /* when side-by-side, do not print a newline */ if (diff_format != D_SIDEBYSIDE || c != '\n') { - printf("%c", c); + if (color && c == '\n') + printf("\033[m%c", c); + else + printf("%c", c); col++; } } } } + if (color && diff_format == D_SIDEBYSIDE) + printf("\033[m"); return (col); } From owner-dev-commits-src-all@freebsd.org Thu Sep 16 00:32:59 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 59C7767126B; Thu, 16 Sep 2021 00:32:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H8yjR24DNz4QlV; Thu, 16 Sep 2021 00:32:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2787717A6E; Thu, 16 Sep 2021 00:32:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18G0WxFn063884; Thu, 16 Sep 2021 00:32:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18G0Wxbc063883; Thu, 16 Sep 2021 00:32:59 GMT (envelope-from git) Date: Thu, 16 Sep 2021 00:32:59 GMT Message-Id: <202109160032.18G0Wxbc063883@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: 9ebe4b8c67bf - main - nfscl: Add vfs.nfs.maxalloclen to limit Allocate/Deallocate RPC RTT MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9ebe4b8c67bf823e62617ba9fbd3c9c1768c8b3b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 00:32:59 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=9ebe4b8c67bf823e62617ba9fbd3c9c1768c8b3b commit 9ebe4b8c67bf823e62617ba9fbd3c9c1768c8b3b Author: Rick Macklem AuthorDate: 2021-09-16 00:29:45 +0000 Commit: Rick Macklem CommitDate: 2021-09-16 00:29:45 +0000 nfscl: Add vfs.nfs.maxalloclen to limit Allocate/Deallocate RPC RTT Unlike Copy, the NFSv4.2 Allocate and Deallocate operations do not allow a reply with partial completion. As such, the only way to limit the time the operation takes to provide a reasonable RPC RTT is to limit the size of the allocation/deallocation in the NFSv4.2 client. This patch adds a sysctl called vfs.nfs.maxalloclen to set the limit on the size of the Allocate operation. There is no way to know how long a server will take to do an allocate operation, but 64Mbytes results in a reasonable RPC RTT for the slow hardware I test on, so that is what the default value for vfs.nfs.maxalloclen is set to. For an 8Gbyte allocation, the elapsed time for doing it in 64Mbyte chunks was the same as the elapsed time taken for a single large allocation operation for a FreeBSD server with a UFS file system. MFC after: 2 weeks --- sys/fs/nfsclient/nfs_clvnops.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index bfd77d50bc91..85b5dd9cfbb1 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -301,6 +301,10 @@ int newnfs_directio_allow_mmap = 1; SYSCTL_INT(_vfs_nfs, OID_AUTO, nfs_directio_allow_mmap, CTLFLAG_RW, &newnfs_directio_allow_mmap, 0, "Enable mmaped IO on file with O_DIRECT opens"); +static uint64_t nfs_maxalloclen = 64 * 1024 * 1024; +SYSCTL_U64(_vfs_nfs, OID_AUTO, maxalloclen, CTLFLAG_RW, + &nfs_maxalloclen, 0, "NFS max allocate/deallocate length"); + #define NFSACCESS_ALL (NFSACCESS_READ | NFSACCESS_MODIFY \ | NFSACCESS_EXTEND | NFSACCESS_EXECUTE \ | NFSACCESS_DELETE | NFSACCESS_LOOKUP) @@ -3639,6 +3643,7 @@ nfs_allocate(struct vop_allocate_args *ap) struct thread *td = curthread; struct nfsvattr nfsva; struct nfsmount *nmp; + off_t alen; int attrflag, error, ret; attrflag = 0; @@ -3652,12 +3657,16 @@ nfs_allocate(struct vop_allocate_args *ap) * file's allocation on the server. */ error = ncl_flush(vp, MNT_WAIT, td, 1, 0); - if (error == 0) - error = nfsrpc_allocate(vp, *ap->a_offset, *ap->a_len, + if (error == 0) { + alen = *ap->a_len; + if ((uint64_t)alen > nfs_maxalloclen) + alen = nfs_maxalloclen; + error = nfsrpc_allocate(vp, *ap->a_offset, alen, &nfsva, &attrflag, td->td_ucred, td, NULL); + } if (error == 0) { - *ap->a_offset += *ap->a_len; - *ap->a_len = 0; + *ap->a_offset += alen; + *ap->a_len -= alen; } else if (error == NFSERR_NOTSUPP) { mtx_lock(&nmp->nm_mtx); nmp->nm_privflag |= NFSMNTP_NOALLOCATE; From owner-dev-commits-src-all@freebsd.org Thu Sep 16 01:43:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 423AF67227D; Thu, 16 Sep 2021 01:43:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H90H31D6Kz4lfn; Thu, 16 Sep 2021 01:43:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A6A118E23; Thu, 16 Sep 2021 01:43:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18G1hgbf057056; Thu, 16 Sep 2021 01:43:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18G1hg6q057055; Thu, 16 Sep 2021 01:43:42 GMT (envelope-from git) Date: Thu, 16 Sep 2021 01:43:42 GMT Message-Id: <202109160143.18G1hg6q057055@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 8895170347fc - stable/13 - bnxt(4): Fix bugs in WOL support. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8895170347fcfd9c9acf413ed408f11b15760b4b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 01:43:43 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=8895170347fcfd9c9acf413ed408f11b15760b4b commit 8895170347fcfd9c9acf413ed408f11b15760b4b Author: Alexander Motin AuthorDate: 2021-09-02 22:11:58 +0000 Commit: Alexander Motin CommitDate: 2021-09-16 01:43:40 +0000 bnxt(4): Fix bugs in WOL support. Before this change driver reported IFCAP_WOL_MAGIC enabled, but not supported. It caused errors on some SIOCSIFCAP calls. Instead report the support if hardware supports WOL, and enabled status if it has such filter installed on boot. Also bnxt_wol_config() should check WOL status in if_getcapenable(), not in if_getcapabilities() to get current one. MFC after: 2 weeks Sponsored by: iXsystems, Inc. (cherry picked from commit 8c14d7da5b9be78f71b1aa803e93ae7de973dd42) --- sys/dev/bnxt/if_bnxt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index 9990e26263b3..52d989a88392 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -796,6 +796,9 @@ bnxt_attach_pre(if_ctx_t ctx) IFCAP_VLAN_HWCSUM | IFCAP_JUMBO_MTU; if (bnxt_wol_supported(softc)) + scctx->isc_capabilities |= IFCAP_WOL_MAGIC; + bnxt_get_wol_settings(softc); + if (softc->wol) scctx->isc_capenable |= IFCAP_WOL_MAGIC; /* Get the queue config */ @@ -805,8 +808,6 @@ bnxt_attach_pre(if_ctx_t ctx) goto failed; } - bnxt_get_wol_settings(softc); - /* Now perform a function reset */ rc = bnxt_hwrm_func_reset(softc); bnxt_clear_ids(softc); @@ -1600,7 +1601,7 @@ bnxt_wol_config(if_ctx_t ctx) if (!bnxt_wol_supported(softc)) return -ENOTSUP; - if (if_getcapabilities(ifp) & IFCAP_WOL_MAGIC) { + if (if_getcapenable(ifp) & IFCAP_WOL_MAGIC) { if (!softc->wol) { if (bnxt_hwrm_alloc_wol_fltr(softc)) return -EBUSY; From owner-dev-commits-src-all@freebsd.org Thu Sep 16 01:44:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BF805672503; Thu, 16 Sep 2021 01:44:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H90Hd53Jfz4lcS; Thu, 16 Sep 2021 01:44:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DEC3189DD; Thu, 16 Sep 2021 01:44:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18G1iDAr057214; Thu, 16 Sep 2021 01:44:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18G1iDVj057213; Thu, 16 Sep 2021 01:44:13 GMT (envelope-from git) Date: Thu, 16 Sep 2021 01:44:13 GMT Message-Id: <202109160144.18G1iDVj057213@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 1a9342cfb036 - stable/12 - bnxt(4): Fix bugs in WOL support. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 1a9342cfb036b22fad93759c6093139ead6ecddb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 01:44:13 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=1a9342cfb036b22fad93759c6093139ead6ecddb commit 1a9342cfb036b22fad93759c6093139ead6ecddb Author: Alexander Motin AuthorDate: 2021-09-02 22:11:58 +0000 Commit: Alexander Motin CommitDate: 2021-09-16 01:44:06 +0000 bnxt(4): Fix bugs in WOL support. Before this change driver reported IFCAP_WOL_MAGIC enabled, but not supported. It caused errors on some SIOCSIFCAP calls. Instead report the support if hardware supports WOL, and enabled status if it has such filter installed on boot. Also bnxt_wol_config() should check WOL status in if_getcapenable(), not in if_getcapabilities() to get current one. MFC after: 2 weeks Sponsored by: iXsystems, Inc. (cherry picked from commit 8c14d7da5b9be78f71b1aa803e93ae7de973dd42) --- sys/dev/bnxt/if_bnxt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/bnxt/if_bnxt.c b/sys/dev/bnxt/if_bnxt.c index 002a18a2ee29..381c4df49372 100644 --- a/sys/dev/bnxt/if_bnxt.c +++ b/sys/dev/bnxt/if_bnxt.c @@ -798,6 +798,9 @@ bnxt_attach_pre(if_ctx_t ctx) IFCAP_VLAN_HWCSUM | IFCAP_JUMBO_MTU; if (bnxt_wol_supported(softc)) + scctx->isc_capabilities |= IFCAP_WOL_MAGIC; + bnxt_get_wol_settings(softc); + if (softc->wol) scctx->isc_capenable |= IFCAP_WOL_MAGIC; /* Get the queue config */ @@ -807,8 +810,6 @@ bnxt_attach_pre(if_ctx_t ctx) goto failed; } - bnxt_get_wol_settings(softc); - /* Now perform a function reset */ rc = bnxt_hwrm_func_reset(softc); bnxt_clear_ids(softc); @@ -1593,7 +1594,7 @@ bnxt_wol_config(if_ctx_t ctx) if (!bnxt_wol_supported(softc)) return -ENOTSUP; - if (if_getcapabilities(ifp) & IFCAP_WOL_MAGIC) { + if (if_getcapenable(ifp) & IFCAP_WOL_MAGIC) { if (!softc->wol) { if (bnxt_hwrm_alloc_wol_fltr(softc)) return -EBUSY; From owner-dev-commits-src-all@freebsd.org Thu Sep 16 06:29:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7167867537E; Thu, 16 Sep 2021 06:29:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H96cs1Txlz50ML; Thu, 16 Sep 2021 06:29:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14C341C8C4; Thu, 16 Sep 2021 06:29:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18G6TWuH030946; Thu, 16 Sep 2021 06:29:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18G6TWMV030945; Thu, 16 Sep 2021 06:29:32 GMT (envelope-from git) Date: Thu, 16 Sep 2021 06:29:32 GMT Message-Id: <202109160629.18G6TWMV030945@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Holm Subject: git: bab406830ab6 - main - stress2: Added more unionfs tests MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pho X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bab406830ab6e9ea777df84991dbae628223422c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 06:29:33 -0000 The branch main has been updated by pho: URL: https://cgit.FreeBSD.org/src/commit/?id=bab406830ab6e9ea777df84991dbae628223422c commit bab406830ab6e9ea777df84991dbae628223422c Author: Peter Holm AuthorDate: 2021-09-16 06:29:07 +0000 Commit: Peter Holm CommitDate: 2021-09-16 06:29:07 +0000 stress2: Added more unionfs tests --- tools/test/stress2/misc/all.exclude | 2 + tools/test/stress2/misc/unionfs4.sh | 77 ++++++++++++++++++++++++++++++++++ tools/test/stress2/misc/unionfs5.sh | 83 +++++++++++++++++++++++++++++++++++++ 3 files changed, 162 insertions(+) diff --git a/tools/test/stress2/misc/all.exclude b/tools/test/stress2/misc/all.exclude index d4a57af4d559..5106478ff2d0 100644 --- a/tools/test/stress2/misc/all.exclude +++ b/tools/test/stress2/misc/all.exclude @@ -73,6 +73,8 @@ truss3.sh WiP 20200915 unionfs.sh insmntque: non-locked vp: xx is not exclusive locked... 20130909 unionfs2.sh insmntque: mp-safe fs and non-locked vp is not ... 20111219 unionfs3.sh insmntque: mp-safe fs and non-locked vp is not ... 20111216 +unionfs4.sh WiP 20210916 +unionfs5.sh WiP 20210916 # Test not to run for other reasons: diff --git a/tools/test/stress2/misc/unionfs4.sh b/tools/test/stress2/misc/unionfs4.sh new file mode 100755 index 000000000000..557cead66389 --- /dev/null +++ b/tools/test/stress2/misc/unionfs4.sh @@ -0,0 +1,77 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Peter Holm +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +# "mkdir: mkdir(d2), level 2. mkdir.c:96: No such file or directory" seen +# with a non debug kernel. + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +. ../default.cfg + +# unionfs usage example from the man page: +# mount -t cd9660 -o ro /dev/cd0 /usr/src +# mount -t unionfs -o noatime /var/obj /usr/src + +md1=$mdstart +md2=$((md1 + 1)) +mp1=/mnt$md1 +mp2=/mnt$md2 +mkdir -p $mp1 $mp2 +set -e +for i in $mp1 $mp2; do + mount | grep -q "on $i " && umount -f $i +done +for i in $md1 $md2; do + mdconfig -l | grep -q md$i && mdconfig -d -u $i +done + +mdconfig -a -t swap -s 2g -u $md1 +mdconfig -a -t swap -s 2g -u $md2 +newfs $newfs_flags -n md$md1 > /dev/null +newfs $newfs_flags -n md$md2 > /dev/null +mount /dev/md$md1 $mp1 +mount /dev/md$md2 $mp2 + +mount -t unionfs -o noatime $mp1 $mp2 +set +e +mount | grep -E "$mp1|$mp2" + +export RUNDIR=$mp2/stressX +export runRUNTIME=2m + +(cd ..; ./run.sh marcus.cfg) + +../tools/killall.sh +umount $mp2 # The unionfs mount +umount $mp2 +n=`find $mp1/stressX | wc -l` +[ $n -eq 1 ] && s=0 || { find $mp1/stressX -ls | head -12; s=1; } +umount $mp1 +mdconfig -d -u $md2 +mdconfig -d -u $md1 +exit $s diff --git a/tools/test/stress2/misc/unionfs5.sh b/tools/test/stress2/misc/unionfs5.sh new file mode 100755 index 000000000000..ba00fa2b5258 --- /dev/null +++ b/tools/test/stress2/misc/unionfs5.sh @@ -0,0 +1,83 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2021 Peter Holm +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +# "mkdir: mkdir(d2), level 2. mkdir.c:96: No such file or directory" seen +# with a non debug kernel. + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 +. ../default.cfg + +# unionfs usage example from the man page: +# mount -t cd9660 -o ro /dev/cd0 /usr/src +# mount -t unionfs -o noatime /var/obj /usr/src + +md1=$mdstart +md2=$((md1 + 1)) +mp1=/mnt$md1 +mp2=/mnt$md2 +mkdir -p $mp1 $mp2 +set -e +for i in $mp1 $mp2; do + mount | grep -q "on $i " && umount -f $i +done +for i in $md1 $md2; do + mdconfig -l | grep -q md$i && mdconfig -d -u $i +done + +mdconfig -a -t swap -s 2g -u $md1 +mdconfig -a -t swap -s 2g -u $md2 +newfs $newfs_flags -n md$md1 > /dev/null +newfs $newfs_flags -n md$md2 > /dev/null +mount /dev/md$md1 $mp1 +mount /dev/md$md2 $mp2 + +mount -t unionfs -o noatime $mp1 $mp2 +set +e +mount | grep -E "$mp1|$mp2" + +if [ $# -eq 0 ]; then + echo "Using unionfs" + export RUNDIR=$mp2/stressX +else + echo "Using FFS" + export RUNDIR=$mp1/stressX +fi +export runRUNTIME=2m + +(cd ../testcases/mkdir; ./mkdir -t 2m -i 20) + +find $RUNDIR -ls +umount $mp2 # The unionfs mount +umount $mp2 +n=`find $mp1/stressX | wc -l` +[ $n -eq 1 ] && s=0 || s=1 +umount $mp1 +mdconfig -d -u $md2 +mdconfig -d -u $md1 +exit $s From owner-dev-commits-src-all@freebsd.org Thu Sep 16 07:32:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F7A1676688; Thu, 16 Sep 2021 07:32:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H981g2v5Sz3JKw; Thu, 16 Sep 2021 07:32:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44F8C1D456; Thu, 16 Sep 2021 07:32:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18G7Wdmv023267; Thu, 16 Sep 2021 07:32:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18G7Wdi9023266; Thu, 16 Sep 2021 07:32:39 GMT (envelope-from git) Date: Thu, 16 Sep 2021 07:32:39 GMT Message-Id: <202109160732.18G7Wdi9023266@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 12061d2626e0 - main - diff: link with libm for sqrt() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 12061d2626e095cd5a5cbadeb567916e7d74db5a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 07:32:39 -0000 The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=12061d2626e095cd5a5cbadeb567916e7d74db5a commit 12061d2626e095cd5a5cbadeb567916e7d74db5a Author: Piotr Pawel Stefaniak AuthorDate: 2021-09-16 07:27:29 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-16 07:31:44 +0000 diff: link with libm for sqrt() Reported by: Jenkins Fixes: bcf2e78dc48378456798191f1c15cb76d6221a65 --- usr.bin/diff/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/usr.bin/diff/Makefile b/usr.bin/diff/Makefile index a9f79d3d81e1..4879570306ba 100644 --- a/usr.bin/diff/Makefile +++ b/usr.bin/diff/Makefile @@ -4,6 +4,7 @@ PROG= diff SRCS= diff.c diffdir.c diffreg.c xmalloc.c pr.c +LIBADD= m HAS_TESTS= SUBDIR.${MK_TESTS}+= tests From owner-dev-commits-src-all@freebsd.org Thu Sep 16 11:21:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A9A9678975; Thu, 16 Sep 2021 11:21:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9F5J1WRcz3HmV; Thu, 16 Sep 2021 11:21:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13DC220996; Thu, 16 Sep 2021 11:21:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18GBL78P024726; Thu, 16 Sep 2021 11:21:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18GBL7Sq024725; Thu, 16 Sep 2021 11:21:07 GMT (envelope-from git) Date: Thu, 16 Sep 2021 11:21:07 GMT Message-Id: <202109161121.18GBL7Sq024725@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 2fc0550ec438 - stable/12 - opencrypto: add kern.crypto sysctl node MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2fc0550ec438e35b9562104c0fd69ef765f459bd Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 11:21:08 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=2fc0550ec438e35b9562104c0fd69ef765f459bd commit 2fc0550ec438e35b9562104c0fd69ef765f459bd Author: Mateusz Guzik AuthorDate: 2021-09-15 13:23:48 +0000 Commit: Mateusz Guzik CommitDate: 2021-09-16 11:20:35 +0000 opencrypto: add kern.crypto sysctl node This is a direct commit to facilitate upcoming merges. Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/opencrypto/crypto.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c index dfd22662e87f..348bcfbbed17 100644 --- a/sys/opencrypto/crypto.c +++ b/sys/opencrypto/crypto.c @@ -151,6 +151,9 @@ static struct mtx crypto_q_mtx; #define CRYPTO_Q_LOCK() mtx_lock(&crypto_q_mtx) #define CRYPTO_Q_UNLOCK() mtx_unlock(&crypto_q_mtx) +SYSCTL_NODE(_kern, OID_AUTO, crypto, CTLFLAG_RW, 0, + "In-kernel cryptography"); + /* * Taskqueue used to dispatch the crypto requests * that have the CRYPTO_F_ASYNC flag From owner-dev-commits-src-all@freebsd.org Thu Sep 16 11:21:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6DC1F6791BC; Thu, 16 Sep 2021 11:21:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9F5K2Tbfz3Hy5; Thu, 16 Sep 2021 11:21:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 361E9205FD; Thu, 16 Sep 2021 11:21:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18GBL9Xv024756; Thu, 16 Sep 2021 11:21:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18GBL9I0024755; Thu, 16 Sep 2021 11:21:09 GMT (envelope-from git) Date: Thu, 16 Sep 2021 11:21:09 GMT Message-Id: <202109161121.18GBL9I0024755@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 16ffd822c823 - stable/12 - Remove CRYPTO_TIMING. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 16ffd822c8236b2b0dae3fb43ffe55043985d0c8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 11:21:09 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=16ffd822c8236b2b0dae3fb43ffe55043985d0c8 commit 16ffd822c8236b2b0dae3fb43ffe55043985d0c8 Author: Mark Johnston AuthorDate: 2020-06-30 15:56:54 +0000 Commit: Mateusz Guzik CommitDate: 2021-09-16 11:20:44 +0000 Remove CRYPTO_TIMING. It was added a very long time ago. It is single-threaded, so only really useful for basic measurements, and in the meantime we've gotten some more sophisticated profiling tools. Reviewed by: cem, delphij, jhb Sponsored by: Rubicon Communications, LLC (Netgate) Differential Revision: https://reviews.freebsd.org/D25464 (cherry picked from commit a5c053f5a78ca68f9dcace37186142266787eaa0) --- sys/opencrypto/crypto.c | 81 +++------------------------------------------- sys/opencrypto/cryptodev.h | 17 ---------- 2 files changed, 4 insertions(+), 94 deletions(-) diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c index 348bcfbbed17..01283807a670 100644 --- a/sys/opencrypto/crypto.c +++ b/sys/opencrypto/crypto.c @@ -54,8 +54,6 @@ __FBSDID("$FreeBSD$"); * PURPOSE. */ -#define CRYPTO_TIMING /* enable timing support */ - #include "opt_ddb.h" #include @@ -223,12 +221,6 @@ static struct cryptostats cryptostats; SYSCTL_STRUCT(_kern, OID_AUTO, crypto_stats, CTLFLAG_RW, &cryptostats, cryptostats, "Crypto system statistics"); -#ifdef CRYPTO_TIMING -static int crypto_timing = 0; -SYSCTL_INT(_debug, OID_AUTO, crypto_timing, CTLFLAG_RW, - &crypto_timing, 0, "Enable/disable crypto timing support"); -#endif - /* Try to avoid directly exposing the key buffer as a symbol */ static struct keybuf *keybuf; @@ -1014,11 +1006,6 @@ crypto_dispatch(struct cryptop *crp) cryptostats.cs_ops++; -#ifdef CRYPTO_TIMING - if (crypto_timing) - binuptime(&crp->crp_tstamp); -#endif - crp->crp_retw_id = ((uintptr_t)crp->crp_session) % crypto_workers_num; if (CRYPTOP_ASYNC(crp)) { @@ -1224,32 +1211,6 @@ crypto_kinvoke(struct cryptkop *krp, int crid) return 0; } -#ifdef CRYPTO_TIMING -static void -crypto_tstat(struct cryptotstat *ts, struct bintime *bt) -{ - struct bintime now, delta; - struct timespec t; - uint64_t u; - - binuptime(&now); - u = now.frac; - delta.frac = now.frac - bt->frac; - delta.sec = now.sec - bt->sec; - if (u < delta.frac) - delta.sec--; - bintime2timespec(&delta, &t); - timespecadd(&ts->acc, &t, &ts->acc); - if (timespeccmp(&t, &ts->min, <)) - ts->min = t; - if (timespeccmp(&t, &ts->max, >)) - ts->max = t; - ts->count++; - - *bt = now; -} -#endif - static void crypto_task_invoke(void *ctx, int pending) { @@ -1279,10 +1240,6 @@ crypto_invoke(struct cryptocap *cap, struct cryptop *crp, int hint) ("%s: crp->crp_callback == NULL", __func__)); KASSERT(crp->crp_desc != NULL, ("%s: crp->crp_desc == NULL", __func__)); -#ifdef CRYPTO_TIMING - if (crypto_timing) - crypto_tstat(&cryptostats.cs_invoke, &crp->crp_tstamp); -#endif if (cap->cc_flags & CRYPTOCAP_F_CLEANUP) { struct cryptodesc *crd; crypto_session_t nses; @@ -1394,10 +1351,7 @@ crypto_done(struct cryptop *crp) crp->crp_flags |= CRYPTO_F_DONE; if (crp->crp_etype != 0) cryptostats.cs_errs++; -#ifdef CRYPTO_TIMING - if (crypto_timing) - crypto_tstat(&cryptostats.cs_done, &crp->crp_tstamp); -#endif + /* * CBIMM means unconditionally do the callback immediately; * CBIFSYNC means do the callback immediately only if the @@ -1414,20 +1368,7 @@ crypto_done(struct cryptop *crp) * callback routine does very little (e.g. the * /dev/crypto callback method just does a wakeup). */ -#ifdef CRYPTO_TIMING - if (crypto_timing) { - /* - * NB: We must copy the timestamp before - * doing the callback as the cryptop is - * likely to be reclaimed. - */ - struct bintime t = crp->crp_tstamp; - crypto_tstat(&cryptostats.cs_cb, &t); - crp->crp_callback(crp); - crypto_tstat(&cryptostats.cs_finis, &t); - } else -#endif - crp->crp_callback(crp); + crp->crp_callback(crp); } else { struct crypto_ret_worker *ret_worker; bool wake; @@ -1732,22 +1673,8 @@ crypto_ret_proc(struct crypto_ret_worker *ret_worker) /* * Run callbacks unlocked. */ - if (crpt != NULL) { -#ifdef CRYPTO_TIMING - if (crypto_timing) { - /* - * NB: We must copy the timestamp before - * doing the callback as the cryptop is - * likely to be reclaimed. - */ - struct bintime t = crpt->crp_tstamp; - crypto_tstat(&cryptostats.cs_cb, &t); - crpt->crp_callback(crpt); - crypto_tstat(&cryptostats.cs_finis, &t); - } else -#endif - crpt->crp_callback(crpt); - } + if (crpt != NULL) + crpt->crp_callback(crpt); if (krpt != NULL) krpt->krp_callback(krpt); CRYPTO_RETW_LOCK(ret_worker); diff --git a/sys/opencrypto/cryptodev.h b/sys/opencrypto/cryptodev.h index 31e7a312d4dc..64020be843bc 100644 --- a/sys/opencrypto/cryptodev.h +++ b/sys/opencrypto/cryptodev.h @@ -348,13 +348,6 @@ struct crypt_kop { #define CIOCFINDDEV _IOWR('c', 108, struct crypt_find_op) #define CIOCCRYPTAEAD _IOWR('c', 109, struct crypt_aead) -struct cryptotstat { - struct timespec acc; /* total accumulated time */ - struct timespec min; /* min time */ - struct timespec max; /* max time */ - u_int32_t count; /* number of observations */ -}; - struct cryptostats { u_int32_t cs_ops; /* symmetric crypto ops submitted */ u_int32_t cs_errs; /* symmetric crypto ops that failed */ @@ -364,16 +357,6 @@ struct cryptostats { u_int32_t cs_rets; /* crypto return thread activations */ u_int32_t cs_blocks; /* symmetric op driver block */ u_int32_t cs_kblocks; /* symmetric op driver block */ - /* - * When CRYPTO_TIMING is defined at compile time and the - * sysctl debug.crypto is set to 1, the crypto system will - * accumulate statistics about how long it takes to process - * crypto requests at various points during processing. - */ - struct cryptotstat cs_invoke; /* crypto_dipsatch -> crypto_invoke */ - struct cryptotstat cs_done; /* crypto_invoke -> crypto_done */ - struct cryptotstat cs_cb; /* crypto_done -> callback */ - struct cryptotstat cs_finis; /* callback -> callback return */ }; #ifdef _KERNEL From owner-dev-commits-src-all@freebsd.org Thu Sep 16 11:21:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A46CE678F68; Thu, 16 Sep 2021 11:21:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9F5M49tbz3J5D; Thu, 16 Sep 2021 11:21:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6CDF820A01; Thu, 16 Sep 2021 11:21:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18GBLBGE024805; Thu, 16 Sep 2021 11:21:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18GBLBNw024804; Thu, 16 Sep 2021 11:21:11 GMT (envelope-from git) Date: Thu, 16 Sep 2021 11:21:11 GMT Message-Id: <202109161121.18GBLBNw024804@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: bef0c20ec74e - stable/12 - Convert cryptostats to a counter_u64 array. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: bef0c20ec74e0aaa4f08bc879efa1a5ee8fed0f1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 11:21:11 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=bef0c20ec74e0aaa4f08bc879efa1a5ee8fed0f1 commit bef0c20ec74e0aaa4f08bc879efa1a5ee8fed0f1 Author: Mark Johnston AuthorDate: 2020-06-30 22:01:21 +0000 Commit: Mateusz Guzik CommitDate: 2021-09-16 11:20:54 +0000 Convert cryptostats to a counter_u64 array. The global counters were not SMP-friendly. Use per-CPU counters instead. Reviewed by: jhb Sponsored by: Rubicon Communications, LLC (Netgate) Differential Revision: https://reviews.freebsd.org/D25466 (cherry picked from commit 7290cb47fced28b5d0654cd1de7cc721e214ea32) --- sys/opencrypto/crypto.c | 46 ++++++++++++++++++++++++++++++++++------------ sys/opencrypto/cryptodev.h | 16 ++++++++-------- 2 files changed, 42 insertions(+), 20 deletions(-) diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c index 01283807a670..1e11a7ead376 100644 --- a/sys/opencrypto/crypto.c +++ b/sys/opencrypto/crypto.c @@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include @@ -217,9 +217,31 @@ static void crypto_remove(struct cryptocap *cap); static void crypto_task_invoke(void *ctx, int pending); static void crypto_batch_enqueue(struct cryptop *crp); -static struct cryptostats cryptostats; -SYSCTL_STRUCT(_kern, OID_AUTO, crypto_stats, CTLFLAG_RW, &cryptostats, - cryptostats, "Crypto system statistics"); +static counter_u64_t cryptostats[sizeof(struct cryptostats) / sizeof(uint64_t)]; +SYSCTL_COUNTER_U64_ARRAY(_kern_crypto, OID_AUTO, stats, CTLFLAG_RW, + cryptostats, nitems(cryptostats), + "Crypto system statistics"); + +#define CRYPTOSTAT_INC(stat) do { \ + counter_u64_add( \ + cryptostats[offsetof(struct cryptostats, stat) / sizeof(uint64_t)],\ + 1); \ +} while (0) + +static void +cryptostats_init(void *arg __unused) +{ + COUNTER_ARRAY_ALLOC(cryptostats, nitems(cryptostats), M_WAITOK); +} +SYSINIT(cryptostats_init, SI_SUB_COUNTER, SI_ORDER_ANY, cryptostats_init, NULL); + +static void +cryptostats_fini(void *arg __unused) +{ + COUNTER_ARRAY_FREE(cryptostats, nitems(cryptostats)); +} +SYSUNINIT(cryptostats_fini, SI_SUB_COUNTER, SI_ORDER_ANY, cryptostats_fini, + NULL); /* Try to avoid directly exposing the key buffer as a symbol */ static struct keybuf *keybuf; @@ -1004,7 +1026,7 @@ crypto_dispatch(struct cryptop *crp) u_int32_t hid; int result; - cryptostats.cs_ops++; + CRYPTOSTAT_INC(cs_ops); crp->crp_retw_id = ((uintptr_t)crp->crp_session) % crypto_workers_num; @@ -1069,7 +1091,7 @@ crypto_kdispatch(struct cryptkop *krp) { int error; - cryptostats.cs_kops++; + CRYPTOSTAT_INC(cs_kops); error = crypto_kinvoke(krp, krp->krp_crid); if (error == ERESTART) { @@ -1350,7 +1372,7 @@ crypto_done(struct cryptop *crp) ("crypto_done: op already done, flags 0x%x", crp->crp_flags)); crp->crp_flags |= CRYPTO_F_DONE; if (crp->crp_etype != 0) - cryptostats.cs_errs++; + CRYPTOSTAT_INC(cs_errs); /* * CBIMM means unconditionally do the callback immediately; @@ -1422,7 +1444,7 @@ crypto_kdone(struct cryptkop *krp) struct cryptocap *cap; if (krp->krp_status != 0) - cryptostats.cs_kerrs++; + CRYPTOSTAT_INC(cs_kerrs); CRYPTO_DRIVER_LOCK(); /* XXX: What if driver is loaded in the meantime? */ if (krp->krp_hid < crypto_drivers_num) { @@ -1564,7 +1586,7 @@ crypto_proc(void) /* XXX validate sid again? */ crypto_drivers[crypto_ses2hid(submit->crp_session)].cc_qblocked = 1; TAILQ_INSERT_HEAD(&crp_q, submit, crp_next); - cryptostats.cs_blocks++; + CRYPTOSTAT_INC(cs_blocks); } } @@ -1604,7 +1626,7 @@ crypto_proc(void) /* XXX validate sid again? */ crypto_drivers[krp->krp_hid].cc_kqblocked = 1; TAILQ_INSERT_HEAD(&crp_kq, krp, krp_next); - cryptostats.cs_kblocks++; + CRYPTOSTAT_INC(cs_kblocks); } } @@ -1626,7 +1648,7 @@ crypto_proc(void) crp_sleep = 0; if (cryptoproc == NULL) break; - cryptostats.cs_intrs++; + CRYPTOSTAT_INC(cs_intrs); } } CRYPTO_Q_UNLOCK(); @@ -1687,7 +1709,7 @@ crypto_ret_proc(struct crypto_ret_worker *ret_worker) "crypto_ret_wait", 0); if (ret_worker->cryptoretproc == NULL) break; - cryptostats.cs_rets++; + CRYPTOSTAT_INC(cs_rets); } } CRYPTO_RETW_UNLOCK(ret_worker); diff --git a/sys/opencrypto/cryptodev.h b/sys/opencrypto/cryptodev.h index 64020be843bc..2e61ee3ed90f 100644 --- a/sys/opencrypto/cryptodev.h +++ b/sys/opencrypto/cryptodev.h @@ -349,14 +349,14 @@ struct crypt_kop { #define CIOCCRYPTAEAD _IOWR('c', 109, struct crypt_aead) struct cryptostats { - u_int32_t cs_ops; /* symmetric crypto ops submitted */ - u_int32_t cs_errs; /* symmetric crypto ops that failed */ - u_int32_t cs_kops; /* asymetric/key ops submitted */ - u_int32_t cs_kerrs; /* asymetric/key ops that failed */ - u_int32_t cs_intrs; /* crypto swi thread activations */ - u_int32_t cs_rets; /* crypto return thread activations */ - u_int32_t cs_blocks; /* symmetric op driver block */ - u_int32_t cs_kblocks; /* symmetric op driver block */ + uint64_t cs_ops; /* symmetric crypto ops submitted */ + uint64_t cs_errs; /* symmetric crypto ops that failed */ + uint64_t cs_kops; /* asymetric/key ops submitted */ + uint64_t cs_kerrs; /* asymetric/key ops that failed */ + uint64_t cs_intrs; /* crypto swi thread activations */ + uint64_t cs_rets; /* crypto return thread activations */ + uint64_t cs_blocks; /* symmetric op driver block */ + uint64_t cs_kblocks; /* symmetric op driver block */ }; #ifdef _KERNEL From owner-dev-commits-src-all@freebsd.org Thu Sep 16 11:21:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1456E678E66; Thu, 16 Sep 2021 11:21:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9F5L3sGNz3J7L; Thu, 16 Sep 2021 11:21:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5379520997; Thu, 16 Sep 2021 11:21:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18GBLAgU024781; Thu, 16 Sep 2021 11:21:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18GBLAmZ024780; Thu, 16 Sep 2021 11:21:10 GMT (envelope-from git) Date: Thu, 16 Sep 2021 11:21:10 GMT Message-Id: <202109161121.18GBLAmZ024780@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mateusz Guzik Subject: git: 2ed47b49b822 - stable/12 - Remove unused 32-bit compatibility structures from cryptodev. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 2ed47b49b822f97901c3dd433384ec781c4df2cb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 11:21:11 -0000 The branch stable/12 has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=2ed47b49b822f97901c3dd433384ec781c4df2cb commit 2ed47b49b822f97901c3dd433384ec781c4df2cb Author: Mark Johnston AuthorDate: 2020-06-30 15:57:11 +0000 Commit: Mateusz Guzik CommitDate: 2021-09-16 11:20:48 +0000 Remove unused 32-bit compatibility structures from cryptodev. The counters are exported by a sysctl and have the same width on all platforms anyway. Reviewed by: cem, delphij, jhb Sponsored by: Rubicon Communications, LLC (Netgate) Differential Revision: https://reviews.freebsd.org/D25465 (cherry picked from commit a5ae70f5a0554235c499016bec3a721adbb1043a) --- sys/opencrypto/cryptodev.c | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/sys/opencrypto/cryptodev.c b/sys/opencrypto/cryptodev.c index b2963b4369b8..e6da18016736 100644 --- a/sys/opencrypto/cryptodev.c +++ b/sys/opencrypto/cryptodev.c @@ -118,28 +118,6 @@ struct crypt_kop32 { struct crparam32 crk_param[CRK_MAXPARAM]; }; -struct cryptotstat32 { - struct timespec32 acc; - struct timespec32 min; - struct timespec32 max; - u_int32_t count; -}; - -struct cryptostats32 { - u_int32_t cs_ops; - u_int32_t cs_errs; - u_int32_t cs_kops; - u_int32_t cs_kerrs; - u_int32_t cs_intrs; - u_int32_t cs_rets; - u_int32_t cs_blocks; - u_int32_t cs_kblocks; - struct cryptotstat32 cs_invoke; - struct cryptotstat32 cs_done; - struct cryptotstat32 cs_cb; - struct cryptotstat32 cs_finis; -}; - #define CIOCGSESSION32 _IOWR('c', 101, struct session_op32) #define CIOCCRYPT32 _IOWR('c', 103, struct crypt_op32) #define CIOCKEY32 _IOWR('c', 104, struct crypt_kop32) From owner-dev-commits-src-all@freebsd.org Thu Sep 16 12:41:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B7DDB67A794; Thu, 16 Sep 2021 12:41:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9GtC4j6Mz4VXL; Thu, 16 Sep 2021 12:41:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8177E21A52; Thu, 16 Sep 2021 12:41:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18GCfdmM033970; Thu, 16 Sep 2021 12:41:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18GCfdAK033969; Thu, 16 Sep 2021 12:41:39 GMT (envelope-from git) Date: Thu, 16 Sep 2021 12:41:39 GMT Message-Id: <202109161241.18GCfdAK033969@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 1cce9f8fecf2 - stable/13 - osd: Fix racy assertions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1cce9f8fecf2ccf8fe908815aa8568727df37c81 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 12:41:39 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=1cce9f8fecf2ccf8fe908815aa8568727df37c81 commit 1cce9f8fecf2ccf8fe908815aa8568727df37c81 Author: Mark Johnston AuthorDate: 2021-09-09 13:50:27 +0000 Commit: Mark Johnston CommitDate: 2021-09-16 12:37:15 +0000 osd: Fix racy assertions osd_register(9) may reallocate and expand the destructor array for a given object type if no space is available for a new key. This happens with the object lock held. Thus, when verifying that a given slot in the array is occupied, we need to hold the object lock to avoid racing with a reallocation. Reported by: syzbot+69ce54c7d7d813315dd3@syzkaller.appspotmail.com Sponsored by: The FreeBSD Foundation (cherry picked from commit 187afc58791cd877c8ba0573b7826c31db8c6f73) --- sys/kern/kern_osd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/kern/kern_osd.c b/sys/kern/kern_osd.c index e15ffde5d7bc..9e318b27c250 100644 --- a/sys/kern/kern_osd.c +++ b/sys/kern/kern_osd.c @@ -156,10 +156,11 @@ osd_deregister(u_int type, u_int slot) KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); KASSERT(slot > 0, ("Invalid slot.")); - KASSERT(osdm[type].osd_destructors[slot - 1] != NULL, ("Unused slot.")); sx_xlock(&osdm[type].osd_module_lock); rm_wlock(&osdm[type].osd_object_lock); + KASSERT(osdm[type].osd_destructors[slot - 1] != NULL, ("Unused slot.")); + /* * Free all OSD for the given slot. */ @@ -222,9 +223,10 @@ osd_set_reserved(u_int type, struct osd *osd, u_int slot, void **rsv, KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); KASSERT(slot > 0, ("Invalid slot.")); - KASSERT(osdm[type].osd_destructors[slot - 1] != NULL, ("Unused slot.")); rm_rlock(&osdm[type].osd_object_lock, &tracker); + KASSERT(osdm[type].osd_destructors[slot - 1] != NULL, ("Unused slot.")); + if (slot > osd->osd_nslots) { void **newptr; @@ -300,9 +302,10 @@ osd_get(u_int type, struct osd *osd, u_int slot) KASSERT(type >= OSD_FIRST && type <= OSD_LAST, ("Invalid type.")); KASSERT(slot > 0, ("Invalid slot.")); - KASSERT(osdm[type].osd_destructors[slot - 1] != NULL, ("Unused slot.")); rm_rlock(&osdm[type].osd_object_lock, &tracker); + KASSERT(osdm[type].osd_destructors[slot - 1] != NULL, ("Unused slot.")); + if (slot > osd->osd_nslots) { value = NULL; OSD_DEBUG("Slot doesn't exist (type=%u, slot=%u).", type, slot); From owner-dev-commits-src-all@freebsd.org Thu Sep 16 12:41:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D5C7167A79C; Thu, 16 Sep 2021 12:41:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9GtD5VXZz4VXP; Thu, 16 Sep 2021 12:41:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C83E21CFF; Thu, 16 Sep 2021 12:41:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18GCfelo033999; Thu, 16 Sep 2021 12:41:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18GCfeLr033998; Thu, 16 Sep 2021 12:41:40 GMT (envelope-from git) Date: Thu, 16 Sep 2021 12:41:40 GMT Message-Id: <202109161241.18GCfeLr033998@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: adfb7f807c66 - stable/13 - sctp: Clear assoc socket references when freeing a PCB MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: adfb7f807c662a69afc0b775ccf070cfab04aac5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 12:41:40 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=adfb7f807c662a69afc0b775ccf070cfab04aac5 commit adfb7f807c662a69afc0b775ccf070cfab04aac5 Author: Mark Johnston AuthorDate: 2021-09-09 12:33:26 +0000 Commit: Mark Johnston CommitDate: 2021-09-16 12:37:53 +0000 sctp: Clear assoc socket references when freeing a PCB This restores behaviour present in the first import of SCTP. Commit ceaad40ae729dea2c5d8ffcfdd45bb96fb8969d2 commented this out and commit 62fb761ff28bb184a2543e539dd689fefd5d3246 removed it. However, once sctp_inpcb_free() returns, the socket reference is gone no matter what, so we need to clear it. Reported by: syzbot+30dd69297fcbc5f0e10a@syzkaller.appspotmail.com Reported by: syzbot+7b2f9d4bcac1c9569291@syzkaller.appspotmail.com Reported by: syzbot+ed3e651f7d040af480a6@syzkaller.appspotmail.com Reviewed by: tuexen Sponsored by: The FreeBSD Foundation (cherry picked from commit 4250aa1188b5622a6cef871003abd4a50067bdae) --- sys/netinet/sctp_pcb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/netinet/sctp_pcb.c b/sys/netinet/sctp_pcb.c index 85ea5a3f8a53..7e0c0562e8a9 100644 --- a/sys/netinet/sctp_pcb.c +++ b/sys/netinet/sctp_pcb.c @@ -3359,6 +3359,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, int immediate, int from) LIST_FOREACH_SAFE(asoc, &inp->sctp_asoc_list, sctp_tcblist, nasoc) { SCTP_TCB_LOCK(asoc); if (asoc->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { + asoc->sctp_socket = NULL; /* Skip guys being freed */ cnt_in_sd++; if (asoc->asoc.state & SCTP_STATE_IN_ACCEPT_QUEUE) { From owner-dev-commits-src-all@freebsd.org Thu Sep 16 13:50:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8392067AF6C; Thu, 16 Sep 2021 13:50:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9JPx32LFz4qDs; Thu, 16 Sep 2021 13:50:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 489352281A; Thu, 16 Sep 2021 13:50:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18GDojTF022938; Thu, 16 Sep 2021 13:50:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18GDoj7h022937; Thu, 16 Sep 2021 13:50:45 GMT (envelope-from git) Date: Thu, 16 Sep 2021 13:50:45 GMT Message-Id: <202109161350.18GDoj7h022937@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jung-uk Kim Subject: git: 277a326b1e3f - stable/13 - rtsx: Call taskqueue sooner, adjust DELAY(9) calls, add an inversion heuristic MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jkim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 277a326b1e3f8cf23af529e075e157c7a2cc67e4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 13:50:45 -0000 The branch stable/13 has been updated by jkim: URL: https://cgit.FreeBSD.org/src/commit/?id=277a326b1e3f8cf23af529e075e157c7a2cc67e4 commit 277a326b1e3f8cf23af529e075e157c7a2cc67e4 Author: Henri Hennebert AuthorDate: 2021-09-09 17:33:51 +0000 Commit: Jung-uk Kim CommitDate: 2021-09-16 13:49:21 +0000 rtsx: Call taskqueue sooner, adjust DELAY(9) calls, add an inversion heuristic - Some configurations, e.g. HP EliteBook 840 G3, come with a dummy card in the card slot which is detected as a valid SD card. This added long timeout at boot time. To alleviate the problem, the default timeout is reduced to one second during the setup phase. [1] - Some configurations crash at boot if rtsx(4) is defined in the kernel config. At boot time, without a card inserted, the driver found that a card is present and just after that a "spontaneous" interrupt is generated showing that no card is present. To solve this problem, DELAY(9) is set to one quarter of a second before checking card presence during driver attach. - As advised by adrian, taskqueue and DMA are set up sooner during the driver attach. A heuristic to try to detect configuration needing inversion was added. PR: 255130 [1] Differential Revision: https://reviews.freebsd.org/D30499 (cherry picked from commit 9d3bc163825415f900d06d62efdf02caaad2d51d) --- share/man/man4/rtsx.4 | 13 +++-- sys/dev/rtsx/rtsx.c | 132 ++++++++++++++++++++++++++++++++++---------------- 2 files changed, 99 insertions(+), 46 deletions(-) diff --git a/share/man/man4/rtsx.4 b/share/man/man4/rtsx.4 index 3f2ffcf6be66..10d1f54b285c 100644 --- a/share/man/man4/rtsx.4 +++ b/share/man/man4/rtsx.4 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 24, 2020 +.Dd April 25, 2021 .Dt RTSX 4 .Os .Sh NAME @@ -108,12 +108,19 @@ with modifications found in Linux and .It The timeouts experienced during card insert and during I/O are solved in version 1.0g. .It -RTS522A on Lenovo P50s and Lenovo T470p, card detection and read-only switch are reversed. -This is sovled by adding in +RTS522A on Lenovo T470p, card detection and read-only switch are reversed. +This is solved by adding in .Em loader.conf(5) : .Bd -ragged .Cd dev.rtsx.0.inversion=1 .Ed +.Pp +The driver tries to automate those exceptions. +If this automation is wrong, it can be avoided by adding in +.Em loader.conf(5) : +.Bd -ragged +.Cd dev.rtsx.0.inversion=0 +.Ed .It Mounting a filesystem with write access on a card write protected may involve a kernel crash. .It diff --git a/sys/dev/rtsx/rtsx.c b/sys/dev/rtsx/rtsx.c index cae35243d137..fe27f067b916 100644 --- a/sys/dev/rtsx/rtsx.c +++ b/sys/dev/rtsx/rtsx.c @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -83,11 +84,13 @@ struct rtsx_softc { struct resource *rtsx_irq_res; /* bus IRQ resource */ void *rtsx_irq_cookie; /* bus IRQ resource cookie */ struct callout rtsx_timeout_callout; /* callout for timeout */ - int rtsx_timeout; /* interrupt timeout value */ + int rtsx_timeout_cmd; /* interrupt timeout for setup commands */ + int rtsx_timeout_io; /* interrupt timeout for I/O commands */ void (*rtsx_intr_trans_ok)(struct rtsx_softc *sc); /* function to call if transfer succeed */ void (*rtsx_intr_trans_ko)(struct rtsx_softc *sc); /* function to call if transfer fail */ + struct timeout_task rtsx_card_insert_task; /* card insert delayed task */ struct task rtsx_card_remove_task; /* card remove task */ @@ -166,25 +169,35 @@ struct rtsx_softc { #define RTSX_RTL8411 0x5289 #define RTSX_RTL8411B 0x5287 -#define RTSX_VERSION "2.0c" +#define RTSX_VERSION "2.0i" static const struct rtsx_device { uint16_t vendor_id; uint16_t device_id; const char *desc; } rtsx_devices[] = { - { RTSX_REALTEK, RTSX_RTS5209, RTSX_VERSION " Realtek RTS5209 PCI MMC/SD Card Reader"}, - { RTSX_REALTEK, RTSX_RTS5227, RTSX_VERSION " Realtek RTS5227 PCI MMC/SD Card Reader"}, - { RTSX_REALTEK, RTSX_RTS5229, RTSX_VERSION " Realtek RTS5229 PCI MMC/SD Card Reader"}, - { RTSX_REALTEK, RTSX_RTS522A, RTSX_VERSION " Realtek RTS522A PCI MMC/SD Card Reader"}, - { RTSX_REALTEK, RTSX_RTS525A, RTSX_VERSION " Realtek RTS525A PCI MMC/SD Card Reader"}, - { RTSX_REALTEK, RTSX_RTS5249, RTSX_VERSION " Realtek RTS5249 PCI MMC/SD Card Reader"}, - { RTSX_REALTEK, RTSX_RTL8402, RTSX_VERSION " Realtek RTL8402 PCI MMC/SD Card Reader"}, - { RTSX_REALTEK, RTSX_RTL8411, RTSX_VERSION " Realtek RTL8411 PCI MMC/SD Card Reader"}, - { RTSX_REALTEK, RTSX_RTL8411B, RTSX_VERSION " Realtek RTL8411B PCI MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTS5209, RTSX_VERSION " Realtek RTS5209 PCIe MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTS5227, RTSX_VERSION " Realtek RTS5227 PCIe MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTS5229, RTSX_VERSION " Realtek RTS5229 PCIe MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTS522A, RTSX_VERSION " Realtek RTS522A PCIe MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTS525A, RTSX_VERSION " Realtek RTS525A PCIe MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTS5249, RTSX_VERSION " Realtek RTS5249 PCIe MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTL8402, RTSX_VERSION " Realtek RTL8402 PCIe MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTL8411, RTSX_VERSION " Realtek RTL8411 PCIe MMC/SD Card Reader"}, + { RTSX_REALTEK, RTSX_RTL8411B, RTSX_VERSION " Realtek RTL8411B PCIe MMC/SD Card Reader"}, { 0, 0, NULL} }; +/* See `kenv | grep smbios.system` */ +static const struct rtsx_inversion_model { + char *maker; + char *family; + char *product; +} rtsx_inversion_models[] = { + { "LENOVO", "ThinkPad T470p", "20J7S0PM00"}, + { NULL, NULL, NULL} +}; + static int rtsx_dma_alloc(struct rtsx_softc *sc); static void rtsx_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nsegs, int error); static void rtsx_dma_free(struct rtsx_softc *sc); @@ -601,7 +614,7 @@ rtsx_handle_card_present(struct rtsx_softc *sc) #ifdef MMCCAM was_present = sc->rtsx_cam_status; -#else +#else /* !MMCCAM */ was_present = sc->rtsx_mmc_dev != NULL; #endif /* MMCCAM */ is_present = rtsx_is_card_present(sc); @@ -640,7 +653,7 @@ rtsx_card_task(void *arg, int pending __unused) if (sc->rtsx_cam_status == 0) { union ccb *ccb; uint32_t pathid; -#else +#else /* !MMCCAM */ if (sc->rtsx_mmc_dev == NULL) { #endif /* MMCCAM */ if (bootverbose) @@ -669,7 +682,7 @@ rtsx_card_task(void *arg, int pending __unused) } RTSX_UNLOCK(sc); xpt_rescan(ccb); -#else +#else /* !MMCCAM */ sc->rtsx_mmc_dev = device_add_child(sc->rtsx_dev, "mmc", -1); RTSX_UNLOCK(sc); if (sc->rtsx_mmc_dev == NULL) { @@ -688,7 +701,7 @@ rtsx_card_task(void *arg, int pending __unused) if (sc->rtsx_cam_status != 0) { union ccb *ccb; uint32_t pathid; -#else +#else /* !MMCCAM */ if (sc->rtsx_mmc_dev != NULL) { #endif /* MMCCAM */ if (bootverbose) @@ -719,7 +732,7 @@ rtsx_card_task(void *arg, int pending __unused) } RTSX_UNLOCK(sc); xpt_rescan(ccb); -#else +#else /* !MMCCAM */ RTSX_UNLOCK(sc); if (device_delete_child(sc->rtsx_dev, sc->rtsx_mmc_dev)) device_printf(sc->rtsx_dev, "Detaching MMC bus failed\n"); @@ -984,7 +997,7 @@ rtsx_init(struct rtsx_softc *sc) RTSX_PHY_REV_CLKREQ_DT_1_0 | RTSX_PHY_REV_STOP_CLKRD | RTSX_PHY_REV_STOP_CLKWR))) return (error); - DELAY(10); + DELAY(1000); if ((error = rtsx_write_phy(sc, RTSX_PHY_BPCR, RTSX_PHY_BPCR_IBRXSEL | RTSX_PHY_BPCR_IBTXSEL | RTSX_PHY_BPCR_IB_FILTER | RTSX_PHY_BPCR_CMIRROR_EN))) @@ -1604,7 +1617,7 @@ rtsx_bus_power_on(struct rtsx_softc *sc) RTSX_BITOP(sc, RTSX_CARD_PWR_CTL, RTSX_SD_PWR_MASK, RTSX_SD_PARTIAL_PWR_ON); RTSX_BITOP(sc, RTSX_PWR_GATE_CTRL, RTSX_LDO3318_PWR_MASK, RTSX_LDO3318_VCC1); - DELAY(200); + DELAY(20000); /* Full power. */ RTSX_BITOP(sc, RTSX_CARD_PWR_CTL, RTSX_SD_PWR_MASK, RTSX_SD_PWR_ON); @@ -1632,7 +1645,7 @@ rtsx_bus_power_on(struct rtsx_softc *sc) RTSX_BITOP(sc, RTSX_CARD_PWR_CTL, RTSX_SD_PWR_MASK, RTSX_SD_PARTIAL_PWR_ON); RTSX_BITOP(sc, RTSX_PWR_GATE_CTRL, RTSX_LDO3318_PWR_MASK, RTSX_LDO3318_VCC1); - DELAY(200); + DELAY(5000); /* Full power. */ RTSX_BITOP(sc, RTSX_CARD_PWR_CTL, RTSX_SD_PWR_MASK, RTSX_SD_PWR_ON); @@ -1983,7 +1996,7 @@ rtsx_sd_tuning_rx_cmd_wait(struct rtsx_softc *sc, struct mmc_command *cmd) status = sc->rtsx_intr_status & mask; while (status == 0) { - if (msleep(&sc->rtsx_intr_status, &sc->rtsx_mtx, 0, "rtsxintr", sc->rtsx_timeout) == EWOULDBLOCK) { + if (msleep(&sc->rtsx_intr_status, &sc->rtsx_mtx, 0, "rtsxintr", sc->rtsx_timeout_cmd) == EWOULDBLOCK) { cmd->error = MMC_ERR_TIMEOUT; return (MMC_ERR_TIMEOUT); } @@ -2254,7 +2267,7 @@ rtsx_req_done(struct rtsx_softc *sc) sc->rtsx_ccb = NULL; ccb->ccb_h.status = (req->cmd->error == 0 ? CAM_REQ_CMP : CAM_REQ_CMP_ERR); xpt_done(ccb); -#else +#else /* !MMCCAM */ req->done(req); #endif /* MMCCAM */ } @@ -2899,6 +2912,7 @@ rtsx_cam_action(struct cam_sim *sim, union ccb *ccb) cpi->ccb_h.status = CAM_REQ_CMP; break; } + case XPT_MMC_GET_TRAN_SETTINGS: case XPT_GET_TRAN_SETTINGS: { struct ccb_trans_settings *cts = &ccb->cts; @@ -2923,6 +2937,7 @@ rtsx_cam_action(struct cam_sim *sim, union ccb *ccb) ccb->ccb_h.status = CAM_REQ_CMP; break; } + case XPT_MMC_SET_TRAN_SETTINGS: case XPT_SET_TRAN_SETTINGS: if (bootverbose || sc->rtsx_debug) device_printf(sc->rtsx_dev, "rtsx_cam_action() - got XPT_SET_TRAN_SETTINGS\n"); @@ -3022,7 +3037,7 @@ rtsx_cam_set_tran_settings(struct rtsx_softc *sc, union ccb *ccb) if (bootverbose || sc->rtsx_debug) device_printf(sc->rtsx_dev, "rtsx_cam_set_tran_settings() - vccq: %d\n", ios->vccq); } -#endif +#endif /* __FreeBSD__ > 12 */ if (rtsx_mmcbr_update_ios(sc->rtsx_dev, NULL) == 0) ccb->ccb_h.status = CAM_REQ_CMP; else @@ -3426,6 +3441,7 @@ rtsx_mmcbr_request(device_t bus, device_t child __unused, struct mmc_request *re { struct rtsx_softc *sc; struct mmc_command *cmd; + int timeout; int error; sc = device_get_softc(bus); @@ -3473,15 +3489,18 @@ rtsx_mmcbr_request(device_t bus, device_t child __unused, struct mmc_request *re if (cmd->data == NULL) { DELAY(200); + timeout = sc->rtsx_timeout_cmd; error = rtsx_send_req(sc, cmd); } else if (cmd->data->len <= 512) { + timeout = sc->rtsx_timeout_io; error = rtsx_xfer_short(sc, cmd); } else { + timeout = sc->rtsx_timeout_io; error = rtsx_xfer(sc, cmd); } end: if (error == MMC_ERR_NONE) { - callout_reset(&sc->rtsx_timeout_callout, sc->rtsx_timeout * hz, rtsx_timeout, sc); + callout_reset(&sc->rtsx_timeout_callout, timeout * hz, rtsx_timeout, sc); } else { rtsx_req_done(sc); } @@ -3587,6 +3606,10 @@ rtsx_attach(device_t dev) int msi_count = 1; uint32_t sdio_cfg; int error; + char *maker; + char *family; + char *product; + int i; if (bootverbose) device_printf(dev, "Attach - Vendor ID: 0x%x - Device ID: 0x%x\n", @@ -3594,32 +3617,53 @@ rtsx_attach(device_t dev) sc->rtsx_dev = dev; sc->rtsx_req = NULL; - sc->rtsx_timeout = 10; + sc->rtsx_timeout_cmd = 1; + sc->rtsx_timeout_io = 10; sc->rtsx_read_only = 0; + sc->rtsx_inversion = 0; sc->rtsx_force_timing = 0; sc->rtsx_debug = 0; sc->rtsx_read_count = 0; sc->rtsx_write_count = 0; + maker = kern_getenv("smbios.system.maker"); + family = kern_getenv("smbios.system.family"); + product = kern_getenv("smbios.system.product"); + for (i = 0; rtsx_inversion_models[i].maker != NULL; i++) { + if (strcmp(rtsx_inversion_models[i].maker, maker) == 0 && + strcmp(rtsx_inversion_models[i].family, family) == 0 && + strcmp(rtsx_inversion_models[i].product, product) == 0) { + device_printf(dev, "Inversion activated for %s/%s/%s, see BUG in rtsx(4)\n", maker, family, product); + device_printf(dev, "If a card is detected without an SD card present," + " add dev.rtsx.0.inversion=0 in loader.conf(5)\n"); + sc->rtsx_inversion = 1; + } + } + RTSX_LOCK_INIT(sc); ctx = device_get_sysctl_ctx(dev); tree = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); - SYSCTL_ADD_INT(ctx, tree, OID_AUTO, "req_timeout", CTLFLAG_RW, - &sc->rtsx_timeout, 0, "Request timeout in seconds"); + SYSCTL_ADD_INT(ctx, tree, OID_AUTO, "timeout_io", CTLFLAG_RW, + &sc->rtsx_timeout_io, 0, "Request timeout for I/O commands in seconds"); + SYSCTL_ADD_INT(ctx, tree, OID_AUTO, "timeout_cmd", CTLFLAG_RW, + &sc->rtsx_timeout_cmd, 0, "Request timeout for setup commands in seconds"); SYSCTL_ADD_U8(ctx, tree, OID_AUTO, "read_only", CTLFLAG_RD, &sc->rtsx_read_only, 0, "Card is write protected"); SYSCTL_ADD_U8(ctx, tree, OID_AUTO, "inversion", CTLFLAG_RWTUN, &sc->rtsx_inversion, 0, "Inversion of card detection and read only status"); SYSCTL_ADD_U8(ctx, tree, OID_AUTO, "force_timing", CTLFLAG_RW, &sc->rtsx_force_timing, 0, "Force bus_timing_uhs_sdr50"); - SYSCTL_ADD_U8(ctx, tree, OID_AUTO, "debug", CTLFLAG_RW, + SYSCTL_ADD_U8(ctx, tree, OID_AUTO, "debug", CTLFLAG_RWTUN, &sc->rtsx_debug, 0, "Debugging flag"); SYSCTL_ADD_U64(ctx, tree, OID_AUTO, "read_count", CTLFLAG_RD, &sc->rtsx_read_count, 0, "Count of read operations"); SYSCTL_ADD_U64(ctx, tree, OID_AUTO, "write_count", CTLFLAG_RD, &sc->rtsx_write_count, 0, "Count of write operations"); + if (bootverbose || sc->rtsx_debug) + device_printf(dev, "We are running with inversion: %d\n", sc->rtsx_inversion); + /* Allocate IRQ. */ sc->rtsx_irq_res_id = 0; if (pci_alloc_msi(dev, &msi_count) == 0) @@ -3652,6 +3696,15 @@ rtsx_attach(device_t dev) sc->rtsx_btag = rman_get_bustag(sc->rtsx_res); sc->rtsx_bhandle = rman_get_bushandle(sc->rtsx_res); + TIMEOUT_TASK_INIT(taskqueue_swi_giant, &sc->rtsx_card_insert_task, 0, + rtsx_card_task, sc); + TASK_INIT(&sc->rtsx_card_remove_task, 0, rtsx_card_task, sc); + + /* Allocate two DMA buffers: a command buffer and a data buffer. */ + error = rtsx_dma_alloc(sc); + if (error) + goto destroy_rtsx_irq_res; + /* Activate the interrupt. */ error = bus_setup_intr(dev, sc->rtsx_irq_res, INTR_TYPE_MISC | INTR_MPSAFE, NULL, rtsx_intr, sc, &sc->rtsx_irq_cookie); @@ -3667,17 +3720,6 @@ rtsx_attach(device_t dev) sc->rtsx_flags |= RTSX_F_SDIO_SUPPORT; } - /* Allocate two DMA buffers: a command buffer and a data buffer. */ - error = rtsx_dma_alloc(sc); - if (error) { - goto destroy_rtsx_irq; - } - - /* From dwmmc.c. */ - TIMEOUT_TASK_INIT(taskqueue_swi_giant, &sc->rtsx_card_insert_task, 0, - rtsx_card_task, sc); - TASK_INIT(&sc->rtsx_card_remove_task, 0, rtsx_card_task, sc); - #ifdef MMCCAM sc->rtsx_ccb = NULL; sc->rtsx_cam_status = 0; @@ -3713,13 +3755,16 @@ rtsx_attach(device_t dev) /* * Schedule a card detection as we won't get an interrupt - * if the card is inserted when we attach + * if the card is inserted when we attach. We wait a quarter + * of a second to allow for a "spontaneous" interrupt which may + * change the card presence state. This delay avoid a panic + * on some configuration (e.g. Lenovo T540p). */ - DELAY(500); + DELAY(250000); if (rtsx_is_card_present(sc)) - device_printf(sc->rtsx_dev, "Card present\n"); + device_printf(sc->rtsx_dev, "A card is detected\n"); else - device_printf(sc->rtsx_dev, "Card absent\n"); + device_printf(sc->rtsx_dev, "No card is detected\n"); rtsx_card_task(sc, 0); if (bootverbose) @@ -3732,6 +3777,7 @@ rtsx_attach(device_t dev) destroy_rtsx_res: bus_release_resource(dev, SYS_RES_MEMORY, sc->rtsx_res_id, sc->rtsx_res); + rtsx_dma_free(sc); destroy_rtsx_irq_res: callout_drain(&sc->rtsx_timeout_callout); bus_release_resource(dev, SYS_RES_IRQ, sc->rtsx_irq_res_id, @@ -3833,7 +3879,7 @@ rtsx_suspend(device_t dev) device_printf(dev, "Request in progress: CMD%u, rtsr_intr_status: 0x%08x\n", sc->rtsx_ccb->mmcio.cmd.opcode, sc->rtsx_intr_status); } -#else +#else /* !MMCCAM */ if (sc->rtsx_req != NULL) { device_printf(dev, "Request in progress: CMD%u, rtsr_intr_status: 0x%08x\n", sc->rtsx_req->cmd->opcode, sc->rtsx_intr_status); From owner-dev-commits-src-all@freebsd.org Thu Sep 16 14:43:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D96C67B6E6 for ; Thu, 16 Sep 2021 14:43:06 +0000 (UTC) (envelope-from mw@semihalf.com) Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9KZK4ztyz3Msg for ; Thu, 16 Sep 2021 14:43:05 +0000 (UTC) (envelope-from mw@semihalf.com) Received: by mail-wm1-x32f.google.com with SMTP id j17-20020a05600c1c1100b002e754875260so4669269wms.4 for ; Thu, 16 Sep 2021 07:43:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=i7mBcaDkSn94e8RP7FCI1AZ1+h9Wj6YJO4UatMLd9gA=; b=XVxibuxFx0+P/uadulasGk46jM5jPLv8033zKJun26WUhLmLA9P4AFJcw7gXle7w1i dDPl4CIE9+sl6q/9bTyMIjFD8KVSHL54ju8yGxDh0i9MchLVNLib8IvcKLsxEDqklEWh nJffUlSPIYFHPWF+icc+2OWLwX5rbQEQube8pchjraz4Kf9++GHCKYowFWGECiki/H0v 530MhjbD2VrtZRN+ICQEQArYdcdzGAwiOVVOjjPZxUI6iBDihzyIyUb/Bn3c1eLOkE6n aPsbwlAI05uZSWYo07E+wp/zD5pdFsGPN8/q1C0tZ2R61cL7HwiXA1Avy+hmDtw7lTln Pv4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=i7mBcaDkSn94e8RP7FCI1AZ1+h9Wj6YJO4UatMLd9gA=; b=gJa/lNRX3PRY38lVFO0GXHQ7+EYVaXKAESJoRrK2tabr6h7xEI0pIDAwngkY7tCcVF 7c9ACQJNzwwcvZG+Px3wRUQO0EgKivUdLGA4sN8ZSDUq7XB849F1iajRTISPcZ0dhJAH NdRIQUYCXonBqa3gwj5DqgC+P94WMd1UxspVSlRv17v84jg2/3EhNCW0GtC9C6N+QMb9 1KEWa4K3C2/k+TVpxlJhrlklq+/eC8asoI5ImtYPpv2UO9gS2fbzm0Jictk3pcRWjh1F o6gtaHRtH2KSBliNv5QjjngcAEdupx3+uSOHJFJ1T8/IjrMpP54jVMLv2/fr1X04K/JT sR2w== X-Gm-Message-State: AOAM533x5Ct9isASoa1wA3VVj2DUWyWANoIfzlRvvWulkHwWZuVC808y W3+abGNyVceAwWF5uB71GvdOd3hyVs4jqOmXTowF6w== X-Google-Smtp-Source: ABdhPJwPVnNs/MXRlhMME3LSpZzaULVaRvdAmiF2BiyLu+vDuMTIsgulT8YRo8ioDH3eI6OqW4d5/jeHGOSph5NlFRA= X-Received: by 2002:a05:600c:3656:: with SMTP id y22mr10425673wmq.58.1631803377766; Thu, 16 Sep 2021 07:42:57 -0700 (PDT) MIME-Version: 1.0 References: <202109151318.18FDIppM059878@gitrepo.freebsd.org> In-Reply-To: From: Marcin Wojtas Date: Thu, 16 Sep 2021 16:42:45 +0200 Message-ID: Subject: Re: git: 2de4c7f6d087 - main - pci_host_generic: Add Synopsys Designware PCIe controller quirk To: Jessica Clarke Cc: Marcin Wojtas , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4H9KZK4ztyz3Msg X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=semihalf-com.20210112.gappssmtp.com header.s=20210112 header.b=XVxibuxF; dmarc=none; spf=none (mx1.freebsd.org: domain of mw@semihalf.com has no SPF policy when checking 2a00:1450:4864:20::32f) smtp.mailfrom=mw@semihalf.com X-Spamd-Result: default: False [-3.28 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[semihalf-com.20210112.gappssmtp.com:s=20210112]; FREEFALL_USER(0.00)[mw]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; RCVD_TLS_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[dev-commits-src-all@freebsd.org]; DMARC_NA(0.00)[semihalf.com]; RCPT_COUNT_FIVE(0.00)[5]; NEURAL_HAM_LONG(-1.00)[-1.000]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[semihalf-com.20210112.gappssmtp.com:+]; NEURAL_HAM_SHORT(-0.98)[-0.977]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::32f:from]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-all] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 14:43:06 -0000 =C5=9Br., 15 wrz 2021 o 15:21 Jessica Clarke napisa=C5= =82(a): > > On 15 Sep 2021, at 14:18, Marcin Wojtas wrote: > > > > The branch main has been updated by mw: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=3D2de4c7f6d08798fb62695829= 07155703d1ab5ef4 > > > > commit 2de4c7f6d08798fb6269582907155703d1ab5ef4 > > Author: Pawel Anikiel > > AuthorDate: 2021-09-13 14:59:40 +0000 > > Commit: Marcin Wojtas > > CommitDate: 2021-09-15 13:17:40 +0000 > > > > pci_host_generic: Add Synopsys Designware PCIe controller quirk > > > > Due to the quirky nature of the Synopsys Designware PCIe IP, > > the type 0 configuration is broadcast and whatever device > > is plugged into slot, will appear at each 32 device > > positions of bus0. Mitigate the issue by filtering out > > duplicated devices on this bus for both DT and ACPI cases. > > > > Reviewed by: mw > > Sponsored by: Semihalf > > MFC: after 3 weeks > > Differential revision: https://reviews.freebsd.org/D31887 > > --- > > sys/dev/pci/pci_host_generic.c | 2 ++ > > sys/dev/pci/pci_host_generic.h | 4 ++++ > > sys/dev/pci/pci_host_generic_acpi.c | 33 ++++++++++++++++++++++++++++++= +++ > > sys/dev/pci/pci_host_generic_fdt.c | 7 +++++++ > > 4 files changed, 46 insertions(+) > > > > diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_gene= ric.c > > index 0c45f5d316ed..22b3ccdc17b1 100644 > > --- a/sys/dev/pci/pci_host_generic.c > > +++ b/sys/dev/pci/pci_host_generic.c > > @@ -185,6 +185,8 @@ generic_pcie_read_config(device_t dev, u_int bus, u= _int slot, > > if ((slot > PCI_SLOTMAX) || (func > PCI_FUNCMAX) || > > (reg > PCIE_REGMAX)) > > return (~0U); > > + if ((sc->quirks & PCIE_ECAM_DESIGNWARE_QUIRK) && bus =3D=3D 0 && = slot > 0) > > + return (~0U); > > > > offset =3D PCIE_ADDR_OFFSET(bus - sc->bus_start, slot, func, reg)= ; > > t =3D sc->bst; > > diff --git a/sys/dev/pci/pci_host_generic.h b/sys/dev/pci/pci_host_gene= ric.h > > index 36a12b9559ba..20117cbe32e3 100644 > > --- a/sys/dev/pci/pci_host_generic.h > > +++ b/sys/dev/pci/pci_host_generic.h > > @@ -85,8 +85,12 @@ struct generic_pcie_core_softc { > > device_t dev; > > bus_space_handle_t ioh; > > bus_dma_tag_t dmat; > > + uint32_t quirks; > > }; > > > > +/* Quirks */ > > +#define PCIE_ECAM_DESIGNWARE_QUIRK (1 << 0) > > + > > DECLARE_CLASS(generic_pcie_core_driver); > > > > int pci_host_generic_core_attach(device_t); > > diff --git a/sys/dev/pci/pci_host_generic_acpi.c b/sys/dev/pci/pci_host= _generic_acpi.c > > index 763a84d2fd53..3c32abc5007a 100644 > > --- a/sys/dev/pci/pci_host_generic_acpi.c > > +++ b/sys/dev/pci/pci_host_generic_acpi.c > > @@ -89,6 +89,21 @@ __FBSDID("$FreeBSD$"); > > #define PROPS_CELL_SIZE 1 > > #define PCI_ADDR_CELL_SIZE 2 > > > > +static struct { > > + char oem_id[ACPI_OEM_ID_SIZE + 1]; > > + char oem_table_id[ACPI_OEM_TABLE_ID_SIZE + 1]; > > + uint32_t quirks; > > +} pci_acpi_quirks[] =3D { > > + { "MRVL ", "CN9130 ", PCIE_ECAM_DESIGNWARE_QUIRK }, > > + { "MRVL ", "CN913X ", PCIE_ECAM_DESIGNWARE_QUIRK }, > > + { "MVEBU ", "ARMADA7K", PCIE_ECAM_DESIGNWARE_QUIRK }, > > + { "MVEBU ", "ARMADA8K", PCIE_ECAM_DESIGNWARE_QUIRK }, > > + { "MVEBU ", "CN9130 ", PCIE_ECAM_DESIGNWARE_QUIRK }, > > + { "MVEBU ", "CN9131 ", PCIE_ECAM_DESIGNWARE_QUIRK }, > > + { "MVEBU ", "CN9132 ", PCIE_ECAM_DESIGNWARE_QUIRK }, > > + { 0 }, > > +}; > > + > > /* Forward prototypes */ > > > > static int generic_pcie_acpi_probe(device_t dev); > > @@ -170,6 +185,23 @@ pci_host_generic_acpi_parse_resource(ACPI_RESOURCE= *res, void *arg) > > return (AE_OK); > > } > > > > +static void > > +pci_host_acpi_get_oem_quirks(struct generic_pcie_acpi_softc *sc, > > + ACPI_TABLE_HEADER *hdr) > > +{ > > + int i; > > + > > + for (i =3D 0; pci_acpi_quirks[i].quirks; i++) { > > + if (memcmp(hdr->OemId, pci_acpi_quirks[i].oem_id, > > + ACPI_OEM_ID_SIZE) !=3D 0) > > + continue; > > + if (memcmp(hdr->OemTableId, pci_acpi_quirks[i].oem_table_= id, > > + ACPI_OEM_TABLE_ID_SIZE) !=3D 0) > > + continue; > > + sc->base.quirks |=3D pci_acpi_quirks[i].quirks; > > + } > > +} > > + > > static int > > pci_host_acpi_get_ecam_resource(device_t dev) > > { > > @@ -209,6 +241,7 @@ pci_host_acpi_get_ecam_resource(device_t dev) > > sc->base.bus_start, sc->base.bus_end); > > return (ENXIO); > > } > > + pci_host_acpi_get_oem_quirks(sc, hdr); > > } else { > > status =3D acpi_GetInteger(handle, "_CBA", &val); > > if (ACPI_SUCCESS(status)) > > diff --git a/sys/dev/pci/pci_host_generic_fdt.c b/sys/dev/pci/pci_host_= generic_fdt.c > > index 91ffaf7357b9..249637019137 100644 > > --- a/sys/dev/pci/pci_host_generic_fdt.c > > +++ b/sys/dev/pci/pci_host_generic_fdt.c > > @@ -151,6 +151,13 @@ pci_host_generic_setup_fdt(device_t dev) > > if (error !=3D 0) > > return (error); > > > > + if (ofw_bus_is_compatible(dev, "marvell,armada8k-pcie-ecam") || > > + ofw_bus_is_compatible(dev, "socionext,synquacer-pcie-ecam") |= | > > + ofw_bus_is_compatible(dev, "snps,dw-pcie-ecam")) { > > + device_set_desc(dev, "Synopsys DesignWare PCIe Controller= "); > > It seems inconsistent to set this for _fdt but not _acpi? > Indeed, thanks for noticing. I'll commit an update right away. Thanks, Marcin From owner-dev-commits-src-all@freebsd.org Thu Sep 16 14:43:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3DD5A67BF7C; Thu, 16 Sep 2021 14:43:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9KbH1HRZz3N4j; Thu, 16 Sep 2021 14:43:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C61D232E5; Thu, 16 Sep 2021 14:43:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18GEhs8o093676; Thu, 16 Sep 2021 14:43:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18GEhs3I093675; Thu, 16 Sep 2021 14:43:54 GMT (envelope-from git) Date: Thu, 16 Sep 2021 14:43:54 GMT Message-Id: <202109161443.18GEhs3I093675@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marko Zec Subject: git: eb3148cc4d25 - main - [fib algo][dxr] Fix division by zero. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: eb3148cc4d256c20b5c7c9052539139b6f57f58b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 14:43:55 -0000 The branch main has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=eb3148cc4d256c20b5c7c9052539139b6f57f58b commit eb3148cc4d256c20b5c7c9052539139b6f57f58b Author: Marko Zec AuthorDate: 2021-09-16 14:34:05 +0000 Commit: Marko Zec CommitDate: 2021-09-16 14:34:05 +0000 [fib algo][dxr] Fix division by zero. A division by zero would occur if DXR would be activated on a vnet with no IP addresses configured on any interfaces. PR: 257965 MFC after: 3 days Reported by: Raul Munoz --- sys/netinet/in_fib_dxr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 3c4e5700cd6c..3aa357cadedc 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -982,7 +982,9 @@ dxr2_try_squeeze: FIB_PRINTF(LOG_INFO, da->fd, "D%dR, %d prefixes, %d nhops (max)", DXR_D, rinfo.num_prefixes, rinfo.num_nhops); #endif - i = dxr_tot_size * 100 / rinfo.num_prefixes; + i = dxr_tot_size * 100; + if (rinfo.num_prefixes) + i /= rinfo.num_prefixes; FIB_PRINTF(LOG_INFO, da->fd, "%d.%02d KBytes, %d.%02d Bytes/prefix", dxr_tot_size / 1024, dxr_tot_size * 100 / 1024 % 100, i / 100, i % 100); From owner-dev-commits-src-all@freebsd.org Thu Sep 16 14:53:25 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 32A6E67C020; Thu, 16 Sep 2021 14:53:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9KpF0kjJz3hBK; Thu, 16 Sep 2021 14:53:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EDD9023831; Thu, 16 Sep 2021 14:53:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18GErObC006780; Thu, 16 Sep 2021 14:53:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18GErOJC006779; Thu, 16 Sep 2021 14:53:24 GMT (envelope-from git) Date: Thu, 16 Sep 2021 14:53:24 GMT Message-Id: <202109161453.18GErOJC006779@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: a3f0d18237bd - main - ena: fix building in-kernel driver MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a3f0d18237bdcf272461d3b4b682de384c572144 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 14:53:25 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=a3f0d18237bdcf272461d3b4b682de384c572144 commit a3f0d18237bdcf272461d3b4b682de384c572144 Author: Artur Rojek AuthorDate: 2021-09-16 12:14:54 +0000 Commit: Marcin Wojtas CommitDate: 2021-09-16 14:47:45 +0000 ena: fix building in-kernel driver When building ENA as compiled into the kernel, the driver would fail to build. Resolve the problem by introducing the following changes: 1. Add missing `ena_rss.c` entry in `sys/conf/files`. 2. Prevent SYSCTL_ADD_INT from throwing an assert due to an extra CTLTYPE_INT flag. Fixes: 986e7b92276 ("ena: Move RSS logic into its own source files") Fixes: 6d1ef2abd33 ("ena: Implement full RSS reconfiguration") Obtained from: Semihalf Sponsored by: Amazon, Inc. MFC after: 1 week --- sys/conf/files | 2 ++ sys/dev/ena/ena_sysctl.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/conf/files b/sys/conf/files index eb0c489b7833..4dd0151945bb 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1695,6 +1695,8 @@ dev/ena/ena_datapath.c optional ena \ compile-with "${NORMAL_C} -I$S/contrib" dev/ena/ena_netmap.c optional ena \ compile-with "${NORMAL_C} -I$S/contrib" +dev/ena/ena_rss.c optional ena \ + compile-with "${NORMAL_C} -I$S/contrib" dev/ena/ena_sysctl.c optional ena \ compile-with "${NORMAL_C} -I$S/contrib" contrib/ena-com/ena_com.c optional ena diff --git a/sys/dev/ena/ena_sysctl.c b/sys/dev/ena/ena_sysctl.c index db3eb69cd369..7337f6578e68 100644 --- a/sys/dev/ena/ena_sysctl.c +++ b/sys/dev/ena/ena_sysctl.c @@ -456,7 +456,7 @@ ena_sysctl_add_rss(struct ena_adapter *adapter) /* RSS indirection table size */ SYSCTL_ADD_INT(ctx, child, OID_AUTO, "indir_table_size", - CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, &ena_rss_table_size, 0, + CTLFLAG_RD | CTLFLAG_MPSAFE, &ena_rss_table_size, 0, "RSS indirection table size."); } #endif /* RSS */ From owner-dev-commits-src-all@freebsd.org Thu Sep 16 14:53:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 88A1467C025; Thu, 16 Sep 2021 14:53:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9KpG2m6Lz3hGY; Thu, 16 Sep 2021 14:53:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3026723832; Thu, 16 Sep 2021 14:53:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18GErQpE006804; Thu, 16 Sep 2021 14:53:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18GErQVq006803; Thu, 16 Sep 2021 14:53:26 GMT (envelope-from git) Date: Thu, 16 Sep 2021 14:53:26 GMT Message-Id: <202109161453.18GErQVq006803@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: e8a872536042 - main - pci_host_generic: update Synopsys device description for ACPI MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e8a872536042970b4dbf14dc75755a352fb14488 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 14:53:26 -0000 The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=e8a872536042970b4dbf14dc75755a352fb14488 commit e8a872536042970b4dbf14dc75755a352fb14488 Author: Marcin Wojtas AuthorDate: 2021-09-16 14:39:42 +0000 Commit: Marcin Wojtas CommitDate: 2021-09-16 14:53:11 +0000 pci_host_generic: update Synopsys device description for ACPI The recent addition of Synopsys ECAM quirk set the device description only for the DT variant. Do the same in ACPI case. Reported by: jrtc27 --- sys/dev/pci/pci_host_generic_acpi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/pci/pci_host_generic_acpi.c b/sys/dev/pci/pci_host_generic_acpi.c index 3c32abc5007a..9628517813a9 100644 --- a/sys/dev/pci/pci_host_generic_acpi.c +++ b/sys/dev/pci/pci_host_generic_acpi.c @@ -242,6 +242,8 @@ pci_host_acpi_get_ecam_resource(device_t dev) return (ENXIO); } pci_host_acpi_get_oem_quirks(sc, hdr); + if (sc->base.quirks & PCIE_ECAM_DESIGNWARE_QUIRK) + device_set_desc(dev, "Synopsys DesignWare PCIe Controller"); } else { status = acpi_GetInteger(handle, "_CBA", &val); if (ACPI_SUCCESS(status)) From owner-dev-commits-src-all@freebsd.org Thu Sep 16 15:32:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C8B1D67CBA5 for ; Thu, 16 Sep 2021 15:32:43 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9Lgb4fX1z3tL5 for ; Thu, 16 Sep 2021 15:32:43 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-yb1-xb2d.google.com with SMTP id z5so13785800ybj.2 for ; Thu, 16 Sep 2021 08:32:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uwy6Cqv8pJIoup6Q4kenXO/Jmyt3MWnzMTvgAHeGurU=; b=PdkC3CoGO+sbnNXgeqFOcH9eb6HLpSA6JJxrmKxUZJGuvOGnjNMt+3IT/tUAy63igj s+psC72Rg7do1xHlnNW05d7T2ewrfByQs/WJ6YnNeJOd36JxBRCCtkAOrh49Gf4qZ07N LH5uHdPc4G1gXNJZjbueFZxJLOpdlDpzznoT0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=uwy6Cqv8pJIoup6Q4kenXO/Jmyt3MWnzMTvgAHeGurU=; b=NMsLh7ka0qAJmyTSY9OTTXjmUNLW/0AkAGLcHuufacW2lQTC7mLKaOXCn3TJmf9tFT QWlMcheFjSIujJEjWsyBaQVfNgJH6lcj9v0Cvgb9bybHkH1p36gTccLQRHM682T5pHgK xJ3NSkOwd/Dugm+ejEKEM5wiflYRzi01tn6mydigG1/pGGyYx99/fxjUXHWyc9mqFbh0 FhDDUlQsY5TvxgNak5/jA0gdZAUlkZg55MCLxkwW27oOVyO/+0WRigsThdM6IZduskeU V02R4wnC8A57NdRzBp+rgyr1KoNsb7fx2hbQ+hmgfxqhyBnWlKKd8XatLqLyn1BxtzS8 41Zg== X-Gm-Message-State: AOAM530o9gVxDWNW0j0GPa1cbEuH9ZADLz49yw4zlrq5jxE9r+77R/sG GEN2dR2Fc52sCc3ZZxe8e1yrspmAIRXn6TBROloGFQ== X-Google-Smtp-Source: ABdhPJzmhwGwTPKNhNNhT81vLfvcDAy0TOJaZ83msno4kkBZmiZU4iRc0gmmwqPIX2EnsN7tbfQNcH2sDhVmdceryrc= X-Received: by 2002:a25:3d84:: with SMTP id k126mr7769971yba.43.1631806362791; Thu, 16 Sep 2021 08:32:42 -0700 (PDT) MIME-Version: 1.0 References: <202109152233.18FMX2qw004740@gitrepo.freebsd.org> In-Reply-To: <202109152233.18FMX2qw004740@gitrepo.freebsd.org> From: Kevin Bowling Date: Thu, 16 Sep 2021 08:32:32 +0000 Message-ID: Subject: Re: git: 2796f7cab107 - main - e1000: Fix up HW vlan ops To: Kevin Bowling Cc: src-committers , "" , "dev-commits-src-main@FreeBSD.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4H9Lgb4fX1z3tL5 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 15:32:43 -0000 PR mentioned should have been 258258 with 230996 as a partial On Wed, Sep 15, 2021 at 10:33 PM Kevin Bowling wrote: > > The branch main has been updated by kbowling (ports committer): > > URL: https://cgit.FreeBSD.org/src/commit/?id=2796f7cab10785ef40efbba97ef67ab319c96e9c > > commit 2796f7cab10785ef40efbba97ef67ab319c96e9c > Author: Kevin Bowling > AuthorDate: 2021-09-15 14:47:19 +0000 > Commit: Kevin Bowling > CommitDate: 2021-09-15 15:03:01 +0000 > > e1000: Fix up HW vlan ops > > * Don't reset the entire adapter for vlan changes, fix up the problems > * Add some functions for vlan filter (vfta) manipulation > * Don't muck with the vfta if we aren't doing HW vlan filtering > * Disable interrupts when manipulating vfta on lem(4)-class NICs > * On the I350 there is a specification update (2.4.20) in which the > suggested workaround is to write to the vfta 10 times (if at first you > don't succeed, try, try again). Our shared code has the goods, use it > * Increase a VF's frame receive size in the case of vlans > > From the referenced PR, this reduced vlan configuration from minutes > to seconds with hundreds or thousands of vlans and prevents wedging the > adapter with needless adapter reinitialization for each vlan ID. > > PR: 230996 > Reviewed by: markj > Tested by: Ozkan KIRIK > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D30002 > --- > sys/dev/e1000/if_em.c | 166 ++++++++++++++++++++++++++++++++++++++------------ > 1 file changed, 126 insertions(+), 40 deletions(-) > > diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c > index 6e3a8f73190f..7900e550c55f 100644 > --- a/sys/dev/e1000/if_em.c > +++ b/sys/dev/e1000/if_em.c > @@ -297,6 +297,11 @@ static void em_if_debug(if_ctx_t ctx); > static void em_update_stats_counters(struct adapter *); > static void em_add_hw_stats(struct adapter *adapter); > static int em_if_set_promisc(if_ctx_t ctx, int flags); > +static bool em_if_vlan_filter_capable(struct adapter *); > +static bool em_if_vlan_filter_used(struct adapter *); > +static void em_if_vlan_filter_enable(struct adapter *); > +static void em_if_vlan_filter_disable(struct adapter *); > +static void em_if_vlan_filter_write(struct adapter *); > static void em_setup_vlan_hw_support(struct adapter *); > static int em_sysctl_nvm_info(SYSCTL_HANDLER_ARGS); > static void em_print_nvm_info(struct adapter *); > @@ -906,6 +911,9 @@ em_if_attach_pre(if_ctx_t ctx) > scctx->isc_capabilities = scctx->isc_capenable = LEM_CAPS; > if (hw->mac.type < e1000_82543) > scctx->isc_capenable &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM); > + /* 82541ER doesn't do HW tagging */ > + if (hw->device_id == E1000_DEV_ID_82541ER || hw->device_id == E1000_DEV_ID_82541ER_LOM) > + scctx->isc_capenable &= ~IFCAP_VLAN_HWTAGGING; > /* INTx only */ > scctx->isc_msix_bar = 0; > } > @@ -1335,23 +1343,8 @@ em_if_init(if_ctx_t ctx) > adapter->rx_mbuf_sz = iflib_get_rx_mbuf_sz(ctx); > em_initialize_receive_unit(ctx); > > - /* Use real VLAN Filter support? */ > - if (if_getcapenable(ifp) & IFCAP_VLAN_HWTAGGING) { > - if (if_getcapenable(ifp) & IFCAP_VLAN_HWFILTER) > - /* Use real VLAN Filter support */ > - em_setup_vlan_hw_support(adapter); > - else { > - u32 ctrl; > - ctrl = E1000_READ_REG(&adapter->hw, E1000_CTRL); > - ctrl |= E1000_CTRL_VME; > - E1000_WRITE_REG(&adapter->hw, E1000_CTRL, ctrl); > - } > - } else { > - u32 ctrl; > - ctrl = E1000_READ_REG(&adapter->hw, E1000_CTRL); > - ctrl &= ~E1000_CTRL_VME; > - E1000_WRITE_REG(&adapter->hw, E1000_CTRL, ctrl); > - } > + /* Set up VLAN support and filter */ > + em_setup_vlan_hw_support(adapter); > > /* Don't lose promiscuous settings */ > em_if_set_promisc(ctx, if_getflags(ifp)); > @@ -1670,14 +1663,19 @@ em_if_set_promisc(if_ctx_t ctx, int flags) > > if (flags & IFF_PROMISC) { > reg_rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE); > + em_if_vlan_filter_disable(adapter); > /* Turn this on if you want to see bad packets */ > if (em_debug_sbp) > reg_rctl |= E1000_RCTL_SBP; > E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); > - } else if (flags & IFF_ALLMULTI) { > - reg_rctl |= E1000_RCTL_MPE; > - reg_rctl &= ~E1000_RCTL_UPE; > - E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); > + } else { > + if (flags & IFF_ALLMULTI) { > + reg_rctl |= E1000_RCTL_MPE; > + reg_rctl &= ~E1000_RCTL_UPE; > + E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); > + } > + if (em_if_vlan_filter_used(adapter)) > + em_if_vlan_filter_enable(adapter); > } > return (0); > } > @@ -3323,7 +3321,11 @@ em_initialize_receive_unit(if_ctx_t ctx) > /* are we on a vlan? */ > if (ifp->if_vlantrunk != NULL) > psize += VLAN_TAG_SIZE; > - E1000_WRITE_REG(hw, E1000_RLPML, psize); > + > + if (adapter->vf_ifp) > + e1000_rlpml_set_vf(hw, pszie); > + else > + E1000_WRITE_REG(hw, E1000_RLPML, psize); > } > > /* Set maximum packet buffer len */ > @@ -3420,6 +3422,7 @@ em_if_vlan_register(if_ctx_t ctx, u16 vtag) > bit = vtag & 0x1F; > adapter->shadow_vfta[index] |= (1 << bit); > ++adapter->num_vlans; > + em_if_vlan_filter_write(adapter); > } > > static void > @@ -3432,41 +3435,121 @@ em_if_vlan_unregister(if_ctx_t ctx, u16 vtag) > bit = vtag & 0x1F; > adapter->shadow_vfta[index] &= ~(1 << bit); > --adapter->num_vlans; > + em_if_vlan_filter_write(adapter); > +} > + > +static bool > +em_if_vlan_filter_capable(struct adapter *adapter) > +{ > + if_softc_ctx_t scctx = adapter->shared; > + > + if ((scctx->isc_capenable & IFCAP_VLAN_HWFILTER) && > + !em_disable_crc_stripping) > + return (true); > + > + return (false); > +} > + > +static bool > +em_if_vlan_filter_used(struct adapter *adapter) > +{ > + if (!em_if_vlan_filter_capable(adapter)) > + return (false); > + > + for (int i = 0; i < EM_VFTA_SIZE; i++) > + if (adapter->shadow_vfta[i] != 0) > + return (true); > + > + return (false); > +} > + > +static void > +em_if_vlan_filter_enable(struct adapter *adapter) > +{ > + struct e1000_hw *hw = &adapter->hw; > + u32 reg; > + > + reg = E1000_READ_REG(hw, E1000_RCTL); > + reg &= ~E1000_RCTL_CFIEN; > + reg |= E1000_RCTL_VFE; > + E1000_WRITE_REG(hw, E1000_RCTL, reg); > +} > + > +static void > +em_if_vlan_filter_disable(struct adapter *adapter) > +{ > + struct e1000_hw *hw = &adapter->hw; > + u32 reg; > + > + reg = E1000_READ_REG(hw, E1000_RCTL); > + reg &= ~(E1000_RCTL_VFE | E1000_RCTL_CFIEN); > + E1000_WRITE_REG(hw, E1000_RCTL, reg); > +} > + > +static void > +em_if_vlan_filter_write(struct adapter *adapter) > +{ > + struct e1000_hw *hw = &adapter->hw; > + > + if (adapter->vf_ifp) > + return; > + > + /* Disable interrupts for lem-class devices during the filter change */ > + if (hw->mac.type < em_mac_min) > + em_if_intr_disable(adapter->ctx); > + > + for (int i = 0; i < EM_VFTA_SIZE; i++) > + if (adapter->shadow_vfta[i] != 0) { > + /* XXXKB: incomplete VF support, we return early above */ > + if (adapter->vf_ifp) > + e1000_vfta_set_vf(hw, adapter->shadow_vfta[i], TRUE); > + else > + e1000_write_vfta(hw, i, adapter->shadow_vfta[i]); > + } > + > + /* Re-enable interrupts for lem-class devices */ > + if (hw->mac.type < em_mac_min) > + em_if_intr_enable(adapter->ctx); > } > > static void > em_setup_vlan_hw_support(struct adapter *adapter) > { > + if_softc_ctx_t scctx = adapter->shared; > struct e1000_hw *hw = &adapter->hw; > u32 reg; > > - /* > - * We get here thru init_locked, meaning > - * a soft reset, this has already cleared > - * the VFTA and other state, so if there > - * have been no vlan's registered do nothing. > + /* XXXKB: Return early if we are a VF until VF decap and filter management > + * is ready and tested. > */ > - if (adapter->num_vlans == 0) > + if (adapter->vf_ifp) > + return; > + > + if (scctx->isc_capenable & IFCAP_VLAN_HWTAGGING && > + !em_disable_crc_stripping) { > + reg = E1000_READ_REG(hw, E1000_CTRL); > + reg |= E1000_CTRL_VME; > + E1000_WRITE_REG(hw, E1000_CTRL, reg); > + } else { > + reg = E1000_READ_REG(hw, E1000_CTRL); > + reg &= ~E1000_CTRL_VME; > + E1000_WRITE_REG(hw, E1000_CTRL, reg); > + } > + > + /* If we aren't doing HW filtering, we're done */ > + if (!em_if_vlan_filter_capable(adapter)) { > + em_if_vlan_filter_disable(adapter); > return; > + } > > /* > * A soft reset zero's out the VFTA, so > * we need to repopulate it now. > */ > - for (int i = 0; i < EM_VFTA_SIZE; i++) > - if (adapter->shadow_vfta[i] != 0) > - E1000_WRITE_REG_ARRAY(hw, E1000_VFTA, > - i, adapter->shadow_vfta[i]); > - > - reg = E1000_READ_REG(hw, E1000_CTRL); > - reg |= E1000_CTRL_VME; > - E1000_WRITE_REG(hw, E1000_CTRL, reg); > + em_if_vlan_filter_write(adapter); > > /* Enable the Filter Table */ > - reg = E1000_READ_REG(hw, E1000_RCTL); > - reg &= ~E1000_RCTL_CFIEN; > - reg |= E1000_RCTL_VFE; > - E1000_WRITE_REG(hw, E1000_RCTL, reg); > + em_if_vlan_filter_enable(adapter); > } > > static void > @@ -3481,6 +3564,7 @@ em_if_intr_enable(if_ctx_t ctx) > ims_mask |= adapter->ims; > } > E1000_WRITE_REG(hw, E1000_IMS, ims_mask); > + E1000_WRITE_FLUSH(hw); > } > > static void > @@ -3492,6 +3576,7 @@ em_if_intr_disable(if_ctx_t ctx) > if (adapter->intr_type == IFLIB_INTR_MSIX) > E1000_WRITE_REG(hw, EM_EIAC, 0); > E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff); > + E1000_WRITE_FLUSH(hw); > } > > static void > @@ -4101,6 +4186,7 @@ em_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) > { > switch (event) { > case IFLIB_RESTART_VLAN_CONFIG: > + return (false); > default: > return (true); > } > _______________________________________________ > dev-commits-src-main@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main > To unsubscribe, send any mail to "dev-commits-src-main-unsubscribe@freebsd.org" From owner-dev-commits-src-all@freebsd.org Thu Sep 16 17:10:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E55FA67D940; Thu, 16 Sep 2021 17:10:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9NrZ5wmMz4qpw; Thu, 16 Sep 2021 17:10:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AADF625461; Thu, 16 Sep 2021 17:10:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18GHAcrB089874; Thu, 16 Sep 2021 17:10:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18GHAcB2089873; Thu, 16 Sep 2021 17:10:38 GMT (envelope-from git) Date: Thu, 16 Sep 2021 17:10:38 GMT Message-Id: <202109161710.18GHAcB2089873@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 181bfb42fd01 - main - vm_phys: do not ignore phys_avail[] segments that do not fit completely into vm_phys segments MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 181bfb42fd01bfa9f4636e803ccb3eeed8ac8ba4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 17:10:39 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=181bfb42fd01bfa9f4636e803ccb3eeed8ac8ba4 commit 181bfb42fd01bfa9f4636e803ccb3eeed8ac8ba4 Author: Konstantin Belousov AuthorDate: 2021-09-14 12:25:37 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-16 17:01:19 +0000 vm_phys: do not ignore phys_avail[] segments that do not fit completely into vm_phys segments If phys_avail[] segment only intersect with some vm_phys segment, add pages from it to the free list that belong to the given vm_phys_seg, instead of dropping them. The vm_phys segments are generally result of subdivision of phys_avail segments, for instance DMA32 or LOWMEM boundaries split them. On amd64, after UEFI in-place kernel activation (copy_staging disable) was enabled, we typically have a large phys_avail[] segment below 4G which crosses LOWMEM (1M) boundary. With the current way of requiring phys_avail[] fully fit into vm_phys_seg, this memory was ignored. Reported by: madpilot Reviewed by: markj Discussed with: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31958 --- sys/vm/vm_page.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 4ecea30e9219..d2e94ced6766 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -552,11 +552,12 @@ vm_offset_t vm_page_startup(vm_offset_t vaddr) { struct vm_phys_seg *seg; + struct vm_domain *vmd; vm_page_t m; char *list, *listend; vm_paddr_t end, high_avail, low_avail, new_end, size; vm_paddr_t page_range __unused; - vm_paddr_t last_pa, pa; + vm_paddr_t last_pa, pa, startp, endp; u_long pagecount; #if MINIDUMP_PAGE_TRACKING u_long vm_page_dump_size; @@ -770,21 +771,20 @@ vm_page_startup(vm_offset_t vaddr) vm_page_init_page(m, pa, segind); /* - * Add the segment to the free lists only if it is covered by - * one of the ranges in phys_avail. Because we've added the - * ranges to the vm_phys_segs array, we can assume that each - * segment is either entirely contained in one of the ranges, - * or doesn't overlap any of them. + * Add the segment's pages that are covered by one of + * phys_avail's ranges to the free lists. */ for (i = 0; phys_avail[i + 1] != 0; i += 2) { - struct vm_domain *vmd; - - if (seg->start < phys_avail[i] || - seg->end > phys_avail[i + 1]) + if (seg->end < phys_avail[i] || + seg->start >= phys_avail[i + 1]) continue; - m = seg->first_page; - pagecount = (u_long)atop(seg->end - seg->start); + startp = MAX(seg->start, phys_avail[i]); + m = seg->first_page + atop(seg->start - startp); + endp = MIN(seg->end, phys_avail[i + 1]); + pagecount = (u_long)atop(endp - startp); + if (pagecount == 0) + continue; vmd = VM_DOMAIN(seg->domain); vm_domain_free_lock(vmd); @@ -796,7 +796,6 @@ vm_page_startup(vm_offset_t vaddr) vmd = VM_DOMAIN(seg->domain); vmd->vmd_page_count += (u_int)pagecount; vmd->vmd_segs |= 1UL << m->segind; - break; } } From owner-dev-commits-src-all@freebsd.org Thu Sep 16 17:26:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D337167E0CD; Thu, 16 Sep 2021 17:26:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9PCK5Mjpz4tsX; Thu, 16 Sep 2021 17:26:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9893025918; Thu, 16 Sep 2021 17:26:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18GHQraH006748; Thu, 16 Sep 2021 17:26:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18GHQrX4006747; Thu, 16 Sep 2021 17:26:53 GMT (envelope-from git) Date: Thu, 16 Sep 2021 17:26:53 GMT Message-Id: <202109161726.18GHQrX4006747@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: f575573ca577 - main - Remove PT_GET_SC_ARGS_ALL MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f575573ca57716395ad88b962388a55d755cf6a7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 17:26:53 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f575573ca57716395ad88b962388a55d755cf6a7 commit f575573ca57716395ad88b962388a55d755cf6a7 Author: Konstantin Belousov AuthorDate: 2021-09-15 13:24:09 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-16 17:11:27 +0000 Remove PT_GET_SC_ARGS_ALL Reimplement bdf0f24bb16d556a5b by checking for the caller' ABI in the implementation of PT_GET_SC_ARGS, and copying out everything if it is Linuxolator. Also fix a minor information leak: if PT_GET_SC_ARGS_ALL is done on the thread reused after other process, it allows to read some number of that thread last syscall arguments. Clear td_sa.args in thread_alloc(). Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D31968 --- lib/libsysdecode/mktables | 2 +- sys/amd64/linux/linux_ptrace.c | 18 ++++++++++-------- sys/compat/freebsd32/freebsd32_misc.c | 3 --- sys/kern/kern_thread.c | 1 + sys/kern/sys_process.c | 23 ++++------------------- sys/sys/ptrace.h | 4 ---- 6 files changed, 16 insertions(+), 35 deletions(-) diff --git a/lib/libsysdecode/mktables b/lib/libsysdecode/mktables index 1c263fd3b0b2..3d152a3a2646 100644 --- a/lib/libsysdecode/mktables +++ b/lib/libsysdecode/mktables @@ -116,7 +116,7 @@ gen_table "nfssvcflags" "NFSSVC_[A-Z0-9]+[[:space:]]+0x[0-9]+" "nfs/ gen_table "pathconfname" "_PC_[A-Z4_]+[[:space:]]+[0-9]+" "sys/unistd.h" gen_table "prio" "PRIO_[A-Z]+[[:space:]]+[0-9]" "sys/resource.h" gen_table "procctlcmd" "PROC_[A-Z_]+[[:space:]]+[0-9]" "sys/procctl.h" "PROC_TRACE_CTL_" -gen_table "ptraceop" "PT_[[:alnum:]_]+[[:space:]]+[0-9]+" "sys/ptrace.h" "PT_GET_SC_ARGS_ALL" +gen_table "ptraceop" "PT_[[:alnum:]_]+[[:space:]]+[0-9]+" "sys/ptrace.h" gen_table "quotactlcmds" "Q_[A-Z]+[[:space:]]+0x[0-9]+" "ufs/ufs/quota.h" gen_table "rebootopt" "RB_[A-Z]+[[:space:]]+0x[0-9]+" "sys/reboot.h" gen_table "rforkflags" "RF[A-Z]+[[:space:]]+\([0-9]+<<[0-9]+\)" "sys/unistd.h" diff --git a/sys/amd64/linux/linux_ptrace.c b/sys/amd64/linux/linux_ptrace.c index 70e52c528c72..eb39e3c9ada6 100644 --- a/sys/amd64/linux/linux_ptrace.c +++ b/sys/amd64/linux/linux_ptrace.c @@ -544,17 +544,19 @@ linux_ptrace_get_syscall_info(struct thread *td, pid_t pid, si.op = LINUX_PTRACE_SYSCALL_INFO_ENTRY; si.entry.nr = lwpinfo.pl_syscall_code; /* - * The reason for using PT_GET_SC_ARGS_ALL instead - * of PT_GET_SC_ARGS is to emulate Linux bug which strace(1) - * depends on: at initialization it tests whether ptrace works - * by calling close(2), or some other single-argument syscall, - * _with six arguments_, and then verifies whether it can - * fetch them all using this API; otherwise it bails out. + * The use of PT_GET_SC_ARGS there is special, + * implementation of PT_GET_SC_ARGS for Linux-ABI + * callers emulates Linux bug which strace(1) depends + * on: at initialization it tests whether ptrace works + * by calling close(2), or some other single-argument + * syscall, _with six arguments_, and then verifies + * whether it can fetch them all using this API; + * otherwise it bails out. */ - error = kern_ptrace(td, PT_GET_SC_ARGS_ALL, pid, + error = kern_ptrace(td, PT_GET_SC_ARGS, pid, &si.entry.args, sizeof(si.entry.args)); if (error != 0) { - linux_msg(td, "PT_GET_SC_ARGS_ALL failed with error %d", + linux_msg(td, "PT_GET_SC_ARGS failed with error %d", error); return (error); } diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index 01d772b35ee8..c417a64d286a 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -1032,9 +1032,6 @@ freebsd32_ptrace(struct thread *td, struct freebsd32_ptrace_args *uap) r.pc.pc_limit = PAIR32TO64(off_t, r32.pc.pc_limit); data = sizeof(r.pc); break; - case PT_GET_SC_ARGS_ALL: - error = EINVAL; - break; default: addr = uap->addr; break; diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index cb35d565974d..65c5cc65c87e 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -762,6 +762,7 @@ thread_alloc(int pages) return (NULL); } td->td_tid = tid; + bzero(&td->td_sa.args, sizeof(td->td_sa.args)); kmsan_thread_alloc(td); cpu_thread_alloc(td); EVENTHANDLER_DIRECT_INVOKE(thread_ctor, td); diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index e2d8042744d0..2c212edd0ae7 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -527,9 +527,6 @@ sys_ptrace(struct thread *td, struct ptrace_args *uap) else error = copyin(uap->addr, &r.pc, uap->data); break; - case PT_GET_SC_ARGS_ALL: - error = EINVAL; - break; default: addr = uap->addr; break; @@ -711,7 +708,6 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) case PT_SET_EVENT_MASK: case PT_DETACH: case PT_GET_SC_ARGS: - case PT_GET_SC_ARGS_ALL: sx_xlock(&proctree_lock); proctree_locked = true; break; @@ -1011,21 +1007,10 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) break; } bzero(addr, sizeof(td2->td_sa.args)); - bcopy(td2->td_sa.args, addr, td2->td_sa.callp->sy_narg * - sizeof(register_t)); - break; - - case PT_GET_SC_ARGS_ALL: - CTR1(KTR_PTRACE, "PT_GET_SC_ARGS_ALL: pid %d", p->p_pid); - if ((td2->td_dbgflags & (TDB_SCE | TDB_SCX)) == 0 -#ifdef COMPAT_FREEBSD32 - || (wrap32 && !safe) -#endif - ) { - error = EINVAL; - break; - } - bcopy(td2->td_sa.args, addr, sizeof(td2->td_sa.args)); + /* See the explanation in linux_ptrace_get_syscall_info(). */ + bcopy(td2->td_sa.args, addr, SV_PROC_ABI(td->td_proc) == + SV_ABI_LINUX ? sizeof(td2->td_sa.args) : + td2->td_sa.callp->sy_narg * sizeof(register_t)); break; case PT_GET_SC_RET: diff --git a/sys/sys/ptrace.h b/sys/sys/ptrace.h index 066a54f721c8..1e7c1c71056b 100644 --- a/sys/sys/ptrace.h +++ b/sys/sys/ptrace.h @@ -86,10 +86,6 @@ #define PT_VM_TIMESTAMP 40 /* Get VM version (timestamp) */ #define PT_VM_ENTRY 41 /* Get VM map (entry) */ -#ifdef _KERNEL -#define PT_GET_SC_ARGS_ALL 42 /* Used by linux(4) */ -#endif - #define PT_FIRSTMACH 64 /* for machine-specific requests */ #include /* machine-specific requests, if any */ From owner-dev-commits-src-all@freebsd.org Thu Sep 16 17:26:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4774667E03B; Thu, 16 Sep 2021 17:26:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9PCM1Lj0z4tdL; Thu, 16 Sep 2021 17:26:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2487259FF; Thu, 16 Sep 2021 17:26:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18GHQsiH006772; Thu, 16 Sep 2021 17:26:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18GHQsFX006771; Thu, 16 Sep 2021 17:26:54 GMT (envelope-from git) Date: Thu, 16 Sep 2021 17:26:54 GMT Message-Id: <202109161726.18GHQsFX006771@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 9a8eb5db5596 - main - test/ptrace/scescx.c: fix printing of braces for syscalls without args MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9a8eb5db55964c2fc7aca0db5939d8300badc9ab Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 17:26:55 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9a8eb5db55964c2fc7aca0db5939d8300badc9ab commit 9a8eb5db55964c2fc7aca0db5939d8300badc9ab Author: Konstantin Belousov AuthorDate: 2021-09-16 17:23:11 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-16 17:26:18 +0000 test/ptrace/scescx.c: fix printing of braces for syscalls without args Also do not print stray closing brace for error condition. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- tools/test/ptrace/scescx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/test/ptrace/scescx.c b/tools/test/ptrace/scescx.c index 782a43d69bf4..582d1734427e 100644 --- a/tools/test/ptrace/scescx.c +++ b/tools/test/ptrace/scescx.c @@ -196,16 +196,17 @@ wait_info(int pid, int status, struct ptrace_lwpinfo *lwpinfo) (caddr_t)args, lwpinfo->pl_syscall_narg * sizeof(long)); if (error == 0) { + printf("("); for (i = 0; i < (int)lwpinfo->pl_syscall_narg; i++) { - printf("%c%#lx", i == 0 ? '(' : ',', + printf("%s%#lx", i == 0 ? "" : ",", args[i]); } + printf(")"); } else { fprintf(stderr, "PT_GET_SC_ARGS failed: %s", strerror(errno)); } - printf(")"); free(args); } } From owner-dev-commits-src-all@freebsd.org Thu Sep 16 17:59:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE6F367E693; Thu, 16 Sep 2021 17:59:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9Pwt5Hc1z3KmH; Thu, 16 Sep 2021 17:59:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95EF026094; Thu, 16 Sep 2021 17:59:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18GHxQGC046519; Thu, 16 Sep 2021 17:59:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18GHxQLx046518; Thu, 16 Sep 2021 17:59:26 GMT (envelope-from git) Date: Thu, 16 Sep 2021 17:59:26 GMT Message-Id: <202109161759.18GHxQLx046518@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 7cf62c68c0f4 - main - nanobsd: Provide empty routines for new embedded scheme MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7cf62c68c0f48c44e3fcb098d0406f417c1f488b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 17:59:26 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7cf62c68c0f48c44e3fcb098d0406f417c1f488b commit 7cf62c68c0f48c44e3fcb098d0406f417c1f488b Author: Warner Losh AuthorDate: 2021-09-16 16:18:32 +0000 Commit: Warner Losh CommitDate: 2021-09-16 17:54:18 +0000 nanobsd: Provide empty routines for new embedded scheme calculate_partitioning and create_code_slice are now required in nanobsd.sh. While things work with the ones provided by legacy.sh, it's fighting embedded/common's other actions. Instead, replace them with stubs. Sponsored by: Netflix --- tools/tools/nanobsd/embedded/common | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/tools/nanobsd/embedded/common b/tools/tools/nanobsd/embedded/common index f3be05ae857a..3b8faff5e252 100644 --- a/tools/tools/nanobsd/embedded/common +++ b/tools/tools/nanobsd/embedded/common @@ -647,6 +647,14 @@ esac NANO_SLICE_DATA= # Not included +# These don't make any sense to this strategy, so stub them out. +calculate_partitioning ( ) ( +) + +# These don't make any sense to this strategy, so stub them out. +create_code_slice ( ) ( +) + # Each major disk scheme has its own routine. Generally # this is for mbr, gpt, etc. These are generally are widely # shared, but some specialized formats won't be shared. From owner-dev-commits-src-all@freebsd.org Thu Sep 16 18:11:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A555D67EC11; Thu, 16 Sep 2021 18:11:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9QBx4H6cz3Nnh; Thu, 16 Sep 2021 18:11:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70DDF26139; Thu, 16 Sep 2021 18:11:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18GIBbgR070474; Thu, 16 Sep 2021 18:11:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18GIBbRS070473; Thu, 16 Sep 2021 18:11:37 GMT (envelope-from git) Date: Thu, 16 Sep 2021 18:11:37 GMT Message-Id: <202109161811.18GIBbRS070473@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: adb56e58e8db - main - openssh: use global state for blacklist in grace_alarm_handler MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: adb56e58e8db84d8087ebe3d3e7def0074cb5a90 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 18:11:37 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=adb56e58e8db84d8087ebe3d3e7def0074cb5a90 commit adb56e58e8db84d8087ebe3d3e7def0074cb5a90 Author: Ed Maste AuthorDate: 2021-09-16 18:08:27 +0000 Commit: Ed Maste CommitDate: 2021-09-16 18:10:11 +0000 openssh: use global state for blacklist in grace_alarm_handler Obtained from: security/openssh-portable Fixes: 19261079b743 ("openssh: update to OpenSSH v8.7p1") Sponsored by: The FreeBSD Foundation --- crypto/openssh/sshd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/openssh/sshd.c b/crypto/openssh/sshd.c index 864ad09b29fc..25a3769b4823 100644 --- a/crypto/openssh/sshd.c +++ b/crypto/openssh/sshd.c @@ -385,7 +385,7 @@ grace_alarm_handler(int sig) kill(0, SIGTERM); } - BLACKLIST_NOTIFY(NULL, BLACKLIST_AUTH_FAIL, "ssh"); + BLACKLIST_NOTIFY(the_active_state, BLACKLIST_AUTH_FAIL, "ssh"); /* Log error and exit. */ if (use_privsep && pmonitor != NULL && pmonitor->m_pid <= 0) From owner-dev-commits-src-all@freebsd.org Thu Sep 16 19:23:46 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E85567F82C; Thu, 16 Sep 2021 19:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9RpB2fM1z4S1X; Thu, 16 Sep 2021 19:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AC68271F2; Thu, 16 Sep 2021 19:23:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18GJNkFC067171; Thu, 16 Sep 2021 19:23:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18GJNkWt067170; Thu, 16 Sep 2021 19:23:46 GMT (envelope-from git) Date: Thu, 16 Sep 2021 19:23:46 GMT Message-Id: <202109161923.18GJNkWt067170@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 0aa2a94ea635 - main - EC2: Allow AMI boot mode to be specified MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0aa2a94ea6359fb2587af81841fbf8eb30ab36b0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 19:23:46 -0000 The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=0aa2a94ea6359fb2587af81841fbf8eb30ab36b0 commit 0aa2a94ea6359fb2587af81841fbf8eb30ab36b0 Author: Colin Percival AuthorDate: 2021-09-16 02:15:44 +0000 Commit: Colin Percival CommitDate: 2021-09-16 19:23:19 +0000 EC2: Allow AMI boot mode to be specified The default boot method for amd64 AMIs is BIOS, but at AMI creation time a flag can be set to specify that UEFI should be used instead. This commit adds a variable AMIBOOTMETHOD which, if set to "UEFI", causes the appropriate flag to be set during AMI creation. The only boot method supported by EC2 for arm64 is UEFI. The names of AMIs are also amended to include the boot method; they now look like "FreeBSD 14.0-CURRENT-amd64-20210915 UEFI". MFC after: 1 week Sponsored by: https://www.patreon.com/cperciva --- release/Makefile.ec2 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/release/Makefile.ec2 b/release/Makefile.ec2 index 5683cb6634b6..ce21d93c37ad 100644 --- a/release/Makefile.ec2 +++ b/release/Makefile.ec2 @@ -24,6 +24,16 @@ SSMOPTS= --ssm-name ${SSMPREFIX}/${TARGET_ARCH:S/aarch64/arm64/}/base/ufs/${REVI .if ${TARGET_ARCH} != "amd64" EC2ARCH= --${TARGET_ARCH:S/aarch64/arm64/} .endif +.if !defined(AMIBOOTMETHOD) +.if ${TARGET_ARCH} == "amd64" +AMIBOOTMETHOD= BIOS +.else +AMIBOOTMETHOD= UEFI +.endif +.endif +.if ${AMIBOOTMETHOD} == "UEFI" && ${TARGET_ARCH} == "amd64" +BOOTMODEOPT= --uefi +.endif CLEANFILES+= ec2ami @@ -65,9 +75,9 @@ ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL} @false .endif /usr/local/bin/bsdec2-image-upload ${PUBLISH} ${PUBLICSNAP} \ - ${EC2ARCH} ${SSMOPTS} --sriov --ena \ + ${EC2ARCH} ${SSMOPTS} ${BOOTMODEOPT} --sriov --ena \ ${.OBJDIR}/ec2.raw \ - "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \ + "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX} ${AMIBOOTMETHOD}" \ "${TYPE}/${TARGET} ${GITBRANCH}@${GITREV}" \ ${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE} \ ${EC2SNSTOPIC} ${EC2SNSREL} ${EC2SNSVERS} From owner-dev-commits-src-all@freebsd.org Thu Sep 16 19:23:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A1AA67F3CA; Thu, 16 Sep 2021 19:23:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9RpC3mvrz4Rmq; Thu, 16 Sep 2021 19:23:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FD6E27588; Thu, 16 Sep 2021 19:23:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18GJNlUs067195; Thu, 16 Sep 2021 19:23:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18GJNlwp067194; Thu, 16 Sep 2021 19:23:47 GMT (envelope-from git) Date: Thu, 16 Sep 2021 19:23:47 GMT Message-Id: <202109161923.18GJNlwp067194@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: b43d7aa09b3c - main - EC2: Default to UEFI booting MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b43d7aa09b3c91fb6b652306db2ac13e1459c497 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 19:23:47 -0000 The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=b43d7aa09b3c91fb6b652306db2ac13e1459c497 commit b43d7aa09b3c91fb6b652306db2ac13e1459c497 Author: Colin Percival AuthorDate: 2021-09-16 16:22:42 +0000 Commit: Colin Percival CommitDate: 2021-09-16 19:23:19 +0000 EC2: Default to UEFI booting This reduces the FreeBSD boot time by approximately 5 seconds, roughly equally divided betwenn two factors: * Disk I/O is faster in the EFI loader since it can perform larger I/Os. (The BIOS loader is limited due to the use of bounce buffers in sub-1M memory.) * The EFI console is much faster than the VGA console. Note however that not all EC2 instance types support UEFI; as a general rule the newer instances (based on Amazon's "Nitro" platform) support UEFI but the older instances (based on Xen) do not. X-MFC: TBD based on tradeoff between performance and compatibility Relnotes: yes Sponsored by: https://www.patreon.com/cperciva --- release/Makefile.ec2 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/release/Makefile.ec2 b/release/Makefile.ec2 index ce21d93c37ad..b29f54715fb3 100644 --- a/release/Makefile.ec2 +++ b/release/Makefile.ec2 @@ -25,12 +25,8 @@ SSMOPTS= --ssm-name ${SSMPREFIX}/${TARGET_ARCH:S/aarch64/arm64/}/base/ufs/${REVI EC2ARCH= --${TARGET_ARCH:S/aarch64/arm64/} .endif .if !defined(AMIBOOTMETHOD) -.if ${TARGET_ARCH} == "amd64" -AMIBOOTMETHOD= BIOS -.else AMIBOOTMETHOD= UEFI .endif -.endif .if ${AMIBOOTMETHOD} == "UEFI" && ${TARGET_ARCH} == "amd64" BOOTMODEOPT= --uefi .endif From owner-dev-commits-src-all@freebsd.org Thu Sep 16 21:28:12 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 62AF16A8CE5; Thu, 16 Sep 2021 21:28:12 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f175.google.com (mail-il1-f175.google.com [209.85.166.175]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9VYl42zGz3Pr0; Thu, 16 Sep 2021 21:28:11 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f175.google.com with SMTP id v16so8104717ilg.3; Thu, 16 Sep 2021 14:28:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=op7krweaH0Zdt00wAwpxsQgcePf2ZWjqFPLovd4Ut8U=; b=73eevLW5GHdnFy7HNfsihFoTIsuIVtdLVkHBV16ntuisTBsJsKjzXZIiV5GIWIn4Fy WCcKuwmzWsoPbBdDgv0QaGBtH/bI9Ay8hlWRbKsXKhPitplnmXp4gNmj6GYcr9mXSVdc fVhe4NkSDgSBf6BSl794fbjef0xnc5cLtsN9jusLB3StgyKguDvMdEt/tUwdlvtiQpiJ XKg/Jw80F6e+7F9D+/0+UWrPYQ7iuMdXY1TaiSivWp/Sy3KPfHvp+hRtmUjRuB45tw1P iqAvPBjdcTqjOQCZ/apTVU7J67MixKP2EfU8Kp0yHTPypJlSpxggVQE6j4ycnyAdUWk9 4/Og== X-Gm-Message-State: AOAM5310mQR0ruhopmtTRjEAXpCEkfzqJWVPQCXYNGCOiTWBd8HHmXsx j6+w6lIKz6A558vmUShcCgUHqmPWEwAXf7Es8DnSknR1yOw= X-Google-Smtp-Source: ABdhPJwKDjR956Y5mT7BJVN6QU6lGbsn3AZmOMu0ofW80vEPAUh9LTXTsgjPDnWY44SgxHRSHBclwF6eT08IYhUVTOo= X-Received: by 2002:a92:7302:: with SMTP id o2mr5490994ilc.44.1631827685036; Thu, 16 Sep 2021 14:28:05 -0700 (PDT) MIME-Version: 1.0 References: <202109041534.184FYq6n093346@gitrepo.freebsd.org> In-Reply-To: From: Ed Maste Date: Thu, 16 Sep 2021 17:27:10 -0400 Message-ID: Subject: Re: git: b0025f9b7ff0 - main - openssh: update default version addendum in man pages To: Ronald Klop Cc: src-committers , "" , dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4H9VYl42zGz3Pr0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of carpeddiem@gmail.com designates 209.85.166.175 as permitted sender) smtp.mailfrom=carpeddiem@gmail.com X-Spamd-Result: default: False [-2.98 / 15.00]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; FREEFALL_USER(0.00)[carpeddiem]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; RCVD_TLS_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.982]; RCVD_IN_DNSWL_NONE(0.00)[209.85.166.175:from]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FORGED_SENDER(0.30)[emaste@freebsd.org,carpeddiem@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.85.166.175:from]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[emaste@freebsd.org,carpeddiem@gmail.com]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Sep 2021 21:28:12 -0000 On Sun, 5 Sept 2021 at 12:26, Ronald Klop wrote: > > I'm wondering why the FreeBSD project adds this information to the banner by default. I learned that not exposing information about the running system is good security practice. > Any thoughts about this? What is the gain of this banner? Like many things it's a tradeoff. Adding the version to sshd's banner provides an easy way for an administrator to confirm that an update has been applied (assuming that the version is updated). Conversely, it's even easier (for an attacker) to connect and just attempt some misbehaviour than it would be to check this version string first. We introduced the VersionAddendum here: commit 933ca70f8f888b7fc1b06213198ba15ca346aeca Author: Brian Feldman Date: Thu May 3 00:29:28 2001 +0000 Add a "VersionAddendum" configuration setting for sshd which allows anyone to easily change the part of the OpenSSH version after the main version number. The FreeBSD-specific version banner could be disabled that way, for example: # Call ourselves plain OpenSSH VersionAddendum Notes: svn path=/head/; revision=76227 Upstream adopted it here: commit 23528816dc10165b3bc009f2ab5fdf1653db418c Author: Damien Miller Date: Sun Apr 22 11:24:43 2012 +1000 - djm@cvs.openbsd.org 2012/04/12 02:42:32 [servconf.c servconf.h sshd.c sshd_config sshd_config.5] VersionAddendum option to allow server operators to append some arbitrary text to the SSH-... banner; ok deraadt@ "don't care" markus@ Now, we support it for both the client and server while upstream supports it for the server only. I suspect there isn't a lot of value in the client-side support, and am considering removing it to reduce the differences between our in-tree ssh and upstream, and ease future OpenSSH updates. From owner-dev-commits-src-all@freebsd.org Fri Sep 17 00:35:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 803606AB026; Fri, 17 Sep 2021 00:35:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9ZkJ30KPz3pXF; Fri, 17 Sep 2021 00:35:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4688433D7; Fri, 17 Sep 2021 00:35:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18H0ZqYt078456; Fri, 17 Sep 2021 00:35:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18H0ZqAu078455; Fri, 17 Sep 2021 00:35:52 GMT (envelope-from git) Date: Fri, 17 Sep 2021 00:35:52 GMT Message-Id: <202109170035.18H0ZqAu078455@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 1a0ffb2b06bc - stable/13 - openssh: remove login class restrictions leftovers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1a0ffb2b06bc0a8b26c993746cdf82bb643cc7a7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 00:35:52 -0000 The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=1a0ffb2b06bc0a8b26c993746cdf82bb643cc7a7 commit 1a0ffb2b06bc0a8b26c993746cdf82bb643cc7a7 Author: Ed Maste AuthorDate: 2021-09-02 21:13:29 +0000 Commit: Ed Maste CommitDate: 2021-09-17 00:34:13 +0000 openssh: remove login class restrictions leftovers MFC after: 2 weeks Fixes: 27ceebbc2402 ("openssh: simplify login class...") Sponsored by: The FreeBSD Foundation (cherry picked from commit ba91e31f478aaade96bbdbf01560e8b7cbe41b56) --- crypto/openssh/auth2.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/crypto/openssh/auth2.c b/crypto/openssh/auth2.c index af6fdae97193..b03822e5f150 100644 --- a/crypto/openssh/auth2.c +++ b/crypto/openssh/auth2.c @@ -260,10 +260,6 @@ input_userauth_request(int type, u_int32_t seq, struct ssh *ssh) char *user, *service, *method, *style = NULL; int authenticated = 0; double tstart = monotime_double(); -#ifdef HAVE_LOGIN_CAP - login_cap_t *lc; - const char *from_host, *from_ip; -#endif if (authctxt == NULL) fatal("input_userauth_request: no authctxt"); From owner-dev-commits-src-all@freebsd.org Fri Sep 17 00:36:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4A1326AB16D; Fri, 17 Sep 2021 00:36:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9Zkn1gVcz3pb6; Fri, 17 Sep 2021 00:36:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 198AB381A; Fri, 17 Sep 2021 00:36:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18H0aH7L078601; Fri, 17 Sep 2021 00:36:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18H0aHEX078600; Fri, 17 Sep 2021 00:36:17 GMT (envelope-from git) Date: Fri, 17 Sep 2021 00:36:17 GMT Message-Id: <202109170036.18H0aHEX078600@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 988f3108b6a8 - stable/12 - openssh: remove login class restrictions leftovers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 988f3108b6a85c76a5dadef7c11b73ea7baa886b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 00:36:17 -0000 The branch stable/12 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=988f3108b6a85c76a5dadef7c11b73ea7baa886b commit 988f3108b6a85c76a5dadef7c11b73ea7baa886b Author: Ed Maste AuthorDate: 2021-09-02 21:13:29 +0000 Commit: Ed Maste CommitDate: 2021-09-17 00:35:25 +0000 openssh: remove login class restrictions leftovers MFC after: 2 weeks Fixes: 27ceebbc2402 ("openssh: simplify login class...") Sponsored by: The FreeBSD Foundation (cherry picked from commit ba91e31f478aaade96bbdbf01560e8b7cbe41b56) --- crypto/openssh/auth2.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/crypto/openssh/auth2.c b/crypto/openssh/auth2.c index af6fdae97193..b03822e5f150 100644 --- a/crypto/openssh/auth2.c +++ b/crypto/openssh/auth2.c @@ -260,10 +260,6 @@ input_userauth_request(int type, u_int32_t seq, struct ssh *ssh) char *user, *service, *method, *style = NULL; int authenticated = 0; double tstart = monotime_double(); -#ifdef HAVE_LOGIN_CAP - login_cap_t *lc; - const char *from_host, *from_ip; -#endif if (authctxt == NULL) fatal("input_userauth_request: no authctxt"); From owner-dev-commits-src-all@freebsd.org Fri Sep 17 00:42:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF96D6AADEA; Fri, 17 Sep 2021 00:42:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9Zt45XVJz3rSL; Fri, 17 Sep 2021 00:42:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E2D4347F; Fri, 17 Sep 2021 00:42:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18H0gag9091288; Fri, 17 Sep 2021 00:42:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18H0gadO091287; Fri, 17 Sep 2021 00:42:36 GMT (envelope-from git) Date: Fri, 17 Sep 2021 00:42:36 GMT Message-Id: <202109170042.18H0gadO091287@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: fd0765933c3c - main - Change lowest address on subnet (host 0) not to broadcast by default. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: karels X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fd0765933c3ccb059ad7456e657b2e8ed22f58b0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 00:42:36 -0000 The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=fd0765933c3ccb059ad7456e657b2e8ed22f58b0 commit fd0765933c3ccb059ad7456e657b2e8ed22f58b0 Author: Mike Karels AuthorDate: 2021-09-05 18:14:04 +0000 Commit: Mike Karels CommitDate: 2021-09-17 00:42:20 +0000 Change lowest address on subnet (host 0) not to broadcast by default. The address with a host part of all zeros was used as a broadcast long ago, but the default has been all ones since 4.3BSD and RFC1122. Until now, we would broadcast the host zero address as well as the configured address. Change to not broadcasting that address by default, but add a sysctl (net.inet.ip.broadcast_lowest) to re-enable it. Note that the correct way to use the zero address for broadcast would be to configure it as the broadcast address for the network. See https:/datatracker.ietf.org/doc/draft-schoen-intarea-lowest-address/ and the discussion in https://reviews.freebsd.org/D19316. Note, Linux now implements this. Reviewed by: rgrimes, tuexen; melifaro (previous version) MFC after: 1 month Relnotes: yes Differential Revision: https://reviews.freebsd.org/D31861 --- sys/netinet/in.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/netinet/in.c b/sys/netinet/in.c index e968a559a13c..b51f1111b88a 100644 --- a/sys/netinet/in.c +++ b/sys/netinet/in.c @@ -88,6 +88,12 @@ SYSCTL_INT(_net_inet_ip, OID_AUTO, no_same_prefix, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(nosameprefix), 0, "Refuse to create same prefixes on different interfaces"); +VNET_DEFINE_STATIC(bool, broadcast_lowest); +#define V_broadcast_lowest VNET(broadcast_lowest) +SYSCTL_BOOL(_net_inet_ip, OID_AUTO, broadcast_lowest, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(broadcast_lowest), 0, + "Treat lowest address on a subnet (host 0) as broadcast"); + VNET_DECLARE(struct inpcbinfo, ripcbinfo); #define V_ripcbinfo VNET(ripcbinfo) @@ -1170,10 +1176,10 @@ in_ifaddr_broadcast(struct in_addr in, struct in_ifaddr *ia) return ((in.s_addr == ia->ia_broadaddr.sin_addr.s_addr || /* - * Check for old-style (host 0) broadcast, but + * Optionally check for old-style (host 0) broadcast, but * taking into account that RFC 3021 obsoletes it. */ - (ia->ia_subnetmask != IN_RFC3021_MASK && + (V_broadcast_lowest && ia->ia_subnetmask != IN_RFC3021_MASK && ntohl(in.s_addr) == ia->ia_subnet)) && /* * Check for an all one subnetmask. These From owner-dev-commits-src-all@freebsd.org Fri Sep 17 01:39:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 360C76AB89D; Fri, 17 Sep 2021 01:39:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9c7L0ZwVz4dH4; Fri, 17 Sep 2021 01:39:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E43BD424F; Fri, 17 Sep 2021 01:39:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18H1d9ZV058385; Fri, 17 Sep 2021 01:39:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18H1d9gG058384; Fri, 17 Sep 2021 01:39:09 GMT (envelope-from git) Date: Fri, 17 Sep 2021 01:39:09 GMT Message-Id: <202109170139.18H1d9gG058384@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: c8f2af5f5d1f - stable/13 - geli(8): Do not report error on resize to the same size. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: c8f2af5f5d1fff0212c18d876acc79ffc17178c8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 01:39:10 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=c8f2af5f5d1fff0212c18d876acc79ffc17178c8 commit c8f2af5f5d1fff0212c18d876acc79ffc17178c8 Author: Alexander Motin AuthorDate: 2021-08-18 21:11:03 +0000 Commit: Alexander Motin CommitDate: 2021-09-17 01:39:07 +0000 geli(8): Do not report error on resize to the same size. Just validate the old metadata and exit. Originally the check was added to not thash the only copy of metadata, but we can achieve the same just by skipping the writing/trashing. The metadata validation should protect user from wrongly specifying new size instead of old. MFC after: 1 month Sponsored by: iXsystems, Inc. (cherry picked from commit c7cf100aafb4cb881e05a5153de152907f6c07f3) --- lib/geom/eli/geom_eli.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/geom/eli/geom_eli.c b/lib/geom/eli/geom_eli.c index 8ee4643e3c91..4c04a9256b5e 100644 --- a/lib/geom/eli/geom_eli.c +++ b/lib/geom/eli/geom_eli.c @@ -1823,10 +1823,6 @@ eli_resize(struct gctl_req *req) gctl_error(req, "Invalid oldsize: Out of range."); goto out; } - if (oldsize == mediasize) { - gctl_error(req, "Size hasn't changed."); - goto out; - } /* Read metadata from the 'oldsize' offset. */ if (pread(provfd, sector, secsize, oldsize - secsize) != secsize) { @@ -1865,6 +1861,10 @@ eli_resize(struct gctl_req *req) goto out; } + /* The metadata is valid and nothing has changed. Just exit. */ + if (oldsize == mediasize) + goto out; + /* * Update the old metadata with the current provider size and write * it back to the correct place on the provider. From owner-dev-commits-src-all@freebsd.org Fri Sep 17 01:39:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5D706AB659; Fri, 17 Sep 2021 01:39:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9c7b6BpRz4dSH; Fri, 17 Sep 2021 01:39:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B495842D9; Fri, 17 Sep 2021 01:39:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18H1dNKG058515; Fri, 17 Sep 2021 01:39:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18H1dNdA058514; Fri, 17 Sep 2021 01:39:23 GMT (envelope-from git) Date: Fri, 17 Sep 2021 01:39:23 GMT Message-Id: <202109170139.18H1dNdA058514@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 3c1c3728f32c - stable/12 - geli(8): Do not report error on resize to the same size. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 3c1c3728f32cc71a3694f13be0610db5ff88519c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 01:39:24 -0000 The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=3c1c3728f32cc71a3694f13be0610db5ff88519c commit 3c1c3728f32cc71a3694f13be0610db5ff88519c Author: Alexander Motin AuthorDate: 2021-08-18 21:11:03 +0000 Commit: Alexander Motin CommitDate: 2021-09-17 01:39:21 +0000 geli(8): Do not report error on resize to the same size. Just validate the old metadata and exit. Originally the check was added to not thash the only copy of metadata, but we can achieve the same just by skipping the writing/trashing. The metadata validation should protect user from wrongly specifying new size instead of old. MFC after: 1 month Sponsored by: iXsystems, Inc. (cherry picked from commit c7cf100aafb4cb881e05a5153de152907f6c07f3) --- lib/geom/eli/geom_eli.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/geom/eli/geom_eli.c b/lib/geom/eli/geom_eli.c index f8d429e95b18..a89ac69cf338 100644 --- a/lib/geom/eli/geom_eli.c +++ b/lib/geom/eli/geom_eli.c @@ -1805,10 +1805,6 @@ eli_resize(struct gctl_req *req) gctl_error(req, "Invalid oldsize: Out of range."); goto out; } - if (oldsize == mediasize) { - gctl_error(req, "Size hasn't changed."); - goto out; - } /* Read metadata from the 'oldsize' offset. */ if (pread(provfd, sector, secsize, oldsize - secsize) != secsize) { @@ -1847,6 +1843,10 @@ eli_resize(struct gctl_req *req) goto out; } + /* The metadata is valid and nothing has changed. Just exit. */ + if (oldsize == mediasize) + goto out; + /* * Update the old metadata with the current provider size and write * it back to the correct place on the provider. From owner-dev-commits-src-all@freebsd.org Fri Sep 17 01:40:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 210796AB7E3; Fri, 17 Sep 2021 01:40:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9c8c5z1Qz4dwJ; Fri, 17 Sep 2021 01:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE3754686; Fri, 17 Sep 2021 01:40:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18H1eGss064558; Fri, 17 Sep 2021 01:40:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18H1eGFG064552; Fri, 17 Sep 2021 01:40:16 GMT (envelope-from git) Date: Fri, 17 Sep 2021 01:40:16 GMT Message-Id: <202109170140.18H1eGFG064552@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: b4194a432b59 - stable/13 - callout(9): Allow spin locks use with callout_init_mtx(). MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b4194a432b599c9e96ce8cd7418e15447d4a4cdb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 01:40:17 -0000 The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=b4194a432b599c9e96ce8cd7418e15447d4a4cdb commit b4194a432b599c9e96ce8cd7418e15447d4a4cdb Author: Alexander Motin AuthorDate: 2021-09-03 01:16:46 +0000 Commit: Alexander Motin CommitDate: 2021-09-17 01:40:15 +0000 callout(9): Allow spin locks use with callout_init_mtx(). Implement lock_spin()/unlock_spin() lock class methods, moving the assertion to _sleep() instead. Change assertions in callout(9) to allow spin locks for both regular and C_DIRECT_EXEC cases. In case of C_DIRECT_EXEC callouts spin locks are the only locks allowed actually. As the first use case allow taskqueue_enqueue_timeout() use on fast task queues. It actually becomes more efficient due to avoided extra context switches in callout(9) thanks to C_DIRECT_EXEC. MFC after: 2 weeks Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D31778 (cherry picked from commit 4730a8972b1f4b67bf9ffde8e63ca906ef4c9563) --- share/man/man9/callout.9 | 5 +---- share/man/man9/taskqueue.9 | 5 +---- sys/kern/kern_mutex.c | 8 ++++++-- sys/kern/kern_synch.c | 2 ++ sys/kern/kern_timeout.c | 10 +++++----- sys/kern/subr_taskqueue.c | 3 ++- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/share/man/man9/callout.9 b/share/man/man9/callout.9 index 9e0cf5e6dc5e..5c011a20d338 100644 --- a/share/man/man9/callout.9 +++ b/share/man/man9/callout.9 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 13, 2019 +.Dd September 1, 2021 .Dt CALLOUT 9 .Os .Sh NAME @@ -241,9 +241,6 @@ and the associated lock is released. This ensures that stopping or rescheduling the callout will abort any previously scheduled invocation. .Pp -Only regular mutexes may be used with -.Fn callout_init_mtx ; -spin mutexes are not supported. A sleepable read-mostly lock .Po one initialized with the diff --git a/share/man/man9/taskqueue.9 b/share/man/man9/taskqueue.9 index 2ede90458629..58eb6b7c5571 100644 --- a/share/man/man9/taskqueue.9 +++ b/share/man/man9/taskqueue.9 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 6, 2020 +.Dd September 1, 2021 .Dt TASKQUEUE 9 .Os .Sh NAME @@ -237,9 +237,6 @@ and .Va flags , as detailed in .Xr callout 9 . -Only non-fast task queues can be used for -.Va timeout_task -scheduling. If the .Va ticks argument is negative, the already scheduled enqueueing is not re-scheduled. diff --git a/sys/kern/kern_mutex.c b/sys/kern/kern_mutex.c index d9db69e2ac09..54a96603ece3 100644 --- a/sys/kern/kern_mutex.c +++ b/sys/kern/kern_mutex.c @@ -215,7 +215,7 @@ void lock_spin(struct lock_object *lock, uintptr_t how) { - panic("spin locks can only use msleep_spin"); + mtx_lock_spin((struct mtx *)lock); } uintptr_t @@ -232,8 +232,12 @@ unlock_mtx(struct lock_object *lock) uintptr_t unlock_spin(struct lock_object *lock) { + struct mtx *m; - panic("spin locks can only use msleep_spin"); + m = (struct mtx *)lock; + mtx_assert(m, MA_OWNED | MA_NOTRECURSED); + mtx_unlock_spin(m); + return (0); } #ifdef KDTRACE_HOOKS diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index b63877e26b68..3d51af2740fc 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -187,6 +187,8 @@ _sleep(const void *ident, struct lock_object *lock, int priority, DROP_GIANT(); if (lock != NULL && lock != &Giant.lock_object && !(class->lc_flags & LC_SLEEPABLE)) { + KASSERT(!(class->lc_flags & LC_SPINLOCK), + ("spin locks can only use msleep_spin")); WITNESS_SAVE(lock, lock_witness); lock_state = class->lc_unlock(lock); } else diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index d9cf2784f642..992a093d30ab 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -919,8 +919,9 @@ callout_reset_sbt_on(struct callout *c, sbintime_t sbt, sbintime_t prec, } else { direct = 0; } - KASSERT(!direct || c->c_lock == NULL, - ("%s: direct callout %p has lock", __func__, c)); + KASSERT(!direct || c->c_lock == NULL || + (LOCK_CLASS(c->c_lock)->lc_flags & LC_SPINLOCK), + ("%s: direct callout %p has non-spin lock", __func__, c)); cc = callout_lock(c); /* * Don't allow migration if the user does not care. @@ -1332,9 +1333,8 @@ _callout_init_lock(struct callout *c, struct lock_object *lock, int flags) ("callout_init_lock: bad flags %d", flags)); KASSERT(lock != NULL || (flags & CALLOUT_RETURNUNLOCKED) == 0, ("callout_init_lock: CALLOUT_RETURNUNLOCKED with no lock")); - KASSERT(lock == NULL || !(LOCK_CLASS(lock)->lc_flags & - (LC_SPINLOCK | LC_SLEEPABLE)), ("%s: invalid lock class", - __func__)); + KASSERT(lock == NULL || !(LOCK_CLASS(lock)->lc_flags & LC_SLEEPABLE), + ("%s: callout %p has sleepable lock", __func__, c)); c->c_iflags = flags & (CALLOUT_RETURNUNLOCKED | CALLOUT_SHAREDLOCK); c->c_cpu = cc_default_cpu; } diff --git a/sys/kern/subr_taskqueue.c b/sys/kern/subr_taskqueue.c index 061361cc06d7..e43b09010761 100644 --- a/sys/kern/subr_taskqueue.c +++ b/sys/kern/subr_taskqueue.c @@ -309,7 +309,6 @@ taskqueue_enqueue_timeout_sbt(struct taskqueue *queue, TQ_LOCK(queue); KASSERT(timeout_task->q == NULL || timeout_task->q == queue, ("Migrated queue")); - KASSERT(!queue->tq_spin, ("Timeout for spin-queue")); timeout_task->q = queue; res = timeout_task->t.ta_pending; if (timeout_task->f & DT_DRAIN_IN_PROGRESS) { @@ -329,6 +328,8 @@ taskqueue_enqueue_timeout_sbt(struct taskqueue *queue, sbt = -sbt; /* Ignore overflow. */ } if (sbt > 0) { + if (queue->tq_spin) + flags |= C_DIRECT_EXEC; callout_reset_sbt(&timeout_task->c, sbt, pr, taskqueue_timeout_func, timeout_task, flags); } From owner-dev-commits-src-all@freebsd.org Fri Sep 17 12:59:08 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D75D26B318F; Fri, 17 Sep 2021 12:59:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9vCw5XlWz3rbw; Fri, 17 Sep 2021 12:59:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E95515546; Fri, 17 Sep 2021 12:59:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HCx8P9060701; Fri, 17 Sep 2021 12:59:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HCx8FN060700; Fri, 17 Sep 2021 12:59:08 GMT (envelope-from git) Date: Fri, 17 Sep 2021 12:59:08 GMT Message-Id: <202109171259.18HCx8FN060700@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 1349891a0eed - main - Style MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1349891a0eed79625faafa5ad354d65ff9ea6012 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 12:59:08 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1349891a0eed79625faafa5ad354d65ff9ea6012 commit 1349891a0eed79625faafa5ad354d65ff9ea6012 Author: Konstantin Belousov AuthorDate: 2021-09-01 23:23:02 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-17 12:41:54 +0000 Style Reviewed by: brooks, emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31779 --- usr.bin/proccontrol/proccontrol.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.bin/proccontrol/proccontrol.c b/usr.bin/proccontrol/proccontrol.c index 9f185de025c1..8b34ecbb06d4 100644 --- a/usr.bin/proccontrol/proccontrol.c +++ b/usr.bin/proccontrol/proccontrol.c @@ -178,7 +178,8 @@ main(int argc, char *argv[]) error = procctl(P_PID, pid, PROC_STACKGAP_STATUS, &arg); break; case MODE_NO_NEW_PRIVS: - error = procctl(P_PID, pid, PROC_NO_NEW_PRIVS_STATUS, &arg); + error = procctl(P_PID, pid, PROC_NO_NEW_PRIVS_STATUS, + &arg); break; #ifdef PROC_KPTI_CTL case MODE_KPTI: @@ -349,7 +350,8 @@ main(int argc, char *argv[]) case MODE_NO_NEW_PRIVS: arg = enable ? PROC_NO_NEW_PRIVS_ENABLE : PROC_NO_NEW_PRIVS_DISABLE; - error = procctl(P_PID, pid, PROC_NO_NEW_PRIVS_CTL, &arg); + error = procctl(P_PID, pid, PROC_NO_NEW_PRIVS_CTL, + &arg); break; #ifdef PROC_KPTI_CTL case MODE_KPTI: From owner-dev-commits-src-all@freebsd.org Fri Sep 17 12:59:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 053E26B319B; Fri, 17 Sep 2021 12:59:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9vCx6YT3z3rs8; Fri, 17 Sep 2021 12:59:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2EF915641; Fri, 17 Sep 2021 12:59:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HCx9iL060731; Fri, 17 Sep 2021 12:59:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HCx91f060730; Fri, 17 Sep 2021 12:59:09 GMT (envelope-from git) Date: Fri, 17 Sep 2021 12:59:09 GMT Message-Id: <202109171259.18HCx91f060730@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 796a8e1ad1ae - main - procctl(2): Add PROC_WXMAP_CTL/STATUS MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 796a8e1ad1ae3f7b8e4c9f97bebbef5d7d5a2c16 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 12:59:10 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=796a8e1ad1ae3f7b8e4c9f97bebbef5d7d5a2c16 commit 796a8e1ad1ae3f7b8e4c9f97bebbef5d7d5a2c16 Author: Konstantin Belousov AuthorDate: 2021-09-02 00:59:10 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-17 12:42:01 +0000 procctl(2): Add PROC_WXMAP_CTL/STATUS It allows to override kern.elf{32,64}.allow_wx on per-process basis. In particular, it makes it possible to run binaries without PT_GNU_STACK and without elfctl note while allow_wx = 0. Reviewed by: brooks, emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31779 --- lib/libc/sys/procctl.2 | 64 ++++++++++++++++++++++++++++- sys/compat/freebsd32/freebsd32_misc.c | 3 ++ sys/kern/imgact_elf.c | 7 +++- sys/kern/kern_fork.c | 3 +- sys/kern/kern_procctl.c | 76 +++++++++++++++++++++++++++++++++++ sys/sys/proc.h | 2 + sys/sys/procctl.h | 6 +++ 7 files changed, 157 insertions(+), 4 deletions(-) diff --git a/lib/libc/sys/procctl.2 b/lib/libc/sys/procctl.2 index ce7a2be5d5e4..30933875ccbc 100644 --- a/lib/libc/sys/procctl.2 +++ b/lib/libc/sys/procctl.2 @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 1, 2021 +.Dd September 2, 2021 .Dt PROCCTL 2 .Os .Sh NAME @@ -599,6 +599,62 @@ following values is written: .It Dv PROC_NO_NEW_PRIVS_ENABLE .It Dv PROC_NO_NEW_PRIVS_DISABLE .El +.It Dv PROC_WXMAP_CTL +Controls the 'write exclusive against execution' permissions for the +mappings in the process address space. +It overrides the global settings established by the +.Dv kern.elf{32/64}.allow_wx +sysctl, +and the corresponding bit in the ELF control note, see +.Xr elfctl 1 . +.Pp +The +.Fa data +parameter must point to the integer variable holding one of the +following values: +.Bl -tag -width PROC_WX_MAPPINGS_DISALLOW_EXEC +.It Dv PROC_WX_MAPPINGS_PERMIT +Enable creation of mappings that have both write and execute +protection attributes, in the specified process' address space. +.It Dv PROC_WX_MAPPINGS_DISALLOW_EXEC +In the new address space created by +.Xr execve 2 , +disallow creation of mappings that have both write and execute +permissions. +.El +.Pp +Once creation of writeable and executable mappings is allowed, +it is impossible (and pointless) to disallow it. +The only way to ensure the absence of such mappings after they +were enabled in a given process, is to set the +.Dv PROC_WX_MAPPINGS_DISALLOW_EXEC +flag and +.Xr execve 2 +an image. +.It Dv PROC_WXMAP_STATUS +Returns the current status of the 'write exclusive against execution' +enforcement for the specified process. +The +.Dv data +parameter must point to the integer variable, where one of the +following values is written: +.Bl -tag -width PROC_WX_MAPPINGS_DISALLOW_EXEC +.It Dv PROC_WX_MAPPINGS_PERMIT +Creation of simultaneously writable and executable mapping is permitted, +otherwise the process cannot create such mappings. +.It Dv PROC_WX_MAPPINGS_DISALLOW_EXEC +After +.Xr execve 2 , +the new address space should disallow creation of simultaneously +writable and executable mappings. +.El +.Pp +Additionally, if the address space of the process disallows +creation of simultaneously writable and executable mappings and +it is guaranteed that no such mapping was created since address space +creation, the +.Dv PROC_WXORX_ENFORCE +flag is set in the returned value. .El .Sh x86 MACHINE-SPECIFIC REQUESTS .Bl -tag -width PROC_KPTI_STATUS @@ -648,6 +704,12 @@ feature, as it is bypassable both by the kernel and privileged processes, and via other system mechanisms. As such, it should not be utilized to reliably protect cryptographic keying material or other confidential data. +.Pp +Note that processes can trivially bypass the 'no simultaneously +writable and executable mappings' policy by first marking some mapping +as writeable and write code to it, then removing write and adding +execute permission. +This may be legitimately required by some programs, such as JIT compilers. .Sh RETURN VALUES If an error occurs, a value of -1 is returned and .Va errno diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index c417a64d286a..f4b1edb6c7b0 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -3643,6 +3643,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_procctl_args *uap) case PROC_TRACE_CTL: case PROC_TRAPCAP_CTL: case PROC_NO_NEW_PRIVS_CTL: + case PROC_WXMAP_CTL: error = copyin(PTRIN(uap->data), &flags, sizeof(flags)); if (error != 0) return (error); @@ -3677,6 +3678,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_procctl_args *uap) case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: case PROC_NO_NEW_PRIVS_STATUS: + case PROC_WXMAP_STATUS: data = &flags; break; case PROC_PDEATHSIG_CTL: @@ -3709,6 +3711,7 @@ freebsd32_procctl(struct thread *td, struct freebsd32_procctl_args *uap) case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: case PROC_NO_NEW_PRIVS_STATUS: + case PROC_WXMAP_STATUS: if (error == 0) error = copyout(&flags, uap->data, sizeof(flags)); break; diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 5b888766daea..ef1edfcabaf0 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -1216,7 +1216,8 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp) */ if (imgp->credential_setid) { PROC_LOCK(imgp->proc); - imgp->proc->p_flag2 &= ~(P2_ASLR_ENABLE | P2_ASLR_DISABLE); + imgp->proc->p_flag2 &= ~(P2_ASLR_ENABLE | P2_ASLR_DISABLE | + P2_WXORX_DISABLE | P2_WXORX_ENABLE_EXEC); PROC_UNLOCK(imgp->proc); } if ((sv->sv_flags & SV_ASLR) == 0 || @@ -1239,7 +1240,9 @@ __CONCAT(exec_, __elfN(imgact))(struct image_params *imgp) imgp->map_flags |= MAP_ASLR_IGNSTART; } - if (!__elfN(allow_wx) && (fctl0 & NT_FREEBSD_FCTL_WXNEEDED) == 0) + if ((!__elfN(allow_wx) && (fctl0 & NT_FREEBSD_FCTL_WXNEEDED) == 0 && + (imgp->proc->p_flag2 & P2_WXORX_DISABLE) == 0) || + (imgp->proc->p_flag2 & P2_WXORX_ENABLE_EXEC) != 0) imgp->map_flags |= MAP_WXORX; error = exec_new_vmspace(imgp, sv); diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 1135f91e0510..2d8381894a7c 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -493,7 +493,8 @@ do_fork(struct thread *td, struct fork_req *fr, struct proc *p2, struct thread * p2->p_flag2 = p1->p_flag2 & (P2_ASLR_DISABLE | P2_ASLR_ENABLE | P2_ASLR_IGNSTART | P2_NOTRACE | P2_NOTRACE_EXEC | P2_PROTMAX_ENABLE | P2_PROTMAX_DISABLE | P2_TRAPCAP | - P2_STKGAP_DISABLE | P2_STKGAP_DISABLE_EXEC | P2_NO_NEW_PRIVS); + P2_STKGAP_DISABLE | P2_STKGAP_DISABLE_EXEC | P2_NO_NEW_PRIVS | + P2_WXORX_DISABLE | P2_WXORX_ENABLE_EXEC); p2->p_swtick = ticks; if (p1->p_flag & P_PROFIL) startprofclock(p2); diff --git a/sys/kern/kern_procctl.c b/sys/kern/kern_procctl.c index 68fa4bc0c3ac..53626caa0fd9 100644 --- a/sys/kern/kern_procctl.c +++ b/sys/kern/kern_procctl.c @@ -591,6 +591,71 @@ stackgap_status(struct thread *td, struct proc *p, int *data) return (0); } +static int +wxmap_ctl(struct thread *td, struct proc *p, int state) +{ + struct vmspace *vm; + vm_map_t map; + + PROC_LOCK_ASSERT(p, MA_OWNED); + if ((p->p_flag & P_WEXIT) != 0) + return (ESRCH); + + switch (state) { + case PROC_WX_MAPPINGS_PERMIT: + p->p_flag2 |= P2_WXORX_DISABLE; + _PHOLD(p); + PROC_UNLOCK(p); + vm = vmspace_acquire_ref(p); + if (vm != NULL) { + map = &vm->vm_map; + vm_map_lock(map); + map->flags &= ~MAP_WXORX; + vm_map_unlock(map); + vmspace_free(vm); + } + PROC_LOCK(p); + _PRELE(p); + break; + case PROC_WX_MAPPINGS_DISALLOW_EXEC: + p->p_flag2 |= P2_WXORX_ENABLE_EXEC; + break; + default: + return (EINVAL); + } + + return (0); +} + +static int +wxmap_status(struct thread *td, struct proc *p, int *data) +{ + struct vmspace *vm; + int d; + + PROC_LOCK_ASSERT(p, MA_OWNED); + if ((p->p_flag & P_WEXIT) != 0) + return (ESRCH); + + d = 0; + if ((p->p_flag2 & P2_WXORX_DISABLE) != 0) + d |= PROC_WX_MAPPINGS_PERMIT; + if ((p->p_flag2 & P2_WXORX_ENABLE_EXEC) != 0) + d |= PROC_WX_MAPPINGS_DISALLOW_EXEC; + _PHOLD(p); + PROC_UNLOCK(p); + vm = vmspace_acquire_ref(p); + if (vm != NULL) { + if ((vm->vm_map.flags & MAP_WXORX) != 0) + d |= PROC_WXORX_ENFORCE; + vmspace_free(vm); + } + PROC_LOCK(p); + _PRELE(p); + *data = d; + return (0); +} + #ifndef _SYS_SYSPROTO_H_ struct procctl_args { idtype_t idtype; @@ -623,6 +688,7 @@ sys_procctl(struct thread *td, struct procctl_args *uap) case PROC_TRACE_CTL: case PROC_TRAPCAP_CTL: case PROC_NO_NEW_PRIVS_CTL: + case PROC_WXMAP_CTL: error = copyin(uap->data, &flags, sizeof(flags)); if (error != 0) return (error); @@ -655,6 +721,7 @@ sys_procctl(struct thread *td, struct procctl_args *uap) case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: case PROC_NO_NEW_PRIVS_STATUS: + case PROC_WXMAP_STATUS: data = &flags; break; case PROC_PDEATHSIG_CTL: @@ -686,6 +753,7 @@ sys_procctl(struct thread *td, struct procctl_args *uap) case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: case PROC_NO_NEW_PRIVS_STATUS: + case PROC_WXMAP_STATUS: if (error == 0) error = copyout(&flags, uap->data, sizeof(flags)); break; @@ -739,6 +807,10 @@ kern_procctl_single(struct thread *td, struct proc *p, int com, void *data) return (no_new_privs_ctl(td, p, *(int *)data)); case PROC_NO_NEW_PRIVS_STATUS: return (no_new_privs_status(td, p, data)); + case PROC_WXMAP_CTL: + return (wxmap_ctl(td, p, *(int *)data)); + case PROC_WXMAP_STATUS: + return (wxmap_status(td, p, data)); default: return (EINVAL); } @@ -771,6 +843,8 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t id, int com, void *data) case PROC_PDEATHSIG_STATUS: case PROC_NO_NEW_PRIVS_CTL: case PROC_NO_NEW_PRIVS_STATUS: + case PROC_WXMAP_CTL: + case PROC_WXMAP_STATUS: if (idtype != P_PID) return (EINVAL); } @@ -821,6 +895,8 @@ kern_procctl(struct thread *td, idtype_t idtype, id_t id, int com, void *data) case PROC_TRACE_STATUS: case PROC_TRAPCAP_STATUS: case PROC_NO_NEW_PRIVS_STATUS: + case PROC_WXMAP_CTL: + case PROC_WXMAP_STATUS: tree_locked = false; break; default: diff --git a/sys/sys/proc.h b/sys/sys/proc.h index ddc8392481aa..3d01aae2d06b 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -838,6 +838,8 @@ struct proc { #define P2_ITSTOPPED 0x00002000 #define P2_PTRACEREQ 0x00004000 /* Active ptrace req */ #define P2_NO_NEW_PRIVS 0x00008000 /* Ignore setuid */ +#define P2_WXORX_DISABLE 0x00010000 /* WX mappings enabled */ +#define P2_WXORX_ENABLE_EXEC 0x00020000 /* WXORX enabled after exec */ /* Flags protected by proctree_lock, kept in p_treeflags. */ #define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */ diff --git a/sys/sys/procctl.h b/sys/sys/procctl.h index cc0279fb0d08..0fcb62e94bb9 100644 --- a/sys/sys/procctl.h +++ b/sys/sys/procctl.h @@ -65,6 +65,8 @@ #define PROC_STACKGAP_STATUS 18 /* query stack gap */ #define PROC_NO_NEW_PRIVS_CTL 19 /* disable setuid/setgid */ #define PROC_NO_NEW_PRIVS_STATUS 20 /* query suid/sgid disabled status */ +#define PROC_WXMAP_CTL 21 /* control W^X */ +#define PROC_WXMAP_STATUS 22 /* query W^X */ /* Operations for PROC_SPROTECT (passed in integer arg). */ #define PPROT_OP(x) ((x) & 0xf) @@ -146,6 +148,10 @@ struct procctl_reaper_kill { #define PROC_NO_NEW_PRIVS_ENABLE 1 #define PROC_NO_NEW_PRIVS_DISABLE 2 +#define PROC_WX_MAPPINGS_PERMIT 0x0001 +#define PROC_WX_MAPPINGS_DISALLOW_EXEC 0x0002 +#define PROC_WXORX_ENFORCE 0x80000000 + #ifndef _KERNEL __BEGIN_DECLS int procctl(idtype_t, id_t, int, void *); From owner-dev-commits-src-all@freebsd.org Fri Sep 17 12:59:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 621506B2DB8; Fri, 17 Sep 2021 12:59:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9vCz15PLz3rvd; Fri, 17 Sep 2021 12:59:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EED5914FE6; Fri, 17 Sep 2021 12:59:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HCxAAM060756; Fri, 17 Sep 2021 12:59:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HCxA4k060755; Fri, 17 Sep 2021 12:59:10 GMT (envelope-from git) Date: Fri, 17 Sep 2021 12:59:10 GMT Message-Id: <202109171259.18HCxA4k060755@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: ac8af1938085 - main - proccontrol(1): Add wxmap control MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ac8af1938085dae0df32db3229c9d5cb659b90a4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 12:59:11 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ac8af1938085dae0df32db3229c9d5cb659b90a4 commit ac8af1938085dae0df32db3229c9d5cb659b90a4 Author: Konstantin Belousov AuthorDate: 2021-09-01 23:27:58 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-17 12:42:07 +0000 proccontrol(1): Add wxmap control Reviewed by: brooks, emaste, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31779 --- usr.bin/proccontrol/proccontrol.1 | 4 +++- usr.bin/proccontrol/proccontrol.c | 24 +++++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/usr.bin/proccontrol/proccontrol.1 b/usr.bin/proccontrol/proccontrol.1 index b4ed6c268a6a..09ec49431293 100644 --- a/usr.bin/proccontrol/proccontrol.1 +++ b/usr.bin/proccontrol/proccontrol.1 @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 2, 2021 +.Dd September 2, 2021 .Dt PROCCONTROL 1 .Os .Sh NAME @@ -72,6 +72,8 @@ Controls the implicit PROT_MAX application for .It Ar nonewprivs Controls disabling the setuid and sgid bits for .Xr execve 2 . +.It Ar wxmap +Controls the write exclusive execute mode for mappings. .It Ar kpti Controls the KPTI enable, AMD64 only. .It Ar la48 diff --git a/usr.bin/proccontrol/proccontrol.c b/usr.bin/proccontrol/proccontrol.c index 8b34ecbb06d4..d9237c4c6b33 100644 --- a/usr.bin/proccontrol/proccontrol.c +++ b/usr.bin/proccontrol/proccontrol.c @@ -46,6 +46,7 @@ enum { MODE_PROTMAX, MODE_STACKGAP, MODE_NO_NEW_PRIVS, + MODE_WXMAP, #ifdef PROC_KPTI_CTL MODE_KPTI, #endif @@ -85,7 +86,7 @@ usage(void) { fprintf(stderr, "Usage: proccontrol -m (aslr|protmax|trace|trapcap|" - "stackgap|nonewprivs"KPTI_USAGE LA_USAGE") [-q] " + "stackgap|nonewprivs|wxmap"KPTI_USAGE LA_USAGE") [-q] " "[-s (enable|disable)] [-p pid | command]\n"); exit(1); } @@ -116,6 +117,8 @@ main(int argc, char *argv[]) mode = MODE_STACKGAP; else if (strcmp(optarg, "nonewprivs") == 0) mode = MODE_NO_NEW_PRIVS; + else if (strcmp(optarg, "wxmap") == 0) + mode = MODE_WXMAP; #ifdef PROC_KPTI_CTL else if (strcmp(optarg, "kpti") == 0) mode = MODE_KPTI; @@ -181,6 +184,9 @@ main(int argc, char *argv[]) error = procctl(P_PID, pid, PROC_NO_NEW_PRIVS_STATUS, &arg); break; + case MODE_WXMAP: + error = procctl(P_PID, pid, PROC_WXMAP_STATUS, &arg); + break; #ifdef PROC_KPTI_CTL case MODE_KPTI: error = procctl(P_PID, pid, PROC_KPTI_STATUS, &arg); @@ -281,6 +287,17 @@ main(int argc, char *argv[]) break; } break; + case MODE_WXMAP: + if ((arg & PROC_WX_MAPPINGS_PERMIT) != 0) + printf("enabled"); + else + printf("disabled"); + if ((arg & PROC_WX_MAPPINGS_DISALLOW_EXEC) != 0) + printf(", disabled on exec"); + if ((arg & PROC_WXORX_ENFORCE) != 0) + printf(", wxorx enforced"); + printf("\n"); + break; #ifdef PROC_KPTI_CTL case MODE_KPTI: switch (arg & ~PROC_KPTI_STATUS_ACTIVE) { @@ -353,6 +370,11 @@ main(int argc, char *argv[]) error = procctl(P_PID, pid, PROC_NO_NEW_PRIVS_CTL, &arg); break; + case MODE_WXMAP: + arg = enable ? PROC_WX_MAPPINGS_PERMIT : + PROC_WX_MAPPINGS_DISALLOW_EXEC; + error = procctl(P_PID, pid, PROC_WXMAP_CTL, &arg); + break; #ifdef PROC_KPTI_CTL case MODE_KPTI: arg = enable ? PROC_KPTI_CTL_ENABLE_ON_EXEC : From owner-dev-commits-src-all@freebsd.org Fri Sep 17 13:14:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C58DF6B35AA; Fri, 17 Sep 2021 13:14:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9vYj5BFGz3vyL; Fri, 17 Sep 2021 13:14:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E7EA15BA6; Fri, 17 Sep 2021 13:14:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HDEXw4088038; Fri, 17 Sep 2021 13:14:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HDEXk3088037; Fri, 17 Sep 2021 13:14:33 GMT (envelope-from git) Date: Fri, 17 Sep 2021 13:14:33 GMT Message-Id: <202109171314.18HDEXk3088037@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: cdb6f3d41686 - stable/13 - net: Enter a net epoch around protocol if_up/down notifications MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cdb6f3d41686b71dd0e804bdee5f094f9130268d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 13:14:33 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=cdb6f3d41686b71dd0e804bdee5f094f9130268d commit cdb6f3d41686b71dd0e804bdee5f094f9130268d Author: Mark Johnston AuthorDate: 2021-09-10 13:07:40 +0000 Commit: Mark Johnston CommitDate: 2021-09-17 13:13:09 +0000 net: Enter a net epoch around protocol if_up/down notifications When traversing a list of interface addresses, we need to be in a net epoch section, and protocol ctlinput routines need a stable reference to the address. Reported by: syzbot+3219af764ead146a3a4e@syzkaller.appspotmail.com Reviewed by: kp, melifaro Sponsored by: The FreeBSD Foundation (cherry picked from commit b1e6a792d68e9c59740d5e925405d8d4343d099b) --- sys/kern/uipc_domain.c | 2 ++ sys/net/if.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/sys/kern/uipc_domain.c b/sys/kern/uipc_domain.c index 4342f1026783..85a2da76012d 100644 --- a/sys/kern/uipc_domain.c +++ b/sys/kern/uipc_domain.c @@ -510,6 +510,8 @@ pfctlinput(int cmd, struct sockaddr *sa) struct domain *dp; struct protosw *pr; + NET_EPOCH_ASSERT(); + for (dp = domains; dp; dp = dp->dom_next) for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) if (pr->pr_ctlinput) diff --git a/sys/net/if.c b/sys/net/if.c index aeb7230fcc9a..7d7206e7596c 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -2215,14 +2215,17 @@ static void if_unroute(struct ifnet *ifp, int flag, int fam) { struct ifaddr *ifa; + struct epoch_tracker et; KASSERT(flag == IFF_UP, ("if_unroute: flag != IFF_UP")); ifp->if_flags &= ~flag; getmicrotime(&ifp->if_lastchange); + NET_EPOCH_ENTER(et); CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) if (fam == PF_UNSPEC || (fam == ifa->ifa_addr->sa_family)) pfctlinput(PRC_IFDOWN, ifa->ifa_addr); + NET_EPOCH_EXIT(et); ifp->if_qflush(ifp); if (ifp->if_carp) @@ -2238,14 +2241,17 @@ static void if_route(struct ifnet *ifp, int flag, int fam) { struct ifaddr *ifa; + struct epoch_tracker et; KASSERT(flag == IFF_UP, ("if_route: flag != IFF_UP")); ifp->if_flags |= flag; getmicrotime(&ifp->if_lastchange); + NET_EPOCH_ENTER(et); CK_STAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) if (fam == PF_UNSPEC || (fam == ifa->ifa_addr->sa_family)) pfctlinput(PRC_IFUP, ifa->ifa_addr); + NET_EPOCH_EXIT(et); if (ifp->if_carp) (*carp_linkstate_p)(ifp); rt_ifmsg(ifp); From owner-dev-commits-src-all@freebsd.org Fri Sep 17 13:14:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DD2336B2DFC; Fri, 17 Sep 2021 13:14:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9vYk5p9Dz3w7C; Fri, 17 Sep 2021 13:14:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A852F15873; Fri, 17 Sep 2021 13:14:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HDEYMp088062; Fri, 17 Sep 2021 13:14:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HDEYOi088061; Fri, 17 Sep 2021 13:14:34 GMT (envelope-from git) Date: Fri, 17 Sep 2021 13:14:34 GMT Message-Id: <202109171314.18HDEYOi088061@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 476f87219f40 - stable/13 - wpi: Fix a lock leak in an error path in wpi_run() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 476f87219f408343846254743c7189076be80c04 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 13:14:35 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=476f87219f408343846254743c7189076be80c04 commit 476f87219f408343846254743c7189076be80c04 Author: Mark Johnston AuthorDate: 2021-09-10 14:03:51 +0000 Commit: Mark Johnston CommitDate: 2021-09-17 13:13:44 +0000 wpi: Fix a lock leak in an error path in wpi_run() PR: 258243 Reported by: dinghao.liu@zju.edu.cn (cherry picked from commit 6d042d7c861a8fffd1784c720720c3b89c7c0883) --- sys/dev/wpi/if_wpi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/wpi/if_wpi.c b/sys/dev/wpi/if_wpi.c index dd8b17c8d21c..3d4e80ab61ad 100644 --- a/sys/dev/wpi/if_wpi.c +++ b/sys/dev/wpi/if_wpi.c @@ -4547,6 +4547,7 @@ wpi_run(struct wpi_softc *sc, struct ieee80211vap *vap) sc->rxon.chan, sc->rxon.flags); if ((error = wpi_send_rxon(sc, 0, 1)) != 0) { + WPI_RXON_UNLOCK(sc); device_printf(sc->sc_dev, "%s: could not send RXON\n", __func__); return error; From owner-dev-commits-src-all@freebsd.org Fri Sep 17 13:14:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 311EB6B3528; Fri, 17 Sep 2021 13:14:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9vYm0khPz3vyN; Fri, 17 Sep 2021 13:14:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE01D15BA7; Fri, 17 Sep 2021 13:14:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HDEZSb088086; Fri, 17 Sep 2021 13:14:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HDEZnR088085; Fri, 17 Sep 2021 13:14:35 GMT (envelope-from git) Date: Fri, 17 Sep 2021 13:14:35 GMT Message-Id: <202109171314.18HDEZnR088085@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 7959799d93c5 - stable/13 - net: Fix memory leaks upon arp_fillheader() failures MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7959799d93c53a7aa835bb941a478b763efd1649 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 13:14:36 -0000 The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7959799d93c53a7aa835bb941a478b763efd1649 commit 7959799d93c53a7aa835bb941a478b763efd1649 Author: orange30 <44566632+orange30@users.noreply.github.com> AuthorDate: 2021-09-01 15:37:36 +0000 Commit: Mark Johnston CommitDate: 2021-09-17 13:14:12 +0000 net: Fix memory leaks upon arp_fillheader() failures Free memory before return from arprequest_internal(). In in_arpinput(), if arp_fillheader() fails, it should use goto drop. Reviewed by: melifaro, imp, markj Pull Request: https://github.com/freebsd/freebsd-src/pull/534 (cherry picked from commit f5777c123a6382f5fdc9732a87c8fa1ff672f148) --- sys/netinet/if_ether.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 2f92d623feeb..5400f35d953f 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -418,6 +418,7 @@ arprequest_internal(struct ifnet *ifp, const struct in_addr *sip, linkhdrsize = sizeof(linkhdr); error = arp_fillheader(ifp, ah, 1, linkhdr, &linkhdrsize); if (error != 0 && error != EAFNOSUPPORT) { + m_freem(m); ARP_LOG(LOG_ERR, "Failed to calculate ARP header on %s: %d\n", if_name(ifp), error); return (error); @@ -1128,7 +1129,7 @@ reply: if (error != 0 && error != EAFNOSUPPORT) { ARP_LOG(LOG_ERR, "Failed to calculate ARP header on %s: %d\n", if_name(ifp), error); - return; + goto drop; } ro.ro_prepend = linkhdr; From owner-dev-commits-src-all@freebsd.org Fri Sep 17 13:57:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1BAD26B3E7B; Fri, 17 Sep 2021 13:57:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9wVx0Gpsz4fsk; Fri, 17 Sep 2021 13:57:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9CDA1619D; Fri, 17 Sep 2021 13:57:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HDvCp2040805; Fri, 17 Sep 2021 13:57:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HDvCap040804; Fri, 17 Sep 2021 13:57:12 GMT (envelope-from git) Date: Fri, 17 Sep 2021 13:57:12 GMT Message-Id: <202109171357.18HDvCap040804@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: f161abf9f2cd - main - readelf: include notes (-n) and unwind (-u) in --all/-a MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f161abf9f2cd7fdd28543f9774de82c89675477c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 13:57:13 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=f161abf9f2cd7fdd28543f9774de82c89675477c commit f161abf9f2cd7fdd28543f9774de82c89675477c Author: Ed Maste AuthorDate: 2021-09-17 12:06:27 +0000 Commit: Ed Maste CommitDate: 2021-09-17 13:51:59 +0000 readelf: include notes (-n) and unwind (-u) in --all/-a This matches the GNU and LLVM versions of readelf. As markj noted in the review -u is not actually implemented yet and has no effect. The option is accepted and just ignored. Reported by: andrew Reviewed by: andrew, markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32003 --- contrib/elftoolchain/readelf/readelf.1 | 4 +++- contrib/elftoolchain/readelf/readelf.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/elftoolchain/readelf/readelf.1 b/contrib/elftoolchain/readelf/readelf.1 index 67344d5359b4..108b62775712 100644 --- a/contrib/elftoolchain/readelf/readelf.1 +++ b/contrib/elftoolchain/readelf/readelf.1 @@ -24,7 +24,7 @@ .\" .\" $Id: readelf.1 3753 2019-06-28 01:13:13Z emaste $ .\" -.Dd October 31, 2020 +.Dd September 17, 2021 .Dt READELF 1 .Os .Sh NAME @@ -76,8 +76,10 @@ Turn on the following flags: .Fl h , .Fl I , .Fl l , +.Fl n , .Fl r , .Fl s , +.Fl u , .Fl A , .Fl S and diff --git a/contrib/elftoolchain/readelf/readelf.c b/contrib/elftoolchain/readelf/readelf.c index 81e6897cf3cd..d5f9205e354d 100644 --- a/contrib/elftoolchain/readelf/readelf.c +++ b/contrib/elftoolchain/readelf/readelf.c @@ -7788,7 +7788,7 @@ main(int argc, char **argv) break; case 'a': re->options |= RE_AA | RE_D | RE_G | RE_H | RE_II | - RE_L | RE_R | RE_SS | RE_S | RE_VV; + RE_L | RE_N | RE_R | RE_SS | RE_S | RE_U | RE_VV; break; case 'c': re->options |= RE_C; From owner-dev-commits-src-all@freebsd.org Fri Sep 17 14:26:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1C4A6B45B0; Fri, 17 Sep 2021 14:26:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9x883v9Xz4mhY; Fri, 17 Sep 2021 14:26:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 662CA16921; Fri, 17 Sep 2021 14:26:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HEQ0NH081125; Fri, 17 Sep 2021 14:26:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HEQ0rf081124; Fri, 17 Sep 2021 14:26:00 GMT (envelope-from git) Date: Fri, 17 Sep 2021 14:26:00 GMT Message-Id: <202109171426.18HEQ0rf081124@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: deef4b8ce8ba - main - readelf: document that -u / --unwind is not yet implemented MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: deef4b8ce8ba7292fe5088bf9f6d4e2e35662fe8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 14:26:00 -0000 The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=deef4b8ce8ba7292fe5088bf9f6d4e2e35662fe8 commit deef4b8ce8ba7292fe5088bf9f6d4e2e35662fe8 Author: Ed Maste AuthorDate: 2021-09-17 13:59:41 +0000 Commit: Ed Maste CommitDate: 2021-09-17 14:22:05 +0000 readelf: document that -u / --unwind is not yet implemented ELF tool chain readelf accepts -u / --unwind but just ignores the option. This was previously undocumented, which could be confusing for someone encountering `readelf -u` (in a script or GNU readelf example). Reported by: markj (in D32003) MFC after: 1 week Sponsored by: The FreeBSD Foundation --- contrib/elftoolchain/readelf/readelf.1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/elftoolchain/readelf/readelf.1 b/contrib/elftoolchain/readelf/readelf.1 index 108b62775712..c4f3408e814a 100644 --- a/contrib/elftoolchain/readelf/readelf.1 +++ b/contrib/elftoolchain/readelf/readelf.1 @@ -43,6 +43,7 @@ .Op Fl p Ar section | Fl -string-dump Ns = Ns Ar section .Op Fl r | Fl -relocs .Op Fl t | Fl -section-details +.Op Fl u | Fl -unwind .Op Fl v | Fl -version .Oo .Fl w Ns Oo Ns Ar afilmoprsFLR Ns Oc | @@ -118,6 +119,8 @@ Print additional information about sections, such as the flags fields in section headers. Implies .Fl S . +.It Fl u | Fl -unwind +Not yet implemented (option accepted but ignored). .It Fl v | Fl -version Prints a version identifier for .Nm From owner-dev-commits-src-all@freebsd.org Fri Sep 17 15:00:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E44176B494A; Fri, 17 Sep 2021 15:00:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H9xw95wMCz3Bn2; Fri, 17 Sep 2021 15:00:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACADD169C6; Fri, 17 Sep 2021 15:00:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HF0f4W030257; Fri, 17 Sep 2021 15:00:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HF0fGr030256; Fri, 17 Sep 2021 15:00:41 GMT (envelope-from git) Date: Fri, 17 Sep 2021 15:00:41 GMT Message-Id: <202109171500.18HF0fGr030256@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 7eb138a9e536 - main - libc/locale: Fix races between localeconv(3) and setlocale(3) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7eb138a9e53636366e615bdf04062fedc044bcea Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 15:00:42 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7eb138a9e53636366e615bdf04062fedc044bcea commit 7eb138a9e53636366e615bdf04062fedc044bcea Author: Mark Johnston AuthorDate: 2021-09-17 14:44:23 +0000 Commit: Mark Johnston CommitDate: 2021-09-17 14:47:46 +0000 libc/locale: Fix races between localeconv(3) and setlocale(3) Each locale embeds a lazily initialized lconv which is populated by localeconv(3) and localeconv_l(3). When setlocale(3) updates the global locale, the lconv needs to be (lazily) reinitialized. To signal this, we set flag variables in the locale structure. There are two problems: - The flags are set before the locale is fully updated, so a concurrent localeconv() call can observe partially initialized locale data. - No barriers ensure that localeconv() observes a fully initialized locale if a flag is set. So, move the flag update appropriately, and use acq/rel barriers to provide some synchronization. Note that this is inadequate in the face of multiple concurrent calls to setlocale(3), but this is not expected to work regardless. Thanks to Henry Hu for providing a test case demonstrating the race. PR: 258360 MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31899 --- lib/libc/locale/lmonetary.c | 4 ++-- lib/libc/locale/lnumeric.c | 4 ++-- lib/libc/locale/localeconv.c | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/libc/locale/lmonetary.c b/lib/libc/locale/lmonetary.c index 99800ae69922..b8b4e78c060b 100644 --- a/lib/libc/locale/lmonetary.c +++ b/lib/libc/locale/lmonetary.c @@ -107,8 +107,6 @@ monetary_load_locale_l(struct xlocale_monetary *loc, int *using_locale, &loc->buffer, "LC_MONETARY", LCMONETARY_SIZE_FULL, LCMONETARY_SIZE_MIN, (const char **)l); - if (ret != _LDP_ERROR) - *changed = 1; if (ret == _LDP_LOADED) { l->mon_grouping = __fix_locale_grouping_str(l->mon_grouping); @@ -146,6 +144,8 @@ monetary_load_locale_l(struct xlocale_monetary *loc, int *using_locale, M_ASSIGN_ICHAR(p_sign_posn); M_ASSIGN_ICHAR(n_sign_posn); } + if (ret != _LDP_ERROR) + atomic_store_rel_int(changed, 1); return (ret); } int diff --git a/lib/libc/locale/lnumeric.c b/lib/libc/locale/lnumeric.c index 046d1f1817dc..cc1daa3863e3 100644 --- a/lib/libc/locale/lnumeric.c +++ b/lib/libc/locale/lnumeric.c @@ -73,8 +73,6 @@ numeric_load_locale(struct xlocale_numeric *loc, int *using_locale, int *changed &loc->buffer, "LC_NUMERIC", LCNUMERIC_SIZE, LCNUMERIC_SIZE, (const char**)l); - if (ret != _LDP_ERROR) - *changed= 1; if (ret == _LDP_LOADED) { /* Can't be empty according to C99 */ if (*l->decimal_point == '\0') @@ -83,6 +81,8 @@ numeric_load_locale(struct xlocale_numeric *loc, int *using_locale, int *changed l->grouping = __fix_locale_grouping_str(l->grouping); } + if (ret != _LDP_ERROR) + atomic_store_rel_int(changed, 1); return (ret); } diff --git a/lib/libc/locale/localeconv.c b/lib/libc/locale/localeconv.c index 641773944e32..130f93c178f4 100644 --- a/lib/libc/locale/localeconv.c +++ b/lib/libc/locale/localeconv.c @@ -65,7 +65,7 @@ localeconv_l(locale_t loc) FIX_LOCALE(loc); struct lconv *ret = &loc->lconv; - if (loc->monetary_locale_changed) { + if (atomic_load_acq_int(&loc->monetary_locale_changed) != 0) { /* LC_MONETARY part */ struct lc_monetary_T * mptr; @@ -94,10 +94,10 @@ localeconv_l(locale_t loc) M_ASSIGN_CHAR(int_n_sep_by_space); M_ASSIGN_CHAR(int_p_sign_posn); M_ASSIGN_CHAR(int_n_sign_posn); - loc->monetary_locale_changed = 0; + atomic_store_int(&loc->monetary_locale_changed, 0); } - if (loc->numeric_locale_changed) { + if (atomic_load_acq_int(&loc->numeric_locale_changed) != 0) { /* LC_NUMERIC part */ struct lc_numeric_T * nptr; @@ -107,7 +107,7 @@ localeconv_l(locale_t loc) N_ASSIGN_STR(decimal_point); N_ASSIGN_STR(thousands_sep); N_ASSIGN_STR(grouping); - loc->numeric_locale_changed = 0; + atomic_store_int(&loc->numeric_locale_changed, 0); } return ret; From owner-dev-commits-src-all@freebsd.org Fri Sep 17 16:44:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5DE0C6B59A7; Fri, 17 Sep 2021 16:44:52 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB0DM1vNNz4Sbf; Fri, 17 Sep 2021 16:44:51 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-lf1-x12d.google.com with SMTP id d42so13672350lfv.10; Fri, 17 Sep 2021 09:44:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=AVSDB95rilSPFCbqIS7Vwa2mE5UN+mtkV1Ti5BvLwd0=; b=EsY4r5itpv0rs3BVUkkTPj7oj8/HHowOVt430PQsHwsVN50eVrd1vlfqBRMiW45nD9 /kEFN5tZHuMMYXf8WGc/PwcBu5JnJIkMVdgJPZyv4/MDa1lx8VKXL3qRWNU1+drDwoGH KRHaUYl73G0NWgvu5PrdfUkFJHj2DA+ygcT5BeFgRwGlPPBwBLEySmh4v1t1LQsUPof7 0Uzo89Oh5UakRfKxT7GM+HGDc0VHvLSB4smydcAFUP8TngFF5sqNBfxdBLpOVRVeX066 5i+TVriQ428qzhAypjB8tkkbFv244Xcks6pdj/Be3NIgSJBx0X2QinboEcCPaMNK8Rq3 dVhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=AVSDB95rilSPFCbqIS7Vwa2mE5UN+mtkV1Ti5BvLwd0=; b=BxfHlszUvahkqyWSz9p4Fq/82lNpWSsJLt/fmbOA2ZsSEHEm3nQkBOrYDfkroBnZM/ ibS8YPFxQVUtsnxsRdLQaiCBvYbWa2ScJn0PCoOZYPfzggWu60RqHgGKpabo8R0HwEkO 5C14RhUSe466HsCfQRhfy+LX7/imrHcnrvcRtvRh08C8kmv26xGtVwrptEPuz4LDcnEG 1aDSkBP4NvwZhJi8G4t9i+D7h+M8xg/hgSgj0PXKxszLV4Soam7oE1N6GnbWPsAtOhbf yJulNYKeEYxLnOBripyJuIQpkPp/4iBFHC3ZWVkSgAbGjx1DwiamOo1/73h84VvOWL45 xZBA== X-Gm-Message-State: AOAM530+iXO74REJ3w2+h87OzplIoxzewiPl4qFK83Xa2/3/2svwvMzP mDfBqs79Hr4p41jlVhI2r+xt25ivnGU1v6uCuDCiqmjm X-Google-Smtp-Source: ABdhPJzE1DsWmneFjJKwyZfOQdmN8VxJRgEXPixg+gufKtABlK+gSSjg1wNRCDVhlA8yvusKCM166XruEzKM+eroNdU= X-Received: by 2002:a05:6512:1114:: with SMTP id l20mr8955330lfg.550.1631897089684; Fri, 17 Sep 2021 09:44:49 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:651c:2115:0:0:0:0 with HTTP; Fri, 17 Sep 2021 09:44:48 -0700 (PDT) In-Reply-To: References: <202109130411.18D4BUs3004805@gitrepo.freebsd.org> From: Mateusz Guzik Date: Fri, 17 Sep 2021 18:44:48 +0200 Message-ID: Subject: Re: git: 6fa041d7f125 - main - Measure latency of PMC interruptions To: Wojciech Macek Cc: Mitchell Horne , Wojciech Macek , src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4HB0DM1vNNz4Sbf X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=EsY4r5it; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of mjguzik@gmail.com designates 2a00:1450:4864:20::12d as permitted sender) smtp.mailfrom=mjguzik@gmail.com X-Spamd-Result: default: False [-2.01 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[text/plain]; NEURAL_SPAM_SHORT(0.99)[0.993]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::12d:from]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 16:44:52 -0000 ping? On 9/14/21, Wojciech Macek wrote: > Hi, > > Thanks for comments, I'll handle all of them as well as docs. > > Wojtek > > pon., 13 wrz 2021 o 22:06 Mitchell Horne napisa=C5= =82(a): > >> On Mon, Sep 13, 2021 at 1:11 AM Wojciech Macek wrote: >> > >> > The branch main has been updated by wma: >> > >> > URL: >> https://cgit.FreeBSD.org/src/commit/?id=3D6fa041d7f125db65f400af7f520a41= ff78d19cd7 >> > >> > commit 6fa041d7f125db65f400af7f520a41ff78d19cd7 >> > Author: Wojciech Macek >> > AuthorDate: 2021-09-13 04:08:32 +0000 >> > Commit: Wojciech Macek >> > CommitDate: 2021-09-13 04:08:32 +0000 >> > >> > Measure latency of PMC interruptions >> > >> > Add HWPMC events to measure latency. >> > Provide sysctl to choose the number of outstanding events which >> > trigger HWPMC event. >> > >> > Obtained from: Semihalf >> > Sponsored by: Stormshield >> > Differential revision: https://reviews.freebsd.org/D31283 >> > --- >> > sys/kern/kern_intr.c | 58 >> ++++++++++++++++++++++++++++++++++++++++++++++------ >> > 1 file changed, 52 insertions(+), 6 deletions(-) >> > >> > diff --git a/sys/kern/kern_intr.c b/sys/kern/kern_intr.c >> > index 1660414a50ef..19401877dfbd 100644 >> > --- a/sys/kern/kern_intr.c >> > +++ b/sys/kern/kern_intr.c >> > @@ -30,6 +30,7 @@ >> > __FBSDID("$FreeBSD$"); >> > >> > #include "opt_ddb.h" >> > +#include "opt_hwpmc_hooks.h" >> > #include "opt_kstack_usage_prof.h" >> > >> > #include >> > @@ -75,6 +76,7 @@ struct intr_thread { >> > struct thread *it_thread; /* Kernel thread. */ >> > int it_flags; /* (j) IT_* flags. */ >> > int it_need; /* Needs service. */ >> > + int it_waiting; /* Waiting in the runq. */ >> > }; >> > >> > /* Interrupt thread flags kept in it_flags */ >> > @@ -100,13 +102,19 @@ SYSCTL_INT(_hw, OID_AUTO, intr_storm_threshold, >> CTLFLAG_RWTUN, >> > static int intr_epoch_batch =3D 1000; >> > SYSCTL_INT(_hw, OID_AUTO, intr_epoch_batch, CTLFLAG_RWTUN, >> &intr_epoch_batch, >> > 0, "Maximum interrupt handler executions without re-entering >> epoch(9)"); >> > +#ifdef HWPMC_HOOKS >> > +static int intr_hwpmc_waiting_report_threshold =3D 1; >> > +SYSCTL_INT(_hw, OID_AUTO, intr_hwpmc_waiting_report_threshold, >> CTLFLAG_RWTUN, >> > + &intr_hwpmc_waiting_report_threshold, 1, >> > + "Threshold for reporting number of events in a workq"); >> > +#endif >> > static TAILQ_HEAD(, intr_event) event_list =3D >> > TAILQ_HEAD_INITIALIZER(event_list); >> > static struct mtx event_lock; >> > MTX_SYSINIT(intr_event_list, &event_lock, "intr event list", MTX_DEF)= ; >> > >> > static void intr_event_update(struct intr_event *ie); >> > -static int intr_event_schedule_thread(struct intr_event *ie); >> > +static int intr_event_schedule_thread(struct intr_event *ie, stru= ct >> trapframe *frame); >> > static struct intr_thread *ithread_create(const char *name); >> > static void ithread_destroy(struct intr_thread *ithread); >> > static void ithread_execute_handlers(struct proc *p, >> > @@ -115,6 +123,16 @@ static void ithread_loop(void *); >> > static void ithread_update(struct intr_thread *ithd); >> > static void start_softintr(void *); >> > >> > +#ifdef HWPMC_HOOKS >> > +#include >> > +PMC_SOFT_DEFINE( , , intr, all); >> > +PMC_SOFT_DEFINE( , , intr, ithread); >> > +PMC_SOFT_DEFINE( , , intr, filter); >> > +PMC_SOFT_DEFINE( , , intr, stray); >> > +PMC_SOFT_DEFINE( , , intr, schedule); >> > +PMC_SOFT_DEFINE( , , intr, waiting); >> > +#endif >> > + >> >> Hi Wojciech, >> >> Do you plan to document these new events in the pmc.soft(3) man page? >> >> Cheers, >> Mitchell >> >> >> > /* Map an interrupt type to an ithread priority. */ >> > u_char >> > intr_priority(enum intr_type flags) >> > @@ -773,7 +791,7 @@ intr_handler_barrier(struct intr_handler *handler) >> > } >> > if ((handler->ih_flags & IH_CHANGED) =3D=3D 0) { >> > handler->ih_flags |=3D IH_CHANGED; >> > - intr_event_schedule_thread(ie); >> > + intr_event_schedule_thread(ie, NULL); >> > } >> > while ((handler->ih_flags & IH_CHANGED) !=3D 0) >> > msleep(handler, &ie->ie_lock, 0, "ih_barr", 0); >> > @@ -872,7 +890,7 @@ intr_event_remove_handler(void *cookie) >> > KASSERT((handler->ih_flags & IH_DEAD) =3D=3D 0, >> > ("duplicate handle remove")); >> > handler->ih_flags |=3D IH_DEAD; >> > - intr_event_schedule_thread(ie); >> > + intr_event_schedule_thread(ie, NULL); >> > while (handler->ih_flags & IH_DEAD) >> > msleep(handler, &ie->ie_lock, 0, "iev_rmh", 0); >> > intr_event_update(ie); >> > @@ -944,7 +962,7 @@ intr_event_resume_handler(void *cookie) >> > } >> > >> > static int >> > -intr_event_schedule_thread(struct intr_event *ie) >> > +intr_event_schedule_thread(struct intr_event *ie, struct trapframe >> *frame) >> > { >> > struct intr_entropy entropy; >> > struct intr_thread *it; >> > @@ -986,11 +1004,28 @@ intr_event_schedule_thread(struct intr_event *i= e) >> > atomic_store_rel_int(&it->it_need, 1); >> > thread_lock(td); >> > if (TD_AWAITING_INTR(td)) { >> > +#ifdef HWPMC_HOOKS >> > + atomic_set_int(&it->it_waiting, 0); >> > + if (frame !=3D NULL) >> > + PMC_SOFT_CALL_TF( , , intr, schedule, frame); >> > + else >> > + PMC_SOFT_CALL( , , intr, schedule); >> > +#endif >> > CTR3(KTR_INTR, "%s: schedule pid %d (%s)", __func__, >> td->td_proc->p_pid, >> > td->td_name); >> > TD_CLR_IWAIT(td); >> > sched_add(td, SRQ_INTR); >> > } else { >> > +#ifdef HWPMC_HOOKS >> > + atomic_add_int(&it->it_waiting, 1); >> > + >> > + if (atomic_load_int(&it->it_waiting) >=3D >> intr_hwpmc_waiting_report_threshold) { >> > + if (frame !=3D NULL) >> > + PMC_SOFT_CALL_TF( , , intr, waiting, >> frame); >> > + else >> > + PMC_SOFT_CALL( , , intr, waiting); >> > + } >> > +#endif >> > CTR5(KTR_INTR, "%s: pid %d (%s): it_need %d, state %d"= , >> > __func__, td->td_proc->p_pid, td->td_name, >> it->it_need, TD_GET_STATE(td)); >> > thread_unlock(td); >> > @@ -1083,7 +1118,7 @@ swi_sched(void *cookie, int flags) >> > #endif >> > } else { >> > VM_CNT_INC(v_soft); >> > - error =3D intr_event_schedule_thread(ie); >> > + error =3D intr_event_schedule_thread(ie, NULL); >> > KASSERT(error =3D=3D 0, ("stray software interrupt")); >> > } >> > } >> > @@ -1374,12 +1409,23 @@ intr_event_handle(struct intr_event *ie, struc= t >> trapframe *frame) >> > ret =3D ih->ih_filter(frame); >> > else >> > ret =3D ih->ih_filter(ih->ih_argument); >> > +#ifdef HWPMC_HOOKS >> > + PMC_SOFT_CALL_TF( , , intr, all, frame); >> > +#endif >> > KASSERT(ret =3D=3D FILTER_STRAY || >> > ((ret & (FILTER_SCHEDULE_THREAD | FILTER_HANDLED)) >> !=3D 0 && >> > (ret & ~(FILTER_SCHEDULE_THREAD | FILTER_HANDLED)) >> =3D=3D 0), >> > ("%s: incorrect return value %#x from %s", __func_= _, >> ret, >> > ih->ih_name)); >> > filter =3D filter || ret =3D=3D FILTER_HANDLED; >> > +#ifdef HWPMC_HOOKS >> > + if (ret & FILTER_SCHEDULE_THREAD) >> > + PMC_SOFT_CALL_TF( , , intr, ithread, frame); >> > + else if (ret & FILTER_HANDLED) >> > + PMC_SOFT_CALL_TF( , , intr, filter, frame); >> > + else if (ret =3D=3D FILTER_STRAY) >> > + PMC_SOFT_CALL_TF( , , intr, stray, frame); >> > +#endif >> > >> > /* >> > * Wrapper handler special handling: >> > @@ -1416,7 +1462,7 @@ intr_event_handle(struct intr_event *ie, struct >> trapframe *frame) >> > if (thread) { >> > int error __unused; >> > >> > - error =3D intr_event_schedule_thread(ie); >> > + error =3D intr_event_schedule_thread(ie, frame); >> > KASSERT(error =3D=3D 0, ("bad stray interrupt")); >> > } >> > critical_exit(); >> > _______________________________________________ > dev-commits-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all > To unsubscribe, send any mail to > "dev-commits-src-all-unsubscribe@freebsd.org" > --=20 Mateusz Guzik From owner-dev-commits-src-all@freebsd.org Fri Sep 17 16:56:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 438976B61BB; Fri, 17 Sep 2021 16:56:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB0Tl19yBz4VBT; Fri, 17 Sep 2021 16:56:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08E081895A; Fri, 17 Sep 2021 16:56:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HGuQJJ080692; Fri, 17 Sep 2021 16:56:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HGuQmN080691; Fri, 17 Sep 2021 16:56:26 GMT (envelope-from git) Date: Fri, 17 Sep 2021 16:56:26 GMT Message-Id: <202109171656.18HGuQmN080691@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: c6efcb1281f3 - main - bhyve: Support setting the disk serial number for VirtIO block devices. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c6efcb1281f3518a92fdc579d2c3c3c74eb6070c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 16:56:27 -0000 The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c6efcb1281f3518a92fdc579d2c3c3c74eb6070c commit c6efcb1281f3518a92fdc579d2c3c3c74eb6070c Author: John Baldwin AuthorDate: 2021-09-17 16:55:06 +0000 Commit: John Baldwin CommitDate: 2021-09-17 16:55:48 +0000 bhyve: Support setting the disk serial number for VirtIO block devices. Reviewed by: allanjude Obtained from: illumos Differential Revision: https://reviews.freebsd.org/D31983 --- usr.sbin/bhyve/bhyve_config.5 | 12 +++++++++++- usr.sbin/bhyve/pci_virtio_block.c | 27 +++++++++++++++++---------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/usr.sbin/bhyve/bhyve_config.5 b/usr.sbin/bhyve/bhyve_config.5 index a6f621048c1a..25bd818d6148 100644 --- a/usr.sbin/bhyve/bhyve_config.5 +++ b/usr.sbin/bhyve/bhyve_config.5 @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 20, 2021 +.Dd September 17, 2021 .Dt BHYVE_CONFIG 5 .Os .Sh NAME @@ -514,6 +514,16 @@ The path of a directory on the host to export to the guest. .It Va ro Ta bool Ta false Ta If true, the guest filesystem is read-only. .El +.Ss VirtIO Block Device Settings +In addition to the block device settings described above, each +VirtIO block device supports the following settings: +.Bl -column "model" "integer" "generated" +.It Sy Name Ta Sy Format Ta Sy Default Ta Sy Description +.It Va ser Ta string Ta generated Ta +Serial number of up to twenty characters. +A default serial number is generated using a hash of the backing +store's pathname. +.El .Ss VirtIO Console Device Settings Each VirtIO Console device contains one or more console ports. Each port stores its settings in a node named diff --git a/usr.sbin/bhyve/pci_virtio_block.c b/usr.sbin/bhyve/pci_virtio_block.c index 3718b2d7eff0..385b812be84c 100644 --- a/usr.sbin/bhyve/pci_virtio_block.c +++ b/usr.sbin/bhyve/pci_virtio_block.c @@ -453,7 +453,7 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) { char bident[sizeof("XX:X:X")]; struct blockif_ctxt *bctxt; - const char *path; + const char *path, *serial; MD5_CTX mdctx; u_char digest[16]; struct pci_vtblk_softc *sc; @@ -498,16 +498,23 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl) /* sc->vbsc_vq.vq_notify = we have no per-queue notify */ /* - * Create an identifier for the backing file. Use parts of the - * md5 sum of the filename + * If an explicit identifier is not given, create an + * identifier using parts of the md5 sum of the filename. */ - path = get_config_value_node(nvl, "path"); - MD5Init(&mdctx); - MD5Update(&mdctx, path, strlen(path)); - MD5Final(digest, &mdctx); - snprintf(sc->vbsc_ident, VTBLK_BLK_ID_BYTES, - "BHYVE-%02X%02X-%02X%02X-%02X%02X", - digest[0], digest[1], digest[2], digest[3], digest[4], digest[5]); + bzero(sc->vbsc_ident, VTBLK_BLK_ID_BYTES); + if ((serial = get_config_value_node(nvl, "serial")) != NULL || + (serial = get_config_value_node(nvl, "ser")) != NULL) { + strlcpy(sc->vbsc_ident, serial, VTBLK_BLK_ID_BYTES); + } else { + path = get_config_value_node(nvl, "path"); + MD5Init(&mdctx); + MD5Update(&mdctx, path, strlen(path)); + MD5Final(digest, &mdctx); + snprintf(sc->vbsc_ident, VTBLK_BLK_ID_BYTES, + "BHYVE-%02X%02X-%02X%02X-%02X%02X", + digest[0], digest[1], digest[2], digest[3], digest[4], + digest[5]); + } /* setup virtio block config space */ sc->vbsc_cfg.vbc_capacity = size / VTBLK_BSIZE; /* 512-byte units */ From owner-dev-commits-src-all@freebsd.org Fri Sep 17 17:43:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50A1C6B6C14; Fri, 17 Sep 2021 17:43:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB1XK1d97z4kMy; Fri, 17 Sep 2021 17:43:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1825719AE8; Fri, 17 Sep 2021 17:43:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HHhjYJ047687; Fri, 17 Sep 2021 17:43:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HHhiQM047686; Fri, 17 Sep 2021 17:43:44 GMT (envelope-from git) Date: Fri, 17 Sep 2021 17:43:44 GMT Message-Id: <202109171743.18HHhiQM047686@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 197a4f29f39e - main - buffer pager: allow get_blksize method to return error MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 197a4f29f39e6ae6215a6dbd28ef449d305e6d49 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 17:43:45 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=197a4f29f39e6ae6215a6dbd28ef449d305e6d49 commit 197a4f29f39e6ae6215a6dbd28ef449d305e6d49 Author: Konstantin Belousov AuthorDate: 2021-09-16 23:53:58 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-17 17:29:55 +0000 buffer pager: allow get_blksize method to return error Reported and reviewed by: asomers Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D31998 --- sys/fs/cd9660/cd9660_vnops.c | 5 +++-- sys/fs/fuse/fuse_vnops.c | 5 +++-- sys/fs/msdosfs/msdosfs_vnops.c | 5 +++-- sys/fs/nfsclient/nfs_clbio.c | 5 +++-- sys/kern/vfs_bio.c | 16 ++++++++++------ sys/sys/buf.h | 2 +- sys/ufs/ffs/ffs_vnops.c | 5 +++-- 7 files changed, 26 insertions(+), 17 deletions(-) diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c index 500ff79716be..0ddf73548e3f 100644 --- a/sys/fs/cd9660/cd9660_vnops.c +++ b/sys/fs/cd9660/cd9660_vnops.c @@ -858,12 +858,13 @@ cd9660_gbp_getblkno(struct vnode *vp, vm_ooffset_t off) } static int -cd9660_gbp_getblksz(struct vnode *vp, daddr_t lbn) +cd9660_gbp_getblksz(struct vnode *vp, daddr_t lbn, long *sz) { struct iso_node *ip; ip = VTOI(vp); - return (blksize(ip->i_mnt, ip, lbn)); + *sz = blksize(ip->i_mnt, ip, lbn); + return (0); } static int diff --git a/sys/fs/fuse/fuse_vnops.c b/sys/fs/fuse/fuse_vnops.c index adb297b6aacb..1216c1252f2b 100644 --- a/sys/fs/fuse/fuse_vnops.c +++ b/sys/fs/fuse/fuse_vnops.c @@ -2199,7 +2199,7 @@ fuse_gbp_getblkno(struct vnode *vp, vm_ooffset_t off) } static int -fuse_gbp_getblksz(struct vnode *vp, daddr_t lbn) +fuse_gbp_getblksz(struct vnode *vp, daddr_t lbn, long *sz) { off_t filesize; int blksz, err; @@ -2217,7 +2217,8 @@ fuse_gbp_getblksz(struct vnode *vp, daddr_t lbn) } else { blksz = biosize; } - return (blksz); + *sz = blksz; + return (0); } /* diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c index 6197340e8943..5f778724786d 100644 --- a/sys/fs/msdosfs/msdosfs_vnops.c +++ b/sys/fs/msdosfs/msdosfs_vnops.c @@ -1861,10 +1861,11 @@ msdosfs_gbp_getblkno(struct vnode *vp, vm_ooffset_t off) } static int -msdosfs_gbp_getblksz(struct vnode *vp, daddr_t lbn) +msdosfs_gbp_getblksz(struct vnode *vp, daddr_t lbn, long *sz) { - return (VTODE(vp)->de_pmp->pm_bpcluster); + *sz = VTODE(vp)->de_pmp->pm_bpcluster; + return (0); } static int diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c index ff9f446ff1ef..10a76f0a4b83 100644 --- a/sys/fs/nfsclient/nfs_clbio.c +++ b/sys/fs/nfsclient/nfs_clbio.c @@ -94,7 +94,7 @@ ncl_gbp_getblkno(struct vnode *vp, vm_ooffset_t off) } static int -ncl_gbp_getblksz(struct vnode *vp, daddr_t lbn) +ncl_gbp_getblksz(struct vnode *vp, daddr_t lbn, long *sz) { struct nfsnode *np; u_quad_t nsize; @@ -111,7 +111,8 @@ ncl_gbp_getblksz(struct vnode *vp, daddr_t lbn) bcount = 0; else if ((off_t)(lbn + 1) * biosize > nsize) bcount = nsize - (off_t)lbn * biosize; - return (bcount); + *sz = bcount; + return (0); } int diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 174892b374d1..e234bf2d6563 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -5203,8 +5203,8 @@ vfs_bio_getpages(struct vnode *vp, vm_page_t *ma, int count, struct mount *mp; daddr_t lbn, lbnp; vm_ooffset_t la, lb, poff, poffe; - long bsize; - int bo_bs, br_flags, error, i, pgsin, pgsin_a, pgsin_b; + long bo_bs, bsize; + int br_flags, error, i, pgsin, pgsin_a, pgsin_b; bool redo, lpart; object = vp->v_object; @@ -5221,7 +5221,10 @@ vfs_bio_getpages(struct vnode *vp, vm_page_t *ma, int count, */ la += PAGE_SIZE; lpart = la > object->un_pager.vnp.vnp_size; - bo_bs = get_blksize(vp, get_lblkno(vp, IDX_TO_OFF(ma[0]->pindex))); + error = get_blksize(vp, get_lblkno(vp, IDX_TO_OFF(ma[0]->pindex)), + &bo_bs); + if (error != 0) + return (VM_PAGER_ERROR); /* * Calculate read-ahead, behind and total pages. @@ -5277,9 +5280,10 @@ again: goto next_page; lbnp = lbn; - bsize = get_blksize(vp, lbn); - error = bread_gb(vp, lbn, bsize, curthread->td_ucred, - br_flags, &bp); + error = get_blksize(vp, lbn, &bsize); + if (error == 0) + error = bread_gb(vp, lbn, bsize, + curthread->td_ucred, br_flags, &bp); if (error != 0) goto end_pages; if (bp->b_rcred == curthread->td_ucred) { diff --git a/sys/sys/buf.h b/sys/sys/buf.h index d6c4c7f44795..b831003cf63d 100644 --- a/sys/sys/buf.h +++ b/sys/sys/buf.h @@ -610,7 +610,7 @@ void bwait(struct buf *, u_char, const char *); void bdone(struct buf *); typedef daddr_t (vbg_get_lblkno_t)(struct vnode *, vm_ooffset_t); -typedef int (vbg_get_blksize_t)(struct vnode *, daddr_t); +typedef int (vbg_get_blksize_t)(struct vnode *, daddr_t, long *); int vfs_bio_getpages(struct vnode *vp, struct vm_page **ma, int count, int *rbehind, int *rahead, vbg_get_lblkno_t get_lblkno, vbg_get_blksize_t get_blksize); diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index a10afd86f8e6..a1657db9ece2 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1935,10 +1935,11 @@ ffs_gbp_getblkno(struct vnode *vp, vm_ooffset_t off) } static int -ffs_gbp_getblksz(struct vnode *vp, daddr_t lbn) +ffs_gbp_getblksz(struct vnode *vp, daddr_t lbn, long *sz) { - return (blksize(VFSTOUFS(vp->v_mount)->um_fs, VTOI(vp), lbn)); + *sz = blksize(VFSTOUFS(vp->v_mount)->um_fs, VTOI(vp), lbn); + return (0); } static int From owner-dev-commits-src-all@freebsd.org Fri Sep 17 17:53:52 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 619066B6EAF; Fri, 17 Sep 2021 17:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB1m026szz4mV7; Fri, 17 Sep 2021 17:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 28DB119F98; Fri, 17 Sep 2021 17:53:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HHrq30061061; Fri, 17 Sep 2021 17:53:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HHrqGd061060; Fri, 17 Sep 2021 17:53:52 GMT (envelope-from git) Date: Fri, 17 Sep 2021 17:53:52 GMT Message-Id: <202109171753.18HHrqGd061060@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 99308580414c - stable/13 - pf: fix synproxy to local MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 99308580414ce625c6e429b876985bf0aa5b8a9b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 17:53:52 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=99308580414ce625c6e429b876985bf0aa5b8a9b commit 99308580414ce625c6e429b876985bf0aa5b8a9b Author: Kristof Provost AuthorDate: 2021-09-01 07:54:55 +0000 Commit: Kristof Provost CommitDate: 2021-09-17 15:55:40 +0000 pf: fix synproxy to local When we're synproxy-ing a connection that's going to us (as opposed to a forwarded one) we wound up trying to send out the pf-generated tcp packets through pf_intr(), which called ip(6)_output(). That doesn't work all that well for packets that are destined for us, so in that case we must call ip(6)_input() instead. MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31853 (cherry picked from commit 0a51d74c3ab8e7ee8771cc3ee78ffba831c953ef) --- sys/netpfil/pf/pf.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 57 insertions(+), 5 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 65bd49c7c635..42e8f3279599 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1482,6 +1482,42 @@ pf_send(struct pf_send_entry *pfse) swi_sched(V_pf_swi_cookie, 0); } +static bool +pf_isforlocal(struct mbuf *m, int af) +{ + switch (af) { + case AF_INET: { + struct rm_priotracker in_ifa_tracker; + struct ip *ip; + struct in_ifaddr *ia = NULL; + + ip = mtod(m, struct ip *); + IN_IFADDR_RLOCK(&in_ifa_tracker); + LIST_FOREACH(ia, INADDR_HASH(ip->ip_dst.s_addr), ia_hash) { + if (IA_SIN(ia)->sin_addr.s_addr == ip->ip_dst.s_addr) { + IN_IFADDR_RUNLOCK(&in_ifa_tracker); + return (true); + } + } + IN_IFADDR_RUNLOCK(&in_ifa_tracker); + break; + } + case AF_INET6: { + struct ip6_hdr *ip6; + struct in6_ifaddr *ia; + ip6 = mtod(m, struct ip6_hdr *); + ia = in6ifa_ifwithaddr(&ip6->ip6_dst, 0 /* XXX */, false); + if (ia == NULL) + return (false); + return (! (ia->ia6_flags & IN6_IFF_NOTREADY)); + } + default: + panic("Unsupported af %d", af); + } + + return (false); +} + void pf_intr(void *v) { @@ -1501,9 +1537,18 @@ pf_intr(void *v) STAILQ_FOREACH_SAFE(pfse, &queue, pfse_next, next) { switch (pfse->pfse_type) { #ifdef INET - case PFSE_IP: - ip_output(pfse->pfse_m, NULL, NULL, 0, NULL, NULL); + case PFSE_IP: { + if (pf_isforlocal(pfse->pfse_m, AF_INET)) { + pfse->pfse_m->m_flags |= M_SKIP_FIREWALL; + pfse->pfse_m->m_pkthdr.csum_flags |= + CSUM_IP_VALID | CSUM_IP_CHECKED; + ip_input(pfse->pfse_m); + } else { + ip_output(pfse->pfse_m, NULL, NULL, 0, NULL, + NULL); + } break; + } case PFSE_ICMP: icmp_error(pfse->pfse_m, pfse->icmpopts.type, pfse->icmpopts.code, 0, pfse->icmpopts.mtu); @@ -1511,8 +1556,13 @@ pf_intr(void *v) #endif /* INET */ #ifdef INET6 case PFSE_IP6: - ip6_output(pfse->pfse_m, NULL, NULL, 0, NULL, NULL, - NULL); + if (pf_isforlocal(pfse->pfse_m, AF_INET6)) { + pfse->pfse_m->m_flags |= M_SKIP_FIREWALL; + ip6_input(pfse->pfse_m); + } else { + ip6_output(pfse->pfse_m, NULL, NULL, 0, NULL, + NULL, NULL); + } break; case PFSE_ICMP6: icmp6_error(pfse->pfse_m, pfse->icmpopts.type, @@ -2656,7 +2706,9 @@ pf_build_tcp(const struct pf_krule *r, sa_family_t af, #endif /* ALTQ */ m->m_data += max_linkhdr; m->m_pkthdr.len = m->m_len = len; - m->m_pkthdr.rcvif = NULL; + /* The rest of the stack assumes a rcvif, so provide one. + * This is a locally generated packet, so .. close enough. */ + m->m_pkthdr.rcvif = V_loif; bzero(m->m_data, len); switch (af) { #ifdef INET From owner-dev-commits-src-all@freebsd.org Fri Sep 17 17:53:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E2DF6B6EB1; Fri, 17 Sep 2021 17:53:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB1m12rjSz4mgV; Fri, 17 Sep 2021 17:53:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4336319C3B; Fri, 17 Sep 2021 17:53:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HHrrkg061088; Fri, 17 Sep 2021 17:53:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HHrri9061087; Fri, 17 Sep 2021 17:53:53 GMT (envelope-from git) Date: Fri, 17 Sep 2021 17:53:53 GMT Message-Id: <202109171753.18HHrri9061087@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 2134d9f05faa - stable/13 - pf tests: synproxy to localhost test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2134d9f05faaa5c9a8980b13701c1e4a7037856c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 17:53:53 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=2134d9f05faaa5c9a8980b13701c1e4a7037856c commit 2134d9f05faaa5c9a8980b13701c1e4a7037856c Author: Kristof Provost AuthorDate: 2021-06-30 12:22:27 +0000 Commit: Kristof Provost CommitDate: 2021-09-17 15:55:40 +0000 pf tests: synproxy to localhost test Test syn-proxying a connection to the local host. Sponsored by: Modirum MDPay MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31854 (cherry picked from commit 6598cababf6425181a755ec97c3fa66d7ee31393) --- tests/sys/netpfil/pf/synproxy.sh | 83 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/tests/sys/netpfil/pf/synproxy.sh b/tests/sys/netpfil/pf/synproxy.sh index aedbb8885129..a111f40cfbcf 100644 --- a/tests/sys/netpfil/pf/synproxy.sh +++ b/tests/sys/netpfil/pf/synproxy.sh @@ -79,7 +79,90 @@ synproxy_cleanup() pft_cleanup } +atf_test_case "local" "cleanup" +local_head() +{ + atf_set descr 'Synproxy a locally terminated connection' + atf_set require.user root +} + +local_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a 192.0.2.2/24 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 192.0.2.1/24 up + jexec alcatraz /usr/sbin/inetd -p inetd-alcatraz.pid \ + $(atf_get_srcdir)/echo_inetd.conf + + jexec alcatraz pfctl -e + pft_set_rules alcatraz "set fail-policy return" \ + "scrub in all fragment reassemble" \ + "pass in quick on ${epair}b proto tcp from any to any port 7 synproxy state" + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1 + + # Check that we can talk to the jail, after synproxying + reply=$(echo ping | nc -N -w 5 192.0.2.1 7) + if [ "${reply}" != "ping" ]; + then + atf_fail "echo failed" + fi +} + +local_cleanup() +{ + rm -f inetd-alcatraz.pid + pft_cleanup +} + +atf_test_case "local_v6" "cleanup" +local_v6_head() +{ + atf_set descr 'Synproxy (v6) a locally terminated connection' + atf_set require.user root +} + +local_v6_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a inet6 2001:db8:42::1/64 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b inet6 2001:db8:42::2/64 up + jexec alcatraz /usr/sbin/inetd -p inetd-alcatraz.pid \ + $(atf_get_srcdir)/echo_inetd.conf + + jexec alcatraz pfctl -e + pft_set_rules alcatraz "set fail-policy return" \ + "scrub in all fragment reassemble" \ + "pass in quick on ${epair}b proto tcp from any to any port 7 synproxy state" + + # Sanity check + atf_check -s exit:0 -o ignore ping6 -c 1 2001:db8:42::2 + + reply=$(echo ping | nc -N -w 5 2001:db8:42::2 7) + if [ "${reply}" != "ping" ]; + then + atf_fail "echo failed" + fi +} + +local_v6_cleanup() +{ + rm -f inetd-alcatraz.pid + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "synproxy" + atf_add_test_case "local" + atf_add_test_case "local_v6" } From owner-dev-commits-src-all@freebsd.org Fri Sep 17 17:53:54 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 02BAE6B6F87; Fri, 17 Sep 2021 17:53:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB1m168Qlz4mV9; Fri, 17 Sep 2021 17:53:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC4C319C3C; Fri, 17 Sep 2021 17:53:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HHrrTa061176; Fri, 17 Sep 2021 17:53:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HHrrve061175; Fri, 17 Sep 2021 17:53:53 GMT (envelope-from git) Date: Fri, 17 Sep 2021 17:53:53 GMT Message-Id: <202109171753.18HHrrve061175@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 21d8ee0cd3bf - stable/12 - pf: fix synproxy to local MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 21d8ee0cd3bfa1d20c903cfde12053c360d41ef4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 17:53:54 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=21d8ee0cd3bfa1d20c903cfde12053c360d41ef4 commit 21d8ee0cd3bfa1d20c903cfde12053c360d41ef4 Author: Kristof Provost AuthorDate: 2021-09-01 07:54:55 +0000 Commit: Kristof Provost CommitDate: 2021-09-17 08:44:05 +0000 pf: fix synproxy to local When we're synproxy-ing a connection that's going to us (as opposed to a forwarded one) we wound up trying to send out the pf-generated tcp packets through pf_intr(), which called ip(6)_output(). That doesn't work all that well for packets that are destined for us, so in that case we must call ip(6)_input() instead. MFC after: 1 week Sponsored by: Modirum MDPay Differential Revision: https://reviews.freebsd.org/D31853 (cherry picked from commit 0a51d74c3ab8e7ee8771cc3ee78ffba831c953ef) --- sys/netpfil/pf/pf.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 57 insertions(+), 5 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index ce94c71fb49e..0722a864a574 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1482,6 +1482,42 @@ pf_send(struct pf_send_entry *pfse) swi_sched(V_pf_swi_cookie, 0); } +static bool +pf_isforlocal(struct mbuf *m, int af) +{ + switch (af) { + case AF_INET: { + struct rm_priotracker in_ifa_tracker; + struct ip *ip; + struct in_ifaddr *ia = NULL; + + ip = mtod(m, struct ip *); + IN_IFADDR_RLOCK(&in_ifa_tracker); + LIST_FOREACH(ia, INADDR_HASH(ip->ip_dst.s_addr), ia_hash) { + if (IA_SIN(ia)->sin_addr.s_addr == ip->ip_dst.s_addr) { + IN_IFADDR_RUNLOCK(&in_ifa_tracker); + return (true); + } + } + IN_IFADDR_RUNLOCK(&in_ifa_tracker); + break; + } + case AF_INET6: { + struct ip6_hdr *ip6; + struct in6_ifaddr *ia; + ip6 = mtod(m, struct ip6_hdr *); + ia = in6ifa_ifwithaddr(&ip6->ip6_dst, 0 /* XXX */); + if (ia == NULL) + return (false); + return (! (ia->ia6_flags & IN6_IFF_NOTREADY)); + } + default: + panic("Unsupported af %d", af); + } + + return (false); +} + void pf_intr(void *v) { @@ -1498,9 +1534,18 @@ pf_intr(void *v) STAILQ_FOREACH_SAFE(pfse, &queue, pfse_next, next) { switch (pfse->pfse_type) { #ifdef INET - case PFSE_IP: - ip_output(pfse->pfse_m, NULL, NULL, 0, NULL, NULL); + case PFSE_IP: { + if (pf_isforlocal(pfse->pfse_m, AF_INET)) { + pfse->pfse_m->m_flags |= M_SKIP_FIREWALL; + pfse->pfse_m->m_pkthdr.csum_flags |= + CSUM_IP_VALID | CSUM_IP_CHECKED; + ip_input(pfse->pfse_m); + } else { + ip_output(pfse->pfse_m, NULL, NULL, 0, NULL, + NULL); + } break; + } case PFSE_ICMP: icmp_error(pfse->pfse_m, pfse->icmpopts.type, pfse->icmpopts.code, 0, pfse->icmpopts.mtu); @@ -1508,8 +1553,13 @@ pf_intr(void *v) #endif /* INET */ #ifdef INET6 case PFSE_IP6: - ip6_output(pfse->pfse_m, NULL, NULL, 0, NULL, NULL, - NULL); + if (pf_isforlocal(pfse->pfse_m, AF_INET6)) { + pfse->pfse_m->m_flags |= M_SKIP_FIREWALL; + ip6_input(pfse->pfse_m); + } else { + ip6_output(pfse->pfse_m, NULL, NULL, 0, NULL, + NULL, NULL); + } break; case PFSE_ICMP6: icmp6_error(pfse->pfse_m, pfse->icmpopts.type, @@ -2657,7 +2707,9 @@ pf_build_tcp(const struct pf_krule *r, sa_family_t af, #endif /* ALTQ */ m->m_data += max_linkhdr; m->m_pkthdr.len = m->m_len = len; - m->m_pkthdr.rcvif = NULL; + /* The rest of the stack assumes a rcvif, so provide one. + * This is a locally generated packet, so .. close enough. */ + m->m_pkthdr.rcvif = V_loif; bzero(m->m_data, len); switch (af) { #ifdef INET From owner-dev-commits-src-all@freebsd.org Fri Sep 17 17:53:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1204E6B6EB4; Fri, 17 Sep 2021 17:53:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB1m36FYJz4mmT; Fri, 17 Sep 2021 17:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D5DF19F9B; Fri, 17 Sep 2021 17:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HHrtHb061255; Fri, 17 Sep 2021 17:53:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HHrth1061254; Fri, 17 Sep 2021 17:53:55 GMT (envelope-from git) Date: Fri, 17 Sep 2021 17:53:55 GMT Message-Id: <202109171753.18HHrth1061254@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 1e7e7452d59b - stable/13 - pf: fix NOINET6 builds MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 1e7e7452d59bb688479e13df04d95346a2ae48b6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 17:53:56 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=1e7e7452d59bb688479e13df04d95346a2ae48b6 commit 1e7e7452d59bb688479e13df04d95346a2ae48b6 Author: Kristof Provost AuthorDate: 2021-09-10 15:20:39 +0000 Commit: Kristof Provost CommitDate: 2021-09-17 15:55:42 +0000 pf: fix NOINET6 builds MFC after: 1 week Sponsored by: Modirum MDPay (cherry picked from commit 9bdff593ead9434e01cfb6084f21c3e93a22963d) --- sys/netpfil/pf/pf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 42e8f3279599..20e775148b7a 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1486,6 +1486,7 @@ static bool pf_isforlocal(struct mbuf *m, int af) { switch (af) { +#ifdef INET case AF_INET: { struct rm_priotracker in_ifa_tracker; struct ip *ip; @@ -1502,6 +1503,8 @@ pf_isforlocal(struct mbuf *m, int af) IN_IFADDR_RUNLOCK(&in_ifa_tracker); break; } +#endif +#ifdef INET6 case AF_INET6: { struct ip6_hdr *ip6; struct in6_ifaddr *ia; @@ -1511,6 +1514,7 @@ pf_isforlocal(struct mbuf *m, int af) return (false); return (! (ia->ia6_flags & IN6_IFF_NOTREADY)); } +#endif default: panic("Unsupported af %d", af); } From owner-dev-commits-src-all@freebsd.org Fri Sep 17 17:53:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 017D26B6F13; Fri, 17 Sep 2021 17:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB1m26LMCz4mpy; Fri, 17 Sep 2021 17:53:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 965B519F9A; Fri, 17 Sep 2021 17:53:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HHrskA061203; Fri, 17 Sep 2021 17:53:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HHrslw061201; Fri, 17 Sep 2021 17:53:54 GMT (envelope-from git) Date: Fri, 17 Sep 2021 17:53:54 GMT Message-Id: <202109171753.18HHrslw061201@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: d073473bc63c - stable/13 - pf: qid and pqid can be uint16_t MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d073473bc63c4cd6c1aa17f1e6fc5069adb7dd07 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 17:53:55 -0000 The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=d073473bc63c4cd6c1aa17f1e6fc5069adb7dd07 commit d073473bc63c4cd6c1aa17f1e6fc5069adb7dd07 Author: Kristof Provost AuthorDate: 2021-09-07 12:41:37 +0000 Commit: Kristof Provost CommitDate: 2021-09-17 15:55:42 +0000 pf: qid and pqid can be uint16_t tag2name() returns a uint16_t, so we don't need to use uint32_t for the qid (or pqid). This reduces the size of struct pf_kstate slightly. That in turn buys us space to add extra fields for dummynet later. Happily these fields are not exposed to user space (there are user space versions of them, but they can just stay uint32_t), so there's no ABI breakage in modifying this. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31873 (cherry picked from commit b64f7ce98f5286721a38b31fa2180313f800fb1d) --- sys/net/pfvar.h | 12 ++++++------ sys/netpfil/pf/pf_altq.h | 2 +- sys/netpfil/pf/pf_ioctl.c | 14 +++++++------- sys/netpfil/pf/pf_mtag.h | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 2bd8a613b510..1eee2ec36351 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -558,8 +558,8 @@ struct pf_kpool { }; struct pf_rule_actions { - u_int32_t qid; - u_int32_t pqid; + uint16_t qid; + uint16_t pqid; }; union pf_krule_ptr { @@ -603,8 +603,8 @@ struct pf_krule { u_int32_t limit; u_int32_t seconds; } max_src_conn_rate; - u_int32_t qid; - u_int32_t pqid; + u_int16_t qid; + u_int16_t pqid; u_int32_t nr; u_int32_t prob; uid_t cuid; @@ -853,8 +853,8 @@ struct pf_kstate { u_int32_t creation; u_int32_t expire; u_int32_t pfsync_time; - u_int32_t qid; - u_int32_t pqid; + u_int16_t qid; + u_int16_t pqid; u_int16_t tag; u_int8_t log; }; diff --git a/sys/netpfil/pf/pf_altq.h b/sys/netpfil/pf/pf_altq.h index 35d2d5cb8bbe..0b913a19c2ff 100644 --- a/sys/netpfil/pf/pf_altq.h +++ b/sys/netpfil/pf/pf_altq.h @@ -220,7 +220,7 @@ struct pf_kaltq { struct fairq_opts fairq_opts; } pq_u; - uint32_t qid; /* return value */ + uint16_t qid; /* return value */ }; #endif /* _KERNEL */ diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index f367ad9a2800..aac47e5512cf 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -113,8 +113,8 @@ static int pf_rollback_altq(u_int32_t); static int pf_commit_altq(u_int32_t); static int pf_enable_altq(struct pf_altq *); static int pf_disable_altq(struct pf_altq *); -static u_int32_t pf_qname2qid(const char *); -static void pf_qid_unref(u_int32_t); +static uint16_t pf_qname2qid(const char *); +static void pf_qid_unref(uint16_t); #endif /* ALTQ */ static int pf_begin_rules(u_int32_t *, int, const char *); static int pf_rollback_rules(u_int32_t, int, char *); @@ -662,23 +662,23 @@ tag_unref(struct pf_tagset *ts, u_int16_t tag) } } -static u_int16_t +static uint16_t pf_tagname2tag(const char *tagname) { return (tagname2tag(&V_pf_tags, tagname)); } #ifdef ALTQ -static u_int32_t +static uint16_t pf_qname2qid(const char *qname) { - return ((u_int32_t)tagname2tag(&V_pf_qids, qname)); + return (tagname2tag(&V_pf_qids, qname)); } static void -pf_qid_unref(u_int32_t qid) +pf_qid_unref(uint16_t qid) { - tag_unref(&V_pf_qids, (u_int16_t)qid); + tag_unref(&V_pf_qids, qid); } static int diff --git a/sys/netpfil/pf/pf_mtag.h b/sys/netpfil/pf/pf_mtag.h index 2135c9e69dbd..e3f6f85f21d0 100644 --- a/sys/netpfil/pf/pf_mtag.h +++ b/sys/netpfil/pf/pf_mtag.h @@ -47,7 +47,7 @@ struct pf_mtag { void *hdr; /* saved hdr pos in mbuf, for ECN */ - u_int32_t qid; /* queue id */ + u_int16_t qid; /* queue id */ u_int32_t qid_hash; /* queue hashid used by WFQ like algos */ u_int16_t tag; /* tag id */ u_int8_t flags; From owner-dev-commits-src-all@freebsd.org Fri Sep 17 17:53:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5986C6B6EB2; Fri, 17 Sep 2021 17:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB1m30ntLz4mkH; Fri, 17 Sep 2021 17:53:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D70DC19CAE; Fri, 17 Sep 2021 17:53:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HHrsoj061230; Fri, 17 Sep 2021 17:53:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HHrsSS061229; Fri, 17 Sep 2021 17:53:54 GMT (envelope-from git) Date: Fri, 17 Sep 2021 17:53:54 GMT Message-Id: <202109171753.18HHrsSS061229@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: b7d3faaad021 - stable/12 - pf tests: synproxy to localhost test MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: b7d3faaad02163a7731f92ddab08ff79c6496c8f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 17:53:55 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b7d3faaad02163a7731f92ddab08ff79c6496c8f commit b7d3faaad02163a7731f92ddab08ff79c6496c8f Author: Kristof Provost AuthorDate: 2021-06-30 12:22:27 +0000 Commit: Kristof Provost CommitDate: 2021-09-17 15:54:38 +0000 pf tests: synproxy to localhost test Test syn-proxying a connection to the local host. Sponsored by: Modirum MDPay MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31854 (cherry picked from commit 6598cababf6425181a755ec97c3fa66d7ee31393) --- tests/sys/netpfil/pf/synproxy.sh | 83 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/tests/sys/netpfil/pf/synproxy.sh b/tests/sys/netpfil/pf/synproxy.sh index aedbb8885129..66debfe9f925 100755 --- a/tests/sys/netpfil/pf/synproxy.sh +++ b/tests/sys/netpfil/pf/synproxy.sh @@ -79,7 +79,90 @@ synproxy_cleanup() pft_cleanup } +atf_test_case "local" "cleanup" +local_head() +{ + atf_set descr 'Synproxy a locally terminated connection' + atf_set require.user root +} + +local_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a 192.0.2.2/24 up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b 192.0.2.1/24 up + jexec alcatraz /usr/sbin/inetd -p inetd-alcatraz.pid \ + $(atf_get_srcdir)/echo_inetd.conf + + jexec alcatraz pfctl -e + pft_set_rules alcatraz "set fail-policy return" \ + "scrub in all fragment reassemble" \ + "pass in quick on ${epair}b proto tcp from any to any port 7 synproxy state" + + # Sanity check + atf_check -s exit:0 -o ignore ping -c 1 192.0.2.1 + + # Check that we can talk to the jail, after synproxying + reply=$(echo ping | nc -N -w 5 192.0.2.1 7) + if [ "${reply}" != "ping" ]; + then + atf_fail "echo failed" + fi +} + +local_cleanup() +{ + rm -f inetd-alcatraz.pid + pft_cleanup +} + +atf_test_case "local_v6" "cleanup" +local_v6_head() +{ + atf_set descr 'Synproxy (v6) a locally terminated connection' + atf_set require.user root +} + +local_v6_body() +{ + pft_init + + epair=$(vnet_mkepair) + ifconfig ${epair}a inet6 2001:db8:42::1/64 no_dad up + + vnet_mkjail alcatraz ${epair}b + jexec alcatraz ifconfig ${epair}b inet6 2001:db8:42::2/64 no_dad up + jexec alcatraz /usr/sbin/inetd -p inetd-alcatraz.pid \ + $(atf_get_srcdir)/echo_inetd.conf + + jexec alcatraz pfctl -e + pft_set_rules alcatraz "set fail-policy return" \ + "scrub in all fragment reassemble" \ + "pass in quick on ${epair}b proto tcp from any to any port 7 synproxy state" + + # Sanity check + atf_check -s exit:0 -o ignore ping6 -c 1 2001:db8:42::2 + + reply=$(echo ping | nc -N -w 5 2001:db8:42::2 7) + if [ "${reply}" != "ping" ]; + then + atf_fail "echo failed" + fi +} + +local_v6_cleanup() +{ + rm -f inetd-alcatraz.pid + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "synproxy" + atf_add_test_case "local" + atf_add_test_case "local_v6" } From owner-dev-commits-src-all@freebsd.org Fri Sep 17 17:53:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 591486B70EE; Fri, 17 Sep 2021 17:53:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB1m41HHhz4mq4; Fri, 17 Sep 2021 17:53:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02CDB19BA3; Fri, 17 Sep 2021 17:53:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HHrteh061279; Fri, 17 Sep 2021 17:53:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HHrtvk061278; Fri, 17 Sep 2021 17:53:55 GMT (envelope-from git) Date: Fri, 17 Sep 2021 17:53:55 GMT Message-Id: <202109171753.18HHrtvk061278@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 4ef480e600b9 - stable/12 - pf: qid and pqid can be uint16_t MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 4ef480e600b9f48217e58ea688527362846d5982 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 17:53:57 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=4ef480e600b9f48217e58ea688527362846d5982 commit 4ef480e600b9f48217e58ea688527362846d5982 Author: Kristof Provost AuthorDate: 2021-09-07 12:41:37 +0000 Commit: Kristof Provost CommitDate: 2021-09-17 15:54:38 +0000 pf: qid and pqid can be uint16_t tag2name() returns a uint16_t, so we don't need to use uint32_t for the qid (or pqid). This reduces the size of struct pf_kstate slightly. That in turn buys us space to add extra fields for dummynet later. Happily these fields are not exposed to user space (there are user space versions of them, but they can just stay uint32_t), so there's no ABI breakage in modifying this. MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D31873 (cherry picked from commit b64f7ce98f5286721a38b31fa2180313f800fb1d) --- sys/net/pfvar.h | 12 ++++++------ sys/netpfil/pf/pf_altq.h | 2 +- sys/netpfil/pf/pf_ioctl.c | 12 ++++++------ sys/netpfil/pf/pf_mtag.h | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index ffa90555c52e..57d19c6c6018 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -558,8 +558,8 @@ struct pf_kpool { }; struct pf_rule_actions { - u_int32_t qid; - u_int32_t pqid; + uint16_t qid; + uint16_t pqid; }; union pf_krule_ptr { @@ -603,8 +603,8 @@ struct pf_krule { u_int32_t limit; u_int32_t seconds; } max_src_conn_rate; - u_int32_t qid; - u_int32_t pqid; + u_int16_t qid; + u_int16_t pqid; u_int32_t nr; u_int32_t prob; uid_t cuid; @@ -853,8 +853,8 @@ struct pf_kstate { u_int32_t creation; u_int32_t expire; u_int32_t pfsync_time; - u_int32_t qid; - u_int32_t pqid; + u_int16_t qid; + u_int16_t pqid; u_int16_t tag; u_int8_t log; }; diff --git a/sys/netpfil/pf/pf_altq.h b/sys/netpfil/pf/pf_altq.h index 35d2d5cb8bbe..0b913a19c2ff 100644 --- a/sys/netpfil/pf/pf_altq.h +++ b/sys/netpfil/pf/pf_altq.h @@ -220,7 +220,7 @@ struct pf_kaltq { struct fairq_opts fairq_opts; } pq_u; - uint32_t qid; /* return value */ + uint16_t qid; /* return value */ }; #endif /* _KERNEL */ diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index e3d194f92c61..cf17d67cc894 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -113,8 +113,8 @@ static int pf_rollback_altq(u_int32_t); static int pf_commit_altq(u_int32_t); static int pf_enable_altq(struct pf_altq *); static int pf_disable_altq(struct pf_altq *); -static u_int32_t pf_qname2qid(char *); -static void pf_qid_unref(u_int32_t); +static uint16_t pf_qname2qid(char *); +static void pf_qid_unref(uint16_t); #endif /* ALTQ */ static int pf_begin_rules(u_int32_t *, int, const char *); static int pf_rollback_rules(u_int32_t, int, char *); @@ -655,16 +655,16 @@ pf_tagname2tag(char *tagname) } #ifdef ALTQ -static u_int32_t +static uint16_t pf_qname2qid(char *qname) { - return ((u_int32_t)tagname2tag(&V_pf_qids, qname)); + return (tagname2tag(&V_pf_qids, qname)); } static void -pf_qid_unref(u_int32_t qid) +pf_qid_unref(uint16_t qid) { - tag_unref(&V_pf_qids, (u_int16_t)qid); + tag_unref(&V_pf_qids, qid); } static int diff --git a/sys/netpfil/pf/pf_mtag.h b/sys/netpfil/pf/pf_mtag.h index b1402e1ac77f..9f556e262b07 100644 --- a/sys/netpfil/pf/pf_mtag.h +++ b/sys/netpfil/pf/pf_mtag.h @@ -46,7 +46,7 @@ struct pf_mtag { void *hdr; /* saved hdr pos in mbuf, for ECN */ - u_int32_t qid; /* queue id */ + u_int16_t qid; /* queue id */ u_int32_t qid_hash; /* queue hashid used by WFQ like algos */ u_int16_t tag; /* tag id */ u_int8_t flags; From owner-dev-commits-src-all@freebsd.org Fri Sep 17 17:53:58 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C1836B6CC4; Fri, 17 Sep 2021 17:53:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB1m52X45z4mkQ; Fri, 17 Sep 2021 17:53:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1B10D19F9C; Fri, 17 Sep 2021 17:53:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HHrvaQ061341; Fri, 17 Sep 2021 17:53:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HHrve0061340; Fri, 17 Sep 2021 17:53:57 GMT (envelope-from git) Date: Fri, 17 Sep 2021 17:53:57 GMT Message-Id: <202109171753.18HHrve0061340@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: e23d47cd9c75 - stable/12 - pf: fix NOINET6 builds MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e23d47cd9c753644f3b17771824111aba5132fbc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 17:53:58 -0000 The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=e23d47cd9c753644f3b17771824111aba5132fbc commit e23d47cd9c753644f3b17771824111aba5132fbc Author: Kristof Provost AuthorDate: 2021-09-10 15:20:39 +0000 Commit: Kristof Provost CommitDate: 2021-09-17 15:54:39 +0000 pf: fix NOINET6 builds MFC after: 1 week Sponsored by: Modirum MDPay (cherry picked from commit 9bdff593ead9434e01cfb6084f21c3e93a22963d) --- sys/netpfil/pf/pf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 0722a864a574..2401dff57dff 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -1486,6 +1486,7 @@ static bool pf_isforlocal(struct mbuf *m, int af) { switch (af) { +#ifdef INET case AF_INET: { struct rm_priotracker in_ifa_tracker; struct ip *ip; @@ -1502,6 +1503,8 @@ pf_isforlocal(struct mbuf *m, int af) IN_IFADDR_RUNLOCK(&in_ifa_tracker); break; } +#endif +#ifdef INET6 case AF_INET6: { struct ip6_hdr *ip6; struct in6_ifaddr *ia; @@ -1511,6 +1514,7 @@ pf_isforlocal(struct mbuf *m, int af) return (false); return (! (ia->ia6_flags & IN6_IFF_NOTREADY)); } +#endif default: panic("Unsupported af %d", af); } From owner-dev-commits-src-all@freebsd.org Fri Sep 17 17:59:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E58646B7172; Fri, 17 Sep 2021 17:59:01 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB1sx293jz4pgm; Fri, 17 Sep 2021 17:59:01 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.16.1/8.16.1) with ESMTPS id 18HHwxVA039633 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 17 Sep 2021 10:58:59 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.16.1/8.16.1/Submit) id 18HHwwqH039632; Fri, 17 Sep 2021 10:58:58 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Fri, 17 Sep 2021 10:58:58 -0700 From: Gleb Smirnoff To: Mateusz Guzik Cc: kp@freebsd.org, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 5091ca26507b - main - pf: save on branching in the common case in pf_test Message-ID: References: <202108171959.17HJx2lL069856@gitrepo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4HB1sx293jz4pgm X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:27348, ipnet:162.251.186.0/24, country:US] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 17:59:02 -0000 Mateusz, On Tue, Sep 14, 2021 at 05:11:11PM +0200, Mateusz Guzik wrote: M> > On Fri, Sep 10, 2021 at 09:43:06AM +0200, Mateusz Guzik wrote: M> > M> > M> diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c M> > M> > M> index e2dd3eb7c0de..add76c7b98d4 100644 M> > M> > M> --- a/sys/netpfil/pf/pf.c M> > M> > M> +++ b/sys/netpfil/pf/pf.c M> > M> > M> @@ -6151,7 +6151,7 @@ pf_test(int dir, int pflags, struct ifnet M> > *ifp, M> > M> > struct mbuf **m0, struct inpcb * M> > M> > M> M> > M> > M> PF_RULES_RLOCK(); M> > M> > M> M> > M> > M> - if (ip_divert_ptr != NULL && M> > M> > M> + if (__predict_false(ip_divert_ptr != NULL) && M> > M> > M> > M> > This is an optimization for a setup without divert(4) at cost of M> > M> > pessimization M> > M> > for a setup with divert(4). IMHO, __predict_false() predicate should M> > guard M> > M> > against error paths and other unusual events, not favor one setup over M> > M> > other. M> > M> > M> > M> M> > M> divert is non-standard and comes with tons of overhead, so I think M> > M> this is justified. M> > M> > pf is also non-standard and comes with tons of overhead, so what M> > about such change to ip_input(), and similar to ip_output(): M> > M> > diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c M> > index 465c00e4dac..e6feb837114 100644 M> > --- a/sys/netinet/ip_input.c M> > +++ b/sys/netinet/ip_input.c M> > @@ -605,7 +605,7 @@ ip_input(struct mbuf *m) M> > */ M> > M> > /* Jump over all PFIL processing if hooks are not active. */ M> > - if (!PFIL_HOOKED_IN(V_inet_pfil_head)) M> > + if (__predict_true(!PFIL_HOOKED_IN(V_inet_pfil_head))) M> > goto passin; M> > M> > odst = ip->ip_dst; M> > M> > I hope that brings my point. M> > M> > M> The real fix would be to either implement hot patchable branches or M> > M> otherwise generate pf_test always (or never) doing divert without M> > M> having to check for it, but that's far in the future. M> > M> > That would be great, but before we have such tools, I believe optimization M> > for one particular setup at cost of pessimization of other setups is not M> > a way to go. M> > M> M> So happens I would argue the pfil change should also be made, perhaps M> conditional on whether a known consumer is compiled in. Thanks for reply, although makes me think that you wouldn't reply anything unless you really want to proceed with my hyperbolic suggestion :( How deep are you going to go this path? May be if (__predict_true(ip->ip_proto == IPPROTO_TCP && th->th_port == ntohs(443))) A suggestion to get optimization for "non-standard" stuff by compiling it statically sounds like a jump 20 years to the past. M> I guess I should elaborate on how I see things here. M> M> The network stack comes with a rampant branch fest which can be M> significantly reduced in easy ways. For example from ip_input: M> M> #if defined(IPSEC) || defined(IPSEC_SUPPORT) M> /* M> * Bypass packet filtering for packets previously handled by IPsec. M> */ M> if (IPSEC_ENABLED(ipv4) && M> IPSEC_CAPS(ipv4, m, IPSEC_CAP_BYPASS_FILTER) != 0) M> goto passin; M> #endif M> M> Let's say this has to be checked every time. Even then IPSEC_CAPS is a M> func call which induces 2 more func calls, which also branch for no M> reason. Instead the complete result could be computed so that there is M> one bool to check (and even that could be hot patched later on). M> Finally, it should probably be predicted one way or the other. M> M> pf_test is an egregious example of this proble and, the commit at hand M> was a step towards cleaning the state up -- it is not meant to be M> permanent in the current form. The idea is to gradually split it into M> parts which have to be there and parts which are optional, the M> annotation will help going forward and should not measurably hurt M> divert. I understand your concerns, but this is the reality of network. A machine supports multiple protocols and encapsulations or whatever the same time. I understand, that some machines and workloads would work 99% of the time on just one protocol. So you create a benchmark that exercises a particular branch of code for all of the packets and then do optimizations for this particular branch. To justify such changes at least you need to have a second benchmark that would measure how much of pessimization you created for a setup that would have 99% prediction mismatch and document the results in the commit message, like: - improves packet rate without pf hooked in by X% - pessimizes packet rate with pf (empty ruleset) by Y% -- Gleb Smirnoff From owner-dev-commits-src-all@freebsd.org Fri Sep 17 19:12:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 31F60668269; Fri, 17 Sep 2021 19:12:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB3Vj0vtCz3PpC; Fri, 17 Sep 2021 19:12:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F365A1B2C9; Fri, 17 Sep 2021 19:12:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HJCS4P068144; Fri, 17 Sep 2021 19:12:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HJCSQN068143; Fri, 17 Sep 2021 19:12:28 GMT (envelope-from git) Date: Fri, 17 Sep 2021 19:12:28 GMT Message-Id: <202109171912.18HJCSQN068143@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 40fcdb9366d5 - main - kcov: Disable address and memory sanitizers in get_kinfo() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 40fcdb9366d51400259020accaac9df212bd9508 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 19:12:29 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=40fcdb9366d51400259020accaac9df212bd9508 commit 40fcdb9366d51400259020accaac9df212bd9508 Author: Mark Johnston AuthorDate: 2021-09-17 16:12:02 +0000 Commit: Mark Johnston CommitDate: 2021-09-17 18:19:05 +0000 kcov: Disable address and memory sanitizers in get_kinfo() get_kinfo() is only called from the coverage sanitizer callbacks, which are similarly uninstrumented. Sponsored by: The FreeBSD Foundation --- sys/kern/kern_kcov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/kern_kcov.c b/sys/kern/kern_kcov.c index 7a11f800c7ce..1f8b62df7b4b 100644 --- a/sys/kern/kern_kcov.c +++ b/sys/kern/kern_kcov.c @@ -165,7 +165,7 @@ SYSCTL_UINT(_kern_kcov, OID_AUTO, max_entries, CTLFLAG_RW, static struct mtx kcov_lock; static int active_count; -static struct kcov_info * +static struct kcov_info * __nosanitizeaddress __nosanitizememory get_kinfo(struct thread *td) { struct kcov_info *info; From owner-dev-commits-src-all@freebsd.org Fri Sep 17 19:12:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 762FC668294; Fri, 17 Sep 2021 19:12:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB3Vl2przz3Q1Q; Fri, 17 Sep 2021 19:12:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 411E61B48F; Fri, 17 Sep 2021 19:12:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HJCV94068193; Fri, 17 Sep 2021 19:12:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HJCVtv068192; Fri, 17 Sep 2021 19:12:31 GMT (envelope-from git) Date: Fri, 17 Sep 2021 19:12:31 GMT Message-Id: <202109171912.18HJCVtv068192@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: d6e77cda9be1 - main - uma: Show the count of free slabs in each per-domain keg's sysctl tree MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d6e77cda9be1509ea170142cca3ff0d3b9f12e35 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 19:12:31 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d6e77cda9be1509ea170142cca3ff0d3b9f12e35 commit d6e77cda9be1509ea170142cca3ff0d3b9f12e35 Author: Mark Johnston AuthorDate: 2021-09-17 16:13:47 +0000 Commit: Mark Johnston CommitDate: 2021-09-17 18:19:05 +0000 uma: Show the count of free slabs in each per-domain keg's sysctl tree This is useful for measuring the number of pages that could be freed from a NOFREE zone under memory pressure. MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/vm/uma_core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/vm/uma_core.c b/sys/vm/uma_core.c index cdf3d482679e..12cab490781b 100644 --- a/sys/vm/uma_core.c +++ b/sys/vm/uma_core.c @@ -2690,7 +2690,10 @@ zone_alloc_sysctl(uma_zone_t zone, void *unused) "Total pages currently allocated from VM"); SYSCTL_ADD_U32(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, "free_items", CTLFLAG_RD, &dom->ud_free_items, 0, - "items free in the slab layer"); + "Items free in the slab layer"); + SYSCTL_ADD_U32(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, + "free_slabs", CTLFLAG_RD, &dom->ud_free_slabs, 0, + "Unused slabs"); } } else SYSCTL_ADD_CONST_STRING(NULL, SYSCTL_CHILDREN(oid), OID_AUTO, From owner-dev-commits-src-all@freebsd.org Fri Sep 17 19:12:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0971F668293; Fri, 17 Sep 2021 19:12:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB3Vk4PbWz3Q5k; Fri, 17 Sep 2021 19:12:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BD941B2CA; Fri, 17 Sep 2021 19:12:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HJCUcQ068169; Fri, 17 Sep 2021 19:12:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HJCU54068168; Fri, 17 Sep 2021 19:12:30 GMT (envelope-from git) Date: Fri, 17 Sep 2021 19:12:30 GMT Message-Id: <202109171912.18HJCU54068168@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 7fabaac2211e - main - rpc: Convert an SOLISTENING check to an assertion MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7fabaac2211e7ed1cec9650e46f4e03428411dcf Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 19:12:31 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7fabaac2211e7ed1cec9650e46f4e03428411dcf commit 7fabaac2211e7ed1cec9650e46f4e03428411dcf Author: Mark Johnston AuthorDate: 2021-09-17 16:13:02 +0000 Commit: Mark Johnston CommitDate: 2021-09-17 18:19:05 +0000 rpc: Convert an SOLISTENING check to an assertion Per the comment, this socket should always be a listening socket. MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/rpc/svc_vc.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/rpc/svc_vc.c b/sys/rpc/svc_vc.c index d81c0b01d84d..77452d906594 100644 --- a/sys/rpc/svc_vc.c +++ b/sys/rpc/svc_vc.c @@ -328,11 +328,9 @@ svc_vc_accept(struct socket *head, struct socket **sop) int error = 0; short nbio; - /* XXXGL: shouldn't that be an assertion? */ - if (!SOLISTENING(head)) { - error = EINVAL; - goto done; - } + KASSERT(SOLISTENING(head), + ("%s: socket %p is not listening", __func__, head)); + #ifdef MAC error = mac_socket_check_accept(curthread->td_ucred, head); if (error != 0) From owner-dev-commits-src-all@freebsd.org Fri Sep 17 19:12:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41C9366803E; Fri, 17 Sep 2021 19:12:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB3Vn0l3Vz3Plf; Fri, 17 Sep 2021 19:12:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6AC061B41B; Fri, 17 Sep 2021 19:12:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HJCWdL068221; Fri, 17 Sep 2021 19:12:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HJCWIj068220; Fri, 17 Sep 2021 19:12:32 GMT (envelope-from git) Date: Fri, 17 Sep 2021 19:12:32 GMT Message-Id: <202109171912.18HJCWIj068220@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: bf25678226f0 - main - ktls: Fix error/mode confusion in TCP_*TLS_MODE getsockopt handlers MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bf25678226f0d9b52c27610c734c97d76a7cae59 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 19:12:33 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=bf25678226f0d9b52c27610c734c97d76a7cae59 commit bf25678226f0d9b52c27610c734c97d76a7cae59 Author: Mark Johnston AuthorDate: 2021-09-17 16:14:29 +0000 Commit: Mark Johnston CommitDate: 2021-09-17 18:19:05 +0000 ktls: Fix error/mode confusion in TCP_*TLS_MODE getsockopt handlers ktls_get_(rx|tx)_mode() can return an errno value or a TLS mode, so errors are effectively hidden. Fix this by using a separate output parameter. Convert to the new socket buffer locking macros while here. Note that the socket buffer lock is not needed to synchronize the SOLISTENING check here, we can rely on the PCB lock. Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31977 --- sys/kern/uipc_ktls.c | 26 ++++++++++++-------------- sys/netinet/tcp_usrreq.c | 12 ++++++++---- sys/sys/ktls.h | 4 ++-- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/sys/kern/uipc_ktls.c b/sys/kern/uipc_ktls.c index 9e9a6b5b60fb..bc21e6fe2493 100644 --- a/sys/kern/uipc_ktls.c +++ b/sys/kern/uipc_ktls.c @@ -1199,45 +1199,43 @@ ktls_enable_tx(struct socket *so, struct tls_enable *en) } int -ktls_get_rx_mode(struct socket *so) +ktls_get_rx_mode(struct socket *so, int *modep) { struct ktls_session *tls; struct inpcb *inp; - int mode; if (SOLISTENING(so)) return (EINVAL); inp = so->so_pcb; INP_WLOCK_ASSERT(inp); - SOCKBUF_LOCK(&so->so_rcv); + SOCK_RECVBUF_LOCK(so); tls = so->so_rcv.sb_tls_info; if (tls == NULL) - mode = TCP_TLS_MODE_NONE; + *modep = TCP_TLS_MODE_NONE; else - mode = tls->mode; - SOCKBUF_UNLOCK(&so->so_rcv); - return (mode); + *modep = tls->mode; + SOCK_RECVBUF_UNLOCK(so); + return (0); } int -ktls_get_tx_mode(struct socket *so) +ktls_get_tx_mode(struct socket *so, int *modep) { struct ktls_session *tls; struct inpcb *inp; - int mode; if (SOLISTENING(so)) return (EINVAL); inp = so->so_pcb; INP_WLOCK_ASSERT(inp); - SOCKBUF_LOCK(&so->so_snd); + SOCK_SENDBUF_LOCK(so); tls = so->so_snd.sb_tls_info; if (tls == NULL) - mode = TCP_TLS_MODE_NONE; + *modep = TCP_TLS_MODE_NONE; else - mode = tls->mode; - SOCKBUF_UNLOCK(&so->so_snd); - return (mode); + *modep = tls->mode; + SOCK_SENDBUF_UNLOCK(so); + return (0); } /* diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 3a1608cc106a..e9f7fa541461 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -2563,14 +2563,18 @@ unhold: #endif #ifdef KERN_TLS case TCP_TXTLS_MODE: - optval = ktls_get_tx_mode(so); + error = ktls_get_tx_mode(so, &optval); INP_WUNLOCK(inp); - error = sooptcopyout(sopt, &optval, sizeof(optval)); + if (error == 0) + error = sooptcopyout(sopt, &optval, + sizeof(optval)); break; case TCP_RXTLS_MODE: - optval = ktls_get_rx_mode(so); + error = ktls_get_rx_mode(so, &optval); INP_WUNLOCK(inp); - error = sooptcopyout(sopt, &optval, sizeof(optval)); + if (error == 0) + error = sooptcopyout(sopt, &optval, + sizeof(optval)); break; #endif case TCP_LRD: diff --git a/sys/sys/ktls.h b/sys/sys/ktls.h index 9729fd6fe8c4..71d55ee1b3d8 100644 --- a/sys/sys/ktls.h +++ b/sys/sys/ktls.h @@ -212,9 +212,9 @@ void ktls_frame(struct mbuf *m, struct ktls_session *tls, int *enqueue_cnt, void ktls_seq(struct sockbuf *sb, struct mbuf *m); void ktls_enqueue(struct mbuf *m, struct socket *so, int page_count); void ktls_enqueue_to_free(struct mbuf *m); -int ktls_get_rx_mode(struct socket *so); +int ktls_get_rx_mode(struct socket *so, int *modep); int ktls_set_tx_mode(struct socket *so, int mode); -int ktls_get_tx_mode(struct socket *so); +int ktls_get_tx_mode(struct socket *so, int *modep); int ktls_output_eagain(struct inpcb *inp, struct ktls_session *tls); #ifdef RATELIMIT int ktls_modify_txrtlmt(struct ktls_session *tls, uint64_t max_pacing_rate); From owner-dev-commits-src-all@freebsd.org Fri Sep 17 19:12:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DE5B16B7F66; Fri, 17 Sep 2021 19:12:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB3Vn52F6z3Q5y; Fri, 17 Sep 2021 19:12:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C4491B603; Fri, 17 Sep 2021 19:12:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HJCXr2068250; Fri, 17 Sep 2021 19:12:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HJCXAI068249; Fri, 17 Sep 2021 19:12:33 GMT (envelope-from git) Date: Fri, 17 Sep 2021 19:12:33 GMT Message-Id: <202109171912.18HJCXAI068249@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: dfcef8771484 - main - socket: Fix a use-after-free in soclose() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dfcef8771484271f2bccdb1dbc088a838441c5a7 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 19:12:34 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=dfcef8771484271f2bccdb1dbc088a838441c5a7 commit dfcef8771484271f2bccdb1dbc088a838441c5a7 Author: Mark Johnston AuthorDate: 2021-09-17 16:26:06 +0000 Commit: Mark Johnston CommitDate: 2021-09-17 18:19:05 +0000 socket: Fix a use-after-free in soclose() After releasing the fd reference to a socket "so", we should avoid testing SOLISTENING(so) since the socket may have been freed. Instead, directly test whether the list of unaccepted sockets is empty. Fixes: f4bb1869ddd2 ("Consistently use the SOLISTENING() macro") Pointy hat: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31973 --- sys/kern/uipc_socket.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 95222a1ecf7b..f1a3b5acc827 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1223,6 +1223,7 @@ int soclose(struct socket *so) { struct accept_queue lqueue; + struct socket *sp, *tsp; int error = 0; KASSERT(!(so->so_state & SS_NOFDREF), ("soclose: SS_NOFDREF on enter")); @@ -1257,11 +1258,9 @@ drop: if (so->so_proto->pr_usrreqs->pru_close != NULL) (*so->so_proto->pr_usrreqs->pru_close)(so); + TAILQ_INIT(&lqueue); SOCK_LOCK(so); if (SOLISTENING(so)) { - struct socket *sp; - - TAILQ_INIT(&lqueue); TAILQ_SWAP(&lqueue, &so->sol_incomp, socket, so_list); TAILQ_CONCAT(&lqueue, &so->sol_comp, so_list); @@ -1279,17 +1278,14 @@ drop: KASSERT((so->so_state & SS_NOFDREF) == 0, ("soclose: NOFDREF")); so->so_state |= SS_NOFDREF; sorele(so); - if (SOLISTENING(so)) { - struct socket *sp, *tsp; - - TAILQ_FOREACH_SAFE(sp, &lqueue, so_list, tsp) { - SOCK_LOCK(sp); - if (sp->so_count == 0) { - SOCK_UNLOCK(sp); - soabort(sp); - } else - /* sp is now in sofree() */ - SOCK_UNLOCK(sp); + TAILQ_FOREACH_SAFE(sp, &lqueue, so_list, tsp) { + SOCK_LOCK(sp); + if (refcount_load(&sp->so_count) == 0) { + SOCK_UNLOCK(sp); + soabort(sp); + } else { + /* sp is now in sofree() */ + SOCK_UNLOCK(sp); } } CURVNET_RESTORE(); From owner-dev-commits-src-all@freebsd.org Fri Sep 17 19:12:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 67F0D6681C6; Fri, 17 Sep 2021 19:12:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB3Vs1BLYz3Q1r; Fri, 17 Sep 2021 19:12:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 033071B491; Fri, 17 Sep 2021 19:12:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HJCa1i068322; Fri, 17 Sep 2021 19:12:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HJCaPI068321; Fri, 17 Sep 2021 19:12:36 GMT (envelope-from git) Date: Fri, 17 Sep 2021 19:12:36 GMT Message-Id: <202109171912.18HJCaPI068321@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: ade1daa5c0d6 - main - socket: Synchronize soshutdown() with listen(2) and AIO MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ade1daa5c0d66b9086f9066297ed984932b5e212 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 19:12:37 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ade1daa5c0d66b9086f9066297ed984932b5e212 commit ade1daa5c0d66b9086f9066297ed984932b5e212 Author: Mark Johnston AuthorDate: 2021-09-17 16:29:28 +0000 Commit: Mark Johnston CommitDate: 2021-09-17 18:19:06 +0000 socket: Synchronize soshutdown() with listen(2) and AIO To handle shutdown(SHUT_RD) we flush the receive buffer of the socket. This may involve searching for control messages of type SCM_RIGHTS, since we need to close the file references. Closing arbitrary files with socket buffer locks held is undesirable, mainly due to lock ordering issues, so we instead make a copy of the socket buffer and operate on that without any locks. Fields in the original buffer are cleared. This behaviour clobbered the AIO job queue associated with a receive buffer. It could also cause us to leak a KTLS session reference. Reorder socket buffer fields to address this. An alternate solution would be to remove the hack in sorflush(), but this is not quite feasible (yet). In particular, though sorflush() flags the sockbuf with SBS_CANTRCVMORE, it is possible for more data to be queued - the flag just prevents userspace from reading more data. I suspect we should fix this; SBS_CANTRCVMORE represents a terminal state and protocols can likely just drop any data destined for such a buffer. Many of them already do, but in some cases the check is racy, and some KPI churn will be needed to fix everything. This approach is more straightforward for now. Reported by: syzbot+104d8ee3430361cb2795@syzkaller.appspotmail.com Reported by: syzbot+5bd2e7d05f84a59d0d1b@syzkaller.appspotmail.com Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31976 --- sys/kern/uipc_socket.c | 54 ++++++++++++++++++++++++++++++-------------------- sys/sys/sockbuf.h | 5 +++-- 2 files changed, 35 insertions(+), 24 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index c3f52a4640d3..1f999108dd71 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -2847,13 +2847,14 @@ soreceive(struct socket *so, struct sockaddr **psa, struct uio *uio, int soshutdown(struct socket *so, int how) { - struct protosw *pr = so->so_proto; + struct protosw *pr; int error, soerror_enotconn; if (!(how == SHUT_RD || how == SHUT_WR || how == SHUT_RDWR)) return (EINVAL); soerror_enotconn = 0; + SOCK_LOCK(so); if ((so->so_state & (SS_ISCONNECTED | SS_ISCONNECTING | SS_ISDISCONNECTING)) == 0) { /* @@ -2865,21 +2866,26 @@ soshutdown(struct socket *so, int how) * both backward-compatibility and POSIX requirements by forcing * ENOTCONN but still asking protocol to perform pru_shutdown(). */ - if (so->so_type != SOCK_DGRAM && !SOLISTENING(so)) + if (so->so_type != SOCK_DGRAM && !SOLISTENING(so)) { + SOCK_UNLOCK(so); return (ENOTCONN); + } soerror_enotconn = 1; } if (SOLISTENING(so)) { if (how != SHUT_WR) { - SOLISTEN_LOCK(so); so->so_error = ECONNABORTED; solisten_wakeup(so); /* unlocks so */ + } else { + SOCK_UNLOCK(so); } goto done; } + SOCK_UNLOCK(so); CURVNET_SET(so->so_vnet); + pr = so->so_proto; if (pr->pr_usrreqs->pru_flush != NULL) (*pr->pr_usrreqs->pru_flush)(so, how); if (how != SHUT_WR) @@ -2900,20 +2906,21 @@ done: void sorflush(struct socket *so) { - struct sockbuf *sb = &so->so_rcv; - struct protosw *pr = so->so_proto; struct socket aso; + struct protosw *pr; int error; VNET_SO_ASSERT(so); /* * In order to avoid calling dom_dispose with the socket buffer mutex - * held, and in order to generally avoid holding the lock for a long - * time, we make a copy of the socket buffer and clear the original - * (except locks, state). The new socket buffer copy won't have - * initialized locks so we can only call routines that won't use or - * assert those locks. + * held, we make a partial copy of the socket buffer and clear the + * original. The new socket buffer copy won't have initialized locks so + * we can only call routines that won't use or assert those locks. + * Ideally calling socantrcvmore() would prevent data from being added + * to the buffer, but currently it merely prevents buffered data from + * being read by userspace. We make this effort to free buffered data + * nonetheless. * * Dislodge threads currently blocked in receive and wait to acquire * a lock against other simultaneous readers before clearing the @@ -2921,28 +2928,31 @@ sorflush(struct socket *so) * despite any existing socket disposition on interruptable waiting. */ socantrcvmore(so); + error = SOCK_IO_RECV_LOCK(so, SBL_WAIT | SBL_NOINTR); - KASSERT(error == 0, ("%s: cannot lock sock %p recv buffer", - __func__, so)); + if (error != 0) { + KASSERT(SOLISTENING(so), + ("%s: soiolock(%p) failed", __func__, so)); + return; + } - /* - * Invalidate/clear most of the sockbuf structure, but leave selinfo - * and mutex data unchanged. - */ - SOCKBUF_LOCK(sb); + SOCK_RECVBUF_LOCK(so); bzero(&aso, sizeof(aso)); aso.so_pcb = so->so_pcb; - bcopy(&sb->sb_startzero, &aso.so_rcv.sb_startzero, - sizeof(*sb) - offsetof(struct sockbuf, sb_startzero)); - bzero(&sb->sb_startzero, - sizeof(*sb) - offsetof(struct sockbuf, sb_startzero)); - SOCKBUF_UNLOCK(sb); + bcopy(&so->so_rcv.sb_startzero, &aso.so_rcv.sb_startzero, + offsetof(struct sockbuf, sb_endzero) - + offsetof(struct sockbuf, sb_startzero)); + bzero(&so->so_rcv.sb_startzero, + offsetof(struct sockbuf, sb_endzero) - + offsetof(struct sockbuf, sb_startzero)); + SOCK_RECVBUF_UNLOCK(so); SOCK_IO_RECV_UNLOCK(so); /* * Dispose of special rights and flush the copied socket. Don't call * any unsafe routines (that rely on locks being initialized) on aso. */ + pr = so->so_proto; if (pr->pr_flags & PR_RIGHTS && pr->pr_domain->dom_dispose != NULL) (*pr->pr_domain->dom_dispose)(&aso); sbrelease_internal(&aso.so_rcv, so); diff --git a/sys/sys/sockbuf.h b/sys/sys/sockbuf.h index 3fc9b10cd240..eb35a372cae5 100644 --- a/sys/sys/sockbuf.h +++ b/sys/sys/sockbuf.h @@ -104,12 +104,13 @@ struct sockbuf { u_int sb_tlsdcc; /* (a) TLS characters being decrypted */ int sb_lowat; /* (a) low water mark */ sbintime_t sb_timeo; /* (a) timeout for read/write */ - uint64_t sb_tls_seqno; /* (a) TLS seqno */ - struct ktls_session *sb_tls_info; /* (a + b) TLS state */ struct mbuf *sb_mtls; /* (a) TLS mbuf chain */ struct mbuf *sb_mtlstail; /* (a) last mbuf in TLS chain */ int (*sb_upcall)(struct socket *, void *, int); /* (a) */ void *sb_upcallarg; /* (a) */ +#define sb_endzero sb_tls_seqno + uint64_t sb_tls_seqno; /* (a) TLS seqno */ + struct ktls_session *sb_tls_info; /* (a + b) TLS state */ TAILQ_HEAD(, kaiocb) sb_aiojobq; /* (a) pending AIO ops */ struct task sb_aiotask; /* AIO task */ }; From owner-dev-commits-src-all@freebsd.org Fri Sep 17 19:12:35 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 18377668385; Fri, 17 Sep 2021 19:12:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB3Vp6x3pz3Q1j; Fri, 17 Sep 2021 19:12:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B44B51B604; Fri, 17 Sep 2021 19:12:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HJCYmk068274; Fri, 17 Sep 2021 19:12:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HJCYtH068273; Fri, 17 Sep 2021 19:12:34 GMT (envelope-from git) Date: Fri, 17 Sep 2021 19:12:34 GMT Message-Id: <202109171912.18HJCYtH068273@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 6b288408ca32 - main - socket: Add assertions around naked refcount decrements MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6b288408ca32e68c74f6ab12324448ab4862a045 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 19:12:35 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=6b288408ca32e68c74f6ab12324448ab4862a045 commit 6b288408ca32e68c74f6ab12324448ab4862a045 Author: Mark Johnston AuthorDate: 2021-09-17 16:26:56 +0000 Commit: Mark Johnston CommitDate: 2021-09-17 18:19:06 +0000 socket: Add assertions around naked refcount decrements Sockets in a listen queue hold a reference to the parent listening socket. Several code paths release this reference manually when moving a child socket out of the queue. Replace comments about the expected post-decrement refcount value with assertions. Use refcount_load() instead of a plain load. No functional change intended. MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31974 --- sys/kern/uipc_socket.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index f1a3b5acc827..9e898861f8f4 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -1120,11 +1120,12 @@ void sofree(struct socket *so) { struct protosw *pr = so->so_proto; + bool last __diagused; SOCK_LOCK_ASSERT(so); - if ((so->so_state & SS_NOFDREF) == 0 || so->so_count != 0 || - (so->so_state & SS_PROTOREF) || (so->so_qstate == SQ_COMP)) { + if ((so->so_state & (SS_NOFDREF | SS_PROTOREF)) != SS_NOFDREF || + refcount_load(&so->so_count) != 0 || so->so_qstate == SQ_COMP) { SOCK_UNLOCK(so); return; } @@ -1160,8 +1161,9 @@ sofree(struct socket *so) __func__, so, sol)); TAILQ_REMOVE(&sol->sol_incomp, so, so_list); sol->sol_incqlen--; - /* This is guarenteed not to be the last. */ - refcount_release(&sol->so_count); + last = refcount_release(&sol->so_count); + KASSERT(!last, ("%s: released last reference for %p", + __func__, sol)); so->so_qstate = SQ_NONE; so->so_listen = NULL; } else @@ -1169,7 +1171,7 @@ sofree(struct socket *so) ("%s: so %p not on (in)comp with so_listen", __func__, so)); sorele(sol); - KASSERT(so->so_count == 1, + KASSERT(refcount_load(&so->so_count) == 1, ("%s: so %p count %u", __func__, so, so->so_count)); so->so_count = 0; } @@ -1225,6 +1227,7 @@ soclose(struct socket *so) struct accept_queue lqueue; struct socket *sp, *tsp; int error = 0; + bool last __diagused; KASSERT(!(so->so_state & SS_NOFDREF), ("soclose: SS_NOFDREF on enter")); @@ -1271,8 +1274,9 @@ drop: sp->so_qstate = SQ_NONE; sp->so_listen = NULL; SOCK_UNLOCK(sp); - /* Guaranteed not to be the last. */ - refcount_release(&so->so_count); + last = refcount_release(&so->so_count); + KASSERT(!last, ("%s: released last reference for %p", + __func__, so)); } } KASSERT((so->so_state & SS_NOFDREF) == 0, ("soclose: NOFDREF")); @@ -1284,7 +1288,7 @@ drop: SOCK_UNLOCK(sp); soabort(sp); } else { - /* sp is now in sofree() */ + /* See the handling of queued sockets in sofree(). */ SOCK_UNLOCK(sp); } } @@ -4010,6 +4014,7 @@ soisconnecting(struct socket *so) void soisconnected(struct socket *so) { + bool last __diagused; SOCK_LOCK(so); so->so_state &= ~(SS_ISCONNECTING|SS_ISDISCONNECTING|SS_ISCONFIRMING); @@ -4042,8 +4047,9 @@ soisconnected(struct socket *so) sorele(head); return; } - /* Not the last one, as so holds a ref. */ - refcount_release(&head->so_count); + last = refcount_release(&head->so_count); + KASSERT(!last, ("%s: released last reference for %p", + __func__, head)); } again: if ((so->so_options & SO_ACCEPTFILTER) == 0) { From owner-dev-commits-src-all@freebsd.org Fri Sep 17 19:12:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 457DD6681C2; Fri, 17 Sep 2021 19:12:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB3Vr0c4dz3Q3Y; Fri, 17 Sep 2021 19:12:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0C981B269; Fri, 17 Sep 2021 19:12:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HJCZDe068298; Fri, 17 Sep 2021 19:12:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HJCZBq068297; Fri, 17 Sep 2021 19:12:35 GMT (envelope-from git) Date: Fri, 17 Sep 2021 19:12:35 GMT Message-Id: <202109171912.18HJCZBq068297@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 883761f0a81a - main - socket: Remove NOFREE from the socket zone MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 883761f0a81af392893b235632159b15b898e4c6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 19:12:36 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=883761f0a81af392893b235632159b15b898e4c6 commit 883761f0a81af392893b235632159b15b898e4c6 Author: Mark Johnston AuthorDate: 2021-09-17 16:27:26 +0000 Commit: Mark Johnston CommitDate: 2021-09-17 18:19:06 +0000 socket: Remove NOFREE from the socket zone This flag was added during the transition away from the legacy zone allocator, commit c897b81311792ccf6a93feff2a405e2ae53f664e. The old zone allocator effectively provided _NOFREE semantics, but it seems that they are not required for sockets. In particular, we use reference counting to keep sockets live. One somewhat dangerous case is sonewconn(), which returns a pointer to a socket with reference count 0. This socket is still effectively owned by the listening socket. Protocols must therefore be careful to synchronize sonewconn() calls with their pru_close implementations, since for listening sockets soclose() will abort the child sockets. For example, TCP holds the listening socket's PCB read locked across the sonewconn() call, which blocks tcp_usr_close(), and sofree() synchronizes with a concurrent soabort() of the nascent socket. However, _NOFREE semantics are not required here. Eliminating _NOFREE has several benefits: it enables use-after-free detection (e.g., by KASAN) and lets the system reclaim memory from the socket zone under memory pressure. No functional change intended. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31975 --- sys/kern/uipc_socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 9e898861f8f4..c3f52a4640d3 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -309,7 +309,7 @@ socket_init(void *tag) { socket_zone = uma_zcreate("socket", sizeof(struct socket), NULL, NULL, - NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + NULL, NULL, UMA_ALIGN_PTR, 0); maxsockets = uma_zone_set_max(socket_zone, maxsockets); uma_zone_set_warning(socket_zone, "kern.ipc.maxsockets limit reached"); EVENTHANDLER_REGISTER(maxsockets_change, socket_zone_change, NULL, From owner-dev-commits-src-all@freebsd.org Fri Sep 17 19:12:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B1FEE6682AF; Fri, 17 Sep 2021 19:12:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB3Vv6hrfz3Q23; Fri, 17 Sep 2021 19:12:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 429091B605; Fri, 17 Sep 2021 19:12:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HJCd2W068376; Fri, 17 Sep 2021 19:12:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HJCdm4068375; Fri, 17 Sep 2021 19:12:39 GMT (envelope-from git) Date: Fri, 17 Sep 2021 19:12:39 GMT Message-Id: <202109171912.18HJCdm4068375@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 2bd9826995ca - main - vfs: Permit unix sockets to be opened with O_PATH MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2bd9826995ca6b23f8b088cfa035c0ad1c578ac3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 19:12:40 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=2bd9826995ca6b23f8b088cfa035c0ad1c578ac3 commit 2bd9826995ca6b23f8b088cfa035c0ad1c578ac3 Author: Mark Johnston AuthorDate: 2021-09-17 16:34:21 +0000 Commit: Mark Johnston CommitDate: 2021-09-17 18:19:06 +0000 vfs: Permit unix sockets to be opened with O_PATH As with FIFOs, a path descriptor for a unix socket cannot be used with kevent(). In principle connectat(2) and bindat(2) could be modified to support an AT_EMPTY_PATH-like mode which operates on the socket referenced by an O_PATH fd referencing a unix socket. That would eliminate the path length limit imposed by sockaddr_un. Update O_PATH tests. Reviewed by: kib MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31970 --- sys/kern/vfs_vnops.c | 11 ++++------- tests/sys/file/path_test.c | 32 ++++++++++++++++++++++++++++---- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c index 93d5a9e6b127..d4229160f11e 100644 --- a/sys/kern/vfs_vnops.c +++ b/sys/kern/vfs_vnops.c @@ -399,13 +399,13 @@ vn_open_vnode(struct vnode *vp, int fmode, struct ucred *cred, if ((fmode & O_PATH) == 0 || (fmode & FEXEC) != 0) return (EMLINK); } - if (vp->v_type == VSOCK) - return (EOPNOTSUPP); if (vp->v_type != VDIR && fmode & O_DIRECTORY) return (ENOTDIR); accmode = 0; if ((fmode & O_PATH) == 0) { + if (vp->v_type == VSOCK) + return (EOPNOTSUPP); if ((fmode & (FWRITE | O_TRUNC)) != 0) { if (vp->v_type == VDIR) return (EISDIR); @@ -437,11 +437,8 @@ vn_open_vnode(struct vnode *vp, int fmode, struct ucred *cred, return (error); } if ((fmode & O_PATH) != 0) { - if (vp->v_type == VFIFO) - error = EPIPE; - else - error = VOP_ACCESS(vp, VREAD, cred, td); - if (error == 0) + if (vp->v_type != VFIFO && vp->v_type != VSOCK && + VOP_ACCESS(vp, VREAD, cred, td) == 0) fp->f_flag |= FKQALLOWED; return (0); } diff --git a/tests/sys/file/path_test.c b/tests/sys/file/path_test.c index ad88c691a914..a39862cc78d6 100644 --- a/tests/sys/file/path_test.c +++ b/tests/sys/file/path_test.c @@ -845,13 +845,15 @@ ATF_TC_BODY(path_rights, tc) CHECKED_CLOSE(sd[1]); } -/* Verify that a local socket can't be opened with O_PATH. */ +/* Verify that a local socket can be opened with O_PATH. */ ATF_TC_WITHOUT_HEAD(path_unix); ATF_TC_BODY(path_unix, tc) { - char path[PATH_MAX]; + char buf[BUFSIZ], path[PATH_MAX]; + struct kevent ev; struct sockaddr_un sun; - int pathfd, sd; + struct stat sb; + int kq, pathfd, sd; snprintf(path, sizeof(path), "path_unix.XXXXXX"); ATF_REQUIRE_MSG(mktemp(path) == path, FMT_ERR("mktemp")); @@ -866,9 +868,31 @@ ATF_TC_BODY(path_unix, tc) FMT_ERR("bind")); pathfd = open(path, O_PATH); - ATF_REQUIRE_ERRNO(EOPNOTSUPP, pathfd < 0); + ATF_REQUIRE_MSG(pathfd >= 0, FMT_ERR("open")); + + ATF_REQUIRE_MSG(fstatat(pathfd, "", &sb, AT_EMPTY_PATH) == 0, + FMT_ERR("fstatat")); + ATF_REQUIRE_MSG(sb.st_mode & S_IFSOCK, "socket mode %#x", sb.st_mode); + ATF_REQUIRE_MSG(sb.st_ino != 0, "socket has inode number 0"); + + memset(buf, 0, sizeof(buf)); + ATF_REQUIRE_ERRNO(EBADF, write(pathfd, buf, sizeof(buf))); + ATF_REQUIRE_ERRNO(EBADF, read(pathfd, buf, sizeof(buf))); + + /* kevent() is disallowed with sockets. */ + kq = kqueue(); + ATF_REQUIRE_MSG(kq >= 0, FMT_ERR("kqueue")); + EV_SET(&ev, pathfd, EVFILT_READ, EV_ADD | EV_ENABLE, 0, 0, 0); + ATF_REQUIRE_ERRNO(EBADF, kevent(kq, &ev, 1, NULL, 0, NULL) == -1); + + /* Should not be able to open a socket without O_PATH. */ + ATF_REQUIRE_ERRNO(EOPNOTSUPP, openat(pathfd, "", O_EMPTY_PATH) == -1); + + ATF_REQUIRE_MSG(funlinkat(AT_FDCWD, path, pathfd, 0) == 0, + FMT_ERR("funlinkat")); CHECKED_CLOSE(sd); + CHECKED_CLOSE(pathfd); } ATF_TP_ADD_TCS(tp) From owner-dev-commits-src-all@freebsd.org Fri Sep 17 19:12:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA7416B785E; Fri, 17 Sep 2021 19:12:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB3Vt4GQFz3Q7n; Fri, 17 Sep 2021 19:12:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 251BA1B26A; Fri, 17 Sep 2021 19:12:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HJCcn3068348; Fri, 17 Sep 2021 19:12:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HJCcWK068347; Fri, 17 Sep 2021 19:12:38 GMT (envelope-from git) Date: Fri, 17 Sep 2021 19:12:38 GMT Message-Id: <202109171912.18HJCcWK068347@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: c13f6dd7d213 - main - aio_test: Validate interactions between AIO on sockets and shutdown(2) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c13f6dd7d213cf08a26ed9a08290e239b49c25c4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 19:12:39 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=c13f6dd7d213cf08a26ed9a08290e239b49c25c4 commit c13f6dd7d213cf08a26ed9a08290e239b49c25c4 Author: Mark Johnston AuthorDate: 2021-09-17 16:31:59 +0000 Commit: Mark Johnston CommitDate: 2021-09-17 18:19:06 +0000 aio_test: Validate interactions between AIO on sockets and shutdown(2) Reviewed by: asomers, jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31976 --- tests/sys/aio/aio_test.c | 68 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/tests/sys/aio/aio_test.c b/tests/sys/aio/aio_test.c index a81cb906e38a..c3cf1d372e23 100644 --- a/tests/sys/aio/aio_test.c +++ b/tests/sys/aio/aio_test.c @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -1319,6 +1320,72 @@ ATF_TC_BODY(aio_socket_short_write_cancel, tc) close(s[0]); } +/* + * Test handling of aio_read() and aio_write() on shut-down sockets. + */ +ATF_TC_WITHOUT_HEAD(aio_socket_shutdown); +ATF_TC_BODY(aio_socket_shutdown, tc) +{ + struct aiocb iocb; + sigset_t set; + char *buffer; + ssize_t len; + size_t bsz; + int error, s[2]; + + ATF_REQUIRE_KERNEL_MODULE("aio"); + + ATF_REQUIRE(socketpair(PF_UNIX, SOCK_STREAM, 0, s) != -1); + + bsz = 1024; + buffer = malloc(bsz); + memset(buffer, 0, bsz); + + /* Put some data in s[0]'s recv buffer. */ + ATF_REQUIRE(send(s[1], buffer, bsz, 0) == (ssize_t)bsz); + + /* No more reading from s[0]. */ + ATF_REQUIRE(shutdown(s[0], SHUT_RD) != -1); + + ATF_REQUIRE(buffer != NULL); + + memset(&iocb, 0, sizeof(iocb)); + iocb.aio_fildes = s[0]; + iocb.aio_buf = buffer; + iocb.aio_nbytes = bsz; + ATF_REQUIRE(aio_read(&iocb) == 0); + + /* Expect to see zero bytes, analogous to recv(2). */ + while ((error = aio_error(&iocb)) == EINPROGRESS) + usleep(25000); + ATF_REQUIRE_MSG(error == 0, "aio_error() returned %d", error); + len = aio_return(&iocb); + ATF_REQUIRE_MSG(len == 0, "read job returned %zd bytes", len); + + /* No more writing to s[1]. */ + ATF_REQUIRE(shutdown(s[1], SHUT_WR) != -1); + + /* Block SIGPIPE so that we can detect the error in-band. */ + sigemptyset(&set); + sigaddset(&set, SIGPIPE); + ATF_REQUIRE(sigprocmask(SIG_BLOCK, &set, NULL) == 0); + + memset(&iocb, 0, sizeof(iocb)); + iocb.aio_fildes = s[1]; + iocb.aio_buf = buffer; + iocb.aio_nbytes = bsz; + ATF_REQUIRE(aio_write(&iocb) == 0); + + /* Expect an error, analogous to send(2). */ + while ((error = aio_error(&iocb)) == EINPROGRESS) + usleep(25000); + ATF_REQUIRE_MSG(error == EPIPE, "aio_error() returned %d", error); + + ATF_REQUIRE(close(s[0]) != -1); + ATF_REQUIRE(close(s[1]) != -1); + free(buffer); +} + /* * test aio_fsync's behavior with bad inputs */ @@ -1885,6 +1952,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, aio_socket_listen_fail); ATF_TP_ADD_TC(tp, aio_socket_listen_pending); ATF_TP_ADD_TC(tp, aio_socket_short_write_cancel); + ATF_TP_ADD_TC(tp, aio_socket_shutdown); ATF_TP_ADD_TC(tp, aio_writev_dos_iov_len); ATF_TP_ADD_TC(tp, aio_writev_dos_iovcnt); ATF_TP_ADD_TC(tp, aio_writev_efault); From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:05:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E283B66A100; Fri, 17 Sep 2021 21:05:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB60d5pQzz4f1D; Fri, 17 Sep 2021 21:05:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A2D561D085; Fri, 17 Sep 2021 21:05:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HL556I014982; Fri, 17 Sep 2021 21:05:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HL55YB014981; Fri, 17 Sep 2021 21:05:05 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:05:05 GMT Message-Id: <202109172105.18HL55YB014981@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: a4378873e9ce - main - e1000: Revert Update intel shared code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a4378873e9ce1b35b55378c21f8eae69e58c2525 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:05:06 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a4378873e9ce1b35b55378c21f8eae69e58c2525 commit a4378873e9ce1b35b55378c21f8eae69e58c2525 Author: Kevin Bowling AuthorDate: 2021-09-08 22:43:13 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:03:08 +0000 e1000: Revert Update intel shared code This reverts commit fc7682b17f3738573099b8b03f5628dcc8148adb. This will be done incrementally to help with bisecting an issue in later I21x devices (ich8lan). PR: 258153 Approved by: imp MFC after: 1 day --- sys/dev/e1000/e1000_80003es2lan.c | 36 ++--- sys/dev/e1000/e1000_80003es2lan.h | 38 ++--- sys/dev/e1000/e1000_82540.c | 40 ++--- sys/dev/e1000/e1000_82541.c | 40 ++--- sys/dev/e1000/e1000_82541.h | 40 ++--- sys/dev/e1000/e1000_82542.c | 40 ++--- sys/dev/e1000/e1000_82543.c | 40 ++--- sys/dev/e1000/e1000_82543.h | 40 ++--- sys/dev/e1000/e1000_82571.c | 42 ++--- sys/dev/e1000/e1000_82571.h | 40 ++--- sys/dev/e1000/e1000_82575.c | 40 ++--- sys/dev/e1000/e1000_82575.h | 40 ++--- sys/dev/e1000/e1000_api.c | 56 +++---- sys/dev/e1000/e1000_api.h | 41 +++-- sys/dev/e1000/e1000_defines.h | 73 +++------ sys/dev/e1000/e1000_hw.h | 42 +++-- sys/dev/e1000/e1000_i210.c | 140 +++-------------- sys/dev/e1000/e1000_i210.h | 42 +++-- sys/dev/e1000/e1000_ich8lan.c | 316 ++++++++------------------------------ sys/dev/e1000/e1000_ich8lan.h | 47 +++--- sys/dev/e1000/e1000_mac.c | 40 ++--- sys/dev/e1000/e1000_mac.h | 40 ++--- sys/dev/e1000/e1000_manage.c | 40 ++--- sys/dev/e1000/e1000_manage.h | 40 ++--- sys/dev/e1000/e1000_mbx.c | 40 ++--- sys/dev/e1000/e1000_mbx.h | 40 ++--- sys/dev/e1000/e1000_nvm.c | 199 +++--------------------- sys/dev/e1000/e1000_nvm.h | 42 ++--- sys/dev/e1000/e1000_osdep.c | 40 ++--- sys/dev/e1000/e1000_osdep.h | 40 ++--- sys/dev/e1000/e1000_phy.c | 62 ++++---- sys/dev/e1000/e1000_phy.h | 49 +++--- sys/dev/e1000/e1000_regs.h | 55 +++---- sys/dev/e1000/e1000_vf.c | 43 +++--- sys/dev/e1000/e1000_vf.h | 40 ++--- sys/dev/e1000/if_em.c | 10 +- 36 files changed, 755 insertions(+), 1298 deletions(-) diff --git a/sys/dev/e1000/e1000_80003es2lan.c b/sys/dev/e1000/e1000_80003es2lan.c index c1aa47a73ac8..5c0220adfc6f 100644 --- a/sys/dev/e1000/e1000_80003es2lan.c +++ b/sys/dev/e1000/e1000_80003es2lan.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its + + 3. Neither the name of the Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_80003es2lan.h b/sys/dev/e1000/e1000_80003es2lan.h index 501cfc958819..cbf0eafa9407 100644 --- a/sys/dev/e1000/e1000_80003es2lan.h +++ b/sys/dev/e1000/e1000_80003es2lan.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82540.c b/sys/dev/e1000/e1000_82540.c index 720798260f8a..adc944a8ebb4 100644 --- a/sys/dev/e1000/e1000_82540.c +++ b/sys/dev/e1000/e1000_82540.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82541.c b/sys/dev/e1000/e1000_82541.c index aaa3de7f02ce..ead974cb1358 100644 --- a/sys/dev/e1000/e1000_82541.c +++ b/sys/dev/e1000/e1000_82541.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82541.h b/sys/dev/e1000/e1000_82541.h index d31065d9a182..ce29548a4d85 100644 --- a/sys/dev/e1000/e1000_82541.h +++ b/sys/dev/e1000/e1000_82541.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82542.c b/sys/dev/e1000/e1000_82542.c index 2fdf7066865b..09906699ab10 100644 --- a/sys/dev/e1000/e1000_82542.c +++ b/sys/dev/e1000/e1000_82542.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82543.c b/sys/dev/e1000/e1000_82543.c index 42c4726fa8c7..e247b01f6cda 100644 --- a/sys/dev/e1000/e1000_82543.c +++ b/sys/dev/e1000/e1000_82543.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82543.h b/sys/dev/e1000/e1000_82543.h index 27f8507fb63c..98289524f6d8 100644 --- a/sys/dev/e1000/e1000_82543.h +++ b/sys/dev/e1000/e1000_82543.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82571.c b/sys/dev/e1000/e1000_82571.c index 8db1fcb921a9..348a3daa3c05 100644 --- a/sys/dev/e1000/e1000_82571.c +++ b/sys/dev/e1000/e1000_82571.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. @@ -515,7 +515,7 @@ e1000_get_hw_semaphore_82574(struct e1000_hw *hw) u32 extcnf_ctrl; s32 i = 0; /* XXX assert that mutex is held */ - DEBUGFUNC("e1000_get_hw_semaphore_82574"); + DEBUGFUNC("e1000_get_hw_semaphore_82573"); ASSERT_CTX_LOCK_HELD(hw); extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); diff --git a/sys/dev/e1000/e1000_82571.h b/sys/dev/e1000/e1000_82571.h index 77303adb162f..a39f63c53e2d 100644 --- a/sys/dev/e1000/e1000_82571.h +++ b/sys/dev/e1000/e1000_82571.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index d588539ca8e8..81bd419fcf0d 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82575.h b/sys/dev/e1000/e1000_82575.h index 22c2f8c4a2f5..36045556661b 100644 --- a/sys/dev/e1000/e1000_82575.h +++ b/sys/dev/e1000/e1000_82575.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_api.c b/sys/dev/e1000/e1000_api.c index b28ab77f3794..b1d5ef74c24f 100644 --- a/sys/dev/e1000/e1000_api.c +++ b/sys/dev/e1000/e1000_api.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. @@ -383,7 +383,6 @@ s32 e1000_set_mac_type(struct e1000_hw *hw) break; case E1000_DEV_ID_I210_COPPER_FLASHLESS: case E1000_DEV_ID_I210_SERDES_FLASHLESS: - case E1000_DEV_ID_I210_SGMII_FLASHLESS: case E1000_DEV_ID_I210_COPPER: case E1000_DEV_ID_I210_COPPER_OEM1: case E1000_DEV_ID_I210_COPPER_IT: @@ -1269,21 +1268,6 @@ s32 e1000_read_pba_length(struct e1000_hw *hw, u32 *pba_num_size) return e1000_read_pba_length_generic(hw, pba_num_size); } -/** - * e1000_read_pba_num - Read device part number - * @hw: pointer to the HW structure - * @pba_num: pointer to device part number - * - * Reads the product board assembly (PBA) number from the EEPROM and stores - * the value in pba_num. - * Currently no func pointer exists and all implementations are handled in the - * generic version of this function. - **/ -s32 e1000_read_pba_num(struct e1000_hw *hw, u32 *pba_num) -{ - return e1000_read_pba_num_generic(hw, pba_num); -} - /** * e1000_validate_nvm_checksum - Verifies NVM (EEPROM) checksum * @hw: pointer to the HW structure diff --git a/sys/dev/e1000/e1000_api.h b/sys/dev/e1000/e1000_api.h index b558b1cf5f23..bf5f637cb3dd 100644 --- a/sys/dev/e1000/e1000_api.h +++ b/sys/dev/e1000/e1000_api.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. @@ -100,7 +100,6 @@ void e1000_power_down_phy(struct e1000_hw *hw); s32 e1000_read_mac_addr(struct e1000_hw *hw); s32 e1000_read_pba_string(struct e1000_hw *hw, u8 *pba_num, u32 pba_num_size); s32 e1000_read_pba_length(struct e1000_hw *hw, u32 *pba_num_size); -s32 e1000_read_pba_num(struct e1000_hw *hw, u32 *part_num); void e1000_reload_nvm(struct e1000_hw *hw); s32 e1000_update_nvm_checksum(struct e1000_hw *hw); s32 e1000_validate_nvm_checksum(struct e1000_hw *hw); diff --git a/sys/dev/e1000/e1000_defines.h b/sys/dev/e1000/e1000_defines.h index 6c1138ed9335..262b01dd5b64 100644 --- a/sys/dev/e1000/e1000_defines.h +++ b/sys/dev/e1000/e1000_defines.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. @@ -1070,44 +1070,11 @@ /* NVM Word Offsets */ #define NVM_COMPAT 0x0003 #define NVM_ID_LED_SETTINGS 0x0004 -#define NVM_VERSION 0x0005 #define NVM_SERDES_AMPLITUDE 0x0006 /* SERDES output amplitude */ #define NVM_PHY_CLASS_WORD 0x0007 #define E1000_I210_NVM_FW_MODULE_PTR 0x0010 #define E1000_I350_NVM_FW_MODULE_PTR 0x0051 #define NVM_FUTURE_INIT_WORD1 0x0019 -#define NVM_ETRACK_WORD 0x0042 -#define NVM_ETRACK_HIWORD 0x0043 -#define NVM_COMB_VER_OFF 0x0083 -#define NVM_COMB_VER_PTR 0x003D - -/* NVM version defines */ -#define NVM_MAJOR_MASK 0xF000 -#define NVM_MINOR_MASK 0x0FF0 -#define NVM_IMAGE_ID_MASK 0x000F -#define NVM_COMB_VER_MASK 0x00FF -#define NVM_MAJOR_SHIFT 12 -#define NVM_MINOR_SHIFT 4 -#define NVM_COMB_VER_SHFT 8 -#define NVM_VER_INVALID 0xFFFF -#define NVM_ETRACK_SHIFT 16 -#define NVM_ETRACK_VALID 0x8000 -#define NVM_NEW_DEC_MASK 0x0F00 -#define NVM_HEX_CONV 16 -#define NVM_HEX_TENS 10 *** 2213 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:06:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C2F1669C46; Fri, 17 Sep 2021 21:06:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB6231Zn9z4fC3; Fri, 17 Sep 2021 21:06:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15BC11D10B; Fri, 17 Sep 2021 21:06:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HL6JwN015182; Fri, 17 Sep 2021 21:06:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HL6IcQ015181; Fri, 17 Sep 2021 21:06:18 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:06:18 GMT Message-Id: <202109172106.18HL6IcQ015181@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 702cac6c6bf2 - main - e1000: Update copyrights and readme MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 702cac6c6bf20ca43db26c38185f65fc9ed1935e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:06:19 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=702cac6c6bf20ca43db26c38185f65fc9ed1935e commit 702cac6c6bf20ca43db26c38185f65fc9ed1935e Author: Kevin Bowling AuthorDate: 2021-09-16 11:35:45 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:06:01 +0000 e1000: Update copyrights and readme Copyrights in sync with "cid-gigabit.2020.06.05.tar.gz released by ND" (from DPDK). README from the latest em-7.7.8 on intel.com Approved by: imp MFC after: 1 week --- sys/dev/e1000/LICENSE | 41 ++- sys/dev/e1000/README | 547 ++++++++++++++++++++------------------ sys/dev/e1000/e1000_80003es2lan.c | 40 +-- sys/dev/e1000/e1000_80003es2lan.h | 40 +-- sys/dev/e1000/e1000_82540.c | 40 +-- sys/dev/e1000/e1000_82541.c | 40 +-- sys/dev/e1000/e1000_82541.h | 40 +-- sys/dev/e1000/e1000_82542.c | 40 +-- sys/dev/e1000/e1000_82543.c | 40 +-- sys/dev/e1000/e1000_82543.h | 40 +-- sys/dev/e1000/e1000_82571.c | 40 +-- sys/dev/e1000/e1000_82571.h | 40 +-- sys/dev/e1000/e1000_82575.c | 40 +-- sys/dev/e1000/e1000_82575.h | 40 +-- sys/dev/e1000/e1000_api.c | 40 +-- sys/dev/e1000/e1000_api.h | 40 +-- sys/dev/e1000/e1000_defines.h | 40 +-- sys/dev/e1000/e1000_hw.h | 40 +-- sys/dev/e1000/e1000_i210.c | 40 +-- sys/dev/e1000/e1000_i210.h | 40 +-- sys/dev/e1000/e1000_ich8lan.c | 40 +-- sys/dev/e1000/e1000_ich8lan.h | 40 +-- sys/dev/e1000/e1000_mac.c | 40 +-- sys/dev/e1000/e1000_mac.h | 40 +-- sys/dev/e1000/e1000_manage.c | 40 +-- sys/dev/e1000/e1000_manage.h | 40 +-- sys/dev/e1000/e1000_mbx.c | 40 +-- sys/dev/e1000/e1000_mbx.h | 40 +-- sys/dev/e1000/e1000_nvm.c | 40 +-- sys/dev/e1000/e1000_nvm.h | 40 +-- sys/dev/e1000/e1000_osdep.c | 40 +-- sys/dev/e1000/e1000_osdep.h | 40 +-- sys/dev/e1000/e1000_phy.c | 40 +-- sys/dev/e1000/e1000_phy.h | 40 +-- sys/dev/e1000/e1000_regs.h | 40 +-- sys/dev/e1000/e1000_vf.c | 40 +-- sys/dev/e1000/e1000_vf.h | 40 +-- 37 files changed, 1007 insertions(+), 981 deletions(-) diff --git a/sys/dev/e1000/LICENSE b/sys/dev/e1000/LICENSE index f70a7cbd4a1d..51a32a819633 100644 --- a/sys/dev/e1000/LICENSE +++ b/sys/dev/e1000/LICENSE @@ -1,31 +1,30 @@ $FreeBSD$ - Copyright (c) 2001-2010, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. - diff --git a/sys/dev/e1000/README b/sys/dev/e1000/README index c0abeacccf4a..d734be75e758 100644 --- a/sys/dev/e1000/README +++ b/sys/dev/e1000/README @@ -1,9 +1,8 @@ $FreeBSD$ -FreeBSD* Driver for Intel Network Connection -============================================= - -May 30, 2007 +FreeBSD* Driver for Intel(R) Ethernet +===================================== +August 7, 2019 Contents ======== @@ -11,396 +10,424 @@ Contents - Overview - Identifying Your Adapter - Building and Installation -- Speed and Duplex Configuration -- Additional Configurations -- Known Limitations +- Additional Features and Configurations +- Known Issues/Troubleshooting - Support - License Overview ======== - -This file describes the FreeBSD* driver for Intel Network Connection. -This driver has been developed for use with FreeBSD, Release 7.x. +This file describes the FreeBSD* driver for Intel(R) Ethernet. This driver has +been developed for use with all community-supported versions of FreeBSD. For questions related to hardware requirements, refer to the documentation -supplied with your Gigabit adapter. All hardware requirements listed +supplied with your Intel Ethernet Adapter. All hardware requirements listed apply to use with FreeBSD. Identifying Your Adapter ======================== +This release includes two gigabit FreeBSD base Drivers for Intel(R) Ethernet. +These drivers are em and igb. -For information on how to identify your adapter, go to the Adapter & -Driver ID Guide at: - -http://support.intel.com/support/network/sb/cs-012904.htm - - -For the latest Intel network drivers for FreeBSD, see: +- The igb driver supports all 82575 and 82576-based gigabit network connections. +- The em driver supports all other gigabit network connections. +- Gigabit devices base on the Intel(R) Ethernet Controller X722 are supported by + the ixl driver. -http://downloadfinder.intel.com/scripts-df-external/support_intel.aspx - - -NOTE: Mobile adapters are not fully supported. NOTE: The Intel(R) 82562v 10/100 Network Connection only provides 10/100 support. +For information on how to identify your adapter, and for the latest Intel +network drivers, refer to the Intel Support website: +http://www.intel.com/support + + Building and Installation ========================= +NOTE: This driver package is to be used only as a standalone archive and the +user should not attempt to incorporate it into the kernel source tree. -NOTE: The driver can be installed as a dynamic loadable kernel module or - compiled into the kernel. You must have kernel sources installed in - order to compile the driver module. - -In the instructions below, x.x.x is the driver version as indicated in the -name of the driver tar file. +In the instructions below, x.x.x is the driver version as indicated in the name +of the driver tar file. 1. Move the base driver tar file to the directory of your choice. For example, use /home/username/em or /usr/local/src/em. 2. Untar/unzip the archive: - tar xzvf em-x.x.x.tar.gz - - This will create an em-x.x.x directory. - -3. To create a loadable module, perform the following steps. - NOTE: To compile the driver into the kernel, go directly to step 4. - - a. To compile the module - - cd em-x.x.x - make - - b. To install the compiled module to the system directory: - - make install - - c. If you want the driver to load automatically when the system is booted: + # tar xzf em-x.x.x.tar.gz - 1. Edit /boot/loader.conf, and add the following line: +This will create the em-x.x.x directory. - if_em_load="YES" +3. To install man page: -4. To compile the driver into the kernel, enter: + # cd em-x.x.x + # gzip -c em.4 > /usr/share/man/man4/em.4.gz - cd em-x.x.x/src - cp *.[ch] /usr/src/sys/dev/em +4. To load the driver onto a running system: - Edit the kernel configuration file (i.e., GENERIC or MYKERNEL) in - /usr/src/sys/i386/conf, and ensure the following line is present: - - device em - - Compile and install the kernel. The system must be rebooted for the - kernel updates to take effect. For additional information on compiling - the kernel, consult the FreeBSD operating system documentation. + # cd em-x.x.x/src + # make + # kldload ./if_em.ko 5. To assign an IP address to the interface, enter the following: - ifconfig em + # ifconfig em 6. Verify that the interface works. Enter the following, where is the IP address for another machine on the same subnet as the interface that is being tested: - ping - -7. To configure the IP address to remain after reboot, edit /etc/rc.conf, - and create the appropriate ifconfig_ementry: - - ifconfig_em="" + # ping - Example usage: +7. If you want the driver to load automatically when the system is booted: - ifconfig_em0="inet 192.168.10.1 netmask 255.255.255.0" + # cd em-x.x.x/src + # make + # make install - NOTE: For assistance, see the ifconfig man page. +Edit /boot/loader.conf, and add the following line: + if_em_load="YES" +Edit /etc/rc.conf, and create the appropriate ifconfig_em entry: -Speed and Duplex Configuration -============================== - -By default, the adapter auto-negotiates the speed and duplex of the -connection. If there is a specific need, the ifconfig utility can be used to -configure the speed and duplex settings on the adapter. Example usage: + ifconfig_em="" - ifconfig em media 100baseTX mediaopt - full-duplex +Example usage: + ifconfig_em0="inet 192.168.10.1 netmask 255.255.255.0" - NOTE: Only use mediaopt to set the driver to full-duplex. If mediaopt is - not specified and you are not running at gigabit speed, the driver - defaults to half-duplex. + NOTE: For assistance, see the ifconfig man page. -If the interface is currently forced to 100 full duplex, in order to change -to half duplex you must use this command: - ifconfig em media 100baseTX -mediaopt - full-duplex +Additional Features and Configurations +====================================== +Speed and Duplex Configuration +------------------------------ +In addressing speed and duplex configuration issues, you need to distinguish +between copper-based adapters and fiber-based adapters. -This driver supports the following media type options: +In the default mode, an Intel(R) Ethernet Network Adapter using copper +connections will attempt to auto-negotiate with its link partner to determine +the best setting. If the adapter cannot establish link with the link partner +using auto-negotiation, you may need to manually configure the adapter and link +partner to identical settings to establish link and pass packets. This should +only be needed when attempting to link with an older switch that does not +support auto-negotiation or one that has been forced to a specific speed or +duplex mode. Your link partner must match the setting you choose. 1 Gbps speeds +and higher cannot be forced. Use the autonegotiation advertising setting to +manually set devices for 1 Gbps and higher. - autoselect - Enables auto-negotiation for speed and duplex. +Caution: Only experienced network administrators should force speed and duplex +or change autonegotiation advertising manually. The settings at the switch must +always match the adapter settings. Adapter performance may suffer or your +adapter may not operate if you configure the adapter differently from your +switch. - 10baseT/UTP - Sets speed to 10 Mbps. Use the ifconfig mediaopt - option to select full-duplex mode. +An Intel(R) Ethernet Network Adapter using fiber-based connections, however, +will not attempt to auto-negotiate with its link partner since those adapters +operate only in full duplex and only at their native speed. - 100baseTX - Sets speed to 100 Mbps. Use the ifconfig mediaopt - option to select full-duplex mode. +By default, the adapter auto-negotiates the speed and duplex of the connection. +If there is a specific need, the ifconfig utility can be used to configure the +speed and duplex settings on the adapter. - 1000baseTX - Sets speed to 1000 Mbps. In this case, the driver - supports only full-duplex mode. +Example usage: - 1000baseSX - Sets speed to 1000 Mbps. In this case, the driver - supports only full-duplex mode. +# ifconfig emX media 100baseTX mediaopt full-duplex -For more information on the ifconfig utility, see the ifconfig man page. +NOTE: Only use mediaopt to set the driver to full-duplex. If mediaopt is not +specified and you are not running at gigabit speed, the driver defaults to +half-duplex. +If the interface is currently forced to 100 full duplex, you must use this +command to change to half duplex: -Additional Configurations -========================= +# ifconfig emX media 100baseTX -mediaopt full-duplex -The driver supports Transmit/Receive Checksum Offload and Jumbo Frames on -all but the 82542-based adapters. For specific adapters, refer to the -Identifying Your Adapter section. +This driver supports the following media type options: - Jumbo Frames - ------------ - To enable Jumbo Frames, use the ifconfig utility to set the Maximum - Transport Unit (MTU) frame size above its default of 1500 bytes. +Media Type Description +---------- ----------- +autoselect Enables auto-negotiation for speed and duplex. +10baseT/UTP Sets speed to 10 Mbps. Use the ifconfig mediaopt + option to select full-duplex mode. +100baseTX Sets speed to 100 Mbps. Use the ifconfig mediaopt + option to select full-duplex mode. +1000baseTX Sets speed to 1000 Mbps. In this case, the driver + supports only full-duplex mode. +1000baseSX Sets speed to 1000 Mbps. In this case, the driver + supports only full-duplex mode. - The Jumbo Frames MTU range for Intel Adapters is 1500 to 16110. To modify - the setting, enter the following: +For more information on the ifconfig utility, see the ifconfig man page. - ifconfig em mtu 9000 +Jumbo Frames +------------ +Jumbo Frames support is enabled by changing the Maximum Transmission Unit (MTU) +to a value larger than the default value of 1500. + +Use the ifconfig command to increase the MTU size. For example, enter the +following where X is the interface number: + +# ifconfig emX mtu 9000 + +To confirm an interface's MTU value, use the ifconfig command. + +To confirm the MTU used between two specific devices, use: + +# route get + +NOTE: The maximum MTU setting for Jumbo Frames is 16110. This value coincides +with the maximum Jumbo Frames size of 16132 bytes. + +NOTE: Using Jumbo frames at 10 or 100 Mbps is not supported and may result in +poor performance or loss of link. + +NOTE: Packet loss may have a greater impact on throughput when you use jumbo +frames. If you observe a drop in performance after enabling jumbo frames, +enabling flow control may mitigate the issue. + +NOTE: Some Intel gigabit adapters that support Jumbo Frames have a frame size +limit of 9238 bytes, with a corresponding MTU size limit of 9216 bytes. The +adapters with this limitation are based on the Intel(R) 82571EB, 82572EI, +82573L, 82566, 82562, and 80003ES2LAN controller. These correspond to the +following product names: + Intel(R) PRO/1000 PT Server Adapter + Intel(R) PRO/1000 PT Desktop Adapter + Intel(R) PRO/1000 PT Network Connection + Intel(R) PRO/1000 PT Dual Port Server Adapter + Intel(R) PRO/1000 PT Dual Port Network Connection + Intel(R) PRO/1000 PT Quad Port Server Adapter + Intel(R) PRO/1000 PF Quad Port Server Adapter + Intel(R) PRO/1000 PF Server Adapter + Intel(R) PRO/1000 PF Network Connection + Intel(R) PRO/1000 PF Dual Port Server Adapter + Intel(R) PRO/1000 PB Server Connection + Intel(R) PRO/1000 PL Network Connection + Intel(R) PRO/1000 EB Network Connection with I/O Acceleration + Intel(R) PRO/1000 EB Backplane Connection with I/O Acceleration + Intel(R) 82566DM-2 Gigabit Network Connection + Intel(R) 82574L Gigabit Network Connection + Intel(R) Gigabit CT Desktop Adapter + Intel(R) 82567LM-4 Gigabit Network Connection + Intel(R) 82567LM-3 Gigabit Network Connection + Intel(R) 82567LF-3 Gigabit Network Connection - To confirm the MTU used between two specific devices, use: +NOTE: The following adapters limit Jumbo Frames sized packets to a maximum of +4088 bytes: + - Intel(R) 82578DM Gigabit Network Connection + - Intel(R) 82577LM Gigabit Network Connection +- The following adapters do not support Jumbo Frames: + - Intel(R) PRO/1000 Gigabit Server Adapter + - Intel(R) PRO/1000 PM Network Connection + - Intel(R) 82562G 10/100 Network Connection + - Intel(R) 82562G-2 10/100 Network Connection + - Intel(R) 82562GT 10/100 Network Connection + - Intel(R) 82562GT-2 10/100 Network Connection + - Intel(R) 82562V 10/100 Network Connection + - Intel(R) 82562V-2 10/100 Network Connection + - Intel(R) 82566DC Gigabit Network Connection + - Intel(R) 82566DC-2 Gigabit Network Connection + - Intel(R) 82566DM Gigabit Network Connection + - Intel(R) 82566MC Gigabit Network Connection + - Intel(R) 82566MM Gigabit Network Connection + - Intel(R) 82567V-3 Gigabit Network Connection + - Intel(R) 82577LC Gigabit Network Connection + - Intel(R) 82578DC Gigabit Network Connection +- Jumbo Frames cannot be configured on an 82579-based Network device if + MACSec is enabled on the system. - route get - Notes: +VLANS +----- +To create a new VLAN interface: - - Only enable Jumbo Frames if your network infrastructure supports them. +# ifconfig create - - To enable Jumbo Frames, increase the MTU size on the interface beyond - 1500. +To associate the VLAN interface with a physical interface and assign a VLAN ID, +IP address, and netmask: - - The Jumbo Frames setting on the switch must be set to at least 22 bytes - larger than that of the MTU. +# ifconfig netmask vlan +vlandev - - The maximum MTU setting for Jumbo Frames is 16110. This value coincides - with the maximum Jumbo Frames size of 16128. +Example: - - Some Intel gigabit adapters that support Jumbo Frames have a frame size - limit of 9238 bytes, with a corresponding MTU size limit of 9216 bytes. - The adapters with this limitation are based on the Intel(R) 82571EB, - 82572EI, 82573L, 82566, 82562, and 80003ES2LAN controller. These - correspond to the following product names: - Intel(R) PRO/1000 PT Server Adapter - Intel(R) PRO/1000 PT Desktop Adapter - Intel(R) PRO/1000 PT Network Connection - Intel(R) PRO/1000 PT Dual Port Server Adapter - Intel(R) PRO/1000 PT Dual Port Network Connection - Intel(R) PRO/1000 PT Quad Port Server Adapter - Intel(R) PRO/1000 PF Quad Port Server Adapter - Intel(R) PRO/1000 PF Server Adapter - Intel(R) PRO/1000 PF Network Connection - Intel(R) PRO/1000 PF Dual Port Server Adapter - Intel(R) PRO/1000 PB Server Connection - Intel(R) PRO/1000 PL Network Connection - Intel(R) PRO/1000 EB Network Connection with I/O Acceleration - Intel(R) PRO/1000 EB Backplane Connection with I/O Acceleration - Intel(R) 82566DM-2 Gigabit Network Connection +# ifconfig vlan10 10.0.0.1 netmask 255.255.255.0 vlan 10 vlandev em0 - - Adapters based on the Intel(R) 82542 and 82573V/E controller do not - support Jumbo Frames. These correspond to the following product names: - Intel(R) PRO/1000 Gigabit Server Adapter - Intel(R) PRO/1000 PM Network Connection +In this example, all packets will be marked on egress with 802.1Q VLAN tags, +specifying a VLAN ID of 10. - - Using Jumbo Frames at 10 or 100 Mbps may result in poor performance or - loss of link. +To remove a VLAN interface: - - The following adapters do not support Jumbo Frames: - Intel(R) 82562V 10/100 Network Connection - Intel(R) 82566DM Gigabit Network Connection - Intel(R) 82566DC Gigabit Network Connection - Intel(R) 82566MM Gigabit Network Connection - Intel(R) 82566MC Gigabit Network Connection - Intel(R) 82562GT 10/100 Network Connection - Intel(R) 82562G 10/100 Network Connection - Intel(R) 82566DC-2 Gigabit Network Connection - Intel(R) 82562V-2 10/100 Network Connection - Intel(R) 82562G-2 10/100 Network Connection - Intel(R) 82562GT-2 10/100 Network Connection +# ifconfig destroy - VLANs - ----- - To create a new VLAN interface: - ifconfig create +Polling +------- +NOTES: +- Device Polling is only valid for non-SMP kernels. +- The driver has to be built into the kernel for Device Polling to be + enabled in the driver. - To associate the VLAN interface with a physical interface and - assign a VLAN ID, IP address, and netmask: +To enable polling in the driver, add the following options to the kernel +configuration, and then recompile the kernel: - ifconfig netmask vlan - vlandev + options DEVICE_POLLING + options HZ=1000 - Example: +At runtime use: + ifconfig emX polling (to turn polling on) +and: + ifconfig emX -polling (to turn it off) - ifconfig vlan10 10.0.0.1 netmask 255.255.255.0 vlan 10 vlandev em0 - In this example, all packets will be marked on egress with 802.1Q VLAN - tags, specifying a VLAN ID of 10. +Checksum Offload +---------------- +Checksum offloading is not supported on 82542 Gigabit adapters. - To remove a VLAN interface: +Checksum offloading supports both TCP and UDP packets and is supported for both +transmit and receive. - Intel Network Connection ifconfig destroy +Checksum offloading can be enabled or disabled using ifconfig. Both transmit +and receive offloading will be either enabled or disabled together. You cannot +enable/disable one without the other. +To enable checksum offloading: - Polling - ------- +# ifconfig emX rxcsum - To enable polling in the driver, add the following options to the kernel - configuration, and then recompile the kernel: +To disable checksum offloading: - options DEVICE_POLLING - options HZ=1000 +# ifconfig emX -rxcsum - At runtime use: - ifconfig emX polling (to turn polling on) - and: - ifconfig emX -polling (to turn it off) +To confirm the current setting: +# ifconfig emX - Checksum Offload - ---------------- - Checksum offloading is not supported on 82542 Gigabit adapters. +Look for the presence or absence of the following line: + options=3 - Checksum offloading supports both TCP and UDP packets and is - supported for both transmit and receive. +See the ifconfig man page for further information. - Checksum offloading can be enabled or disabled using ifconfig. - Both transmit and receive offloading will be either enabled or - disabled together. You cannot enable/disable one without the other. - To enable checksum offloading: +TSO +--- +TSO (TCP Segmentation Offload) supports both IPv4 and IPv6. TSO can be disabled +and enabled using the ifconfig utility or sysctl. - ifconfig rxcsum +NOTE: TSO requires Tx checksum, if Tx checksum is disabled, TSO will also be +disabled. - To disable checksum offloading: +NOTE: By default only PCI-Express adapters are ENABLED to do TSO. Others can be +enabled by the user at their own risk. TSO is not supported on 82547 or +82544-based adapters, as well as older adapters. - ifconfig -rxcsum +To enable/disable TSO in the stack: - To confirm the current setting: +# sysctl net.inet.tcp.tso=0 (or 1 to enable it) - ifconfig +Doing this disables/enables TSO in the stack and affects all installed adapters. - Look for the presence or absence of the following line: +To disable BOTH TSO IPv4 and IPv6: - options=3 +# ifconfig em -tso - See the ifconfig man page for further information. +To enable BOTH TSO IPv4 and IPv6: +# ifconfig em tso - TSO - --- - The FreeBSD driver offers support for TSO (TCP Segmentation Offload). +You can also enable/disable IPv4 TSO or IPv6 TSO individually. Simply replace +tso|-tso in the above command with tso4 or tso6. For example, to disable +TSO IPv4: - You can enable/disable it in two ways/places: +# ifconfig em -tso4 - - sysctl net.inet.tcp.tso=0 (or 1 to enable it) +To disable TSO IPv6: - Doing this disables TSO in the stack and will affect all adapters. +# ifconfig em -tso6 - - ifconfig emX -tso - Doing this will disable TSO only for this adapter. +MSI-X +----- +MSI or MSI-X can be turned off by an entry in /etc/sysctl.conf - To enable: + hw.em.enable_msi=0 - - ifconfig emX tso +Unload and reload the driver. - NOTES: By default only PCI-Express adapters are ENABLED to do TSO. Others - can be enabled by the user at their own risk - TSO is not supported on 82547 and 82544-based adapters, as well as older adapters. +Known Issues/Troubleshooting +============================ -Known Limitations -================= +Detected Tx Unit Hang in Quad Port Adapters +------------------------------------------- +In some cases ports 3 and 4 don't pass traffic and report 'Detected Tx Unit +Hang' followed by 'NETDEV WATCHDOG: emX: transmit timed out' errors. Ports 1 +and 2 do not show any errors and will pass traffic. - Detected Tx Unit Hang in Quad Port Adapters - ------------------------------------------- +This issue may be resolved by updating to the latest kernel and BIOS. You +should use an OS that fully supports Message Signaled Interrupts (MSI) and make +sure that MSI is enabled in your system's BIOS. - In some cases ports 3 and 4 wont pass traffic. Ports 1 and 2 don't show - any errors and will pass traffic. - This issue MAY be resolved by updating to the latest BIOS. You can - check your system's BIOS by downloading the Linux Firmware Developer Kit - that can be obtained at http://www.linuxfirmwarekit.org/ +There are known performance issues with this driver when running UDP traffic +with Jumbo Frames. +---------------------------------------------------------------------------- - There are known performance issues with this driver when running UDP traffic - with Jumbo Frames. - ---------------------------------------------------------------------------- +82541/82547 can't link or is slow to link with some link partners +----------------------------------------------------------------- +There is a known compatibility issue where time to link is slow or link is not +established between 82541/82547 controllers and some switches. Known switches +include: + Planex FXG-08TE + I-O Data ETG-SH8 - 82541/82547 can't link or is slow to link with some link partners - ----------------------------------------------------------------- +The driver can be compiled with the following changes: - There is a known compatibility issue where time to link is slow or link is not - established between 82541/82547 controllers and some switches. Known switches - include: - Planex FXG-08TE - I-O Data ETG-SH8 - Netgear GS105v3 + Edit ./em.x.x.x/src/if_em.h to change the #define EM_MASTER_SLAVE - The driver can be compiled with the following changes: +For example, change from: - Edit ./em.x.x.x/src/if_em.h to change the #define EM_MASTER_SLAVE - For example, change from: + #define EM_MASTER_SLAVE e1000_ms_hw_default - #define EM_MASTER_SLAVE e1000_ms_hw_default - to: - #define EM_MASTER_SLAVE 2 +to: - Use one of the following options: - 1 = Master mode - 2 = Slave mode - 3 = Auto master/slave - Setting 2 is recommended. + #define EM_MASTER_SLAVE 2 - Recompile the module: - a. To compile the module - cd em-x.x.x - make clean - make +Use one of the following options: + 1 = Master mode + 2 = Slave mode + 3 = Auto master/slave +Setting 2 is recommended. - b. To install the compiled module in system directory: - make install +Recompile the module: + a. To compile the module + cd em-x.x.x + make clean + make + b. To install the compiled module in system directory: + make install Support ======= +For general information, go to the Intel support website at: +http://www.intel.com/support/ -For general information and support, go to the Intel support website at: +If an issue is identified with the released source code on a supported kernel +with a supported adapter, email the specific information related to the issue +to freebsd@intel.com - http://support.intel.com -If an issue is identified, support is through email only at: -freebsd@intel.com +Copyright(c) 1999-2019 Intel Corporation. -License -======= - -This software program is released under the terms of a license agreement -between you ('Licensee') and Intel. Do not use or load this software or any -associated materials (collectively, the 'Software') until you have carefully -read the full terms and conditions of the LICENSE located in this software -package. By loading or using the Software, you agree to the terms of this -Agreement. If you do not agree with the terms of this Agreement, do not -install or use the Software. +Trademarks +========== +Intel is a trademark or registered trademark of Intel Corporation or its +subsidiaries in the United States and/or other countries. * Other names and brands may be claimed as the property of others. diff --git a/sys/dev/e1000/e1000_80003es2lan.c b/sys/dev/e1000/e1000_80003es2lan.c index 5c0220adfc6f..50fdfab54685 100644 --- a/sys/dev/e1000/e1000_80003es2lan.c +++ b/sys/dev/e1000/e1000_80003es2lan.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_80003es2lan.h b/sys/dev/e1000/e1000_80003es2lan.h index cbf0eafa9407..9e6de14757d7 100644 --- a/sys/dev/e1000/e1000_80003es2lan.h +++ b/sys/dev/e1000/e1000_80003es2lan.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82540.c b/sys/dev/e1000/e1000_82540.c index adc944a8ebb4..720798260f8a 100644 --- a/sys/dev/e1000/e1000_82540.c +++ b/sys/dev/e1000/e1000_82540.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2015, Intel Corporation + Copyright (c) 2001-2020, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82541.c b/sys/dev/e1000/e1000_82541.c index ead974cb1358..aaa3de7f02ce 100644 --- a/sys/dev/e1000/e1000_82541.c *** 1821 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:09:09 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 28C6066A034; Fri, 17 Sep 2021 21:09:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB65K0gp9z4gJS; Fri, 17 Sep 2021 21:09:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EAD5C1CB6B; Fri, 17 Sep 2021 21:09:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HL98Rr015508; Fri, 17 Sep 2021 21:09:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HL98wf015507; Fri, 17 Sep 2021 21:09:08 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:09:08 GMT Message-Id: <202109172109.18HL98wf015507@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: de0ae5d1cb89 - main - e1000: support flashless i211 PBA MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: de0ae5d1cb896dbc04c5334ef0b864b3c841c3ce Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:09:09 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=de0ae5d1cb896dbc04c5334ef0b864b3c841c3ce commit de0ae5d1cb896dbc04c5334ef0b864b3c841c3ce Author: Guinan Sun AuthorDate: 2020-07-06 08:11:59 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:07:27 +0000 e1000: support flashless i211 PBA Add support to print PBA when using flashless. Signed-off-by: Todd Fujinaka Signed-off-by: Sasha Neftin Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (d3c41d90dfd5b39dec14c74cf53086f4e6634aed) MFC after: 1 week --- sys/dev/e1000/e1000_82575.c | 2 +- sys/dev/e1000/e1000_nvm.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index d588539ca8e8..27e564d7841b 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -461,7 +461,7 @@ static s32 e1000_init_mac_params_82575(struct e1000_hw *hw) if ((mac->type == e1000_i210) || (mac->type == e1000_i211)) mac->ops.init_hw = e1000_init_hw_i210; else - mac->ops.init_hw = e1000_init_hw_82575; + mac->ops.init_hw = e1000_init_hw_82575; /* link setup */ mac->ops.setup_link = e1000_setup_link_generic; /* physical interface link setup */ diff --git a/sys/dev/e1000/e1000_nvm.c b/sys/dev/e1000/e1000_nvm.c index ecc7b013febb..f46444cf38b9 100644 --- a/sys/dev/e1000/e1000_nvm.c +++ b/sys/dev/e1000/e1000_nvm.c @@ -776,8 +776,9 @@ s32 e1000_read_pba_string_generic(struct e1000_hw *hw, u8 *pba_num, DEBUGFUNC("e1000_read_pba_string_generic"); - if ((hw->mac.type >= e1000_i210) && - !e1000_get_flash_presence_i210(hw)) { + if ((hw->mac.type == e1000_i210 || + hw->mac.type == e1000_i211) && + !e1000_get_flash_presence_i210(hw)) { DEBUGOUT("Flashless no PBA string\n"); return -E1000_ERR_NVM_PBA_SECTION; } From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:09:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0696F66A0E3; Fri, 17 Sep 2021 21:09:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB6646qbnz4gSr; Fri, 17 Sep 2021 21:09:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0E271CEDA; Fri, 17 Sep 2021 21:09:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HL9mWB015664; Fri, 17 Sep 2021 21:09:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HL9mFG015663; Fri, 17 Sep 2021 21:09:48 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:09:48 GMT Message-Id: <202109172109.18HL9mFG015663@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 82a9d0c2c1ef - main - e1000: add missing device ID MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 82a9d0c2c1ef75703d16e49e96d1e7b0bf046882 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:09:49 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=82a9d0c2c1ef75703d16e49e96d1e7b0bf046882 commit 82a9d0c2c1ef75703d16e49e96d1e7b0bf046882 Author: Guinan Sun AuthorDate: 2020-07-06 08:12:10 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:09:32 +0000 e1000: add missing device ID Adding Intel(R) I210 Gigabit Network Connection 15F6 device ID for SGMII flashless automotive device. Signed-off-by: Kamil Bednarczyk Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (586d770bfefc01d4af97c0ddf17c960c3e49ec22) MFC after: 1 week --- sys/dev/e1000/e1000_api.c | 1 + sys/dev/e1000/e1000_hw.h | 1 + sys/dev/e1000/if_em.c | 1 + 3 files changed, 3 insertions(+) diff --git a/sys/dev/e1000/e1000_api.c b/sys/dev/e1000/e1000_api.c index a36b228e075f..6e0f51ab7ffa 100644 --- a/sys/dev/e1000/e1000_api.c +++ b/sys/dev/e1000/e1000_api.c @@ -383,6 +383,7 @@ s32 e1000_set_mac_type(struct e1000_hw *hw) break; case E1000_DEV_ID_I210_COPPER_FLASHLESS: case E1000_DEV_ID_I210_SERDES_FLASHLESS: + case E1000_DEV_ID_I210_SGMII_FLASHLESS: case E1000_DEV_ID_I210_COPPER: case E1000_DEV_ID_I210_COPPER_OEM1: case E1000_DEV_ID_I210_COPPER_IT: diff --git a/sys/dev/e1000/e1000_hw.h b/sys/dev/e1000/e1000_hw.h index a08630618662..95973e29dbf0 100644 --- a/sys/dev/e1000/e1000_hw.h +++ b/sys/dev/e1000/e1000_hw.h @@ -209,6 +209,7 @@ struct e1000_hw; #define E1000_DEV_ID_I210_SGMII 0x1538 #define E1000_DEV_ID_I210_COPPER_FLASHLESS 0x157B #define E1000_DEV_ID_I210_SERDES_FLASHLESS 0x157C +#define E1000_DEV_ID_I210_SGMII_FLASHLESS 0x15F6 #define E1000_DEV_ID_I211_COPPER 0x1539 #define E1000_DEV_ID_I354_BACKPLANE_1GBPS 0x1F40 #define E1000_DEV_ID_I354_SGMII 0x1F41 diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index fadbcc2473e8..0ef542dd4c78 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -233,6 +233,7 @@ static pci_vendor_info_t igb_vendor_info_array[] = PVID(0x8086, E1000_DEV_ID_I210_COPPER_OEM1, "Intel(R) I210 (OEM)"), PVID(0x8086, E1000_DEV_ID_I210_COPPER_FLASHLESS, "Intel(R) I210 Flashless (Copper)"), PVID(0x8086, E1000_DEV_ID_I210_SERDES_FLASHLESS, "Intel(R) I210 Flashless (SERDES)"), + PVID(0x8086, E1000_DEV_ID_I210_SGMII_FLASHLESS, "Intel(R) I210 Flashless (SGMII)"), PVID(0x8086, E1000_DEV_ID_I210_FIBER, "Intel(R) I210 (Fiber)"), PVID(0x8086, E1000_DEV_ID_I210_SERDES, "Intel(R) I210 (SERDES)"), PVID(0x8086, E1000_DEV_ID_I210_SGMII, "Intel(R) I210 (SGMII)"), From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:12:17 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E899166A3C9; Fri, 17 Sep 2021 21:12:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB68x6Jybz4gp4; Fri, 17 Sep 2021 21:12:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B89BE1D05F; Fri, 17 Sep 2021 21:12:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HLCHSX027383; Fri, 17 Sep 2021 21:12:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HLCHpS027382; Fri, 17 Sep 2021 21:12:17 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:12:17 GMT Message-Id: <202109172112.18HLCHpS027382@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: da24467c7a16 - main - e1000: expose xMDIO methods MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: da24467c7a162691a14f2f74d90ff8dedb816cfc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:12:18 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=da24467c7a162691a14f2f74d90ff8dedb816cfc commit da24467c7a162691a14f2f74d90ff8dedb816cfc Author: Guinan Sun AuthorDate: 2020-07-06 08:12:00 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:10:02 +0000 e1000: expose xMDIO methods Move read and write xmdio methods to e1000_phy. Signed-off-by: Sasha Neftin Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (b14d20f1b2bb0e6d95f19963c5d7f55374e0ead9) MFC after: 1 week --- sys/dev/e1000/e1000_i210.c | 71 --------------------------------------------- sys/dev/e1000/e1000_i210.h | 4 --- sys/dev/e1000/e1000_phy.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++ sys/dev/e1000/e1000_phy.h | 5 ++++ 4 files changed, 77 insertions(+), 75 deletions(-) diff --git a/sys/dev/e1000/e1000_i210.c b/sys/dev/e1000/e1000_i210.c index 88806891566f..c0055aa0df71 100644 --- a/sys/dev/e1000/e1000_i210.c +++ b/sys/dev/e1000/e1000_i210.c @@ -600,77 +600,6 @@ out: return ret_val; } -/** - * __e1000_access_xmdio_reg - Read/write XMDIO register - * @hw: pointer to the HW structure - * @address: XMDIO address to program - * @dev_addr: device address to program - * @data: pointer to value to read/write from/to the XMDIO address - * @read: boolean flag to indicate read or write - **/ -static s32 __e1000_access_xmdio_reg(struct e1000_hw *hw, u16 address, - u8 dev_addr, u16 *data, bool read) -{ - s32 ret_val; - - DEBUGFUNC("__e1000_access_xmdio_reg"); - - ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAC, dev_addr); - if (ret_val) - return ret_val; - - ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAAD, address); - if (ret_val) - return ret_val; - - ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAC, E1000_MMDAC_FUNC_DATA | - dev_addr); - if (ret_val) - return ret_val; - - if (read) - ret_val = hw->phy.ops.read_reg(hw, E1000_MMDAAD, data); - else - ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAAD, *data); - if (ret_val) - return ret_val; - - /* Recalibrate the device back to 0 */ - ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAC, 0); - if (ret_val) - return ret_val; - - return ret_val; -} - -/** - * e1000_read_xmdio_reg - Read XMDIO register - * @hw: pointer to the HW structure - * @addr: XMDIO address to program - * @dev_addr: device address to program - * @data: value to be read from the EMI address - **/ -s32 e1000_read_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, u16 *data) -{ - DEBUGFUNC("e1000_read_xmdio_reg"); - - return __e1000_access_xmdio_reg(hw, addr, dev_addr, data, TRUE); -} - -/** - * e1000_write_xmdio_reg - Write XMDIO register - * @hw: pointer to the HW structure - * @addr: XMDIO address to program - * @dev_addr: device address to program - * @data: value to be written to the XMDIO address - **/ -s32 e1000_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, u16 data) -{ - DEBUGFUNC("e1000_read_xmdio_reg"); - - return __e1000_access_xmdio_reg(hw, addr, dev_addr, &data, FALSE); -} - /** * e1000_pll_workaround_i210 * @hw: pointer to the HW structure diff --git a/sys/dev/e1000/e1000_i210.h b/sys/dev/e1000/e1000_i210.h index d1ef4edf6261..9ad9e28c363b 100644 --- a/sys/dev/e1000/e1000_i210.h +++ b/sys/dev/e1000/e1000_i210.h @@ -44,10 +44,6 @@ s32 e1000_write_nvm_srwr_i210(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); s32 e1000_read_nvm_srrd_i210(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); -s32 e1000_read_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, - u16 *data); -s32 e1000_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, - u16 data); s32 e1000_init_hw_i210(struct e1000_hw *hw); #define E1000_STM_OPCODE 0xDB00 diff --git a/sys/dev/e1000/e1000_phy.c b/sys/dev/e1000/e1000_phy.c index 3215ed33d115..d22bcb7149c1 100644 --- a/sys/dev/e1000/e1000_phy.c +++ b/sys/dev/e1000/e1000_phy.c @@ -4251,3 +4251,75 @@ bool e1000_is_mphy_ready(struct e1000_hw *hw) return ready; } + +/** + * __e1000_access_xmdio_reg - Read/write XMDIO register + * @hw: pointer to the HW structure + * @address: XMDIO address to program + * @dev_addr: device address to program + * @data: pointer to value to read/write from/to the XMDIO address + * @read: boolean flag to indicate read or write + **/ +static s32 __e1000_access_xmdio_reg(struct e1000_hw *hw, u16 address, + u8 dev_addr, u16 *data, bool read) +{ + s32 ret_val; + + DEBUGFUNC("__e1000_access_xmdio_reg"); + + ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAC, dev_addr); + if (ret_val) + return ret_val; + + ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAAD, address); + if (ret_val) + return ret_val; + + ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAC, E1000_MMDAC_FUNC_DATA | + dev_addr); + if (ret_val) + return ret_val; + + if (read) + ret_val = hw->phy.ops.read_reg(hw, E1000_MMDAAD, data); + else + ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAAD, *data); + if (ret_val) + return ret_val; + + /* Recalibrate the device back to 0 */ + ret_val = hw->phy.ops.write_reg(hw, E1000_MMDAC, 0); + if (ret_val) + return ret_val; + + return ret_val; +} + +/** + * e1000_read_xmdio_reg - Read XMDIO register + * @hw: pointer to the HW structure + * @addr: XMDIO address to program + * @dev_addr: device address to program + * @data: value to be read from the EMI address + **/ +s32 e1000_read_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, u16 *data) +{ + DEBUGFUNC("e1000_read_xmdio_reg"); + + return __e1000_access_xmdio_reg(hw, addr, dev_addr, data, true); +} + +/** + * e1000_write_xmdio_reg - Write XMDIO register + * @hw: pointer to the HW structure + * @addr: XMDIO address to program + * @dev_addr: device address to program + * @data: value to be written to the XMDIO address + **/ +s32 e1000_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, u16 data) +{ + DEBUGFUNC("e1000_write_xmdio_reg"); + + return __e1000_access_xmdio_reg(hw, addr, dev_addr, &data, + false); +} diff --git a/sys/dev/e1000/e1000_phy.h b/sys/dev/e1000/e1000_phy.h index a13413e98638..38c8f9b466ce 100644 --- a/sys/dev/e1000/e1000_phy.h +++ b/sys/dev/e1000/e1000_phy.h @@ -122,6 +122,11 @@ s32 e1000_write_phy_reg_mphy(struct e1000_hw *hw, u32 address, u32 data, bool line_override); bool e1000_is_mphy_ready(struct e1000_hw *hw); +s32 e1000_read_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, + u16 *data); +s32 e1000_write_xmdio_reg(struct e1000_hw *hw, u16 addr, u8 dev_addr, + u16 data); + #define E1000_MAX_PHY_ADDR 8 /* IGP01E1000 Specific Registers */ From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:14:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBC6A66A07F; Fri, 17 Sep 2021 21:14:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB6CD6KJ5z4h5t; Fri, 17 Sep 2021 21:14:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8E611D385; Fri, 17 Sep 2021 21:14:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HLEGaa028347; Fri, 17 Sep 2021 21:14:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HLEGFs028346; Fri, 17 Sep 2021 21:14:16 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:14:16 GMT Message-Id: <202109172114.18HLEGFs028346@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 5b426b3e8cbd - main - e1000: add function parameter descriptions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5b426b3e8cbd5abdb3a57ff49cd27c36cac03427 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:14:17 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5b426b3e8cbd5abdb3a57ff49cd27c36cac03427 commit 5b426b3e8cbd5abdb3a57ff49cd27c36cac03427 Author: Guinan Sun AuthorDate: 2020-07-06 08:12:02 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:13:37 +0000 e1000: add function parameter descriptions Add function parameter descriptions to address gcc 7 warnings. Signed-off-by: Todd Fujinaka Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (1bf35d435c9764e83be76042fa6489dd127b6c40) MFC after: 1 week --- sys/dev/e1000/e1000_82575.c | 11 +++++------ sys/dev/e1000/e1000_mac.c | 8 ++++++++ sys/dev/e1000/e1000_mbx.c | 4 ++++ sys/dev/e1000/e1000_nvm.c | 7 +++++++ sys/dev/e1000/e1000_phy.c | 6 ++++++ 5 files changed, 30 insertions(+), 6 deletions(-) diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index 27e564d7841b..296a72542914 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -2702,7 +2702,7 @@ out: /** * __e1000_access_emi_reg - Read/write EMI register * @hw: pointer to the HW structure - * @addr: EMI address to program + * @address: EMI address to program * @data: pointer to value to read/write from/to the EMI address * @read: boolean flag to indicate read or write **/ @@ -2929,8 +2929,8 @@ out: /** * e1000_set_eee_i350 - Enable/disable EEE support * @hw: pointer to the HW structure - * @adv1g: boolean flag enabling 1G EEE advertisement - * @adv100m: boolean flag enabling 100M EEE advertisement + * @adv1G: boolean flag enabling 1G EEE advertisement + * @adv100M: boolean flag enabling 100M EEE advertisement * * Enable/disable EEE based on setting in dev_spec structure. * @@ -2984,8 +2984,8 @@ out: /** * e1000_set_eee_i354 - Enable/disable EEE support * @hw: pointer to the HW structure - * @adv1g: boolean flag enabling 1G EEE advertisement - * @adv100m: boolean flag enabling 100M EEE advertisement + * @adv1G: boolean flag enabling 1G EEE advertisement + * @adv100M: boolean flag enabling 100M EEE advertisement * * Enable/disable EEE legacy mode based on setting in dev_spec structure. * @@ -3641,7 +3641,6 @@ static s32 e1000_set_i2c_data(struct e1000_hw *hw, u32 *i2cctl, bool data) /** * e1000_get_i2c_data - Reads the I2C SDA data bit - * @hw: pointer to hardware structure * @i2cctl: Current value of I2CCTL register * * Returns the I2C data bit value diff --git a/sys/dev/e1000/e1000_mac.c b/sys/dev/e1000/e1000_mac.c index 11fbcb62142f..bda2ad65e3dc 100644 --- a/sys/dev/e1000/e1000_mac.c +++ b/sys/dev/e1000/e1000_mac.c @@ -105,6 +105,8 @@ void e1000_null_mac_generic(struct e1000_hw E1000_UNUSEDARG *hw) /** * e1000_null_link_info - No-op function, return 0 * @hw: pointer to the HW structure + * @s: dummy variable + * @d: dummy variable **/ s32 e1000_null_link_info(struct e1000_hw E1000_UNUSEDARG *hw, u16 E1000_UNUSEDARG *s, u16 E1000_UNUSEDARG *d) @@ -126,6 +128,8 @@ bool e1000_null_mng_mode(struct e1000_hw E1000_UNUSEDARG *hw) /** * e1000_null_update_mc - No-op function, return void * @hw: pointer to the HW structure + * @h: dummy variable + * @a: dummy variable **/ void e1000_null_update_mc(struct e1000_hw E1000_UNUSEDARG *hw, u8 E1000_UNUSEDARG *h, u32 E1000_UNUSEDARG a) @@ -137,6 +141,8 @@ void e1000_null_update_mc(struct e1000_hw E1000_UNUSEDARG *hw, /** * e1000_null_write_vfta - No-op function, return void * @hw: pointer to the HW structure + * @a: dummy variable + * @b: dummy variable **/ void e1000_null_write_vfta(struct e1000_hw E1000_UNUSEDARG *hw, u32 E1000_UNUSEDARG a, u32 E1000_UNUSEDARG b) @@ -148,6 +154,8 @@ void e1000_null_write_vfta(struct e1000_hw E1000_UNUSEDARG *hw, /** * e1000_null_rar_set - No-op function, return 0 * @hw: pointer to the HW structure + * @h: dummy variable + * @a: dummy variable **/ int e1000_null_rar_set(struct e1000_hw E1000_UNUSEDARG *hw, u8 E1000_UNUSEDARG *h, u32 E1000_UNUSEDARG a) diff --git a/sys/dev/e1000/e1000_mbx.c b/sys/dev/e1000/e1000_mbx.c index da31185c3476..3fc3811757f7 100644 --- a/sys/dev/e1000/e1000_mbx.c +++ b/sys/dev/e1000/e1000_mbx.c @@ -38,6 +38,7 @@ /** * e1000_null_mbx_check_for_flag - No-op function, return 0 * @hw: pointer to the HW structure + * @mbx_id: id of mailbox to read **/ static s32 e1000_null_mbx_check_for_flag(struct e1000_hw E1000_UNUSEDARG *hw, u16 E1000_UNUSEDARG mbx_id) @@ -50,6 +51,9 @@ static s32 e1000_null_mbx_check_for_flag(struct e1000_hw E1000_UNUSEDARG *hw, /** * e1000_null_mbx_transact - No-op function, return 0 * @hw: pointer to the HW structure + * @msg: The message buffer + * @size: Length of buffer + * @mbx_id: id of mailbox to read **/ static s32 e1000_null_mbx_transact(struct e1000_hw E1000_UNUSEDARG *hw, u32 E1000_UNUSEDARG *msg, diff --git a/sys/dev/e1000/e1000_nvm.c b/sys/dev/e1000/e1000_nvm.c index f46444cf38b9..46c00e1d64b3 100644 --- a/sys/dev/e1000/e1000_nvm.c +++ b/sys/dev/e1000/e1000_nvm.c @@ -63,6 +63,9 @@ void e1000_init_nvm_ops_generic(struct e1000_hw *hw) /** * e1000_null_nvm_read - No-op function, return 0 * @hw: pointer to the HW structure + * @a: dummy variable + * @b: dummy variable + * @c: dummy variable **/ s32 e1000_null_read_nvm(struct e1000_hw E1000_UNUSEDARG *hw, u16 E1000_UNUSEDARG a, u16 E1000_UNUSEDARG b, @@ -85,6 +88,7 @@ void e1000_null_nvm_generic(struct e1000_hw E1000_UNUSEDARG *hw) /** * e1000_null_led_default - No-op function, return 0 * @hw: pointer to the HW structure + * @data: dummy variable **/ s32 e1000_null_led_default(struct e1000_hw E1000_UNUSEDARG *hw, u16 E1000_UNUSEDARG *data) @@ -96,6 +100,9 @@ s32 e1000_null_led_default(struct e1000_hw E1000_UNUSEDARG *hw, /** * e1000_null_write_nvm - No-op function, return 0 * @hw: pointer to the HW structure + * @a: dummy variable + * @b: dummy variable + * @c: dummy variable **/ s32 e1000_null_write_nvm(struct e1000_hw E1000_UNUSEDARG *hw, u16 E1000_UNUSEDARG a, u16 E1000_UNUSEDARG b, diff --git a/sys/dev/e1000/e1000_phy.c b/sys/dev/e1000/e1000_phy.c index d22bcb7149c1..d73e3a10ae13 100644 --- a/sys/dev/e1000/e1000_phy.c +++ b/sys/dev/e1000/e1000_phy.c @@ -104,6 +104,7 @@ void e1000_init_phy_ops_generic(struct e1000_hw *hw) /** * e1000_null_set_page - No-op function, return 0 * @hw: pointer to the HW structure + * @data: dummy variable **/ s32 e1000_null_set_page(struct e1000_hw E1000_UNUSEDARG *hw, u16 E1000_UNUSEDARG data) @@ -115,6 +116,8 @@ s32 e1000_null_set_page(struct e1000_hw E1000_UNUSEDARG *hw, /** * e1000_null_read_reg - No-op function, return 0 * @hw: pointer to the HW structure + * @offset: dummy variable + * @data: dummy variable **/ s32 e1000_null_read_reg(struct e1000_hw E1000_UNUSEDARG *hw, u32 E1000_UNUSEDARG offset, u16 E1000_UNUSEDARG *data) @@ -136,6 +139,7 @@ void e1000_null_phy_generic(struct e1000_hw E1000_UNUSEDARG *hw) /** * e1000_null_lplu_state - No-op function, return 0 * @hw: pointer to the HW structure + * @active: dummy variable **/ s32 e1000_null_lplu_state(struct e1000_hw E1000_UNUSEDARG *hw, bool E1000_UNUSEDARG active) @@ -147,6 +151,8 @@ s32 e1000_null_lplu_state(struct e1000_hw E1000_UNUSEDARG *hw, /** * e1000_null_write_reg - No-op function, return 0 * @hw: pointer to the HW structure + * @offset: dummy variable + * @data: dummy variable **/ s32 e1000_null_write_reg(struct e1000_hw E1000_UNUSEDARG *hw, u32 E1000_UNUSEDARG offset, u16 E1000_UNUSEDARG data) From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:15:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A742B66A536; Fri, 17 Sep 2021 21:15:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB6DL4LSdz4hRS; Fri, 17 Sep 2021 21:15:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74D831CD6D; Fri, 17 Sep 2021 21:15:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HLFELx028542; Fri, 17 Sep 2021 21:15:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HLFEQU028541; Fri, 17 Sep 2021 21:15:14 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:15:14 GMT Message-Id: <202109172115.18HLFEQU028541@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 6c59e1866ca7 - main - e1000: fix minor issues and improve code style MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6c59e1866ca7a48d84f1d298bb3e6a07d2e6f756 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:15:14 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=6c59e1866ca7a48d84f1d298bb3e6a07d2e6f756 commit 6c59e1866ca7a48d84f1d298bb3e6a07d2e6f756 Author: Guinan Sun AuthorDate: 2020-07-06 08:12:03 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:14:34 +0000 e1000: fix minor issues and improve code style Fix typo in piece of code of NVM access for SPT. And cleans up the remaining instances in the shared code where it was not adhering to the Linux code standard. Wrong description was found in the mentioned file, so fix them. Remove shadowing variable declarations. Relating to operands in bitwise operations having different sizes. Unreachable code since *clock_in_i2c_* always return success. Don't return unused s32 and don't check for constants. Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Neftin Signed-off-by: Vitaly Lifshits Signed-off-by: Robert Konklewski Signed-off-by: Doug Dziggel Signed-off-by: Todd Fujinaka Signed-off-by: Jacob Keller Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (b8592c89c8fbc871d22313dcac0b86c89a7d5a62) MFC after: 1 week --- sys/dev/e1000/e1000_80003es2lan.c | 1 - sys/dev/e1000/e1000_82575.c | 16 +++++----------- sys/dev/e1000/e1000_i210.c | 8 +++----- sys/dev/e1000/e1000_ich8lan.c | 40 ++++++++++++++++++++------------------- sys/dev/e1000/e1000_mac.c | 2 +- sys/dev/e1000/e1000_nvm.c | 2 +- sys/dev/e1000/e1000_phy.c | 5 ++++- 7 files changed, 35 insertions(+), 39 deletions(-) diff --git a/sys/dev/e1000/e1000_80003es2lan.c b/sys/dev/e1000/e1000_80003es2lan.c index 50fdfab54685..db6f1aeb65fb 100644 --- a/sys/dev/e1000/e1000_80003es2lan.c +++ b/sys/dev/e1000/e1000_80003es2lan.c @@ -1168,7 +1168,6 @@ static s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw) /** * e1000_cfg_on_link_up_80003es2lan - es2 link configuration after link-up * @hw: pointer to the HW structure - * @duplex: current duplex setting * * Configure the KMRN interface by applying last minute quirks for * 10/100 operation. diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index 296a72542914..b252a4c7ff1d 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -104,10 +104,10 @@ static void e1000_clear_vfta_i350(struct e1000_hw *hw); static void e1000_i2c_start(struct e1000_hw *hw); static void e1000_i2c_stop(struct e1000_hw *hw); -static s32 e1000_clock_in_i2c_byte(struct e1000_hw *hw, u8 *data); +static void e1000_clock_in_i2c_byte(struct e1000_hw *hw, u8 *data); static s32 e1000_clock_out_i2c_byte(struct e1000_hw *hw, u8 data); static s32 e1000_get_i2c_ack(struct e1000_hw *hw); -static s32 e1000_clock_in_i2c_bit(struct e1000_hw *hw, bool *data); +static void e1000_clock_in_i2c_bit(struct e1000_hw *hw, bool *data); static s32 e1000_clock_out_i2c_bit(struct e1000_hw *hw, bool data); static void e1000_raise_i2c_clk(struct e1000_hw *hw, u32 *i2cctl); static void e1000_lower_i2c_clk(struct e1000_hw *hw, u32 *i2cctl); @@ -3238,9 +3238,7 @@ s32 e1000_read_i2c_byte_generic(struct e1000_hw *hw, u8 byte_offset, if (status != E1000_SUCCESS) goto fail; - status = e1000_clock_in_i2c_byte(hw, data); - if (status != E1000_SUCCESS) - goto fail; + e1000_clock_in_i2c_byte(hw, data); status = e1000_clock_out_i2c_bit(hw, nack); if (status != E1000_SUCCESS) @@ -3404,7 +3402,7 @@ static void e1000_i2c_stop(struct e1000_hw *hw) * * Clocks in one byte data via I2C data/clock **/ -static s32 e1000_clock_in_i2c_byte(struct e1000_hw *hw, u8 *data) +static void e1000_clock_in_i2c_byte(struct e1000_hw *hw, u8 *data) { s32 i; bool bit = 0; @@ -3416,8 +3414,6 @@ static s32 e1000_clock_in_i2c_byte(struct e1000_hw *hw, u8 *data) e1000_clock_in_i2c_bit(hw, &bit); *data |= bit << i; } - - return E1000_SUCCESS; } /** @@ -3506,7 +3502,7 @@ static s32 e1000_get_i2c_ack(struct e1000_hw *hw) * * Clocks in one bit via I2C data/clock **/ -static s32 e1000_clock_in_i2c_bit(struct e1000_hw *hw, bool *data) +static void e1000_clock_in_i2c_bit(struct e1000_hw *hw, bool *data) { u32 i2cctl = E1000_READ_REG(hw, E1000_I2CPARAMS); @@ -3524,8 +3520,6 @@ static s32 e1000_clock_in_i2c_bit(struct e1000_hw *hw, bool *data) /* Minimum low period of clock is 4.7 us */ usec_delay(E1000_I2C_T_LOW); - - return E1000_SUCCESS; } /** diff --git a/sys/dev/e1000/e1000_i210.c b/sys/dev/e1000/e1000_i210.c index c0055aa0df71..c6ca38f0f917 100644 --- a/sys/dev/e1000/e1000_i210.c +++ b/sys/dev/e1000/e1000_i210.c @@ -195,7 +195,7 @@ static s32 e1000_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words, } for (i = 0; i < words; i++) { - eewr = ((offset+i) << E1000_NVM_RW_ADDR_SHIFT) | + eewr = ((offset + i) << E1000_NVM_RW_ADDR_SHIFT) | (data[i] << E1000_NVM_RW_REG_DATA) | E1000_NVM_RW_REG_START; @@ -281,9 +281,9 @@ static s32 e1000_read_invm_i210(struct e1000_hw *hw, u16 offset, switch (offset) { case NVM_MAC_ADDR: ret_val = e1000_read_invm_word_i210(hw, (u8)offset, &data[0]); - ret_val |= e1000_read_invm_word_i210(hw, (u8)offset+1, + ret_val |= e1000_read_invm_word_i210(hw, (u8)offset + 1, &data[1]); - ret_val |= e1000_read_invm_word_i210(hw, (u8)offset+2, + ret_val |= e1000_read_invm_word_i210(hw, (u8)offset + 2, &data[2]); if (ret_val != E1000_SUCCESS) DEBUGOUT("MAC Addr not found in iNVM\n"); @@ -561,8 +561,6 @@ void e1000_init_function_pointers_i210(struct e1000_hw *hw) { e1000_init_function_pointers_82575(hw); hw->nvm.ops.init_params = e1000_init_nvm_params_i210; - - return; } /** diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index 39e5ad518617..3a912dc3870e 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -841,7 +841,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw) /** * __e1000_access_emi_reg_locked - Read/write EMI register * @hw: pointer to the HW structure - * @addr: EMI address to program + * @address: EMI address to program * @data: pointer to value to read/write from/to the EMI address * @read: boolean flag to indicate read or write * @@ -1619,8 +1619,6 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) if (hw->mac.type >= e1000_pch_lpt) { - u16 phy_reg; - hw->phy.ops.read_reg_locked(hw, I217_PLL_CLOCK_GATE_REG, &phy_reg); phy_reg &= ~I217_PLL_CLOCK_GATE_MASK; @@ -2474,7 +2472,7 @@ release: /** * e1000_configure_k1_ich8lan - Configure K1 power state * @hw: pointer to the HW structure - * @enable: K1 state to configure + * @k1_enable: K1 state to configure * * Configure the K1 power state based on the provided parameter. * Assumes semaphore already acquired. @@ -2622,6 +2620,7 @@ static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw) /** * e1000_hv_phy_workarounds_ich8lan - A series of Phy workarounds to be * done after every PHY reset. + * @hw: pointer to the HW structure **/ static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw) { @@ -2943,6 +2942,7 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) /** * e1000_lv_phy_workarounds_ich8lan - A series of Phy workarounds to be * done after every PHY reset. + * @hw: pointer to the HW structure **/ static s32 e1000_lv_phy_workarounds_ich8lan(struct e1000_hw *hw) { @@ -3550,8 +3550,9 @@ static s32 e1000_read_nvm_spt(struct e1000_hw *hw, u16 offset, u16 words, for (i = 0; i < words; i += 2) { if (words - i == 1) { - if (dev_spec->shadow_ram[offset+i].modified) { - data[i] = dev_spec->shadow_ram[offset+i].value; + if (dev_spec->shadow_ram[offset + i].modified) { + data[i] = + dev_spec->shadow_ram[offset + i].value; } else { offset_to_read = act_offset + i - ((act_offset + i) % 2); @@ -3568,8 +3569,8 @@ static s32 e1000_read_nvm_spt(struct e1000_hw *hw, u16 offset, u16 words, } } else { offset_to_read = act_offset + i; - if (!(dev_spec->shadow_ram[offset+i].modified) || - !(dev_spec->shadow_ram[offset+i+1].modified)) { + if (!(dev_spec->shadow_ram[offset + i].modified) || + !(dev_spec->shadow_ram[offset + i + 1].modified)) { ret_val = e1000_read_flash_dword_ich8lan(hw, offset_to_read, @@ -3577,15 +3578,16 @@ static s32 e1000_read_nvm_spt(struct e1000_hw *hw, u16 offset, u16 words, if (ret_val) break; } - if (dev_spec->shadow_ram[offset+i].modified) - data[i] = dev_spec->shadow_ram[offset+i].value; + if (dev_spec->shadow_ram[offset + i].modified) + data[i] = + dev_spec->shadow_ram[offset + i].value; else - data[i] = (u16) (dword & 0xFFFF); - if (dev_spec->shadow_ram[offset+i].modified) - data[i+1] = - dev_spec->shadow_ram[offset+i+1].value; + data[i] = (u16)(dword & 0xFFFF); + if (dev_spec->shadow_ram[offset + i + 1].modified) + data[i + 1] = + dev_spec->shadow_ram[offset + i + 1].value; else - data[i+1] = (u16) (dword >> 16 & 0xFFFF); + data[i + 1] = (u16)(dword >> 16 & 0xFFFF); } } @@ -3639,8 +3641,8 @@ static s32 e1000_read_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words, ret_val = E1000_SUCCESS; for (i = 0; i < words; i++) { - if (dev_spec->shadow_ram[offset+i].modified) { - data[i] = dev_spec->shadow_ram[offset+i].value; + if (dev_spec->shadow_ram[offset + i].modified) { + data[i] = dev_spec->shadow_ram[offset + i].value; } else { ret_val = e1000_read_flash_word_ich8lan(hw, act_offset + i, @@ -4045,8 +4047,8 @@ static s32 e1000_write_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words, nvm->ops.acquire(hw); for (i = 0; i < words; i++) { - dev_spec->shadow_ram[offset+i].modified = TRUE; - dev_spec->shadow_ram[offset+i].value = data[i]; + dev_spec->shadow_ram[offset + i].modified = TRUE; + dev_spec->shadow_ram[offset + i].value = data[i]; } nvm->ops.release(hw); diff --git a/sys/dev/e1000/e1000_mac.c b/sys/dev/e1000/e1000_mac.c index bda2ad65e3dc..e0d078d924f9 100644 --- a/sys/dev/e1000/e1000_mac.c +++ b/sys/dev/e1000/e1000_mac.c @@ -2362,7 +2362,7 @@ e1000_release_swfw_sync(struct e1000_hw *hw, u16 mask) ; /* Empty */ swfw_sync = E1000_READ_REG(hw, E1000_SW_FW_SYNC); - swfw_sync &= ~mask; + swfw_sync &= (u32)~mask; E1000_WRITE_REG(hw, E1000_SW_FW_SYNC, swfw_sync); e1000_put_hw_semaphore(hw); diff --git a/sys/dev/e1000/e1000_nvm.c b/sys/dev/e1000/e1000_nvm.c index 46c00e1d64b3..86a1e772fb13 100644 --- a/sys/dev/e1000/e1000_nvm.c +++ b/sys/dev/e1000/e1000_nvm.c @@ -578,7 +578,7 @@ s32 e1000_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) } for (i = 0; i < words; i++) { - eerd = ((offset+i) << E1000_NVM_RW_ADDR_SHIFT) + + eerd = ((offset + i) << E1000_NVM_RW_ADDR_SHIFT) + E1000_NVM_RW_REG_START; E1000_WRITE_REG(hw, E1000_EERD, eerd); diff --git a/sys/dev/e1000/e1000_phy.c b/sys/dev/e1000/e1000_phy.c index d73e3a10ae13..d84b6120dd31 100644 --- a/sys/dev/e1000/e1000_phy.c +++ b/sys/dev/e1000/e1000_phy.c @@ -621,7 +621,7 @@ s32 e1000_write_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 data) * lane and update whole word */ data_local = i2ccmd & 0xFF00; - data_local |= data; + data_local |= (u32)data; i2ccmd = ((offset << E1000_I2CCMD_REG_ADDR_SHIFT) | E1000_I2CCMD_OPCODE_WRITE | data_local); @@ -3094,6 +3094,7 @@ s32 e1000_determine_phy_address(struct e1000_hw *hw) /** * e1000_get_phy_addr_for_bm_page - Retrieve PHY page address * @page: page to access + * @reg: register to access * * Returns the phy address for the page requested. **/ @@ -3531,6 +3532,7 @@ void e1000_power_down_phy_copper(struct e1000_hw *hw) * @offset: register offset to be read * @data: pointer to the read data * @locked: semaphore has already been acquired or not + * @page_set: BM_WUC_PAGE already set and access enabled * * Acquires semaphore, if necessary, then reads the PHY register at offset * and stores the retrieved information in data. Release any acquired @@ -3641,6 +3643,7 @@ s32 e1000_read_phy_reg_page_hv(struct e1000_hw *hw, u32 offset, u16 *data) * @offset: register offset to write to * @data: data to write at register offset * @locked: semaphore has already been acquired or not + * @page_set: BM_WUC_PAGE already set and access enabled * * Acquires semaphore, if necessary, then writes the data to PHY register * at the offset. Release any acquired semaphores before exiting. From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:16:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1D35166A61B; Fri, 17 Sep 2021 21:16:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB6GJ0Kc7z4jF8; Fri, 17 Sep 2021 21:16:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9A701CEFE; Fri, 17 Sep 2021 21:16:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HLGtNU028825; Fri, 17 Sep 2021 21:16:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HLGtdj028824; Fri, 17 Sep 2021 21:16:55 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:16:55 GMT Message-Id: <202109172116.18HLGtdj028824@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: d50f362b505e - main - e1000: modify HW level time sync mechanisms MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d50f362b505e9026fbd33d00dc43e09cac26a209 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:16:56 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=d50f362b505e9026fbd33d00dc43e09cac26a209 commit d50f362b505e9026fbd33d00dc43e09cac26a209 Author: Guinan Sun AuthorDate: 2020-07-06 08:12:04 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:16:15 +0000 e1000: modify HW level time sync mechanisms Add additional configuration space access to allow HW level time sync mechanism. Signed-off-by: Evgeny Efimov Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (d53391f1fe2e0eba8818517fdf285f893d95dcc8) MFC after: 1 week --- sys/dev/e1000/e1000_ich8lan.c | 18 ++++++++++++++++++ sys/dev/e1000/e1000_ich8lan.h | 2 ++ 2 files changed, 20 insertions(+) diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index 3a912dc3870e..1d15881f047d 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -4963,6 +4963,7 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) u16 kum_cfg; u32 ctrl, reg; s32 ret_val; + u16 pci_cfg; DEBUGFUNC("e1000_reset_hw_ich8lan"); @@ -5023,11 +5024,28 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) e1000_gate_hw_phy_config_ich8lan(hw, TRUE); } ret_val = e1000_acquire_swflag_ich8lan(hw); + + /* Read from EXTCNF_CTRL in e1000_acquire_swflag_ich8lan function + * may occur during global reset and cause system hang. + * Configuration space access creates the needed delay. + * Write to E1000_STRAP RO register E1000_PCI_VENDOR_ID_REGISTER value + * insures configuration space read is done before global reset. + */ + e1000_read_pci_cfg(hw, E1000_PCI_VENDOR_ID_REGISTER, &pci_cfg); + E1000_WRITE_REG(hw, E1000_STRAP, pci_cfg); DEBUGOUT("Issuing a global reset to ich8lan\n"); E1000_WRITE_REG(hw, E1000_CTRL, (ctrl | E1000_CTRL_RST)); /* cannot issue a flush here because it hangs the hardware */ msec_delay(20); + /* Configuration space access improve HW level time sync mechanism. + * Write to E1000_STRAP RO register E1000_PCI_VENDOR_ID_REGISTER + * value to insure configuration space read is done + * before any access to mac register. + */ + e1000_read_pci_cfg(hw, E1000_PCI_VENDOR_ID_REGISTER, &pci_cfg); + E1000_WRITE_REG(hw, E1000_STRAP, pci_cfg); + /* Set Phy Config Counter to 50msec */ if (hw->mac.type == e1000_pch2lan) { reg = E1000_READ_REG(hw, E1000_FEXTNVM3); diff --git a/sys/dev/e1000/e1000_ich8lan.h b/sys/dev/e1000/e1000_ich8lan.h index a467e647636f..12f912ebc6e0 100644 --- a/sys/dev/e1000/e1000_ich8lan.h +++ b/sys/dev/e1000/e1000_ich8lan.h @@ -327,6 +327,8 @@ #define E1000_SVCR_OFF_TIMER_SHIFT 16 #define E1000_SVT_OFF_HWM_MASK 0x0000001F +#define E1000_PCI_VENDOR_ID_REGISTER 0x00 + void e1000_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw, bool state); void e1000_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw); From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:17:47 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0047466A69A; Fri, 17 Sep 2021 21:17:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB6HG69svz4jHb; Fri, 17 Sep 2021 21:17:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B447B1D313; Fri, 17 Sep 2021 21:17:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HLHk1n028993; Fri, 17 Sep 2021 21:17:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HLHkiX028992; Fri, 17 Sep 2021 21:17:46 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:17:46 GMT Message-Id: <202109172117.18HLHkiX028992@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 6b9d35fac12b - main - e1000: remove duplicated phy codes MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6b9d35fac12bf657cd1df8f1521c70704ff62b61 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:17:47 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=6b9d35fac12bf657cd1df8f1521c70704ff62b61 commit 6b9d35fac12bf657cd1df8f1521c70704ff62b61 Author: Guinan Sun AuthorDate: 2020-07-06 08:12:05 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:17:15 +0000 e1000: remove duplicated phy codes Add two files base.c and base.h to reduce the redundancy in the silicon family code. Remove the code duplication from e1000_82575 files. Clean family specific functions from base. Fix up a stray and duplicate function declaration. Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Neftin Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (44dddd14059f151f39f7e075b887decfc9a10f11) MFC after: 1 week --- sys/conf/files | 2 + sys/dev/e1000/e1000_82575.c | 471 ++++++++++++++---------------------------- sys/dev/e1000/e1000_82575.h | 93 +-------- sys/dev/e1000/e1000_api.h | 1 - sys/dev/e1000/e1000_base.c | 221 ++++++++++++++++++++ sys/dev/e1000/e1000_base.h | 158 ++++++++++++++ sys/dev/e1000/e1000_defines.h | 14 +- sys/dev/e1000/e1000_hw.h | 1 + sys/dev/e1000/e1000_i210.c | 2 +- sys/dev/e1000/e1000_regs.h | 23 ++- sys/dev/e1000/if_em.c | 2 +- sys/dev/e1000/igb_txrx.c | 4 +- sys/modules/em/Makefile | 6 +- 13 files changed, 578 insertions(+), 420 deletions(-) diff --git a/sys/conf/files b/sys/conf/files index 4dd0151945bb..bf1c680093d1 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -1674,6 +1674,8 @@ dev/e1000/e1000_i210.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_api.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" +dev/e1000/e1000_base.c optional em \ + compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_mac.c optional em \ compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_manage.c optional em \ diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index b252a4c7ff1d..172e99b02d5c 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -48,8 +48,6 @@ static s32 e1000_init_phy_params_82575(struct e1000_hw *hw); static s32 e1000_init_mac_params_82575(struct e1000_hw *hw); -static s32 e1000_acquire_phy_82575(struct e1000_hw *hw); -static void e1000_release_phy_82575(struct e1000_hw *hw); static s32 e1000_acquire_nvm_82575(struct e1000_hw *hw); static void e1000_release_nvm_82575(struct e1000_hw *hw); static s32 e1000_check_for_link_82575(struct e1000_hw *hw); @@ -61,6 +59,7 @@ static s32 e1000_phy_hw_reset_sgmii_82575(struct e1000_hw *hw); static s32 e1000_read_phy_reg_sgmii_82575(struct e1000_hw *hw, u32 offset, u16 *data); static s32 e1000_reset_hw_82575(struct e1000_hw *hw); +static s32 e1000_init_hw_82575(struct e1000_hw *hw); static s32 e1000_reset_hw_82580(struct e1000_hw *hw); static s32 e1000_read_phy_reg_82580(struct e1000_hw *hw, u32 offset, u16 *data); @@ -84,10 +83,8 @@ static s32 e1000_get_pcs_speed_and_duplex_82575(struct e1000_hw *hw, u16 *speed, u16 *duplex); static s32 e1000_get_phy_id_82575(struct e1000_hw *hw); static bool e1000_sgmii_active_82575(struct e1000_hw *hw); -static s32 e1000_reset_init_script_82575(struct e1000_hw *hw); static s32 e1000_read_mac_addr_82575(struct e1000_hw *hw); static void e1000_config_collision_dist_82575(struct e1000_hw *hw); -static void e1000_power_down_phy_copper_82575(struct e1000_hw *hw); static void e1000_shutdown_serdes_link_82575(struct e1000_hw *hw); static void e1000_power_up_serdes_link_82575(struct e1000_hw *hw); static s32 e1000_set_pcie_completion_timeout(struct e1000_hw *hw); @@ -156,8 +153,8 @@ static bool e1000_sgmii_uses_mdio_82575(struct e1000_hw *hw) } /** - * e1000_init_phy_params_82575 - Init PHY func ptrs. - * @hw: pointer to the HW structure + * e1000_init_phy_params_82575 - Initialize PHY function ptrs + * @hw: pointer to the HW structure **/ static s32 e1000_init_phy_params_82575(struct e1000_hw *hw) { @@ -175,17 +172,17 @@ static s32 e1000_init_phy_params_82575(struct e1000_hw *hw) goto out; } - phy->ops.power_up = e1000_power_up_phy_copper; - phy->ops.power_down = e1000_power_down_phy_copper_82575; + phy->ops.power_up = e1000_power_up_phy_copper; + phy->ops.power_down = e1000_power_down_phy_copper_base; phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; phy->reset_delay_us = 100; - phy->ops.acquire = e1000_acquire_phy_82575; + phy->ops.acquire = e1000_acquire_phy_base; phy->ops.check_reset_block = e1000_check_reset_block_generic; phy->ops.commit = e1000_phy_sw_reset_generic; phy->ops.get_cfg_done = e1000_get_cfg_done_82575; - phy->ops.release = e1000_release_phy_82575; + phy->ops.release = e1000_release_phy_base; ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT); @@ -232,76 +229,39 @@ static s32 e1000_init_phy_params_82575(struct e1000_hw *hw) case I347AT4_E_PHY_ID: case M88E1112_E_PHY_ID: case M88E1340M_E_PHY_ID: + phy->type = e1000_phy_m88; + phy->ops.check_polarity = e1000_check_polarity_m88; + phy->ops.get_info = e1000_get_phy_info_m88; + phy->ops.get_cable_length = e1000_get_cable_length_m88_gen2; + phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_m88; + break; case M88E1111_I_PHY_ID: phy->type = e1000_phy_m88; phy->ops.check_polarity = e1000_check_polarity_m88; phy->ops.get_info = e1000_get_phy_info_m88; - if (phy->id == I347AT4_E_PHY_ID || - phy->id == M88E1112_E_PHY_ID || - phy->id == M88E1340M_E_PHY_ID) - phy->ops.get_cable_length = - e1000_get_cable_length_m88_gen2; - else if (phy->id == M88E1543_E_PHY_ID || - phy->id == M88E1512_E_PHY_ID) - phy->ops.get_cable_length = - e1000_get_cable_length_m88_gen2; - else - phy->ops.get_cable_length = e1000_get_cable_length_m88; + phy->ops.get_cable_length = e1000_get_cable_length_m88; phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_m88; - /* Check if this PHY is confgured for media swap. */ - if (phy->id == M88E1112_E_PHY_ID) { - u16 data; - - ret_val = phy->ops.write_reg(hw, - E1000_M88E1112_PAGE_ADDR, - 2); - if (ret_val) - goto out; - - ret_val = phy->ops.read_reg(hw, - E1000_M88E1112_MAC_CTRL_1, - &data); - if (ret_val) - goto out; - - data = (data & E1000_M88E1112_MAC_CTRL_1_MODE_MASK) >> - E1000_M88E1112_MAC_CTRL_1_MODE_SHIFT; - if (data == E1000_M88E1112_AUTO_COPPER_SGMII || - data == E1000_M88E1112_AUTO_COPPER_BASEX) - hw->mac.ops.check_for_link = - e1000_check_for_link_media_swap; - } - if (phy->id == M88E1512_E_PHY_ID) { - ret_val = e1000_initialize_M88E1512_phy(hw); - if (ret_val) - goto out; - } - if (phy->id == M88E1543_E_PHY_ID) { - ret_val = e1000_initialize_M88E1543_phy(hw); - if (ret_val) - goto out; - } break; case IGP03E1000_E_PHY_ID: case IGP04E1000_E_PHY_ID: - phy->type = e1000_phy_igp_3; - phy->ops.check_polarity = e1000_check_polarity_igp; - phy->ops.get_info = e1000_get_phy_info_igp; + phy->type = e1000_phy_igp_3; + phy->ops.check_polarity = e1000_check_polarity_igp; + phy->ops.get_info = e1000_get_phy_info_igp; phy->ops.get_cable_length = e1000_get_cable_length_igp_2; - phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_igp; phy->ops.set_d0_lplu_state = e1000_set_d0_lplu_state_82575; phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_generic; + phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_igp; break; case I82580_I_PHY_ID: case I350_I_PHY_ID: - phy->type = e1000_phy_82580; - phy->ops.check_polarity = e1000_check_polarity_82577; - phy->ops.force_speed_duplex = - e1000_phy_force_speed_duplex_82577; + phy->type = e1000_phy_82580; + phy->ops.check_polarity = e1000_check_polarity_82577; + phy->ops.get_info = e1000_get_phy_info_82577; phy->ops.get_cable_length = e1000_get_cable_length_82577; - phy->ops.get_info = e1000_get_phy_info_82577; phy->ops.set_d0_lplu_state = e1000_set_d0_lplu_state_82580; phy->ops.set_d3_lplu_state = e1000_set_d3_lplu_state_82580; + phy->ops.force_speed_duplex = + e1000_phy_force_speed_duplex_82577; break; case I210_I_PHY_ID: phy->type = e1000_phy_i210; @@ -317,98 +277,49 @@ static s32 e1000_init_phy_params_82575(struct e1000_hw *hw) goto out; } -out: - return ret_val; -} - -/** - * e1000_init_nvm_params_82575 - Init NVM func ptrs. - * @hw: pointer to the HW structure - **/ -s32 e1000_init_nvm_params_82575(struct e1000_hw *hw) -{ - struct e1000_nvm_info *nvm = &hw->nvm; - u32 eecd = E1000_READ_REG(hw, E1000_EECD); - u16 size; - - DEBUGFUNC("e1000_init_nvm_params_82575"); - - size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >> - E1000_EECD_SIZE_EX_SHIFT); - /* - * Added to a constant, "size" becomes the left-shift value - * for setting word_size. - */ - size += NVM_WORD_SIZE_BASE_SHIFT; - - /* Just in case size is out of range, cap it to the largest - * EEPROM size supported - */ - if (size > 15) - size = 15; - - nvm->word_size = 1 << size; - if (hw->mac.type < e1000_i210) { - nvm->opcode_bits = 8; - nvm->delay_usec = 1; + /* Check if this PHY is configured for media swap. */ + switch (phy->id) { + case M88E1112_E_PHY_ID: + { + u16 data; - switch (nvm->override) { - case e1000_nvm_override_spi_large: - nvm->page_size = 32; - nvm->address_bits = 16; - break; - case e1000_nvm_override_spi_small: - nvm->page_size = 8; - nvm->address_bits = 8; - break; - default: - nvm->page_size = eecd & E1000_EECD_ADDR_BITS ? 32 : 8; - nvm->address_bits = eecd & E1000_EECD_ADDR_BITS ? - 16 : 8; - break; - } - if (nvm->word_size == (1 << 15)) - nvm->page_size = 128; + ret_val = phy->ops.write_reg(hw, E1000_M88E1112_PAGE_ADDR, 2); + if (ret_val) + goto out; + ret_val = phy->ops.read_reg(hw, E1000_M88E1112_MAC_CTRL_1, + &data); + if (ret_val) + goto out; - nvm->type = e1000_nvm_eeprom_spi; - } else { - nvm->type = e1000_nvm_flash_hw; + data = (data & E1000_M88E1112_MAC_CTRL_1_MODE_MASK) >> + E1000_M88E1112_MAC_CTRL_1_MODE_SHIFT; + if (data == E1000_M88E1112_AUTO_COPPER_SGMII || + data == E1000_M88E1112_AUTO_COPPER_BASEX) + hw->mac.ops.check_for_link = + e1000_check_for_link_media_swap; + break; } - - /* Function Pointers */ - nvm->ops.acquire = e1000_acquire_nvm_82575; - nvm->ops.release = e1000_release_nvm_82575; - if (nvm->word_size < (1 << 15)) - nvm->ops.read = e1000_read_nvm_eerd; - else - nvm->ops.read = e1000_read_nvm_spi; - - nvm->ops.write = e1000_write_nvm_spi; - nvm->ops.validate = e1000_validate_nvm_checksum_generic; - nvm->ops.update = e1000_update_nvm_checksum_generic; - nvm->ops.valid_led_default = e1000_valid_led_default_82575; - - /* override generic family function pointers for specific descendants */ - switch (hw->mac.type) { - case e1000_82580: - nvm->ops.validate = e1000_validate_nvm_checksum_82580; - nvm->ops.update = e1000_update_nvm_checksum_82580; + case M88E1512_E_PHY_ID: + { + ret_val = e1000_initialize_M88E1512_phy(hw); break; - case e1000_i350: - case e1000_i354: - nvm->ops.validate = e1000_validate_nvm_checksum_i350; - nvm->ops.update = e1000_update_nvm_checksum_i350; + } + case M88E1543_E_PHY_ID: + { + ret_val = e1000_initialize_M88E1543_phy(hw); break; + } default: - break; + goto out; } - return E1000_SUCCESS; +out: + return ret_val; } /** - * e1000_init_mac_params_82575 - Init MAC func ptrs. - * @hw: pointer to the HW structure + * e1000_init_mac_params_82575 - Init MAC func ptrs. + * @hw: pointer to the HW structure **/ static s32 e1000_init_mac_params_82575(struct e1000_hw *hw) { @@ -417,13 +328,16 @@ static s32 e1000_init_mac_params_82575(struct e1000_hw *hw) DEBUGFUNC("e1000_init_mac_params_82575"); + /* Initialize function pointer */ + e1000_init_mac_ops_generic(hw); + /* Derives media type */ e1000_get_media_type_82575(hw); - /* Set mta register count */ + /* Set MTA register count */ mac->mta_reg_count = 128; - /* Set uta register count */ + /* Set UTA register count */ mac->uta_reg_count = (hw->mac.type == e1000_82575) ? 0 : 128; - /* Set rar entry count */ + /* Set RAR entry count */ mac->rar_entry_count = E1000_RAR_ENTRIES_82575; if (mac->type == e1000_82576) mac->rar_entry_count = E1000_RAR_ENTRIES_82576; @@ -456,8 +370,8 @@ static s32 e1000_init_mac_params_82575(struct e1000_hw *hw) if (mac->type >= e1000_82580) mac->ops.reset_hw = e1000_reset_hw_82580; else - mac->ops.reset_hw = e1000_reset_hw_82575; - /* hw initialization */ + mac->ops.reset_hw = e1000_reset_hw_82575; + /* HW initialization */ if ((mac->type == e1000_i210) || (mac->type == e1000_i211)) mac->ops.init_hw = e1000_init_hw_i210; else @@ -493,7 +407,7 @@ static s32 e1000_init_mac_params_82575(struct e1000_hw *hw) } if (hw->mac.type >= e1000_82580) mac->ops.validate_mdi_setting = - e1000_validate_mdi_setting_crossover_generic; + e1000_validate_mdi_setting_crossover_generic; /* ID LED init */ mac->ops.id_led_init = e1000_id_led_init_generic; /* blink LED */ @@ -511,6 +425,7 @@ static s32 e1000_init_mac_params_82575(struct e1000_hw *hw) mac->ops.get_link_up_info = e1000_get_link_up_info_82575; /* acquire SW_FW sync */ mac->ops.acquire_swfw_sync = e1000_acquire_swfw_sync; + /* release SW_FW sync */ mac->ops.release_swfw_sync = e1000_release_swfw_sync; /* set lan id for port to determine which phy lock to use */ @@ -520,63 +435,102 @@ static s32 e1000_init_mac_params_82575(struct e1000_hw *hw) } /** - * e1000_init_function_pointers_82575 - Init func ptrs. - * @hw: pointer to the HW structure - * - * Called to initialize all function pointers and parameters. + * e1000_init_nvm_params_82575 - Initialize NVM function ptrs + * @hw: pointer to the HW structure **/ -void e1000_init_function_pointers_82575(struct e1000_hw *hw) +s32 e1000_init_nvm_params_82575(struct e1000_hw *hw) { - DEBUGFUNC("e1000_init_function_pointers_82575"); + struct e1000_nvm_info *nvm = &hw->nvm; + u32 eecd = E1000_READ_REG(hw, E1000_EECD); + u16 size; - hw->mac.ops.init_params = e1000_init_mac_params_82575; - hw->nvm.ops.init_params = e1000_init_nvm_params_82575; - hw->phy.ops.init_params = e1000_init_phy_params_82575; - hw->mbx.ops.init_params = e1000_init_mbx_params_pf; -} + DEBUGFUNC("e1000_init_nvm_params_82575"); -/** - * e1000_acquire_phy_82575 - Acquire rights to access PHY - * @hw: pointer to the HW structure - * - * Acquire access rights to the correct PHY. - **/ -static s32 e1000_acquire_phy_82575(struct e1000_hw *hw) -{ - u16 mask = E1000_SWFW_PHY0_SM; + size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >> + E1000_EECD_SIZE_EX_SHIFT); + /* Added to a constant, "size" becomes the left-shift value + * for setting word_size. + */ + size += NVM_WORD_SIZE_BASE_SHIFT; - DEBUGFUNC("e1000_acquire_phy_82575"); + /* Just in case size is out of range, cap it to the largest + * EEPROM size supported + */ + if (size > 15) + size = 15; - if (hw->bus.func == E1000_FUNC_1) - mask = E1000_SWFW_PHY1_SM; - else if (hw->bus.func == E1000_FUNC_2) - mask = E1000_SWFW_PHY2_SM; - else if (hw->bus.func == E1000_FUNC_3) - mask = E1000_SWFW_PHY3_SM; + nvm->word_size = 1 << size; + if (hw->mac.type < e1000_i210) { + nvm->opcode_bits = 8; + nvm->delay_usec = 1; + + switch (nvm->override) { + case e1000_nvm_override_spi_large: + nvm->page_size = 32; + nvm->address_bits = 16; + break; + case e1000_nvm_override_spi_small: + nvm->page_size = 8; + nvm->address_bits = 8; + break; + default: + nvm->page_size = eecd & E1000_EECD_ADDR_BITS ? 32 : 8; + nvm->address_bits = eecd & E1000_EECD_ADDR_BITS ? + 16 : 8; + break; + } + if (nvm->word_size == (1 << 15)) + nvm->page_size = 128; + + nvm->type = e1000_nvm_eeprom_spi; + } else { + nvm->type = e1000_nvm_flash_hw; + } + + /* Function Pointers */ + nvm->ops.acquire = e1000_acquire_nvm_82575; + nvm->ops.release = e1000_release_nvm_82575; + if (nvm->word_size < (1 << 15)) + nvm->ops.read = e1000_read_nvm_eerd; + else + nvm->ops.read = e1000_read_nvm_spi; + + nvm->ops.write = e1000_write_nvm_spi; + nvm->ops.validate = e1000_validate_nvm_checksum_generic; + nvm->ops.update = e1000_update_nvm_checksum_generic; + nvm->ops.valid_led_default = e1000_valid_led_default_82575; + + /* override generic family function pointers for specific descendants */ + switch (hw->mac.type) { + case e1000_82580: + nvm->ops.validate = e1000_validate_nvm_checksum_82580; + nvm->ops.update = e1000_update_nvm_checksum_82580; + break; + case e1000_i350: + nvm->ops.validate = e1000_validate_nvm_checksum_i350; + nvm->ops.update = e1000_update_nvm_checksum_i350; + break; + default: + break; + } - return hw->mac.ops.acquire_swfw_sync(hw, mask); + return E1000_SUCCESS; } /** - * e1000_release_phy_82575 - Release rights to access PHY + * e1000_init_function_pointers_82575 - Init func ptrs. * @hw: pointer to the HW structure * - * A wrapper to release access rights to the correct PHY. + * Called to initialize all function pointers and parameters. **/ -static void e1000_release_phy_82575(struct e1000_hw *hw) +void e1000_init_function_pointers_82575(struct e1000_hw *hw) { - u16 mask = E1000_SWFW_PHY0_SM; - - DEBUGFUNC("e1000_release_phy_82575"); - - if (hw->bus.func == E1000_FUNC_1) - mask = E1000_SWFW_PHY1_SM; - else if (hw->bus.func == E1000_FUNC_2) - mask = E1000_SWFW_PHY2_SM; - else if (hw->bus.func == E1000_FUNC_3) - mask = E1000_SWFW_PHY3_SM; + DEBUGFUNC("e1000_init_function_pointers_82575"); - hw->mac.ops.release_swfw_sync(hw, mask); + hw->mac.ops.init_params = e1000_init_mac_params_82575; + hw->nvm.ops.init_params = e1000_init_nvm_params_82575; + hw->phy.ops.init_params = e1000_init_phy_params_82575; + hw->mbx.ops.init_params = e1000_init_mbx_params_pf; } /** @@ -1401,16 +1355,15 @@ static s32 e1000_reset_hw_82575(struct e1000_hw *hw) } /** - * e1000_init_hw_82575 - Initialize hardware - * @hw: pointer to the HW structure + * e1000_init_hw_82575 - Initialize hardware + * @hw: pointer to the HW structure * - * This inits the hardware readying it for operation. + * This inits the hardware readying it for operation. **/ -s32 e1000_init_hw_82575(struct e1000_hw *hw) +STATIC s32 e1000_init_hw_82575(struct e1000_hw *hw) { struct e1000_mac_info *mac = &hw->mac; s32 ret_val; - u16 i, rar_count = mac->rar_entry_count; DEBUGFUNC("e1000_init_hw_82575"); @@ -1425,27 +1378,12 @@ s32 e1000_init_hw_82575(struct e1000_hw *hw) DEBUGOUT("Initializing the IEEE VLAN\n"); mac->ops.clear_vfta(hw); - /* Setup the receive address */ - e1000_init_rx_addrs_generic(hw, rar_count); - - /* Zero out the Multicast HASH table */ - DEBUGOUT("Zeroing the MTA\n"); - for (i = 0; i < mac->mta_reg_count; i++) - E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0); - - /* Zero out the Unicast HASH table */ - DEBUGOUT("Zeroing the UTA\n"); - for (i = 0; i < mac->uta_reg_count; i++) - E1000_WRITE_REG_ARRAY(hw, E1000_UTA, i, 0); - - /* Setup link and flow control */ - ret_val = mac->ops.setup_link(hw); + ret_val = e1000_init_hw_base(hw); /* Set the default MTU size */ hw->dev_spec._82575.mtu = 1500; - /* - * Clear all of the statistics registers (clear on read). It is + /* Clear all of the statistics registers (clear on read). It is * important that we do this after we have tried to establish link * because the symbol error count will increment wildly if there * is no link. @@ -1454,7 +1392,6 @@ s32 e1000_init_hw_82575(struct e1000_hw *hw) return ret_val; } - /** * e1000_setup_copper_link_82575 - Configure copper link settings * @hw: pointer to the HW structure @@ -1465,9 +1402,9 @@ s32 e1000_init_hw_82575(struct e1000_hw *hw) **/ static s32 e1000_setup_copper_link_82575(struct e1000_hw *hw) { + u32 phpm_reg; u32 ctrl; s32 ret_val; - u32 phpm_reg; DEBUGFUNC("e1000_setup_copper_link_82575"); @@ -1889,7 +1826,7 @@ static bool e1000_sgmii_active_82575(struct e1000_hw *hw) * Inits recommended HW defaults after a reset when there is no EEPROM * detected. This is only for the 82575. **/ -static s32 e1000_reset_init_script_82575(struct e1000_hw *hw) +s32 e1000_reset_init_script_82575(struct e1000_hw *hw) { DEBUGFUNC("e1000_reset_init_script_82575"); @@ -1967,27 +1904,6 @@ static void e1000_config_collision_dist_82575(struct e1000_hw *hw) E1000_WRITE_FLUSH(hw); } -/** - * e1000_power_down_phy_copper_82575 - Remove link during PHY power down - * @hw: pointer to the HW structure - * - * In the case of a PHY power down to save power, or to turn off link during a - * driver unload, or wake on lan is not enabled, remove the link. - **/ -static void e1000_power_down_phy_copper_82575(struct e1000_hw *hw) -{ - struct e1000_phy_info *phy = &hw->phy; - - if (!(phy->ops.check_reset_block)) - return; - - /* If the management interface is not enabled, then power down */ - if (!(e1000_enable_mng_pass_thru(hw) || phy->ops.check_reset_block(hw))) - e1000_power_down_phy_copper(hw); - - return; -} - /** * e1000_clear_hw_cntrs_82575 - Clear device specific hardware counters * @hw: pointer to the HW structure @@ -2053,85 +1969,6 @@ static void e1000_clear_hw_cntrs_82575(struct e1000_hw *hw) E1000_READ_REG(hw, E1000_SCVPC); } -/** - * e1000_rx_fifo_flush_82575 - Clean rx fifo after Rx enable - * @hw: pointer to the HW structure - * - * After Rx enable, if manageability is enabled then there is likely some - * bad data at the start of the fifo and possibly in the DMA fifo. This - * function clears the fifos and flushes any packets that came in as rx was - * being enabled. - **/ -void e1000_rx_fifo_flush_82575(struct e1000_hw *hw) -{ - u32 rctl, rlpml, rxdctl[4], rfctl, temp_rctl, rx_enabled; - int i, ms_wait; - - DEBUGFUNC("e1000_rx_fifo_flush_82575"); - - /* disable IPv6 options as per hardware errata */ - rfctl = E1000_READ_REG(hw, E1000_RFCTL); - rfctl |= E1000_RFCTL_IPV6_EX_DIS; - E1000_WRITE_REG(hw, E1000_RFCTL, rfctl); - - if (hw->mac.type != e1000_82575 || - !(E1000_READ_REG(hw, E1000_MANC) & E1000_MANC_RCV_TCO_EN)) - return; - - /* Disable all Rx queues */ - for (i = 0; i < 4; i++) { - rxdctl[i] = E1000_READ_REG(hw, E1000_RXDCTL(i)); - E1000_WRITE_REG(hw, E1000_RXDCTL(i), - rxdctl[i] & ~E1000_RXDCTL_QUEUE_ENABLE); - } - /* Poll all queues to verify they have shut down */ - for (ms_wait = 0; ms_wait < 10; ms_wait++) { - msec_delay(1); - rx_enabled = 0; - for (i = 0; i < 4; i++) - rx_enabled |= E1000_READ_REG(hw, E1000_RXDCTL(i)); - if (!(rx_enabled & E1000_RXDCTL_QUEUE_ENABLE)) - break; - } - - if (ms_wait == 10) - DEBUGOUT("Queue disable timed out after 10ms\n"); - - /* Clear RLPML, RCTL.SBP, RFCTL.LEF, and set RCTL.LPE so that all - * incoming packets are rejected. Set enable and wait 2ms so that - * any packet that was coming in as RCTL.EN was set is flushed - */ - E1000_WRITE_REG(hw, E1000_RFCTL, rfctl & ~E1000_RFCTL_LEF); - - rlpml = E1000_READ_REG(hw, E1000_RLPML); - E1000_WRITE_REG(hw, E1000_RLPML, 0); - - rctl = E1000_READ_REG(hw, E1000_RCTL); - temp_rctl = rctl & ~(E1000_RCTL_EN | E1000_RCTL_SBP); - temp_rctl |= E1000_RCTL_LPE; - - E1000_WRITE_REG(hw, E1000_RCTL, temp_rctl); - E1000_WRITE_REG(hw, E1000_RCTL, temp_rctl | E1000_RCTL_EN); - E1000_WRITE_FLUSH(hw); - msec_delay(2); - - /* Enable Rx queues that were previously enabled and restore our - * previous state - */ - for (i = 0; i < 4; i++) - E1000_WRITE_REG(hw, E1000_RXDCTL(i), rxdctl[i]); - E1000_WRITE_REG(hw, E1000_RCTL, rctl); - E1000_WRITE_FLUSH(hw); - - E1000_WRITE_REG(hw, E1000_RLPML, rlpml); - E1000_WRITE_REG(hw, E1000_RFCTL, rfctl); - - /* Flush receive errors generated by workaround */ - E1000_READ_REG(hw, E1000_ROC); - E1000_READ_REG(hw, E1000_RNBC); - E1000_READ_REG(hw, E1000_MPC); -} - /** * e1000_set_pcie_completion_timeout - set pci-e completion timeout * @hw: pointer to the HW structure diff --git a/sys/dev/e1000/e1000_82575.h b/sys/dev/e1000/e1000_82575.h index 22c2f8c4a2f5..d6665bfe64dd 100644 --- a/sys/dev/e1000/e1000_82575.h +++ b/sys/dev/e1000/e1000_82575.h @@ -56,9 +56,7 @@ #define E1000_RAR_ENTRIES_I350 32 #define E1000_SW_SYNCH_MB 0x00000100 #define E1000_STAT_DEV_RST_SET 0x00100000 -#define E1000_CTRL_DEV_RST 0x20000000 -#ifdef E1000_BIT_FIELDS struct e1000_adv_data_desc { __le64 buffer_addr; /* Address of the descriptor's data buffer */ union { @@ -121,7 +119,6 @@ struct e1000_adv_context_desc { } fields; } l4_setup; }; -#endif /* SRRCTL bit definitions */ #define E1000_SRRCTL_BSIZEPKT_SHIFT 10 /* Shift _right_ */ @@ -181,46 +178,12 @@ struct e1000_adv_context_desc { /* Immediate Interrupt Rx (A.K.A. Low Latency Interrupt) */ #define E1000_IMIR_PORT_IM_EN 0x00010000 /* TCP port enable */ #define E1000_IMIR_PORT_BP 0x00020000 /* TCP port check bypass */ -#define E1000_IMIREXT_SIZE_BP 0x00001000 /* Packet size bypass */ #define E1000_IMIREXT_CTRL_URG 0x00002000 /* Check URG bit in header */ #define E1000_IMIREXT_CTRL_ACK 0x00004000 /* Check ACK bit in header */ #define E1000_IMIREXT_CTRL_PSH 0x00008000 /* Check PSH bit in header */ #define E1000_IMIREXT_CTRL_RST 0x00010000 /* Check RST bit in header */ #define E1000_IMIREXT_CTRL_SYN 0x00020000 /* Check SYN bit in header */ #define E1000_IMIREXT_CTRL_FIN 0x00040000 /* Check FIN bit in header */ -#define E1000_IMIREXT_CTRL_BP 0x00080000 /* Bypass check of ctrl bits */ - -/* Receive Descriptor - Advanced */ -union e1000_adv_rx_desc { - struct { - __le64 pkt_addr; /* Packet buffer address */ - __le64 hdr_addr; /* Header buffer address */ - } read; - struct { - struct { - union { - __le32 data; - struct { - __le16 pkt_info; /*RSS type, Pkt type*/ - /* Split Header, header buffer len */ - __le16 hdr_info; - } hs_rss; - } lo_dword; - union { - __le32 rss; /* RSS Hash */ - struct { - __le16 ip_id; /* IP id */ - __le16 csum; /* Packet Checksum */ - } csum_ip; - } hi_dword; - } lower; - struct { - __le32 status_error; /* ext status/error */ - __le16 length; /* Packet length */ - __le16 vlan; /* VLAN tag */ - } upper; - } wb; /* writeback */ -}; #define E1000_RXDADV_RSSTYPE_MASK 0x0000000F #define E1000_RXDADV_RSSTYPE_SHIFT 12 @@ -229,7 +192,6 @@ union e1000_adv_rx_desc { #define E1000_RXDADV_SPLITHEADER_EN 0x00001000 #define E1000_RXDADV_SPH 0x8000 #define E1000_RXDADV_STAT_TS 0x10000 /* Pkt was time stamped */ -#define E1000_RXDADV_STAT_TSIP 0x08000 /* timestamp in packet */ #define E1000_RXDADV_ERR_HBO 0x00800000 /* RSS Hash results */ @@ -278,20 +240,6 @@ union e1000_adv_rx_desc { #define E1000_RXDADV_IPSEC_ERROR_INVALID_LENGTH 0x10000000 #define E1000_RXDADV_IPSEC_ERROR_AUTHENTICATION_FAILED 0x18000000 -/* Transmit Descriptor - Advanced */ -union e1000_adv_tx_desc { - struct { - __le64 buffer_addr; /* Address of descriptor's data buf */ - __le32 cmd_type_len; - __le32 olinfo_status; - } read; - struct { - __le64 rsvd; /* Reserved */ - __le32 nxtseq_seed; - __le32 status; - } wb; -}; - /* Adv Transmit Descriptor Config Masks */ #define E1000_ADVTXD_DTYP_CTXT 0x00200000 /* Advanced Context Descriptor */ #define E1000_ADVTXD_DTYP_DATA 0x00300000 /* Advanced Data Descriptor */ @@ -314,33 +262,6 @@ union e1000_adv_tx_desc { #define E1000_ADVTXD_POPTS_IPSEC 0x00000400 /* IPSec offload request */ #define E1000_ADVTXD_PAYLEN_SHIFT 14 /* Adv desc PAYLEN shift */ -/* Context descriptors */ -struct e1000_adv_tx_context_desc { - __le32 vlan_macip_lens; - __le32 seqnum_seed; - __le32 type_tucmd_mlhl; - __le32 mss_l4len_idx; -}; - -#define E1000_ADVTXD_MACLEN_SHIFT 9 /* Adv ctxt desc mac len shift */ -#define E1000_ADVTXD_VLAN_SHIFT 16 /* Adv ctxt vlan tag shift */ -#define E1000_ADVTXD_TUCMD_IPV4 0x00000400 /* IP Packet Type: 1=IPv4 */ -#define E1000_ADVTXD_TUCMD_IPV6 0x00000000 /* IP Packet Type: 0=IPv6 */ -#define E1000_ADVTXD_TUCMD_L4T_UDP 0x00000000 /* L4 Packet TYPE of UDP */ -#define E1000_ADVTXD_TUCMD_L4T_TCP 0x00000800 /* L4 Packet TYPE of TCP */ -#define E1000_ADVTXD_TUCMD_L4T_SCTP 0x00001000 /* L4 Packet TYPE of SCTP */ -#define E1000_ADVTXD_TUCMD_IPSEC_TYPE_ESP 0x00002000 /* IPSec Type ESP */ -/* IPSec Encrypt Enable for ESP */ -#define E1000_ADVTXD_TUCMD_IPSEC_ENCRYPT_EN 0x00004000 -/* Req requires Markers and CRC */ -#define E1000_ADVTXD_TUCMD_MKRREQ 0x00002000 -#define E1000_ADVTXD_L4LEN_SHIFT 8 /* Adv ctxt L4LEN shift */ -#define E1000_ADVTXD_MSS_SHIFT 16 /* Adv ctxt MSS shift */ -/* Adv ctxt IPSec SA IDX mask */ -#define E1000_ADVTXD_IPSEC_SA_INDEX_MASK 0x000000FF -/* Adv ctxt IPSec ESP len mask */ -#define E1000_ADVTXD_IPSEC_ESP_LEN_MASK 0x000000FF - /* Additional Transmit Descriptor Control definitions */ #define E1000_TXDCTL_QUEUE_ENABLE 0x02000000 /* Ena specific Tx Queue */ #define E1000_TXDCTL_SWFLSH 0x04000000 /* Tx Desc. wbk flushing */ @@ -380,11 +301,6 @@ struct e1000_adv_tx_context_desc { #define E1000_IMS_LSECPNS E1000_ICR_LSECPNS /* PN threshold - server */ #define E1000_ICS_LSECPNS E1000_ICR_LSECPNS /* PN threshold - server */ -/* ETQF register bit definitions */ -#define E1000_ETQF_FILTER_ENABLE (1 << 26) -#define E1000_ETQF_IMM_INT (1 << 29) -#define E1000_ETQF_1588 (1 << 30) -#define E1000_ETQF_QUEUE_ENABLE (1U << 31) /* * ETQF filter list: one static filter per filter consumer. This is * to avoid filter collisions later. Add new filters @@ -395,10 +311,6 @@ struct e1000_adv_tx_context_desc { */ #define E1000_ETQF_FILTER_EAPOL 0 -#define E1000_FTQF_VF_BP 0x00008000 -#define E1000_FTQF_1588_TIME_STAMP 0x08000000 -#define E1000_FTQF_MASK 0xF0000000 -#define E1000_FTQF_MASK_PROTO_BP 0x10000000 #define E1000_FTQF_MASK_SOURCE_ADDR_BP 0x20000000 #define E1000_FTQF_MASK_DEST_ADDR_BP 0x40000000 #define E1000_FTQF_MASK_SOURCE_PORT_BP 0x80000000 @@ -474,13 +386,14 @@ struct e1000_adv_tx_context_desc { #define ALL_QUEUES 0xFFFF +s32 e1000_reset_init_script_82575(struct e1000_hw *hw); +s32 e1000_init_nvm_params_82575(struct e1000_hw *hw); + /* Rx packet buffer size defines */ #define E1000_RXPBS_SIZE_MASK_82576 0x0000007F void e1000_vmdq_set_loopback_pf(struct e1000_hw *hw, bool enable); void e1000_vmdq_set_anti_spoofing_pf(struct e1000_hw *hw, bool enable, int pf); void e1000_vmdq_set_replication_pf(struct e1000_hw *hw, bool enable); -s32 e1000_init_nvm_params_82575(struct e1000_hw *hw); -s32 e1000_init_hw_82575(struct e1000_hw *hw); enum e1000_promisc_type { e1000_promisc_disabled = 0, /* all promisc modes disabled */ diff --git a/sys/dev/e1000/e1000_api.h b/sys/dev/e1000/e1000_api.h index 7e052910e7d0..db4caac37e97 100644 --- a/sys/dev/e1000/e1000_api.h +++ b/sys/dev/e1000/e1000_api.h @@ -46,7 +46,6 @@ extern void e1000_init_function_pointers_82541(struct e1000_hw *hw); extern void e1000_init_function_pointers_80003es2lan(struct e1000_hw *hw); extern void e1000_init_function_pointers_ich8lan(struct e1000_hw *hw); extern void e1000_init_function_pointers_82575(struct e1000_hw *hw); -extern void e1000_rx_fifo_flush_82575(struct e1000_hw *hw); extern void e1000_init_function_pointers_vf(struct e1000_hw *hw); extern void e1000_power_up_fiber_serdes_link(struct e1000_hw *hw); extern void e1000_shutdown_fiber_serdes_link(struct e1000_hw *hw); diff --git a/sys/dev/e1000/e1000_base.c b/sys/dev/e1000/e1000_base.c new file mode 100644 index 000000000000..e12a5fbecf25 --- /dev/null +++ b/sys/dev/e1000/e1000_base.c @@ -0,0 +1,221 @@ +/****************************************************************************** + SPDX-License-Identifier: BSD-3-Clause + + Copyright (c) 2001-2020, Intel Corporation + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + +******************************************************************************/ +/*$FreeBSD$*/ + +#include "e1000_hw.h" +#include "e1000_82575.h" +#include "e1000_mac.h" +#include "e1000_base.h" +#include "e1000_manage.h" + +/** + * e1000_acquire_phy_base - Acquire rights to access PHY + * @hw: pointer to the HW structure + * + * Acquire access rights to the correct PHY. + **/ +s32 e1000_acquire_phy_base(struct e1000_hw *hw) +{ + u16 mask = E1000_SWFW_PHY0_SM; + + DEBUGFUNC("e1000_acquire_phy_base"); + + if (hw->bus.func == E1000_FUNC_1) + mask = E1000_SWFW_PHY1_SM; + else if (hw->bus.func == E1000_FUNC_2) + mask = E1000_SWFW_PHY2_SM; + else if (hw->bus.func == E1000_FUNC_3) + mask = E1000_SWFW_PHY3_SM; + + return hw->mac.ops.acquire_swfw_sync(hw, mask); +} + +/** + * e1000_release_phy_base - Release rights to access PHY + * @hw: pointer to the HW structure + * *** 508 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:19:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F1C5066A6B0; Fri, 17 Sep 2021 21:19:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB6Jl6PpQz4jCb; Fri, 17 Sep 2021 21:19:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC9CF1D314; Fri, 17 Sep 2021 21:19:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HLJ3F1029252; Fri, 17 Sep 2021 21:19:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HLJ3dv029251; Fri, 17 Sep 2021 21:19:03 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:19:03 GMT Message-Id: <202109172119.18HLJ3dv029251@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 1883a6ff3b2e - main - e1000: update for i210 slow system clock MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1883a6ff3b2ebaf108c45717c8eb94e0a76bb0b9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:19:04 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=1883a6ff3b2ebaf108c45717c8eb94e0a76bb0b9 commit 1883a6ff3b2ebaf108c45717c8eb94e0a76bb0b9 Author: Guinan Sun AuthorDate: 2020-07-06 08:11:56 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:18:25 +0000 e1000: update for i210 slow system clock This code is required for the update for system clock. Signed-off-by: Todd Fujinaka Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (3f0188c8f29847038bc9f306b2570ace57e3811c) MFC after: 1 week --- sys/dev/e1000/e1000_i210.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sys/dev/e1000/e1000_i210.c b/sys/dev/e1000/e1000_i210.c index 0bdad37e56d3..cd85a8c3172a 100644 --- a/sys/dev/e1000/e1000_i210.c +++ b/sys/dev/e1000/e1000_i210.c @@ -612,6 +612,8 @@ static s32 e1000_pll_workaround_i210(struct e1000_hw *hw) u16 nvm_word, phy_word, pci_word, tmp_nvm; int i; + /* Get PHY semaphore */ + hw->phy.ops.acquire(hw); /* Get and set needed register values */ wuc = E1000_READ_REG(hw, E1000_WUC); mdicnfg = E1000_READ_REG(hw, E1000_MDICNFG); @@ -626,8 +628,11 @@ static s32 e1000_pll_workaround_i210(struct e1000_hw *hw) tmp_nvm = nvm_word | E1000_INVM_PLL_WO_VAL; for (i = 0; i < E1000_MAX_PLL_TRIES; i++) { /* check current state directly from internal PHY */ - e1000_read_phy_reg_gs40g(hw, (E1000_PHY_PLL_FREQ_PAGE | - E1000_PHY_PLL_FREQ_REG), &phy_word); + e1000_write_phy_reg_mdic(hw, GS40G_PAGE_SELECT, 0xFC); + usec_delay(20); + e1000_read_phy_reg_mdic(hw, E1000_PHY_PLL_FREQ_REG, &phy_word); + usec_delay(20); + e1000_write_phy_reg_mdic(hw, GS40G_PAGE_SELECT, 0); if ((phy_word & E1000_PHY_PLL_UNCONF) != E1000_PHY_PLL_UNCONF) { ret_val = E1000_SUCCESS; @@ -661,6 +666,8 @@ static s32 e1000_pll_workaround_i210(struct e1000_hw *hw) } /* restore MDICNFG setting */ E1000_WRITE_REG(hw, E1000_MDICNFG, mdicnfg); + /* Release PHY semaphore */ + hw->phy.ops.release(hw); return ret_val; } From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:19:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7971766A834; Fri, 17 Sep 2021 21:19:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB6Kl32c7z4jTH; Fri, 17 Sep 2021 21:19:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 480AD1D06C; Fri, 17 Sep 2021 21:19:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HLJtCG029420; Fri, 17 Sep 2021 21:19:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HLJtjL029419; Fri, 17 Sep 2021 21:19:55 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:19:55 GMT Message-Id: <202109172119.18HLJtjL029419@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: d1c37752e2af - main - e1000: expose MAC functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d1c37752e2afb51dfb2e08afe714a799788b6ede Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:19:55 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=d1c37752e2afb51dfb2e08afe714a799788b6ede commit d1c37752e2afb51dfb2e08afe714a799788b6ede Author: Guinan Sun AuthorDate: 2020-07-06 08:12:06 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:19:22 +0000 e1000: expose MAC functions Now the functions are being accessed outside of the file, we need to properly expose them for silicon families to use. Signed-off-by: Jeff Kirsher Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (df01c0ee277d51f81d7d72501dba97550d3b6c4a) MFC after: 1 week --- sys/dev/e1000/e1000_mac.c | 3 +-- sys/dev/e1000/e1000_mac.h | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/e1000/e1000_mac.c b/sys/dev/e1000/e1000_mac.c index e0d078d924f9..a13572d8dc18 100644 --- a/sys/dev/e1000/e1000_mac.c +++ b/sys/dev/e1000/e1000_mac.c @@ -38,7 +38,6 @@ static s32 e1000_validate_mdi_setting_generic(struct e1000_hw *hw); static void e1000_set_lan_id_multi_port_pcie(struct e1000_hw *hw); static void e1000_config_collision_dist_generic(struct e1000_hw *hw); -static int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index); /** * e1000_init_mac_ops_generic - Initialize MAC function pointers @@ -484,7 +483,7 @@ s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw) * Sets the receive address array register at index to the address passed * in by addr. **/ -static int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index) +int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index) { u32 rar_low, rar_high; diff --git a/sys/dev/e1000/e1000_mac.h b/sys/dev/e1000/e1000_mac.h index 1f472d42421e..370f7f9d8a1a 100644 --- a/sys/dev/e1000/e1000_mac.h +++ b/sys/dev/e1000/e1000_mac.h @@ -70,6 +70,7 @@ s32 e1000_led_on_generic(struct e1000_hw *hw); s32 e1000_led_off_generic(struct e1000_hw *hw); void e1000_update_mc_addr_list_generic(struct e1000_hw *hw, u8 *mc_addr_list, u32 mc_addr_count); +int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index); s32 e1000_set_default_fc_generic(struct e1000_hw *hw); s32 e1000_set_fc_watermarks_generic(struct e1000_hw *hw); s32 e1000_setup_fiber_serdes_link_generic(struct e1000_hw *hw); From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:21:11 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C405866A99E for ; Fri, 17 Sep 2021 21:21:11 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [IPv6:2607:f8b0:4864:20::72c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB6MC4xw3z4jTr for ; Fri, 17 Sep 2021 21:21:11 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-qk1-x72c.google.com with SMTP id c10so21674517qko.11 for ; Fri, 17 Sep 2021 14:21:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OdD6yP68iCBuhgNXmy09gqHUNUyqUMFZlv6jO7YM8j8=; b=FytPDH2EqX42eKFyyO24EpbK6l93S/JpF07zoQ+UVy6BugW2r2FtPJ/PFJwGNSzW47 VaGHwhUL0GtbBvfJa1qhGBgieEpU9xwnJMcUgLwMxhZSuZCRG2onfHT557gTHZDOzAfV 9nI3/QoOVeZa+efoA7Gbg/55flcDKV3XmMsUc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=OdD6yP68iCBuhgNXmy09gqHUNUyqUMFZlv6jO7YM8j8=; b=QOMjztzKCF+XRzQ/C1JX8G/CSTtsgoMQ/WBJywdB8++ok3ULSEKxXpjYiKo322GoZP NfFBDjSuqK+SMxw/+RAelGf3tGaYlIsQZQqOgx5AEro1u83R5v41RVq6GTwyTnVxYPcS +1R74qOW65xU/eVUGrpihkIFgFu5GzIMNrMDuKDylSB81hpiHC8jVsc3Gvo9po+oS2ro 0/fcqhUeDBl/4LyFdSFWhdo1CpaiNQF5xq6Vy2mRlv0Drp6Ju8DsfT4BmDF9z01wmL1m vpLxkdlxerwxMM/ddCeJ/2fUzgESSKn1ryP/MRAQ33F2WPmrIArb5sXS34h9Xj/faEXP y4kA== X-Gm-Message-State: AOAM531aeqtOLFG8SZDnngyG0s9oeB+lajlZ/J24GAcidLZ1mot05TZP Jc/Rs1FCcUamGdB/0fL2pphOGTXRxXbt6qc5bIO2MA== X-Google-Smtp-Source: ABdhPJyLWqvV+K3z7s01nH3XB3N9F6oWqnlePJGrBFuMN5kTXlXn5+4cOyL2tGLwCzT4JNHKjY6HhD9GFzpTLgOxGF8= X-Received: by 2002:a05:6902:1204:: with SMTP id s4mr15991574ybu.493.1631913671011; Fri, 17 Sep 2021 14:21:11 -0700 (PDT) MIME-Version: 1.0 References: <202109172119.18HLJtjL029419@gitrepo.freebsd.org> In-Reply-To: <202109172119.18HLJtjL029419@gitrepo.freebsd.org> From: Kevin Bowling Date: Fri, 17 Sep 2021 14:20:59 -0700 Message-ID: Subject: Re: git: d1c37752e2af - main - e1000: expose MAC functions To: Kevin Bowling Cc: src-committers , "" , "dev-commits-src-main@FreeBSD.org" Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4HB6MC4xw3z4jTr X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:21:11 -0000 Sorry for a pasto (X11 clipboard :o)), the DPDK commit hash is aca51d3158c25ea8e50abb3f71c930d667f8c275 here. On Fri, Sep 17, 2021 at 2:19 PM Kevin Bowling wrote: > > The branch main has been updated by kbowling (ports committer): > > URL: https://cgit.FreeBSD.org/src/commit/?id=d1c37752e2afb51dfb2e08afe714a799788b6ede > > commit d1c37752e2afb51dfb2e08afe714a799788b6ede > Author: Guinan Sun > AuthorDate: 2020-07-06 08:12:06 +0000 > Commit: Kevin Bowling > CommitDate: 2021-09-17 21:19:22 +0000 > > e1000: expose MAC functions > > Now the functions are being accessed outside of the file, we need > to properly expose them for silicon families to use. > > Signed-off-by: Jeff Kirsher > Signed-off-by: Guinan Sun > Reviewed-by: Wei Zhao > > Approved by: imp > Obtained from: DPDK (df01c0ee277d51f81d7d72501dba97550d3b6c4a) > MFC after: 1 week > --- > sys/dev/e1000/e1000_mac.c | 3 +-- > sys/dev/e1000/e1000_mac.h | 1 + > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/sys/dev/e1000/e1000_mac.c b/sys/dev/e1000/e1000_mac.c > index e0d078d924f9..a13572d8dc18 100644 > --- a/sys/dev/e1000/e1000_mac.c > +++ b/sys/dev/e1000/e1000_mac.c > @@ -38,7 +38,6 @@ > static s32 e1000_validate_mdi_setting_generic(struct e1000_hw *hw); > static void e1000_set_lan_id_multi_port_pcie(struct e1000_hw *hw); > static void e1000_config_collision_dist_generic(struct e1000_hw *hw); > -static int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index); > > /** > * e1000_init_mac_ops_generic - Initialize MAC function pointers > @@ -484,7 +483,7 @@ s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw) > * Sets the receive address array register at index to the address passed > * in by addr. > **/ > -static int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index) > +int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index) > { > u32 rar_low, rar_high; > > diff --git a/sys/dev/e1000/e1000_mac.h b/sys/dev/e1000/e1000_mac.h > index 1f472d42421e..370f7f9d8a1a 100644 > --- a/sys/dev/e1000/e1000_mac.h > +++ b/sys/dev/e1000/e1000_mac.h > @@ -70,6 +70,7 @@ s32 e1000_led_on_generic(struct e1000_hw *hw); > s32 e1000_led_off_generic(struct e1000_hw *hw); > void e1000_update_mc_addr_list_generic(struct e1000_hw *hw, > u8 *mc_addr_list, u32 mc_addr_count); > +int e1000_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index); > s32 e1000_set_default_fc_generic(struct e1000_hw *hw); > s32 e1000_set_fc_watermarks_generic(struct e1000_hw *hw); > s32 e1000_setup_fiber_serdes_link_generic(struct e1000_hw *hw); > _______________________________________________ > dev-commits-src-main@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main > To unsubscribe, send any mail to "dev-commits-src-main-unsubscribe@freebsd.org" From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:22:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 03C2266A873; Fri, 17 Sep 2021 21:22:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB6NP4b4fz4jtc; Fri, 17 Sep 2021 21:22:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FBC51D606; Fri, 17 Sep 2021 21:22:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HLMD2b041938; Fri, 17 Sep 2021 21:22:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HLMDe0041937; Fri, 17 Sep 2021 21:22:13 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:22:13 GMT Message-Id: <202109172122.18HLMDe0041937@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: a6f0cc373f0a - main - e1000: add PCIm function state MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a6f0cc373f0afc24c9c27bbba45a6a7a3ac268d1 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:22:14 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a6f0cc373f0afc24c9c27bbba45a6a7a3ac268d1 commit a6f0cc373f0afc24c9c27bbba45a6a7a3ac268d1 Author: Guinan Sun AuthorDate: 2020-07-06 08:12:07 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:21:22 +0000 e1000: add PCIm function state Added define to pcim function state. Signed-off-by: Vitaly Lifshits Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (7ee1a3b273c7f321b50e6ba17c3d9537b1b08347) MFC after: 1 week --- sys/dev/e1000/e1000_defines.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/e1000/e1000_defines.h b/sys/dev/e1000/e1000_defines.h index 4bd575a81671..5b77bd43af1a 100644 --- a/sys/dev/e1000/e1000_defines.h +++ b/sys/dev/e1000/e1000_defines.h @@ -346,6 +346,7 @@ #define E1000_STATUS_PCIX_SPEED_66 0x00000000 /* PCI-X bus spd 50-66MHz */ #define E1000_STATUS_PCIX_SPEED_100 0x00004000 /* PCI-X bus spd 66-100MHz */ #define E1000_STATUS_PCIX_SPEED_133 0x00008000 /* PCI-X bus spd 100-133MHz*/ +#define E1000_STATUS_PCIM_STATE 0x40000000 /* PCIm function state */ #define SPEED_10 10 #define SPEED_100 100 From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:37:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A91F66AE87; Fri, 17 Sep 2021 21:37:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB6jz18jFz4nfT; Fri, 17 Sep 2021 21:37:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 04A6D1D5E0; Fri, 17 Sep 2021 21:37:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HLbQ3r056159; Fri, 17 Sep 2021 21:37:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HLbQQm056158; Fri, 17 Sep 2021 21:37:26 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:37:26 GMT Message-Id: <202109172137.18HLbQQm056158@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 09888d4bc1a2 - main - e1000: add missing register defines MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 09888d4bc1a2c45d121046f79be5c01e4889a67e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:37:27 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=09888d4bc1a2c45d121046f79be5c01e4889a67e commit 09888d4bc1a2c45d121046f79be5c01e4889a67e Author: Guinan Sun AuthorDate: 2020-07-06 08:12:08 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:23:00 +0000 e1000: add missing register defines Added defines for the EEC, SHADOWINF and FLFWUPDATE registers needed for the nvmupd_validate_offset function to correctly validate the NVM update offset. Signed-off-by: Jeff Kirsher Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (2c7fe65ab9a31e6ebf438dad7ccc59bcde83a89f) MFC after: 1 week --- sys/dev/e1000/e1000_regs.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/dev/e1000/e1000_regs.h b/sys/dev/e1000/e1000_regs.h index 2b7696ddea62..fe9834405359 100644 --- a/sys/dev/e1000/e1000_regs.h +++ b/sys/dev/e1000/e1000_regs.h @@ -169,6 +169,8 @@ #define E1000_EMIDATA 0x11 /* Extended Memory Indirect Data */ /* Shadow Ram Write Register - RW */ #define E1000_SRWR 0x12018 +#define E1000_EEC_REG 0x12010 + #define E1000_I210_FLMNGCTL 0x12038 #define E1000_I210_FLMNGDATA 0x1203C #define E1000_I210_FLMNGCNT 0x12040 @@ -179,6 +181,9 @@ #define E1000_I210_FLA 0x1201C +#define E1000_SHADOWINF 0x12068 +#define E1000_FLFWUPDATE 0x12108 + #define E1000_INVM_DATA_REG(_n) (0x12120 + 4*(_n)) #define E1000_INVM_SIZE 64 /* Number of INVM Data Registers */ From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:37:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7106966AD23; Fri, 17 Sep 2021 21:37:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB6k02H9tz4ncQ; Fri, 17 Sep 2021 21:37:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 200E31D479; Fri, 17 Sep 2021 21:37:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HLbSp4056183; Fri, 17 Sep 2021 21:37:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HLbS8S056182; Fri, 17 Sep 2021 21:37:28 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:37:28 GMT Message-Id: <202109172137.18HLbS8S056182@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: e8e3171d992f - main - e1000: increase timeout for ME ULP exit MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e8e3171d992f3255cc8e5a0f59912d07679cc94c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:37:28 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=e8e3171d992f3255cc8e5a0f59912d07679cc94c commit e8e3171d992f3255cc8e5a0f59912d07679cc94c Author: Guinan Sun AuthorDate: 2020-07-06 08:12:09 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:23:07 +0000 e1000: increase timeout for ME ULP exit Due timing issues in WHL and since recovery by host is not always supported, increased timeout for Manageability Engine(ME) to finish Ultra Low Power(ULP) exit flow for Nahum before timer expiration. Signed-off-by: Nir Efrati Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (cf1f3ca45d33e793ca581200b4000c39a798113e) MFC after: 1 week --- sys/dev/e1000/e1000_ich8lan.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index 1d15881f047d..8ca0fb392805 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -1413,6 +1413,7 @@ out: s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force) { s32 ret_val = E1000_SUCCESS; + u8 ulp_exit_timeout = 30; u32 mac_reg; u16 phy_reg; int i = 0; @@ -1434,10 +1435,12 @@ s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force) E1000_WRITE_REG(hw, E1000_H2ME, mac_reg); } - /* Poll up to 300msec for ME to clear ULP_CFG_DONE. */ + if (hw->mac.type == e1000_pch_cnp) + ulp_exit_timeout = 100; + while (E1000_READ_REG(hw, E1000_FWSM) & E1000_FWSM_ULP_CFG_DONE) { - if (i++ == 30) { + if (i++ == ulp_exit_timeout) { ret_val = -E1000_ERR_PHY; goto out; } From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:37:31 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2216066AD8B; Fri, 17 Sep 2021 21:37:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB6k25Dhdz4nWm; Fri, 17 Sep 2021 21:37:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B0C51D731; Fri, 17 Sep 2021 21:37:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HLbUcR056231; Fri, 17 Sep 2021 21:37:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HLbUbn056230; Fri, 17 Sep 2021 21:37:30 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:37:30 GMT Message-Id: <202109172137.18HLbUbn056230@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: de965d042fa4 - main - e1000: expose FEXTNVM registers and masks MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: de965d042fa4d341cec3fa7cacac0f30f224bde4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:37:31 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=de965d042fa4d341cec3fa7cacac0f30f224bde4 commit de965d042fa4d341cec3fa7cacac0f30f224bde4 Author: Guinan Sun AuthorDate: 2020-07-06 08:12:16 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:23:26 +0000 e1000: expose FEXTNVM registers and masks Adding defines for FEXTNVM8 and FEXTNVM12 registers with new masks for future use. Signed-off-by: Nir Efrati Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (6d208ec099cd870a73c6b444b350a82c7a26c5e4) MFC after: 1 week --- sys/dev/e1000/e1000_ich8lan.h | 3 ++- sys/dev/e1000/e1000_regs.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/e1000/e1000_ich8lan.h b/sys/dev/e1000/e1000_ich8lan.h index 12f912ebc6e0..caff11cbb899 100644 --- a/sys/dev/e1000/e1000_ich8lan.h +++ b/sys/dev/e1000/e1000_ich8lan.h @@ -113,11 +113,12 @@ #define E1000_FEXTNVM7_DISABLE_PB_READ 0x00040000 #define E1000_FEXTNVM7_SIDE_CLK_UNGATE 0x00000004 #define E1000_FEXTNVM7_DISABLE_SMB_PERST 0x00000020 +#define E1000_FEXTNVM8_UNBIND_DPG_FROM_MPHY 0x00000400 #define E1000_FEXTNVM9_IOSFSB_CLKGATE_DIS 0x00000800 #define E1000_FEXTNVM9_IOSFSB_CLKREQ_DIS 0x00001000 #define E1000_FEXTNVM11_DISABLE_PB_READ 0x00000200 #define E1000_FEXTNVM11_DISABLE_MULR_FIX 0x00002000 - +#define E1000_FEXTNVM12_DONT_WAK_DPG_CLKREQ 0x00001000 /* bit24: RXDCTL thresholds granularity: 0 - cache lines, 1 - descriptors */ #define E1000_RXDCTL_THRESH_UNIT_DESC 0x01000000 diff --git a/sys/dev/e1000/e1000_regs.h b/sys/dev/e1000/e1000_regs.h index fe9834405359..01009d969620 100644 --- a/sys/dev/e1000/e1000_regs.h +++ b/sys/dev/e1000/e1000_regs.h @@ -66,8 +66,10 @@ #define E1000_FEXTNVM4 0x00024 /* Future Extended NVM 4 - RW */ #define E1000_FEXTNVM6 0x00010 /* Future Extended NVM 6 - RW */ #define E1000_FEXTNVM7 0x000E4 /* Future Extended NVM 7 - RW */ +#define E1000_FEXTNVM8 0x5BB0 /* Future Extended NVM 8 - RW */ #define E1000_FEXTNVM9 0x5BB4 /* Future Extended NVM 9 - RW */ #define E1000_FEXTNVM11 0x5BBC /* Future Extended NVM 11 - RW */ +#define E1000_FEXTNVM12 0x5BC0 /* Future Extended NVM 12 - RW */ #define E1000_PCIEANACFG 0x00F18 /* PCIE Analog Config */ #define E1000_FCT 0x00030 /* Flow Control Type - RW */ #define E1000_CONNSW 0x00034 /* Copper/Fiber switch control - RW */ From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:37:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A266966AF0A; Fri, 17 Sep 2021 21:37:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB6k13Z4Qz4nNr; Fri, 17 Sep 2021 21:37:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42DB11D5E1; Fri, 17 Sep 2021 21:37:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HLbTJx056207; Fri, 17 Sep 2021 21:37:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HLbTU4056206; Fri, 17 Sep 2021 21:37:29 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:37:29 GMT Message-Id: <202109172137.18HLbTU4056206@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: a8bb4ab7cfb8 - main - e1000: add missed define for VFTA MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a8bb4ab7cfb84195ef8af3c788fecdc8830fc960 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:37:29 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a8bb4ab7cfb84195ef8af3c788fecdc8830fc960 commit a8bb4ab7cfb84195ef8af3c788fecdc8830fc960 Author: Guinan Sun AuthorDate: 2020-07-06 08:12:13 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:23:19 +0000 e1000: add missed define for VFTA VLAN filtering using the VFTA (VLAN Filter Table Array) and should be initialized prior to setting rx mode. Signed-off-by: Sasha Neftin Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (fc9933953c90e99970aa867c38f9c6e6c5d0488d) MFC after: 1 week --- sys/dev/e1000/e1000_defines.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/e1000/e1000_defines.h b/sys/dev/e1000/e1000_defines.h index 5b77bd43af1a..e5435eb56dcd 100644 --- a/sys/dev/e1000/e1000_defines.h +++ b/sys/dev/e1000/e1000_defines.h @@ -1386,6 +1386,7 @@ #define E1000_MDIC_ERROR 0x40000000 #define E1000_MDIC_DEST 0x80000000 +#define E1000_VFTA_BLOCK_SIZE 8 /* SerDes Control */ #define E1000_GEN_CTL_READY 0x80000000 #define E1000_GEN_CTL_ADDRESS_SHIFT 8 From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:37:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2007F66AD8D; Fri, 17 Sep 2021 21:37:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB6k35vg7z4nWs; Fri, 17 Sep 2021 21:37:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C87A1D732; Fri, 17 Sep 2021 21:37:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HLbVG8056261; Fri, 17 Sep 2021 21:37:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HLbVF0056260; Fri, 17 Sep 2021 21:37:31 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:37:31 GMT Message-Id: <202109172137.18HLbVF0056260@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 7fb2111413c7 - main - e1000: introduce DPGFR register MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7fb2111413c799414c86d7bfdcc72bc1c6302726 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:37:32 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=7fb2111413c799414c86d7bfdcc72bc1c6302726 commit 7fb2111413c799414c86d7bfdcc72bc1c6302726 Author: Guinan Sun AuthorDate: 2020-07-06 08:12:19 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:24:07 +0000 e1000: introduce DPGFR register Defined DPGFR, Dynamic Power Gate Force Control Register. Signed-off-by: Vitaly Lifshits Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (1469e5aceffbdcebe834292aadb40b1bd1602867) MFC after: 1 week --- sys/dev/e1000/e1000_regs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/dev/e1000/e1000_regs.h b/sys/dev/e1000/e1000_regs.h index 01009d969620..27c456a432e8 100644 --- a/sys/dev/e1000/e1000_regs.h +++ b/sys/dev/e1000/e1000_regs.h @@ -71,6 +71,7 @@ #define E1000_FEXTNVM11 0x5BBC /* Future Extended NVM 11 - RW */ #define E1000_FEXTNVM12 0x5BC0 /* Future Extended NVM 12 - RW */ #define E1000_PCIEANACFG 0x00F18 /* PCIE Analog Config */ +#define E1000_DPGFR 0x00FAC /* Dynamic Power Gate Force Control Register */ #define E1000_FCT 0x00030 /* Flow Control Type - RW */ #define E1000_CONNSW 0x00034 /* Copper/Fiber switch control - RW */ #define E1000_VET 0x00038 /* VLAN Ether Type - RW */ From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:37:33 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EA2FC66AE91; Fri, 17 Sep 2021 21:37:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB6k53Tg8z4ng3; Fri, 17 Sep 2021 21:37:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADA9A1D47A; Fri, 17 Sep 2021 21:37:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HLbWuG056289; Fri, 17 Sep 2021 21:37:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HLbWf4056288; Fri, 17 Sep 2021 21:37:32 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:37:32 GMT Message-Id: <202109172137.18HLbWf4056288@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 9c4a0fabc8b8 - main - e1000: cleanup pre-processor tags MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9c4a0fabc8b88af0d9fd3f0d67bd080714d1ee4b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:37:34 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=9c4a0fabc8b88af0d9fd3f0d67bd080714d1ee4b commit 9c4a0fabc8b88af0d9fd3f0d67bd080714d1ee4b Author: Guinan Sun AuthorDate: 2020-07-06 08:12:20 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:24:23 +0000 e1000: cleanup pre-processor tags The codes has been exposed correctly, so remove pre-processor tags. Signed-off-by: Guinan Sun Reviewed-by: Wei Zhao Approved by: imp Obtained from: DPDK (a50e998a0fd94e5db508710868a3417b1846425c) MFC after: 1 week --- sys/dev/e1000/e1000_manage.c | 5 +++-- sys/dev/e1000/e1000_regs.h | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/e1000/e1000_manage.c b/sys/dev/e1000/e1000_manage.c index 120431d58b0b..b5ad5815d5ee 100644 --- a/sys/dev/e1000/e1000_manage.c +++ b/sys/dev/e1000/e1000_manage.c @@ -34,6 +34,8 @@ /*$FreeBSD$*/ #include "e1000_api.h" +#include "e1000_manage.h" + /** * e1000_calculate_checksum - Calculate checksum for buffer * @buffer: pointer to EEPROM @@ -455,6 +457,7 @@ s32 e1000_host_interface_command(struct e1000_hw *hw, u8 *buffer, u32 length) return E1000_SUCCESS; } + /** * e1000_load_firmware - Writes proxy FW code buffer to host interface * and execute. @@ -573,5 +576,3 @@ s32 e1000_load_firmware(struct e1000_hw *hw, u8 *buffer, u32 length) return E1000_SUCCESS; } - - diff --git a/sys/dev/e1000/e1000_regs.h b/sys/dev/e1000/e1000_regs.h index 27c456a432e8..c09856e55275 100644 --- a/sys/dev/e1000/e1000_regs.h +++ b/sys/dev/e1000/e1000_regs.h @@ -381,6 +381,7 @@ #define E1000_TSCTC 0x040F8 /* TCP Segmentation Context Tx - R/clr */ #define E1000_TSCTFC 0x040FC /* TCP Segmentation Context Tx Fail - R/clr */ #define E1000_IAC 0x04100 /* Interrupt Assertion Count */ +/* Interrupt Cause */ #define E1000_ICRXPTC 0x04104 /* Interrupt Cause Rx Pkt Timer Expire Count */ #define E1000_ICRXATC 0x04108 /* Interrupt Cause Rx Abs Timer Expire Count */ #define E1000_ICTXPTC 0x0410C /* Interrupt Cause Tx Pkt Timer Expire Count */ @@ -503,12 +504,14 @@ #define E1000_WUC 0x05800 /* Wakeup Control - RW */ #define E1000_WUFC 0x05808 /* Wakeup Filter Control - RW */ #define E1000_WUS 0x05810 /* Wakeup Status - RO */ +/* Management registers */ #define E1000_MANC 0x05820 /* Management Control - RW */ #define E1000_IPAV 0x05838 /* IP Address Valid - RW */ #define E1000_IP4AT 0x05840 /* IPv4 Address Table - RW Array */ #define E1000_IP6AT 0x05880 /* IPv6 Address Table - RW Array */ #define E1000_WUPL 0x05900 /* Wakeup Packet Length - RW */ #define E1000_WUPM 0x05A00 /* Wakeup Packet Memory - RO A */ +/* MSI-X Table Register Descriptions */ #define E1000_PBACL 0x05B68 /* MSIx PBA Clear - Read/Write 1's to clear */ #define E1000_FFLT 0x05F00 /* Flexible Filter Length Table - RW Array */ #define E1000_HOST_IF 0x08800 /* Host Interface */ From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:37:34 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 70D7F66AF10; Fri, 17 Sep 2021 21:37:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB6k60nx1z4nPF; Fri, 17 Sep 2021 21:37:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D30D41D47B; Fri, 17 Sep 2021 21:37:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HLbXda056321; Fri, 17 Sep 2021 21:37:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HLbXxw056320; Fri, 17 Sep 2021 21:37:33 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:37:33 GMT Message-Id: <202109172137.18HLbXxw056320@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: f6517a7e69c1 - main - e1000: fix timeout for shadow RAM write MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f6517a7e69c10c6057d6c990a9f3ea22a2b62398 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:37:34 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=f6517a7e69c10c6057d6c990a9f3ea22a2b62398 commit f6517a7e69c10c6057d6c990a9f3ea22a2b62398 Author: Chengwen Feng AuthorDate: 2021-04-21 09:15:35 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:24:29 +0000 e1000: fix timeout for shadow RAM write This fixes the timed out for shadow RAM write EEWR can't be detected. Fixes: 5a32a257f957 ("e1000: more NICs in base driver") Cc: stable@dpdk.org Signed-off-by: Chengwen Feng Signed-off-by: Min Hu (Connor) Acked-by: Haiyue Wang Approved by: imp Obtained from: DPDK (4a8ab48ec47b3616272e50620b8e1a9599358ea6) MFC after: 1 week --- sys/dev/e1000/e1000_i210.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/e1000/e1000_i210.c b/sys/dev/e1000/e1000_i210.c index cd85a8c3172a..d3692db11245 100644 --- a/sys/dev/e1000/e1000_i210.c +++ b/sys/dev/e1000/e1000_i210.c @@ -195,6 +195,8 @@ static s32 e1000_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words, } for (i = 0; i < words; i++) { + ret_val = -E1000_ERR_NVM; + eewr = ((offset + i) << E1000_NVM_RW_ADDR_SHIFT) | (data[i] << E1000_NVM_RW_REG_DATA) | E1000_NVM_RW_REG_START; From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:37:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0098966AE78; Fri, 17 Sep 2021 21:37:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB6k73TmJz4nZT; Fri, 17 Sep 2021 21:37:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED5AF1D5E2; Fri, 17 Sep 2021 21:37:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HLbY3U056345; Fri, 17 Sep 2021 21:37:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HLbYaw056344; Fri, 17 Sep 2021 21:37:34 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:37:34 GMT Message-Id: <202109172137.18HLbYaw056344@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: ecf2a89a997a - main - e1000: fix multicast setting in VF MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ecf2a89a997ad4a14339b6a2f544e44b422620a0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:37:36 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=ecf2a89a997ad4a14339b6a2f544e44b422620a0 commit ecf2a89a997ad4a14339b6a2f544e44b422620a0 Author: Yong Wang AuthorDate: 2017-02-21 09:33:23 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:24:44 +0000 e1000: fix multicast setting in VF In function e1000_update_mc_addr_list_vf(), "msgbuf[0]" is used prior to initialization at "msgbuf[0] |= E1000_VF_SET_MULTICAST_OVERFLOW". And "msgbuf[0]" is overwritten at "msgbuf[0] = E1000_VF_SET_MULTICAST". Fix it by moving the second line prior to the first one that mentioned above. Fixes: dffbaf7880a8 ("e1000: revert fix for multicast in VF") Cc: stable@dpdk.org Signed-off-by: Yong Wang Acked-by: Wenzhuo Lu Approved by: imp Obtained from: DPDK (f58ca2f9ef6) MFC after: 1 week --- sys/dev/e1000/e1000_vf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/e1000/e1000_vf.c b/sys/dev/e1000/e1000_vf.c index 653ba322a185..4b73bb9709c1 100644 --- a/sys/dev/e1000/e1000_vf.c +++ b/sys/dev/e1000/e1000_vf.c @@ -419,12 +419,13 @@ void e1000_update_mc_addr_list_vf(struct e1000_hw *hw, DEBUGOUT1("MC Addr Count = %d\n", mc_addr_count); + msgbuf[0] = E1000_VF_SET_MULTICAST; + if (mc_addr_count > 30) { msgbuf[0] |= E1000_VF_SET_MULTICAST_OVERFLOW; mc_addr_count = 30; } - msgbuf[0] = E1000_VF_SET_MULTICAST; msgbuf[0] |= mc_addr_count << E1000_VT_MSGINFO_SHIFT; for (i = 0; i < mc_addr_count; i++) { From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:37:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8360566B08F; Fri, 17 Sep 2021 21:37:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB6kG0xptz4ndL; Fri, 17 Sep 2021 21:37:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A6EE11D4E0; Fri, 17 Sep 2021 21:37:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HLbehu056471; Fri, 17 Sep 2021 21:37:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HLbet9056470; Fri, 17 Sep 2021 21:37:40 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:37:40 GMT Message-Id: <202109172137.18HLbet9056470@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: e05d9788b7e9 - main - e1000: Consistently use FALLTHROUGH MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e05d9788b7e90ffd6405dc59656b52a63ba7ff3e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:37:42 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=e05d9788b7e90ffd6405dc59656b52a63ba7ff3e commit e05d9788b7e90ffd6405dc59656b52a63ba7ff3e Author: Kevin Bowling AuthorDate: 2021-09-17 03:13:26 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:36:46 +0000 e1000: Consistently use FALLTHROUGH Approved by: imp MFC after: 1 week --- sys/dev/e1000/e1000_82540.c | 2 +- sys/dev/e1000/e1000_82571.c | 4 ++-- sys/dev/e1000/e1000_82575.c | 6 ++++++ sys/dev/e1000/e1000_ich8lan.c | 16 ++++++++-------- sys/dev/e1000/e1000_nvm.c | 2 +- sys/dev/e1000/e1000_phy.c | 6 +++++- 6 files changed, 23 insertions(+), 13 deletions(-) diff --git a/sys/dev/e1000/e1000_82540.c b/sys/dev/e1000/e1000_82540.c index 720798260f8a..e60fc8ebf08e 100644 --- a/sys/dev/e1000/e1000_82540.c +++ b/sys/dev/e1000/e1000_82540.c @@ -100,7 +100,7 @@ static s32 e1000_init_phy_params_82540(struct e1000_hw *hw) case e1000_82546_rev_3: if (phy->id == M88E1011_I_PHY_ID) break; - /* Fall Through */ + /* FALLTHROUGH */ default: ret_val = -E1000_ERR_PHY; goto out; diff --git a/sys/dev/e1000/e1000_82571.c b/sys/dev/e1000/e1000_82571.c index cae9afcb2d78..ce9ae8791654 100644 --- a/sys/dev/e1000/e1000_82571.c +++ b/sys/dev/e1000/e1000_82571.c @@ -238,7 +238,7 @@ static s32 e1000_init_nvm_params_82571(struct e1000_hw *hw) E1000_WRITE_REG(hw, E1000_EECD, eecd); break; } - /* Fall Through */ + /* FALLTHROUGH */ default: nvm->type = e1000_nvm_eeprom_spi; size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >> @@ -1115,7 +1115,7 @@ static s32 e1000_init_hw_82571(struct e1000_hw *hw) switch (mac->type) { case e1000_82573: e1000_enable_tx_pkt_filtering_generic(hw); - /* fall through */ + /* FALLTHROUGH */ case e1000_82574: case e1000_82583: reg_data = E1000_READ_REG(hw, E1000_GCR); diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index 59d8b9c85dc3..a0c057e5f07f 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -1443,13 +1443,19 @@ static s32 e1000_setup_copper_link_82575(struct e1000_hw *hw) } switch (hw->phy.type) { case e1000_phy_i210: + /* FALLTHROUGH */ case e1000_phy_m88: switch (hw->phy.id) { case I347AT4_E_PHY_ID: + /* FALLTHROUGH */ case M88E1112_E_PHY_ID: + /* FALLTHROUGH */ case M88E1340M_E_PHY_ID: + /* FALLTHROUGH */ case M88E1543_E_PHY_ID: + /* FALLTHROUGH */ case M88E1512_E_PHY_ID: + /* FALLTHROUGH */ case I210_I_PHY_ID: ret_val = e1000_copper_link_setup_m88_gen2(hw); break; diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index 5cd13579d50c..4209595a911c 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -365,12 +365,12 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) */ msec_delay(50); - /* fall-through */ + /* FALLTHROUGH */ case e1000_pch2lan: if (e1000_phy_is_accessible_pchlan(hw)) break; - /* fall-through */ + /* FALLTHROUGH */ case e1000_pchlan: if ((hw->mac.type == e1000_pchlan) && (fwsm & E1000_ICH_FWSM_FW_VALID)) @@ -493,7 +493,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) return ret_val; if ((phy->id != 0) && (phy->id != PHY_REVISION_MASK)) break; - /* fall-through */ + /* FALLTHROUGH */ case e1000_pch2lan: case e1000_pch_lpt: case e1000_pch_spt: @@ -796,7 +796,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw) case e1000_pch2lan: mac->rar_entry_count = E1000_PCH2_RAR_ENTRIES; mac->ops.rar_set = e1000_rar_set_pch2lan; - /* fall-through */ + /* FALLTHROUGH */ case e1000_pch_lpt: case e1000_pch_spt: case e1000_pch_cnp: @@ -806,7 +806,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw) /* multicast address update for pch2 */ mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_pch2lan; - /* fall-through */ + /* FALLTHROUGH */ case e1000_pchlan: /* check management mode */ mac->ops.check_mng_mode = e1000_check_mng_mode_pchlan; @@ -1761,7 +1761,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) ret_val = e1000_k1_workaround_lv(hw); if (ret_val) return ret_val; - /* fall-thru */ + /* FALLTHROUGH */ case e1000_pchlan: if (hw->phy.type == e1000_phy_82578) { ret_val = e1000_link_stall_workaround_hv(hw); @@ -2299,7 +2299,7 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG; break; } - /* Fall-thru */ + /* FALLTHROUGH */ case e1000_pchlan: case e1000_pch2lan: case e1000_pch_lpt: @@ -3479,7 +3479,7 @@ static s32 e1000_valid_nvm_bank_detect_ich8lan(struct e1000_hw *hw, u32 *bank) return E1000_SUCCESS; } DEBUGOUT("Unable to determine valid NVM bank via EEC - reading flash signature\n"); - /* fall-thru */ + /* FALLTHROUGH */ default: /* set bank to 0 in case flash read fails */ *bank = 0; diff --git a/sys/dev/e1000/e1000_nvm.c b/sys/dev/e1000/e1000_nvm.c index 31bbfcc6981d..8911204f0b91 100644 --- a/sys/dev/e1000/e1000_nvm.c +++ b/sys/dev/e1000/e1000_nvm.c @@ -1321,7 +1321,7 @@ void e1000_get_fw_version(struct e1000_hw *hw, struct e1000_fw_version *fw_vers) e1000_read_invm_version(hw, fw_vers); return; } - /* fall through */ + /* FALLTHROUGH */ case e1000_i350: hw->nvm.ops.read(hw, NVM_ETRACK_HIWORD, 1, &etrack_test); /* find combo image version */ diff --git a/sys/dev/e1000/e1000_phy.c b/sys/dev/e1000/e1000_phy.c index e5fd942464b6..872a5267bfdb 100644 --- a/sys/dev/e1000/e1000_phy.c +++ b/sys/dev/e1000/e1000_phy.c @@ -1038,7 +1038,7 @@ static s32 e1000_set_master_slave_mode(struct e1000_hw *hw) break; case e1000_ms_auto: phy_data &= ~CR_1000T_MS_ENABLE; - /* fall-through */ + /* FALLTHROUGH */ default: break; } @@ -1098,6 +1098,7 @@ s32 e1000_copper_link_setup_82577(struct e1000_hw *hw) phy_data |= I82577_PHY_CTRL2_MANUAL_MDIX; break; case 0: + /* FALLTHROUGH */ default: phy_data |= I82577_PHY_CTRL2_AUTO_MDI_MDIX; break; @@ -1154,6 +1155,7 @@ s32 e1000_copper_link_setup_m88(struct e1000_hw *hw) phy_data |= M88E1000_PSCR_AUTO_X_1000T; break; case 0: + /* FALLTHROUGH */ default: phy_data |= M88E1000_PSCR_AUTO_X_MODE; break; @@ -1306,6 +1308,7 @@ s32 e1000_copper_link_setup_m88_gen2(struct e1000_hw *hw) } /* FALLTHROUGH */ case 0: + /* FALLTHROUGH */ default: phy_data |= M88E1000_PSCR_AUTO_X_MODE; break; @@ -1420,6 +1423,7 @@ s32 e1000_copper_link_setup_igp(struct e1000_hw *hw) data |= IGP01E1000_PSCR_FORCE_MDI_MDIX; break; case 0: + /* FALLTHROUGH */ default: data |= IGP01E1000_PSCR_AUTO_MDIX; break; From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:37:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A03E66AF8D; Fri, 17 Sep 2021 21:37:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB6kB5tfRz4njt; Fri, 17 Sep 2021 21:37:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 652DB1D789; Fri, 17 Sep 2021 21:37:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HLbcxv056423; Fri, 17 Sep 2021 21:37:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HLbc10056422; Fri, 17 Sep 2021 21:37:38 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:37:38 GMT Message-Id: <202109172137.18HLbc10056422@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 984d1616be88 - main - e1000: Catch up commit with DPDK MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 984d1616be883bc2c351aff9aa69b1abd7d1214c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:37:39 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=984d1616be883bc2c351aff9aa69b1abd7d1214c commit 984d1616be883bc2c351aff9aa69b1abd7d1214c Author: Kevin Bowling AuthorDate: 2021-09-17 02:30:49 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:26:01 +0000 e1000: Catch up commit with DPDK Various syncs with the e1000 shared code from DPDK: "cid-gigabit.2020.06.05.tar.gz released by ND" Approved by: imp Obtained from: DPDK MFC after: 1 week --- sys/dev/e1000/e1000_82571.c | 2 +- sys/dev/e1000/e1000_82575.c | 2 +- sys/dev/e1000/e1000_api.c | 15 +++++ sys/dev/e1000/e1000_api.h | 1 + sys/dev/e1000/e1000_defines.h | 33 ++++++++++ sys/dev/e1000/e1000_hw.h | 2 +- sys/dev/e1000/e1000_i210.c | 100 ++++++++++++++++++++++++++++ sys/dev/e1000/e1000_i210.h | 2 + sys/dev/e1000/e1000_nvm.c | 147 ++++++++++++++++++++++++++++++++++++++++++ sys/dev/e1000/e1000_nvm.h | 19 ++++++ sys/dev/e1000/e1000_regs.h | 3 +- 11 files changed, 322 insertions(+), 4 deletions(-) diff --git a/sys/dev/e1000/e1000_82571.c b/sys/dev/e1000/e1000_82571.c index 6fefcc774cbb..8db1fcb921a9 100644 --- a/sys/dev/e1000/e1000_82571.c +++ b/sys/dev/e1000/e1000_82571.c @@ -515,7 +515,7 @@ e1000_get_hw_semaphore_82574(struct e1000_hw *hw) u32 extcnf_ctrl; s32 i = 0; /* XXX assert that mutex is held */ - DEBUGFUNC("e1000_get_hw_semaphore_82573"); + DEBUGFUNC("e1000_get_hw_semaphore_82574"); ASSERT_CTX_LOCK_HELD(hw); extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index 172e99b02d5c..29805270f8dc 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -1360,7 +1360,7 @@ static s32 e1000_reset_hw_82575(struct e1000_hw *hw) * * This inits the hardware readying it for operation. **/ -STATIC s32 e1000_init_hw_82575(struct e1000_hw *hw) +static s32 e1000_init_hw_82575(struct e1000_hw *hw) { struct e1000_mac_info *mac = &hw->mac; s32 ret_val; diff --git a/sys/dev/e1000/e1000_api.c b/sys/dev/e1000/e1000_api.c index 6e0f51ab7ffa..b28ab77f3794 100644 --- a/sys/dev/e1000/e1000_api.c +++ b/sys/dev/e1000/e1000_api.c @@ -1269,6 +1269,21 @@ s32 e1000_read_pba_length(struct e1000_hw *hw, u32 *pba_num_size) return e1000_read_pba_length_generic(hw, pba_num_size); } +/** + * e1000_read_pba_num - Read device part number + * @hw: pointer to the HW structure + * @pba_num: pointer to device part number + * + * Reads the product board assembly (PBA) number from the EEPROM and stores + * the value in pba_num. + * Currently no func pointer exists and all implementations are handled in the + * generic version of this function. + **/ +s32 e1000_read_pba_num(struct e1000_hw *hw, u32 *pba_num) +{ + return e1000_read_pba_num_generic(hw, pba_num); +} + /** * e1000_validate_nvm_checksum - Verifies NVM (EEPROM) checksum * @hw: pointer to the HW structure diff --git a/sys/dev/e1000/e1000_api.h b/sys/dev/e1000/e1000_api.h index db4caac37e97..c96030b567db 100644 --- a/sys/dev/e1000/e1000_api.h +++ b/sys/dev/e1000/e1000_api.h @@ -97,6 +97,7 @@ s32 e1000_phy_commit(struct e1000_hw *hw); void e1000_power_up_phy(struct e1000_hw *hw); void e1000_power_down_phy(struct e1000_hw *hw); s32 e1000_read_mac_addr(struct e1000_hw *hw); +s32 e1000_read_pba_num(struct e1000_hw *hw, u32 *part_num); s32 e1000_read_pba_string(struct e1000_hw *hw, u8 *pba_num, u32 pba_num_size); s32 e1000_read_pba_length(struct e1000_hw *hw, u32 *pba_num_size); void e1000_reload_nvm(struct e1000_hw *hw); diff --git a/sys/dev/e1000/e1000_defines.h b/sys/dev/e1000/e1000_defines.h index e5435eb56dcd..44281a0fadf6 100644 --- a/sys/dev/e1000/e1000_defines.h +++ b/sys/dev/e1000/e1000_defines.h @@ -1083,11 +1083,44 @@ /* NVM Word Offsets */ #define NVM_COMPAT 0x0003 #define NVM_ID_LED_SETTINGS 0x0004 +#define NVM_VERSION 0x0005 #define NVM_SERDES_AMPLITUDE 0x0006 /* SERDES output amplitude */ #define NVM_PHY_CLASS_WORD 0x0007 #define E1000_I210_NVM_FW_MODULE_PTR 0x0010 #define E1000_I350_NVM_FW_MODULE_PTR 0x0051 #define NVM_FUTURE_INIT_WORD1 0x0019 +#define NVM_ETRACK_WORD 0x0042 +#define NVM_ETRACK_HIWORD 0x0043 +#define NVM_COMB_VER_OFF 0x0083 +#define NVM_COMB_VER_PTR 0x003d + +/* NVM version defines */ +#define NVM_MAJOR_MASK 0xF000 +#define NVM_MINOR_MASK 0x0FF0 +#define NVM_IMAGE_ID_MASK 0x000F +#define NVM_COMB_VER_MASK 0x00FF +#define NVM_MAJOR_SHIFT 12 +#define NVM_MINOR_SHIFT 4 +#define NVM_COMB_VER_SHFT 8 +#define NVM_VER_INVALID 0xFFFF +#define NVM_ETRACK_SHIFT 16 +#define NVM_ETRACK_VALID 0x8000 +#define NVM_NEW_DEC_MASK 0x0F00 +#define NVM_HEX_CONV 16 +#define NVM_HEX_TENS 10 + +/* FW version defines */ +/* Offset of "Loader patch ptr" in Firmware Header */ +#define E1000_I350_NVM_FW_LOADER_PATCH_PTR_OFFSET 0x01 +/* Patch generation hour & minutes */ +#define E1000_I350_NVM_FW_VER_WORD1_OFFSET 0x04 +/* Patch generation month & day */ +#define E1000_I350_NVM_FW_VER_WORD2_OFFSET 0x05 +/* Patch generation year */ +#define E1000_I350_NVM_FW_VER_WORD3_OFFSET 0x06 +/* Patch major & minor numbers */ +#define E1000_I350_NVM_FW_VER_WORD4_OFFSET 0x07 + #define NVM_MAC_ADDR 0x0000 #define NVM_SUB_DEV_ID 0x000B #define NVM_SUB_VEN_ID 0x000C diff --git a/sys/dev/e1000/e1000_hw.h b/sys/dev/e1000/e1000_hw.h index 59e51e5c322f..90bc652861b5 100644 --- a/sys/dev/e1000/e1000_hw.h +++ b/sys/dev/e1000/e1000_hw.h @@ -998,7 +998,7 @@ struct e1000_dev_spec_ich8lan { enum e1000_ulp_state ulp_state; bool ulp_capability_disabled; bool during_suspend_flow; - bool during_dpg_exit; + bool smbus_disable; }; struct e1000_dev_spec_82575 { diff --git a/sys/dev/e1000/e1000_i210.c b/sys/dev/e1000/e1000_i210.c index d3692db11245..0d810fecf3bd 100644 --- a/sys/dev/e1000/e1000_i210.c +++ b/sys/dev/e1000/e1000_i210.c @@ -345,6 +345,105 @@ static s32 e1000_read_invm_i210(struct e1000_hw *hw, u16 offset, return ret_val; } +/** + * e1000_read_invm_version - Reads iNVM version and image type + * @hw: pointer to the HW structure + * @invm_ver: version structure for the version read + * + * Reads iNVM version and image type. + **/ +s32 e1000_read_invm_version(struct e1000_hw *hw, + struct e1000_fw_version *invm_ver) +{ + u32 *record = NULL; + u32 *next_record = NULL; + u32 i = 0; + u32 invm_dword = 0; + u32 invm_blocks = E1000_INVM_SIZE - (E1000_INVM_ULT_BYTES_SIZE / + E1000_INVM_RECORD_SIZE_IN_BYTES); + u32 buffer[E1000_INVM_SIZE]; + s32 status = -E1000_ERR_INVM_VALUE_NOT_FOUND; + u16 version = 0; + + DEBUGFUNC("e1000_read_invm_version"); + + /* Read iNVM memory */ + for (i = 0; i < E1000_INVM_SIZE; i++) { + invm_dword = E1000_READ_REG(hw, E1000_INVM_DATA_REG(i)); + buffer[i] = invm_dword; + } + + /* Read version number */ + for (i = 1; i < invm_blocks; i++) { + record = &buffer[invm_blocks - i]; + next_record = &buffer[invm_blocks - i + 1]; + + /* Check if we have first version location used */ + if ((i == 1) && ((*record & E1000_INVM_VER_FIELD_ONE) == 0)) { + version = 0; + status = E1000_SUCCESS; + break; + } + /* Check if we have second version location used */ + else if ((i == 1) && + ((*record & E1000_INVM_VER_FIELD_TWO) == 0)) { + version = (*record & E1000_INVM_VER_FIELD_ONE) >> 3; + status = E1000_SUCCESS; + break; + } + /* + * Check if we have odd version location + * used and it is the last one used + */ + else if ((((*record & E1000_INVM_VER_FIELD_ONE) == 0) && + ((*record & 0x3) == 0)) || (((*record & 0x3) != 0) && + (i != 1))) { + version = (*next_record & E1000_INVM_VER_FIELD_TWO) + >> 13; + status = E1000_SUCCESS; + break; + } + /* + * Check if we have even version location + * used and it is the last one used + */ + else if (((*record & E1000_INVM_VER_FIELD_TWO) == 0) && + ((*record & 0x3) == 0)) { + version = (*record & E1000_INVM_VER_FIELD_ONE) >> 3; + status = E1000_SUCCESS; + break; + } + } + + if (status == E1000_SUCCESS) { + invm_ver->invm_major = (version & E1000_INVM_MAJOR_MASK) + >> E1000_INVM_MAJOR_SHIFT; + invm_ver->invm_minor = version & E1000_INVM_MINOR_MASK; + } + /* Read Image Type */ + for (i = 1; i < invm_blocks; i++) { + record = &buffer[invm_blocks - i]; + next_record = &buffer[invm_blocks - i + 1]; + + /* Check if we have image type in first location used */ + if ((i == 1) && ((*record & E1000_INVM_IMGTYPE_FIELD) == 0)) { + invm_ver->invm_img_type = 0; + status = E1000_SUCCESS; + break; + } + /* Check if we have image type in first location used */ + else if ((((*record & 0x3) == 0) && + ((*record & E1000_INVM_IMGTYPE_FIELD) == 0)) || + ((((*record & 0x3) != 0) && (i != 1)))) { + invm_ver->invm_img_type = + (*next_record & E1000_INVM_IMGTYPE_FIELD) >> 23; + status = E1000_SUCCESS; + break; + } + } + return status; +} + /** * e1000_validate_nvm_checksum_i210 - Validate EEPROM checksum * @hw: pointer to the HW structure @@ -628,6 +727,7 @@ static s32 e1000_pll_workaround_i210(struct e1000_hw *hw) if (ret_val != E1000_SUCCESS) nvm_word = E1000_INVM_DEFAULT_AL; tmp_nvm = nvm_word | E1000_INVM_PLL_WO_VAL; + phy_word = E1000_PHY_PLL_UNCONF; for (i = 0; i < E1000_MAX_PLL_TRIES; i++) { /* check current state directly from internal PHY */ e1000_write_phy_reg_mdic(hw, GS40G_PAGE_SELECT, 0xFC); diff --git a/sys/dev/e1000/e1000_i210.h b/sys/dev/e1000/e1000_i210.h index 9ad9e28c363b..77414b851a76 100644 --- a/sys/dev/e1000/e1000_i210.h +++ b/sys/dev/e1000/e1000_i210.h @@ -44,6 +44,8 @@ s32 e1000_write_nvm_srwr_i210(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); s32 e1000_read_nvm_srrd_i210(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); +s32 e1000_read_invm_version(struct e1000_hw *hw, + struct e1000_fw_version *invm_ver); s32 e1000_init_hw_i210(struct e1000_hw *hw); #define E1000_STM_OPCODE 0xDB00 diff --git a/sys/dev/e1000/e1000_nvm.c b/sys/dev/e1000/e1000_nvm.c index 86a1e772fb13..31bbfcc6981d 100644 --- a/sys/dev/e1000/e1000_nvm.c +++ b/sys/dev/e1000/e1000_nvm.c @@ -939,6 +939,41 @@ s32 e1000_read_pba_length_generic(struct e1000_hw *hw, u32 *pba_num_size) return E1000_SUCCESS; } +/** + * e1000_read_pba_num_generic - Read device part number + * @hw: pointer to the HW structure + * @pba_num: pointer to device part number + * + * Reads the product board assembly (PBA) number from the EEPROM and stores + * the value in pba_num. + **/ +s32 e1000_read_pba_num_generic(struct e1000_hw *hw, u32 *pba_num) +{ + s32 ret_val; + u16 nvm_data; + + DEBUGFUNC("e1000_read_pba_num_generic"); + + ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_0, 1, &nvm_data); + if (ret_val) { + DEBUGOUT("NVM Read Error\n"); + return ret_val; + } else if (nvm_data == NVM_PBA_PTR_GUARD) { + DEBUGOUT("NVM Not Supported\n"); + return -E1000_NOT_IMPLEMENTED; + } + *pba_num = (u32)(nvm_data << 16); + + ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_1, 1, &nvm_data); + if (ret_val) { + DEBUGOUT("NVM Read Error\n"); + return ret_val; + } + *pba_num |= nvm_data; + + return E1000_SUCCESS; +} + /** * e1000_read_pba_raw @@ -1241,4 +1276,116 @@ static void e1000_reload_nvm_generic(struct e1000_hw *hw) E1000_WRITE_FLUSH(hw); } +/** + * e1000_get_fw_version - Get firmware version information + * @hw: pointer to the HW structure + * @fw_vers: pointer to output version structure + * + * unsupported/not present features return 0 in version structure + **/ +void e1000_get_fw_version(struct e1000_hw *hw, struct e1000_fw_version *fw_vers) +{ + u16 eeprom_verh, eeprom_verl, etrack_test, fw_version; + u8 q, hval, rem, result; + u16 comb_verh, comb_verl, comb_offset; + + memset(fw_vers, 0, sizeof(struct e1000_fw_version)); + + /* basic eeprom version numbers, bits used vary by part and by tool + * used to create the nvm images */ + /* Check which data format we have */ + switch (hw->mac.type) { + case e1000_i211: + e1000_read_invm_version(hw, fw_vers); + return; + case e1000_82575: + case e1000_82576: + case e1000_82580: + case e1000_i354: + hw->nvm.ops.read(hw, NVM_ETRACK_HIWORD, 1, &etrack_test); + /* Use this format, unless EETRACK ID exists, + * then use alternate format + */ + if ((etrack_test & NVM_MAJOR_MASK) != NVM_ETRACK_VALID) { + hw->nvm.ops.read(hw, NVM_VERSION, 1, &fw_version); + fw_vers->eep_major = (fw_version & NVM_MAJOR_MASK) + >> NVM_MAJOR_SHIFT; + fw_vers->eep_minor = (fw_version & NVM_MINOR_MASK) + >> NVM_MINOR_SHIFT; + fw_vers->eep_build = (fw_version & NVM_IMAGE_ID_MASK); + goto etrack_id; + } + break; + case e1000_i210: + if (!(e1000_get_flash_presence_i210(hw))) { + e1000_read_invm_version(hw, fw_vers); + return; + } + /* fall through */ + case e1000_i350: + hw->nvm.ops.read(hw, NVM_ETRACK_HIWORD, 1, &etrack_test); + /* find combo image version */ + hw->nvm.ops.read(hw, NVM_COMB_VER_PTR, 1, &comb_offset); + if ((comb_offset != 0x0) && + (comb_offset != NVM_VER_INVALID)) { + + hw->nvm.ops.read(hw, (NVM_COMB_VER_OFF + comb_offset + + 1), 1, &comb_verh); + hw->nvm.ops.read(hw, (NVM_COMB_VER_OFF + comb_offset), + 1, &comb_verl); + + /* get Option Rom version if it exists and is valid */ + if ((comb_verh && comb_verl) && + ((comb_verh != NVM_VER_INVALID) && + (comb_verl != NVM_VER_INVALID))) { + + fw_vers->or_valid = true; + fw_vers->or_major = + comb_verl >> NVM_COMB_VER_SHFT; + fw_vers->or_build = + (comb_verl << NVM_COMB_VER_SHFT) + | (comb_verh >> NVM_COMB_VER_SHFT); + fw_vers->or_patch = + comb_verh & NVM_COMB_VER_MASK; + } + } + break; + default: + hw->nvm.ops.read(hw, NVM_ETRACK_HIWORD, 1, &etrack_test); + return; + } + hw->nvm.ops.read(hw, NVM_VERSION, 1, &fw_version); + fw_vers->eep_major = (fw_version & NVM_MAJOR_MASK) + >> NVM_MAJOR_SHIFT; + + /* check for old style version format in newer images*/ + if ((fw_version & NVM_NEW_DEC_MASK) == 0x0) { + eeprom_verl = (fw_version & NVM_COMB_VER_MASK); + } else { + eeprom_verl = (fw_version & NVM_MINOR_MASK) + >> NVM_MINOR_SHIFT; + } + /* Convert minor value to hex before assigning to output struct + * Val to be converted will not be higher than 99, per tool output + */ + q = eeprom_verl / NVM_HEX_CONV; + hval = q * NVM_HEX_TENS; + rem = eeprom_verl % NVM_HEX_CONV; + result = hval + rem; + fw_vers->eep_minor = result; + +etrack_id: + if ((etrack_test & NVM_MAJOR_MASK) == NVM_ETRACK_VALID) { + hw->nvm.ops.read(hw, NVM_ETRACK_WORD, 1, &eeprom_verl); + hw->nvm.ops.read(hw, (NVM_ETRACK_WORD + 1), 1, &eeprom_verh); + fw_vers->etrack_id = (eeprom_verh << NVM_ETRACK_SHIFT) + | eeprom_verl; + } else if ((etrack_test & NVM_ETRACK_VALID) == 0) { + hw->nvm.ops.read(hw, NVM_ETRACK_WORD, 1, &eeprom_verh); + hw->nvm.ops.read(hw, (NVM_ETRACK_WORD + 1), 1, &eeprom_verl); + fw_vers->etrack_id = (eeprom_verh << NVM_ETRACK_SHIFT) | + eeprom_verl; + } +} + diff --git a/sys/dev/e1000/e1000_nvm.h b/sys/dev/e1000/e1000_nvm.h index fc7ceab17e32..86fd5d1e892f 100644 --- a/sys/dev/e1000/e1000_nvm.h +++ b/sys/dev/e1000/e1000_nvm.h @@ -41,6 +41,22 @@ struct e1000_pba { u16 *pba_block; }; +struct e1000_fw_version { + u32 etrack_id; + u16 eep_major; + u16 eep_minor; + u16 eep_build; + + u8 invm_major; + u8 invm_minor; + u8 invm_img_type; + + bool or_valid; + u16 or_major; + u16 or_build; + u16 or_patch; +}; + void e1000_init_nvm_ops_generic(struct e1000_hw *hw); s32 e1000_null_read_nvm(struct e1000_hw *hw, u16 a, u16 b, u16 *c); @@ -51,6 +67,7 @@ s32 e1000_acquire_nvm_generic(struct e1000_hw *hw); s32 e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg); s32 e1000_read_mac_addr_generic(struct e1000_hw *hw); +s32 e1000_read_pba_num_generic(struct e1000_hw *hw, u32 *pba_num); s32 e1000_read_pba_string_generic(struct e1000_hw *hw, u8 *pba_num, u32 pba_num_size); s32 e1000_read_pba_length_generic(struct e1000_hw *hw, u32 *pba_num_size); @@ -75,6 +92,8 @@ s32 e1000_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, s32 e1000_update_nvm_checksum_generic(struct e1000_hw *hw); void e1000_stop_nvm(struct e1000_hw *hw); void e1000_release_nvm_generic(struct e1000_hw *hw); +void e1000_get_fw_version(struct e1000_hw *hw, + struct e1000_fw_version *fw_vers); #define E1000_STM_OPCODE 0xDB00 diff --git a/sys/dev/e1000/e1000_regs.h b/sys/dev/e1000/e1000_regs.h index c09856e55275..b3fb854f8adc 100644 --- a/sys/dev/e1000/e1000_regs.h +++ b/sys/dev/e1000/e1000_regs.h @@ -64,6 +64,7 @@ #define E1000_FEXTNVM 0x00028 /* Future Extended NVM - RW */ #define E1000_FEXTNVM3 0x0003C /* Future Extended NVM 3 - RW */ #define E1000_FEXTNVM4 0x00024 /* Future Extended NVM 4 - RW */ +#define E1000_FEXTNVM5 0x00014 /* Future Extended NVM 5 - RW */ #define E1000_FEXTNVM6 0x00010 /* Future Extended NVM 6 - RW */ #define E1000_FEXTNVM7 0x000E4 /* Future Extended NVM 7 - RW */ #define E1000_FEXTNVM8 0x5BB0 /* Future Extended NVM 8 - RW */ @@ -634,7 +635,7 @@ /* ETQF register bit definitions */ #define E1000_ETQF_FILTER_ENABLE (1 << 26) #define E1000_ETQF_IMM_INT (1 << 29) -#define E1000_ETQF_QUEUE_ENABLE (1 << 31) +#define E1000_ETQF_QUEUE_ENABLE (1U << 31) #define E1000_ETQF_QUEUE_SHIFT 16 #define E1000_ETQF_QUEUE_MASK 0x00070000 #define E1000_ETQF_ETYPE_MASK 0x0000FFFF From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:37:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED18166B002; Fri, 17 Sep 2021 21:37:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB6k82qJVz4nZX; Fri, 17 Sep 2021 21:37:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 225571D5E3; Fri, 17 Sep 2021 21:37:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HLbaEB056369; Fri, 17 Sep 2021 21:37:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HLbaDj056368; Fri, 17 Sep 2021 21:37:36 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:37:36 GMT Message-Id: <202109172137.18HLbaDj056368@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 089cdb3990f4 - main - e1000: clean LTO warnings MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 089cdb3990f47be3cd34d1a57567a2e89c917929 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:37:37 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=089cdb3990f47be3cd34d1a57567a2e89c917929 commit 089cdb3990f47be3cd34d1a57567a2e89c917929 Author: Andrzej Ostruszka AuthorDate: 2019-11-07 15:03:15 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:24:54 +0000 e1000: clean LTO warnings During LTO build compiler reports some 'false positive' warnings about variables being possibly used uninitialized. This patch silences these warnings. Exemplary compiler warning to suppress (with LTO enabled): error: 'link' may be used uninitialized in this function [-Werror=maybe-uninitialized] if (link) { Signed-off-by: Andrzej Ostruszka Approved by: imp Obtained from: DPDK (46136031f19107f4e9b6b3a952cb7f57877a7f0f) MFC after: 1 week --- sys/dev/e1000/e1000_82543.c | 2 +- sys/dev/e1000/e1000_ich8lan.c | 2 +- sys/dev/e1000/e1000_phy.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/e1000/e1000_82543.c b/sys/dev/e1000/e1000_82543.c index 42c4726fa8c7..49049b8646cd 100644 --- a/sys/dev/e1000/e1000_82543.c +++ b/sys/dev/e1000/e1000_82543.c @@ -1062,7 +1062,7 @@ static s32 e1000_setup_copper_link_82543(struct e1000_hw *hw) { u32 ctrl; s32 ret_val; - bool link; + bool link = true; DEBUGFUNC("e1000_setup_copper_link_82543"); diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index 8ca0fb392805..635be03f2900 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -5620,7 +5620,7 @@ void e1000_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw) void e1000_gig_downshift_workaround_ich8lan(struct e1000_hw *hw) { s32 ret_val; - u16 reg_data; + u16 reg_data = 0; DEBUGFUNC("e1000_gig_downshift_workaround_ich8lan"); diff --git a/sys/dev/e1000/e1000_phy.c b/sys/dev/e1000/e1000_phy.c index d84b6120dd31..2eae3acbe500 100644 --- a/sys/dev/e1000/e1000_phy.c +++ b/sys/dev/e1000/e1000_phy.c @@ -1695,7 +1695,7 @@ s32 e1000_copper_link_autoneg(struct e1000_hw *hw) s32 e1000_setup_copper_link_generic(struct e1000_hw *hw) { s32 ret_val; - bool link; + bool link = true; DEBUGFUNC("e1000_setup_copper_link_generic"); From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:37:38 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E28D66AEA3; Fri, 17 Sep 2021 21:37:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB6k93Jpjz4nX8; Fri, 17 Sep 2021 21:37:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37CB11D788; Fri, 17 Sep 2021 21:37:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HLbbqt056397; Fri, 17 Sep 2021 21:37:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HLbbSx056396; Fri, 17 Sep 2021 21:37:37 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:37:37 GMT Message-Id: <202109172137.18HLbbSx056396@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 40fa6e53f53c - main - e1000: prevent ULP flow if cable connected MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 40fa6e53f53cde84f6f5c7330f89e4ae373d7d93 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:37:38 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=40fa6e53f53cde84f6f5c7330f89e4ae373d7d93 commit 40fa6e53f53cde84f6f5c7330f89e4ae373d7d93 Author: Wenzhuo Lu AuthorDate: 2015-10-16 02:51:03 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:25:38 +0000 e1000: prevent ULP flow if cable connected Enabling ulp on link down when cable is connect caused an infinite loop of linkup/down indications in the NDIS driver. After discussed, correct flow is to enable ULP only when cable is disconnected. Signed-off-by: Wenzhuo Lu Approved by: imp Obtained from: DPDK (4bff263d54d299269966365f9697941eecaa241b) MFC after: 1 week --- sys/dev/e1000/e1000_ich8lan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index 635be03f2900..dd4e85d64aff 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -1307,6 +1307,10 @@ s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx) (E1000_READ_REG(hw, E1000_FEXT) & E1000_FEXT_PHY_CABLE_DISCONNECTED) ? "" : "not", i * 50); + if (!(E1000_READ_REG(hw, E1000_FEXT) & + E1000_FEXT_PHY_CABLE_DISCONNECTED)) + return 0; + } ret_val = hw->phy.ops.acquire(hw); From owner-dev-commits-src-all@freebsd.org Fri Sep 17 21:37:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C4C266AF35; Fri, 17 Sep 2021 21:37:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB6kD2Jgcz4nnd; Fri, 17 Sep 2021 21:37:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C69D1D78A; Fri, 17 Sep 2021 21:37:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HLbdUx056447; Fri, 17 Sep 2021 21:37:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HLbdpT056446; Fri, 17 Sep 2021 21:37:39 GMT (envelope-from git) Date: Fri, 17 Sep 2021 21:37:39 GMT Message-Id: <202109172137.18HLbdpT056446@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 1bbdc25fc1ed - main - e1000: Use C99 bool types MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1bbdc25fc1edb43562bf2a5f30df7381078991d4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 21:37:41 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=1bbdc25fc1edb43562bf2a5f30df7381078991d4 commit 1bbdc25fc1edb43562bf2a5f30df7381078991d4 Author: Kevin Bowling AuthorDate: 2021-09-17 03:08:08 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 21:29:12 +0000 e1000: Use C99 bool types Approved by: imp MFC after: 1 week --- sys/dev/e1000/e1000_80003es2lan.c | 12 +++--- sys/dev/e1000/e1000_82541.c | 10 ++--- sys/dev/e1000/e1000_82543.c | 22 +++++------ sys/dev/e1000/e1000_82571.c | 60 ++++++++++++++--------------- sys/dev/e1000/e1000_82575.c | 58 ++++++++++++++-------------- sys/dev/e1000/e1000_api.c | 12 +++--- sys/dev/e1000/e1000_api.h | 4 +- sys/dev/e1000/e1000_hw.h | 2 +- sys/dev/e1000/e1000_i210.c | 4 +- sys/dev/e1000/e1000_ich8lan.c | 78 +++++++++++++++++++------------------- sys/dev/e1000/e1000_mac.c | 62 +++++++++++++++--------------- sys/dev/e1000/e1000_manage.c | 28 +++++++------- sys/dev/e1000/e1000_mbx.c | 2 +- sys/dev/e1000/e1000_mbx.h | 2 +- sys/dev/e1000/e1000_osdep.h | 2 - sys/dev/e1000/e1000_phy.c | 80 +++++++++++++++++++-------------------- sys/dev/e1000/e1000_vf.c | 14 +++---- sys/dev/e1000/e1000_vf.h | 2 +- sys/dev/e1000/em_txrx.c | 12 +++--- sys/dev/e1000/if_em.c | 46 +++++++++++----------- sys/dev/e1000/igb_txrx.c | 2 +- 21 files changed, 256 insertions(+), 258 deletions(-) diff --git a/sys/dev/e1000/e1000_80003es2lan.c b/sys/dev/e1000/e1000_80003es2lan.c index db6f1aeb65fb..ac35b4eabf28 100644 --- a/sys/dev/e1000/e1000_80003es2lan.c +++ b/sys/dev/e1000/e1000_80003es2lan.c @@ -219,14 +219,14 @@ static s32 e1000_init_mac_params_80003es2lan(struct e1000_hw *hw) /* Set rar entry count */ mac->rar_entry_count = E1000_RAR_ENTRIES; /* Set if part includes ASF firmware */ - mac->asf_firmware_present = TRUE; + mac->asf_firmware_present = true; /* FWSM register */ - mac->has_fwsm = TRUE; + mac->has_fwsm = true; /* ARC supported; valid only if manageability features are enabled. */ mac->arc_subsystem_valid = !!(E1000_READ_REG(hw, E1000_FWSM) & E1000_FWSM_MODE_MASK); /* Adaptive IFS not supported */ - mac->adaptive_ifs = FALSE; + mac->adaptive_ifs = false; /* Function pointers */ @@ -891,8 +891,8 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw) reg_data &= ~0x00100000; E1000_WRITE_REG_ARRAY(hw, E1000_FFLT, 0x0001, reg_data); - /* default to TRUE to enable the MDIC W/A */ - hw->dev_spec._80003es2lan.mdic_wa_enable = TRUE; + /* default to true to enable the MDIC W/A */ + hw->dev_spec._80003es2lan.mdic_wa_enable = true; ret_val = e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_OFFSET >> @@ -900,7 +900,7 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw) if (!ret_val) { if ((i & E1000_KMRNCTRLSTA_OPMODE_MASK) == E1000_KMRNCTRLSTA_OPMODE_INBAND_MDIO) - hw->dev_spec._80003es2lan.mdic_wa_enable = FALSE; + hw->dev_spec._80003es2lan.mdic_wa_enable = false; } /* Clear all of the statistics registers (clear on read). It is diff --git a/sys/dev/e1000/e1000_82541.c b/sys/dev/e1000/e1000_82541.c index aaa3de7f02ce..7bb2e8ea9449 100644 --- a/sys/dev/e1000/e1000_82541.c +++ b/sys/dev/e1000/e1000_82541.c @@ -230,7 +230,7 @@ static s32 e1000_init_mac_params_82541(struct e1000_hw *hw) /* Set rar entry count */ mac->rar_entry_count = E1000_RAR_ENTRIES; /* Set if part includes ASF firmware */ - mac->asf_firmware_present = TRUE; + mac->asf_firmware_present = true; /* Function Pointers */ @@ -611,11 +611,11 @@ static s32 e1000_check_for_link_82541(struct e1000_hw *hw) goto out; if (!link) { - ret_val = e1000_config_dsp_after_link_change_82541(hw, FALSE); + ret_val = e1000_config_dsp_after_link_change_82541(hw, false); goto out; /* No link detected */ } - mac->get_link_status = FALSE; + mac->get_link_status = false; /* * Check if there was DownShift, must be checked @@ -632,7 +632,7 @@ static s32 e1000_check_for_link_82541(struct e1000_hw *hw) goto out; } - ret_val = e1000_config_dsp_after_link_change_82541(hw, TRUE); + ret_val = e1000_config_dsp_after_link_change_82541(hw, true); /* * Auto-Neg is enabled. Auto Speed Detection takes care @@ -937,7 +937,7 @@ out: * Success returns 0, Failure returns 1 * * The low power link up (lplu) state is set to the power management level D3 - * and SmartSpeed is disabled when active is TRUE, else clear lplu for D3 + * and SmartSpeed is disabled when active is true, else clear lplu for D3 * and enable Smartspeed. LPLU and Smartspeed are mutually exclusive. LPLU * is used during Dx states where the power conservation is most important. * During driver activity, SmartSpeed should be enabled so performance is diff --git a/sys/dev/e1000/e1000_82543.c b/sys/dev/e1000/e1000_82543.c index 49049b8646cd..9a93090c2d33 100644 --- a/sys/dev/e1000/e1000_82543.c +++ b/sys/dev/e1000/e1000_82543.c @@ -256,7 +256,7 @@ static s32 e1000_init_mac_params_82543(struct e1000_hw *hw) /* Set tbi compatibility */ if ((hw->mac.type != e1000_82543) || (hw->phy.media_type == e1000_media_type_fiber)) - e1000_set_tbi_compatibility_82543(hw, FALSE); + e1000_set_tbi_compatibility_82543(hw, false); return E1000_SUCCESS; } @@ -286,7 +286,7 @@ void e1000_init_function_pointers_82543(struct e1000_hw *hw) static bool e1000_tbi_compatibility_enabled_82543(struct e1000_hw *hw) { struct e1000_dev_spec_82543 *dev_spec = &hw->dev_spec._82543; - bool state = FALSE; + bool state = false; DEBUGFUNC("e1000_tbi_compatibility_enabled_82543"); @@ -338,7 +338,7 @@ out: bool e1000_tbi_sbp_enabled_82543(struct e1000_hw *hw) { struct e1000_dev_spec_82543 *dev_spec = &hw->dev_spec._82543; - bool state = FALSE; + bool state = false; DEBUGFUNC("e1000_tbi_sbp_enabled_82543"); @@ -379,7 +379,7 @@ static void e1000_set_tbi_sbp_82543(struct e1000_hw *hw, bool state) * @hw: pointer to the HW structure * * Returns the current status of whether PHY initialization is disabled. - * True if PHY initialization is disabled else FALSE. + * True if PHY initialization is disabled else false. **/ static bool e1000_init_phy_disabled_82543(struct e1000_hw *hw) { @@ -389,7 +389,7 @@ static bool e1000_init_phy_disabled_82543(struct e1000_hw *hw) DEBUGFUNC("e1000_init_phy_disabled_82543"); if (hw->mac.type != e1000_82543) { - ret_val = FALSE; + ret_val = false; goto out; } @@ -913,7 +913,7 @@ static s32 e1000_reset_hw_82543(struct e1000_hw *hw) E1000_WRITE_REG(hw, E1000_TCTL, E1000_TCTL_PSP); E1000_WRITE_FLUSH(hw); - e1000_set_tbi_sbp_82543(hw, FALSE); + e1000_set_tbi_sbp_82543(hw, false); /* * Delay to allow any outstanding PCI transactions to complete before @@ -1217,7 +1217,7 @@ static s32 e1000_check_for_copper_link_82543(struct e1000_hw *hw) if (!link) goto out; /* No link detected */ - mac->get_link_status = FALSE; + mac->get_link_status = false; e1000_check_downshift_generic(hw); @@ -1299,7 +1299,7 @@ static s32 e1000_check_for_copper_link_82543(struct e1000_hw *hw) * If we previously were in the mode, * turn it off. */ - e1000_set_tbi_sbp_82543(hw, FALSE); + e1000_set_tbi_sbp_82543(hw, false); rctl = E1000_READ_REG(hw, E1000_RCTL); rctl &= ~E1000_RCTL_SBP; E1000_WRITE_REG(hw, E1000_RCTL, rctl); @@ -1313,7 +1313,7 @@ static s32 e1000_check_for_copper_link_82543(struct e1000_hw *hw) * will look like CRC errors to the hardware. */ if (!e1000_tbi_sbp_enabled_82543(hw)) { - e1000_set_tbi_sbp_82543(hw, TRUE); + e1000_set_tbi_sbp_82543(hw, true); rctl = E1000_READ_REG(hw, E1000_RCTL); rctl |= E1000_RCTL_SBP; E1000_WRITE_REG(hw, E1000_RCTL, rctl); @@ -1356,7 +1356,7 @@ static s32 e1000_check_for_fiber_link_82543(struct e1000_hw *hw) (!(status & E1000_STATUS_LU)) && (!(rxcw & E1000_RXCW_C))) { if (!mac->autoneg_failed) { - mac->autoneg_failed = TRUE; + mac->autoneg_failed = true; ret_val = 0; goto out; } @@ -1387,7 +1387,7 @@ static s32 e1000_check_for_fiber_link_82543(struct e1000_hw *hw) E1000_WRITE_REG(hw, E1000_TXCW, mac->txcw); E1000_WRITE_REG(hw, E1000_CTRL, (ctrl & ~E1000_CTRL_SLU)); - mac->serdes_has_link = TRUE; + mac->serdes_has_link = true; } out: diff --git a/sys/dev/e1000/e1000_82571.c b/sys/dev/e1000/e1000_82571.c index 8db1fcb921a9..cae9afcb2d78 100644 --- a/sys/dev/e1000/e1000_82571.c +++ b/sys/dev/e1000/e1000_82571.c @@ -285,7 +285,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_hw *hw) struct e1000_mac_info *mac = &hw->mac; u32 swsm = 0; u32 swsm2 = 0; - bool force_clear_smbi = FALSE; + bool force_clear_smbi = false; DEBUGFUNC("e1000_init_mac_params_82571"); @@ -327,9 +327,9 @@ static s32 e1000_init_mac_params_82571(struct e1000_hw *hw) /* Set rar entry count */ mac->rar_entry_count = E1000_RAR_ENTRIES; /* Set if part includes ASF firmware */ - mac->asf_firmware_present = TRUE; + mac->asf_firmware_present = true; /* Adaptive IFS supported */ - mac->adaptive_ifs = TRUE; + mac->adaptive_ifs = true; /* Function pointers */ @@ -369,7 +369,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_hw *hw) mac->ops.blink_led = e1000_blink_led_generic; /* FWSM register */ - mac->has_fwsm = TRUE; + mac->has_fwsm = true; /* ARC supported; valid only if manageability features are * enabled. */ @@ -388,7 +388,7 @@ static s32 e1000_init_mac_params_82571(struct e1000_hw *hw) mac->ops.blink_led = e1000_blink_led_generic; /* FWSM register */ - mac->has_fwsm = TRUE; + mac->has_fwsm = true; break; } @@ -407,13 +407,13 @@ static s32 e1000_init_mac_params_82571(struct e1000_hw *hw) /* Only do this for the first interface on this card */ E1000_WRITE_REG(hw, E1000_SWSM2, swsm2 | E1000_SWSM2_LOCK); - force_clear_smbi = TRUE; + force_clear_smbi = true; } else { - force_clear_smbi = FALSE; + force_clear_smbi = false; } break; default: - force_clear_smbi = TRUE; + force_clear_smbi = true; break; } @@ -563,7 +563,7 @@ e1000_put_hw_semaphore_82574(struct e1000_hw *hw) /** * e1000_set_d0_lplu_state_82574 - Set Low Power Linkup D0 state * @hw: pointer to the HW structure - * @active: TRUE to enable LPLU, FALSE to disable + * @active: true to enable LPLU, false to disable * * Sets the LPLU D0 state according to the active flag. * LPLU will not be activated unless the @@ -593,7 +593,7 @@ static s32 e1000_set_d0_lplu_state_82574(struct e1000_hw *hw, bool active) * @active: boolean used to enable/disable lplu * * The low power link up (lplu) state is set to the power management level D3 - * when active is TRUE, else clear lplu for D3. LPLU + * when active is true, else clear lplu for D3. LPLU * is used during Dx states where the power conservation is most important. * During driver activity, SmartSpeed should be enabled so performance is * maintained. @@ -860,7 +860,7 @@ static s32 e1000_get_cfg_done_82571(struct e1000_hw *hw) /** * e1000_set_d0_lplu_state_82571 - Set Low Power Linkup D0 state * @hw: pointer to the HW structure - * @active: TRUE to enable LPLU, FALSE to disable + * @active: true to enable LPLU, false to disable * * Sets the LPLU D0 state according to the active flag. When activating LPLU * this function also disables smart speed and vice versa. LPLU will not be @@ -1051,7 +1051,7 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw) if (ret_val) return ret_val; - e1000_set_laa_state_82571(hw, TRUE); + e1000_set_laa_state_82571(hw, true); } /* Reinitialize the 82571 serdes link state machine */ @@ -1327,8 +1327,8 @@ static void e1000_clear_vfta_82571(struct e1000_hw *hw) * e1000_check_mng_mode_82574 - Check manageability is enabled * @hw: pointer to the HW structure * - * Reads the NVM Initialization Control Word 2 and returns TRUE - * (>0) if any manageability is enabled, else FALSE (0). + * Reads the NVM Initialization Control Word 2 and returns true + * (>0) if any manageability is enabled, else false (0). **/ static bool e1000_check_mng_mode_82574(struct e1000_hw *hw) { @@ -1339,7 +1339,7 @@ static bool e1000_check_mng_mode_82574(struct e1000_hw *hw) ret_val = hw->nvm.ops.read(hw, NVM_INIT_CONTROL2_REG, 1, &data); if (ret_val) - return FALSE; + return false; return (data & E1000_NVM_INIT_CTRL2_MNGM) != 0; } @@ -1392,18 +1392,18 @@ bool e1000_check_phy_82574(struct e1000_hw *hw) ret_val = hw->phy.ops.read_reg(hw, E1000_RECEIVE_ERROR_COUNTER, &receive_errors); if (ret_val) - return FALSE; + return false; if (receive_errors == E1000_RECEIVE_ERROR_MAX) { ret_val = hw->phy.ops.read_reg(hw, E1000_BASE1000T_STATUS, &status_1kbt); if (ret_val) - return FALSE; + return false; if ((status_1kbt & E1000_IDLE_ERROR_COUNT_MASK) == E1000_IDLE_ERROR_COUNT_MASK) - return TRUE; + return true; } - return FALSE; + return false; } @@ -1556,10 +1556,10 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) */ mac->serdes_link_state = e1000_serdes_link_autoneg_progress; - mac->serdes_has_link = FALSE; + mac->serdes_has_link = false; DEBUGOUT("AN_UP -> AN_PROG\n"); } else { - mac->serdes_has_link = TRUE; + mac->serdes_has_link = true; } break; @@ -1576,10 +1576,10 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) (ctrl & ~E1000_CTRL_SLU)); mac->serdes_link_state = e1000_serdes_link_autoneg_progress; - mac->serdes_has_link = FALSE; + mac->serdes_has_link = false; DEBUGOUT("FORCED_UP -> AN_PROG\n"); } else { - mac->serdes_has_link = TRUE; + mac->serdes_has_link = true; } break; @@ -1593,7 +1593,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) mac->serdes_link_state = e1000_serdes_link_autoneg_complete; DEBUGOUT("AN_PROG -> AN_UP\n"); - mac->serdes_has_link = TRUE; + mac->serdes_has_link = true; } else { /* Autoneg completed, but failed. */ mac->serdes_link_state = @@ -1619,7 +1619,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) } mac->serdes_link_state = e1000_serdes_link_forced_up; - mac->serdes_has_link = TRUE; + mac->serdes_has_link = true; DEBUGOUT("AN_PROG -> FORCED_UP\n"); } break; @@ -1635,13 +1635,13 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) ~E1000_CTRL_SLU)); mac->serdes_link_state = e1000_serdes_link_autoneg_progress; - mac->serdes_has_link = FALSE; + mac->serdes_has_link = false; DEBUGOUT("DOWN -> AN_PROG\n"); break; } } else { if (!(rxcw & E1000_RXCW_SYNCH)) { - mac->serdes_has_link = FALSE; + mac->serdes_has_link = false; mac->serdes_link_state = e1000_serdes_link_down; DEBUGOUT("ANYSTATE -> DOWN\n"); } else { @@ -1657,7 +1657,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) continue; if (rxcw & E1000_RXCW_IV) { - mac->serdes_has_link = FALSE; + mac->serdes_has_link = false; mac->serdes_link_state = e1000_serdes_link_down; DEBUGOUT("ANYSTATE -> DOWN\n"); @@ -1671,7 +1671,7 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw) E1000_WRITE_REG(hw, E1000_TXCW, txcw); mac->serdes_link_state = e1000_serdes_link_autoneg_progress; - mac->serdes_has_link = FALSE; + mac->serdes_has_link = false; DEBUGOUT("ANYSTATE -> AN_PROG\n"); } } @@ -1728,7 +1728,7 @@ bool e1000_get_laa_state_82571(struct e1000_hw *hw) DEBUGFUNC("e1000_get_laa_state_82571"); if (hw->mac.type != e1000_82571) - return FALSE; + return false; return hw->dev_spec._82571.laa_is_present; } diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index 29805270f8dc..59d8b9c85dc3 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -128,7 +128,7 @@ static const u16 e1000_82580_rxpbs_table[] = { static bool e1000_sgmii_uses_mdio_82575(struct e1000_hw *hw) { u32 reg = 0; - bool ext_mdio = FALSE; + bool ext_mdio = false; DEBUGFUNC("e1000_sgmii_uses_mdio_82575"); @@ -348,16 +348,16 @@ static s32 e1000_init_mac_params_82575(struct e1000_hw *hw) /* Enable EEE default settings for EEE supported devices */ if (mac->type >= e1000_i350) - dev_spec->eee_disable = FALSE; + dev_spec->eee_disable = false; /* Allow a single clear of the SW semaphore on I210 and newer */ if (mac->type >= e1000_i210) - dev_spec->clear_semaphore_once = TRUE; + dev_spec->clear_semaphore_once = true; /* Set if part includes ASF firmware */ - mac->asf_firmware_present = TRUE; + mac->asf_firmware_present = true; /* FWSM register */ - mac->has_fwsm = TRUE; + mac->has_fwsm = true; /* ARC supported; valid only if manageability features are enabled. */ mac->arc_subsystem_valid = !!(E1000_READ_REG(hw, E1000_FWSM) & E1000_FWSM_MODE_MASK); @@ -716,7 +716,7 @@ static s32 e1000_phy_hw_reset_sgmii_82575(struct e1000_hw *hw) DEBUGFUNC("e1000_phy_hw_reset_sgmii_82575"); /* - * This isn't a TRUE "hard" reset, but is the only reset + * This isn't a true "hard" reset, but is the only reset * available to us at this time. */ @@ -746,7 +746,7 @@ out: /** * e1000_set_d0_lplu_state_82575 - Set Low Power Linkup D0 state * @hw: pointer to the HW structure - * @active: TRUE to enable LPLU, FALSE to disable + * @active: true to enable LPLU, false to disable * * Sets the LPLU D0 state according to the active flag. When * activating LPLU this function also disables smart speed @@ -832,7 +832,7 @@ out: /** * e1000_set_d0_lplu_state_82580 - Set Low Power Linkup D0 state * @hw: pointer to the HW structure - * @active: TRUE to enable LPLU, FALSE to disable + * @active: true to enable LPLU, false to disable * * Sets the LPLU D0 state according to the active flag. When * activating LPLU this function also disables smart speed @@ -883,7 +883,7 @@ static s32 e1000_set_d0_lplu_state_82580(struct e1000_hw *hw, bool active) * Success returns 0, Failure returns 1 * * The low power link up (lplu) state is set to the power management level D3 - * and SmartSpeed is disabled when active is TRUE, else clear lplu for D3 + * and SmartSpeed is disabled when active is true, else clear lplu for D3 * and enable Smartspeed. LPLU and Smartspeed are mutually exclusive. LPLU * is used during Dx states where the power conservation is most important. * During driver activity, SmartSpeed should be enabled so performance is @@ -1139,7 +1139,7 @@ static s32 e1000_check_for_link_media_swap(struct e1000_hw *hw) /* Determine if a swap needs to happen. */ if (port && (hw->dev_spec._82575.media_port != port)) { hw->dev_spec._82575.media_port = port; - hw->dev_spec._82575.media_changed = TRUE; + hw->dev_spec._82575.media_changed = true; } if (port == E1000_MEDIA_PORT_COPPER) { @@ -1217,7 +1217,7 @@ static s32 e1000_get_pcs_speed_and_duplex_82575(struct e1000_hw *hw, * The link up bit determines when link is up on autoneg. */ if (pcs & E1000_PCS_LSTS_LINK_OK) { - mac->serdes_has_link = TRUE; + mac->serdes_has_link = true; /* Detect and store PCS speed */ if (pcs & E1000_PCS_LSTS_SPEED_1000) @@ -1246,7 +1246,7 @@ static s32 e1000_get_pcs_speed_and_duplex_82575(struct e1000_hw *hw, } } else { - mac->serdes_has_link = FALSE; + mac->serdes_has_link = false; *speed = 0; *duplex = 0; } @@ -1527,13 +1527,13 @@ static s32 e1000_setup_serdes_link_82575(struct e1000_hw *hw) switch (ctrl_ext & E1000_CTRL_EXT_LINK_MODE_MASK) { case E1000_CTRL_EXT_LINK_MODE_SGMII: /* sgmii mode lets the phy handle forcing speed/duplex */ - pcs_autoneg = TRUE; + pcs_autoneg = true; /* autoneg time out should be disabled for SGMII mode */ reg &= ~(E1000_PCS_LCTL_AN_TIMEOUT); break; case E1000_CTRL_EXT_LINK_MODE_1000BASE_KX: /* disable PCS autoneg and support parallel detect only */ - pcs_autoneg = FALSE; + pcs_autoneg = false; /* FALLTHROUGH */ default: if (hw->mac.type == e1000_82575 || @@ -1545,7 +1545,7 @@ static s32 e1000_setup_serdes_link_82575(struct e1000_hw *hw) } if (data & E1000_EEPROM_PCS_AUTONEG_DISABLE_BIT) - pcs_autoneg = FALSE; + pcs_autoneg = false; } /* @@ -1637,8 +1637,8 @@ static s32 e1000_get_media_type_82575(struct e1000_hw *hw) u32 link_mode = 0; /* Set internal phy as default */ - dev_spec->sgmii_active = FALSE; - dev_spec->module_plugged = FALSE; + dev_spec->sgmii_active = false; + dev_spec->module_plugged = false; /* Get CSR setting */ ctrl_ext = E1000_READ_REG(hw, E1000_CTRL_EXT); @@ -1657,7 +1657,7 @@ static s32 e1000_get_media_type_82575(struct e1000_hw *hw) /* Get phy control interface type set (MDIO vs. I2C)*/ if (e1000_sgmii_uses_mdio_82575(hw)) { hw->phy.media_type = e1000_media_type_copper; - dev_spec->sgmii_active = TRUE; + dev_spec->sgmii_active = true; break; } /* fall through for I2C based SGMII */ @@ -1675,7 +1675,7 @@ static s32 e1000_get_media_type_82575(struct e1000_hw *hw) if (link_mode == E1000_CTRL_EXT_LINK_MODE_SGMII) { hw->phy.media_type = e1000_media_type_copper; - dev_spec->sgmii_active = TRUE; + dev_spec->sgmii_active = true; } break; @@ -1746,14 +1746,14 @@ static s32 e1000_set_sfp_media_type_82575(struct e1000_hw *hw) /* Check if there is some SFP module plugged and powered */ if ((tranceiver_type == E1000_SFF_IDENTIFIER_SFP) || (tranceiver_type == E1000_SFF_IDENTIFIER_SFF)) { - dev_spec->module_plugged = TRUE; + dev_spec->module_plugged = true; if (eth_flags->e1000_base_lx || eth_flags->e1000_base_sx) { hw->phy.media_type = e1000_media_type_internal_serdes; } else if (eth_flags->e100_base_fx) { - dev_spec->sgmii_active = TRUE; + dev_spec->sgmii_active = true; hw->phy.media_type = e1000_media_type_internal_serdes; } else if (eth_flags->e1000_base_t) { - dev_spec->sgmii_active = TRUE; + dev_spec->sgmii_active = true; hw->phy.media_type = e1000_media_type_copper; } else { hw->phy.media_type = e1000_media_type_unknown; @@ -2224,11 +2224,11 @@ static s32 e1000_reset_hw_82580(struct e1000_hw *hw) DEBUGFUNC("e1000_reset_hw_82580"); - hw->dev_spec._82575.global_device_reset = FALSE; + hw->dev_spec._82575.global_device_reset = false; /* 82580 does not reliably do global_device_reset due to hw errata */ if (hw->mac.type == e1000_82580) - global_device_reset = FALSE; + global_device_reset = false; /* Get current control state. */ ctrl = E1000_READ_REG(hw, E1000_CTRL); @@ -2252,7 +2252,7 @@ static s32 e1000_reset_hw_82580(struct e1000_hw *hw) /* Determine whether or not a global dev reset is requested */ if (global_device_reset && hw->mac.ops.acquire_swfw_sync(hw, swmbsw_mask)) - global_device_reset = FALSE; + global_device_reset = false; if (global_device_reset && !(E1000_READ_REG(hw, E1000_STATUS) & E1000_STAT_DEV_RST_SET)) @@ -2572,7 +2572,7 @@ s32 e1000_read_emi_reg(struct e1000_hw *hw, u16 addr, u16 *data) { DEBUGFUNC("e1000_read_emi_reg"); - return __e1000_access_emi_reg(hw, addr, data, TRUE); + return __e1000_access_emi_reg(hw, addr, data, true); } /** @@ -2930,7 +2930,7 @@ s32 e1000_get_eee_status_i354(struct e1000_hw *hw, bool *status) goto out; *status = phy_data & (E1000_PCS_STATUS_TX_LPI_RCVD | - E1000_PCS_STATUS_RX_LPI_RCVD) ? TRUE : FALSE; + E1000_PCS_STATUS_RX_LPI_RCVD) ? true : false; out: return ret_val; @@ -3032,7 +3032,7 @@ s32 e1000_read_i2c_byte_generic(struct e1000_hw *hw, u8 byte_offset, u32 retry = 1; u16 swfw_mask = 0; - bool nack = TRUE; + bool nack = true; DEBUGFUNC("e1000_read_i2c_byte_generic"); @@ -3299,7 +3299,7 @@ static s32 e1000_get_i2c_ack(struct e1000_hw *hw) u32 i = 0; u32 i2cctl = E1000_READ_REG(hw, E1000_I2CPARAMS); u32 timeout = 10; - bool ack = TRUE; + bool ack = true; DEBUGFUNC("e1000_get_i2c_ack"); diff --git a/sys/dev/e1000/e1000_api.c b/sys/dev/e1000/e1000_api.c index b28ab77f3794..5c778a48bba0 100644 --- a/sys/dev/e1000/e1000_api.c +++ b/sys/dev/e1000/e1000_api.c @@ -421,10 +421,10 @@ s32 e1000_set_mac_type(struct e1000_hw *hw) /** * e1000_setup_init_funcs - Initializes function pointers * @hw: pointer to the HW structure - * @init_device: TRUE will initialize the rest of the function pointers - * getting the device ready for use. FALSE will only set + * @init_device: true will initialize the rest of the function pointers + * getting the device ready for use. false will only set * MAC type and the function pointers for the other init - * functions. Passing FALSE will not generate any hardware + * functions. Passing false will not generate any hardware * reads or writes. * * This function must be called by a driver in order to use the rest @@ -656,7 +656,7 @@ bool e1000_check_mng_mode(struct e1000_hw *hw) if (hw->mac.ops.check_mng_mode) return hw->mac.ops.check_mng_mode(hw); - return FALSE; + return false; } /** @@ -1186,7 +1186,7 @@ s32 e1000_phy_commit(struct e1000_hw *hw) * Success returns 0, Failure returns 1 * * The low power link up (lplu) state is set to the power management level D0 - * and SmartSpeed is disabled when active is TRUE, else clear lplu for D0 + * and SmartSpeed is disabled when active is true, else clear lplu for D0 * and enable Smartspeed. LPLU and Smartspeed are mutually exclusive. LPLU * is used during Dx states where the power conservation is most important. * During driver activity, SmartSpeed should be enabled so performance is @@ -1208,7 +1208,7 @@ s32 e1000_set_d0_lplu_state(struct e1000_hw *hw, bool active) * Success returns 0, Failure returns 1 * * The low power link up (lplu) state is set to the power management level D3 - * and SmartSpeed is disabled when active is TRUE, else clear lplu for D3 + * and SmartSpeed is disabled when active is true, else clear lplu for D3 * and enable Smartspeed. LPLU and Smartspeed are mutually exclusive. LPLU * is used during Dx states where the power conservation is most important. * During driver activity, SmartSpeed should be enabled so performance is diff --git a/sys/dev/e1000/e1000_api.h b/sys/dev/e1000/e1000_api.h index c96030b567db..48cf33213043 100644 --- a/sys/dev/e1000/e1000_api.h +++ b/sys/dev/e1000/e1000_api.h @@ -140,11 +140,11 @@ u32 e1000_translate_register_82542(u32 reg); * Typical use: * ... * if (TBI_ACCEPT) { - * accept_frame = TRUE; + * accept_frame = true; * e1000_tbi_adjust_stats(adapter, MacAddress); * frame_length--; * } else { - * accept_frame = FALSE; + * accept_frame = false; * } * ... */ diff --git a/sys/dev/e1000/e1000_hw.h b/sys/dev/e1000/e1000_hw.h index 90bc652861b5..6ee252e147a4 100644 --- a/sys/dev/e1000/e1000_hw.h +++ b/sys/dev/e1000/e1000_hw.h @@ -275,7 +275,7 @@ enum e1000_mac_type { e1000_i211, e1000_vfadapt, e1000_vfadapt_i350, - e1000_num_macs /* List is 1-based, so subtract 1 for TRUE count. */ + e1000_num_macs /* List is 1-based, so subtract 1 for true count. */ }; enum e1000_media_type { diff --git a/sys/dev/e1000/e1000_i210.c b/sys/dev/e1000/e1000_i210.c index 0d810fecf3bd..da2e786130c8 100644 --- a/sys/dev/e1000/e1000_i210.c +++ b/sys/dev/e1000/e1000_i210.c @@ -552,14 +552,14 @@ out: bool e1000_get_flash_presence_i210(struct e1000_hw *hw) { u32 eec = 0; - bool ret_val = FALSE; + bool ret_val = false; DEBUGFUNC("e1000_get_flash_presence_i210"); eec = E1000_READ_REG(hw, E1000_EECD); if (eec & E1000_EECD_FLASH_DETECTED_I210) - ret_val = TRUE; + ret_val = true; return ret_val; } diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index dd4e85d64aff..5cd13579d50c 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -242,7 +242,7 @@ static bool e1000_phy_is_accessible_pchlan(struct e1000_hw *hw) } if (ret_val) - return FALSE; + return false; out: if (hw->mac.type >= e1000_pch_lpt) { /* Only unforce SMBus if ME is not active */ @@ -260,7 +260,7 @@ out: } } - return TRUE; + return true; } /** @@ -324,7 +324,7 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) /* Gate automatic PHY configuration by hardware on managed and * non-managed 82579 and newer adapters. */ - e1000_gate_hw_phy_config_ich8lan(hw, TRUE); + e1000_gate_hw_phy_config_ich8lan(hw, true); /* It is not possible to be certain of the current state of ULP * so forcibly disable it. @@ -439,7 +439,7 @@ out: if ((hw->mac.type == e1000_pch2lan) && !(fwsm & E1000_ICH_FWSM_FW_VALID)) { msec_delay(10); - e1000_gate_hw_phy_config_ich8lan(hw, FALSE); + e1000_gate_hw_phy_config_ich8lan(hw, false); } return ret_val; @@ -699,7 +699,7 @@ static s32 e1000_init_nvm_params_ich8lan(struct e1000_hw *hw) /* Clear shadow ram */ for (i = 0; i < nvm->word_size; i++) { - dev_spec->shadow_ram[i].modified = FALSE; + dev_spec->shadow_ram[i].modified = false; dev_spec->shadow_ram[i].value = 0xFFFF; } @@ -743,13 +743,13 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw) if (mac->type == e1000_ich8lan) mac->rar_entry_count--; /* Set if part includes ASF firmware */ - mac->asf_firmware_present = TRUE; + mac->asf_firmware_present = true; /* FWSM register */ - mac->has_fwsm = TRUE; + mac->has_fwsm = true; /* ARC subsystem not supported */ - mac->arc_subsystem_valid = FALSE; + mac->arc_subsystem_valid = false; /* Adaptive IFS supported */ - mac->adaptive_ifs = TRUE; + mac->adaptive_ifs = true; /* Function pointers */ @@ -833,7 +833,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw) /* Enable PCS Lock-loss workaround for ICH8 */ if (mac->type == e1000_ich8lan) - e1000_set_kmrn_lock_loss_workaround_ich8lan(hw, TRUE); + e1000_set_kmrn_lock_loss_workaround_ich8lan(hw, true); return E1000_SUCCESS; } @@ -880,7 +880,7 @@ s32 e1000_read_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 *data) { DEBUGFUNC("e1000_read_emi_reg_locked"); - return __e1000_access_emi_reg_locked(hw, addr, data, TRUE); + return __e1000_access_emi_reg_locked(hw, addr, data, true); } /** @@ -895,7 +895,7 @@ s32 e1000_write_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 data) { DEBUGFUNC("e1000_read_emi_reg_locked"); - return __e1000_access_emi_reg_locked(hw, addr, &data, FALSE); + return __e1000_access_emi_reg_locked(hw, addr, &data, false); } /** @@ -1112,7 +1112,7 @@ static u64 e1000_ltr2ns(u16 ltr) * GbE MAC in the Lynx Point PCH based on Rx buffer size and link speed * when link is up (which must not exceed the maximum latency supported * by the platform), otherwise specify there is no LTR requirement. - * Unlike TRUE-PCIe devices which set the LTR maximum snoop/no-snoop + * Unlike true-PCIe devices which set the LTR maximum snoop/no-snoop * latencies in the LTR Extended Capability Structure in the PCIe Extended * Capability register set, on this device LTR is set by writing the * equivalent snoop/no-snoop latencies in the LTRV register in the MAC and @@ -1410,8 +1410,8 @@ out: * If not on an ME enabled system, un-configure the ULP mode by software. * * During nominal operation, this function is called when link is acquired - * to disable ULP mode (force=FALSE); otherwise, for example when unloading - * the driver or during Sx->S0 transitions, this is called with force=TRUE + * to disable ULP mode (force=false); otherwise, for example when unloading + * the driver or during Sx->S0 transitions, this is called with force=true * to forcibly disable ULP. */ s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force) @@ -1745,7 +1745,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) fextnvm6 &= ~E1000_FEXTNVM6_K1_OFF_ENABLE; } - if (hw->dev_spec.ich8lan.disable_k1_off == TRUE) + if (hw->dev_spec.ich8lan.disable_k1_off == true) fextnvm6 &= ~E1000_FEXTNVM6_K1_OFF_ENABLE; E1000_WRITE_REG(hw, E1000_FEXTNVM6, fextnvm6); @@ -1754,7 +1754,7 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) if (!link) return E1000_SUCCESS; /* No link detected */ - mac->get_link_status = FALSE; + mac->get_link_status = false; switch (hw->mac.type) { case e1000_pch2lan: @@ -2209,7 +2209,7 @@ release: static s32 e1000_check_reset_block_ich8lan(struct e1000_hw *hw) { u32 fwsm; - bool blocked = FALSE; + bool blocked = false; int i = 0; DEBUGFUNC("e1000_check_reset_block_ich8lan"); @@ -2217,11 +2217,11 @@ static s32 e1000_check_reset_block_ich8lan(struct e1000_hw *hw) do { fwsm = E1000_READ_REG(hw, E1000_FWSM); if (!(fwsm & E1000_ICH_FWSM_RSPCIPHY)) { - blocked = TRUE; + blocked = true; msec_delay(10); continue; } - blocked = FALSE; + blocked = false; } while (blocked && (i++ < 30)); return blocked ? E1000_BLK_PHY_RESET : E1000_SUCCESS; } @@ -2435,7 +2435,7 @@ static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link) if (status_reg == (BM_CS_STATUS_LINK_UP | BM_CS_STATUS_RESOLVED | BM_CS_STATUS_SPEED_1000)) - k1_enable = FALSE; + k1_enable = false; } if (hw->phy.type == e1000_phy_82577) { @@ -2451,7 +2451,7 @@ static s32 e1000_k1_gig_workaround_hv(struct e1000_hw *hw, bool link) if (status_reg == (HV_M_STATUS_LINK_UP | HV_M_STATUS_AUTONEG_COMPLETE | HV_M_STATUS_SPEED_1000)) - k1_enable = FALSE; + k1_enable = false; } /* Link stall fix for link up */ @@ -2688,7 +2688,7 @@ static s32 e1000_hv_phy_workarounds_ich8lan(struct e1000_hw *hw) /* Configure the K1 Si workaround during phy reset assuming there is * link so that it disables K1 if link is in 1Gbps. */ - ret_val = e1000_k1_gig_workaround_hv(hw, TRUE); + ret_val = e1000_k1_gig_workaround_hv(hw, true); if (ret_val) return ret_val; @@ -3033,7 +3033,7 @@ static s32 e1000_k1_workaround_lv(struct e1000_hw *hw) /** * e1000_gate_hw_phy_config_ich8lan - disable PHY config via hardware * @hw: pointer to the HW structure - * @gate: boolean set to TRUE to gate, FALSE to ungate + * @gate: boolean set to true to gate, false to ungate * * Gate/ungate the automatic PHY configuration via hardware; perform * the configuration via software instead. @@ -3136,14 +3136,14 @@ static s32 e1000_post_phy_reset_ich8lan(struct e1000_hw *hw) return ret_val; /* Configure the LCD with the OEM bits in NVM */ - ret_val = e1000_oem_bits_config_ich8lan(hw, TRUE); + ret_val = e1000_oem_bits_config_ich8lan(hw, true); if (hw->mac.type == e1000_pch2lan) { /* Ungate automatic PHY configuration on non-managed 82579 */ if (!(E1000_READ_REG(hw, E1000_FWSM) & E1000_ICH_FWSM_FW_VALID)) { msec_delay(10); - e1000_gate_hw_phy_config_ich8lan(hw, FALSE); + e1000_gate_hw_phy_config_ich8lan(hw, false); } /* Set EEE LPI Update Timer to 200usec */ *** 1089 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Fri Sep 17 22:13:45 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA8AF66BC51; Fri, 17 Sep 2021 22:13:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB7Ws5c9Dz3Dw6; Fri, 17 Sep 2021 22:13:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A213D1DD71; Fri, 17 Sep 2021 22:13:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HMDjYY010022; Fri, 17 Sep 2021 22:13:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HMDjpL010021; Fri, 17 Sep 2021 22:13:45 GMT (envelope-from git) Date: Fri, 17 Sep 2021 22:13:45 GMT Message-Id: <202109172213.18HMDjpL010021@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 4b977e6dda92 - main - nvme/nda: Fail all nvme I/Os after controller fails MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4b977e6dda92fe093ea300f1a91dbcf877b64fa0 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 22:13:45 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4b977e6dda92fe093ea300f1a91dbcf877b64fa0 commit 4b977e6dda92fe093ea300f1a91dbcf877b64fa0 Author: Warner Losh AuthorDate: 2021-09-17 20:56:58 +0000 Commit: Warner Losh CommitDate: 2021-09-17 22:09:21 +0000 nvme/nda: Fail all nvme I/Os after controller fails Once the controller has failed, fail all I/O w/o sending it to the device. The reset of the nvme driver won't schedule any I/O to the failed device, and the controller is in an indeterminate state and can't accept I/O. Fail both at the top end of the sim and the bottom end. Don't bother queueing up the I/O for failure in a different task. Reviewed by: chuck Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31341 --- sys/dev/nvme/nvme_qpair.c | 8 +++----- sys/dev/nvme/nvme_sim.c | 4 ++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/dev/nvme/nvme_qpair.c b/sys/dev/nvme/nvme_qpair.c index eea87e299d3d..71718acff66f 100644 --- a/sys/dev/nvme/nvme_qpair.c +++ b/sys/dev/nvme/nvme_qpair.c @@ -1078,12 +1078,10 @@ _nvme_qpair_submit_request(struct nvme_qpair *qpair, struct nvme_request *req) if (qpair->ctrlr->is_failed) { /* - * The controller has failed. Post the request to a - * task where it will be aborted, so that we do not - * invoke the request's callback in the context - * of the submission. + * The controller has failed, so fail the request. */ - nvme_ctrlr_post_failed_request(qpair->ctrlr, req); + nvme_qpair_manual_complete_request(qpair, req, + NVME_SCT_GENERIC, NVME_SC_ABORTED_BY_REQUEST); } else { /* * Put the request on the qpair's request queue to be diff --git a/sys/dev/nvme/nvme_sim.c b/sys/dev/nvme/nvme_sim.c index efec8d34868a..06e645ebdf90 100644 --- a/sys/dev/nvme/nvme_sim.c +++ b/sys/dev/nvme/nvme_sim.c @@ -258,6 +258,10 @@ nvme_sim_action(struct cam_sim *sim, union ccb *ccb) break; case XPT_NVME_IO: /* Execute the requested I/O operation */ case XPT_NVME_ADMIN: /* or Admin operation */ + if (ctrlr->is_failed) { + ccb->ccb_h.status = CAM_DEV_NOT_THERE; + break; + } nvme_sim_nvmeio(sim, ccb); return; /* no done */ default: From owner-dev-commits-src-all@freebsd.org Fri Sep 17 23:07:53 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5851366CD85; Fri, 17 Sep 2021 23:07:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB8kK1mSkz3hS4; Fri, 17 Sep 2021 23:07:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1835B1EBD0; Fri, 17 Sep 2021 23:07:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HN7qc5076218; Fri, 17 Sep 2021 23:07:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HN7q26076217; Fri, 17 Sep 2021 23:07:52 GMT (envelope-from git) Date: Fri, 17 Sep 2021 23:07:52 GMT Message-Id: <202109172307.18HN7q26076217@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 007c2463d6d0 - main - calendar.freebsd: Fix off-by-one error MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 007c2463d6d017ad5321d5cd2bc500e577d22196 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 23:07:53 -0000 The branch main has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=007c2463d6d017ad5321d5cd2bc500e577d22196 commit 007c2463d6d017ad5321d5cd2bc500e577d22196 Author: Kevin Bowling AuthorDate: 2021-09-17 23:05:27 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 23:07:23 +0000 calendar.freebsd: Fix off-by-one error --- usr.bin/calendar/calendars/calendar.freebsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/calendar/calendars/calendar.freebsd b/usr.bin/calendar/calendars/calendar.freebsd index c813f99b3664..10c361fac8da 100644 --- a/usr.bin/calendar/calendars/calendar.freebsd +++ b/usr.bin/calendar/calendars/calendar.freebsd @@ -96,8 +96,8 @@ 02/23 Vinícius Zavam born in Fortaleza, Ceará, Brazil, 1986 02/24 Johan Karlsson born in Mariannelund, Sweden, 1974 02/24 Colin Percival born in Burnaby, Canada, 1981 -02/24 Kevin Bowling born in Scottsdale, Arizona, United States, 1989 02/24 Brandon Bergren born in Edmond, Oklahoma, United States, 1984 +02/25 Kevin Bowling born in Scottsdale, Arizona, United States, 1989 02/26 Pietro Cerutti born in Faido, Switzerland, 1984 02/28 Daichi GOTO born in Shimizu Suntou, Shizuoka, Japan, 1980 02/28 Ruslan Makhmatkhanov born in Rostov-on-Don, USSR, 1984 From owner-dev-commits-src-all@freebsd.org Fri Sep 17 23:08:32 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 515FA66CDA4; Fri, 17 Sep 2021 23:08:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB8l41sxfz3hPs; Fri, 17 Sep 2021 23:08:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 217631E7FF; Fri, 17 Sep 2021 23:08:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HN8WtV076369; Fri, 17 Sep 2021 23:08:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HN8WRF076368; Fri, 17 Sep 2021 23:08:32 GMT (envelope-from git) Date: Fri, 17 Sep 2021 23:08:32 GMT Message-Id: <202109172308.18HN8WRF076368@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: d44b684e1a40 - stable/13 - calendar.freebsd: Fix off-by-one error MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d44b684e1a40aedb8043063cc0927d1e55fc634f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 23:08:32 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=d44b684e1a40aedb8043063cc0927d1e55fc634f commit d44b684e1a40aedb8043063cc0927d1e55fc634f Author: Kevin Bowling AuthorDate: 2021-09-17 23:05:27 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 23:08:18 +0000 calendar.freebsd: Fix off-by-one error (cherry picked from commit 007c2463d6d017ad5321d5cd2bc500e577d22196) --- usr.bin/calendar/calendars/calendar.freebsd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/calendar/calendars/calendar.freebsd b/usr.bin/calendar/calendars/calendar.freebsd index df016ec95209..7ee66eaca7aa 100644 --- a/usr.bin/calendar/calendars/calendar.freebsd +++ b/usr.bin/calendar/calendars/calendar.freebsd @@ -94,8 +94,8 @@ 02/23 Vinícius Zavam born in Fortaleza, Ceará, Brazil, 1986 02/24 Johan Karlsson born in Mariannelund, Sweden, 1974 02/24 Colin Percival born in Burnaby, Canada, 1981 -02/24 Kevin Bowling born in Scottsdale, Arizona, United States, 1989 02/24 Brandon Bergren born in Edmond, Oklahoma, United States, 1984 +02/25 Kevin Bowling born in Scottsdale, Arizona, United States, 1989 02/26 Pietro Cerutti born in Faido, Switzerland, 1984 02/28 Daichi GOTO born in Shimizu Suntou, Shizuoka, Japan, 1980 02/28 Ruslan Makhmatkhanov born in Rostov-on-Don, USSR, 1984 From owner-dev-commits-src-all@freebsd.org Fri Sep 17 23:10:06 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 297AE66C582; Fri, 17 Sep 2021 23:10:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB8mt0grvz3j6l; Fri, 17 Sep 2021 23:10:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EC9651ECAB; Fri, 17 Sep 2021 23:10:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HNA5vF078991; Fri, 17 Sep 2021 23:10:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HNA5ko078988; Fri, 17 Sep 2021 23:10:05 GMT (envelope-from git) Date: Fri, 17 Sep 2021 23:10:05 GMT Message-Id: <202109172310.18HNA5ko078988@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: f4350b6becb8 - stable/12 - calendar.freebsd: Fix off-by-one error MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: f4350b6becb843c124e8f1c3436c2046469c6e31 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 23:10:06 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=f4350b6becb843c124e8f1c3436c2046469c6e31 commit f4350b6becb843c124e8f1c3436c2046469c6e31 Author: Kevin Bowling AuthorDate: 2021-09-17 23:05:27 +0000 Commit: Kevin Bowling CommitDate: 2021-09-17 23:09:51 +0000 calendar.freebsd: Fix off-by-one error (cherry picked from commit 007c2463d6d017ad5321d5cd2bc500e577d22196) --- usr.bin/calendar/calendars/calendar.freebsd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/calendar/calendars/calendar.freebsd b/usr.bin/calendar/calendars/calendar.freebsd index a20ba9fe4f93..ae0ec2f4a1df 100644 --- a/usr.bin/calendar/calendars/calendar.freebsd +++ b/usr.bin/calendar/calendars/calendar.freebsd @@ -88,7 +88,8 @@ 02/23 Vinícius Zavam born in Fortaleza, Ceará, Brazil, 1986 02/24 Johan Karlsson born in Mariannelund, Sweden, 1974 02/24 Colin Percival born in Burnaby, Canada, 1981 -02/24 Kevin Bowling born in Scottsdale, Arizona, United States, 1989 +02/24 Brandon Bergren born in Edmond, Oklahoma, United States, 1984 +02/25 Kevin Bowling born in Scottsdale, Arizona, United States, 1989 02/26 Pietro Cerutti born in Faido, Switzerland, 1984 02/28 Daichi GOTO born in Shimizu Suntou, Shizuoka, Japan, 1980 02/28 Ruslan Makhmatkhanov born in Rostov-on-Don, USSR, 1984 From owner-dev-commits-src-all@freebsd.org Fri Sep 17 23:25:49 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AD63C66CEBE for ; Fri, 17 Sep 2021 23:25:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HB9714LT8z3mZR; Fri, 17 Sep 2021 23:25:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 760DF1F112; Fri, 17 Sep 2021 23:25:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18HNPnZh003378; Fri, 17 Sep 2021 23:25:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18HNPnSl003376; Fri, 17 Sep 2021 23:25:49 GMT (envelope-from git) Date: Fri, 17 Sep 2021 23:25:49 GMT Message-Id: <202109172325.18HNPnSl003376@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Martin Matuska Subject: git: 4f92fe0f5c82..71c6098526c6 - vendor/openzfs/zfs-2.1-release - vendor branch updated MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/vendor/openzfs/zfs-2.1-release X-Git-Reftype: branch X-Git-Commit: 71c6098526c6d5fbfa84a58cefe6cdc403488d8c X-Git-Oldrev: 4f92fe0f5c822f6802c6ec675809d7c112a46f2e X-Git-Newrev: 71c6098526c6d5fbfa84a58cefe6cdc403488d8c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Sep 2021 23:25:49 -0000 The branch vendor/openzfs/zfs-2.1-release has been updated by mm: URL: https://cgit.FreeBSD.org/src/log/?id=4f92fe0f5c82..71c6098526c6 18260685236e FreeBSD: Clean up ASSERT/VERIFY use in module 6fe6192796f6 FreeBSD: Implement xattr=sa f3969ea78b5f Optimize small random numbers generation d6c2b89032be ZED: Match added disk by pool/vdev GUID if found (#12217) 2334bc4efa9a Upstream: dmu_zfetch_stream_fini leaks refcount 035219ee10b1 Fix abd leak, kmem_free correct size of abd_t 15177c1aac9f Compact dbuf/buf hashes and lock arrays c20ba9bd7a1e Udev rules: use non-ancient comma syntax 0cb122941e1a Udev rules: replace deprecated $tempnode with $devnode fd2e4d143dff Udev rules: use match (==) rather than assign (=) for PROGRAM 7138fe7205da Print zvol_id error messages to stderr rather than stdout dab147d65ac0 Use substantially more robust program exit status logic in zvol_id 41b33dce4438 Move gethrtime() calls out of vdev queue lock 49bb454120d9 FreeBSD: Hardcode abd_chunk_size to PAGE_SIZE c84670950ad8 FreeBSD: Use unmapped I/O for scattered/gang ABD buffers a0b4da22978b Replace strchrnul() with strrchr() 04ebe2918803 dprintf_dnode: strcpy -> strlcpy 8415c3c1705e file reference counts can get corrupted a5e68f047899 Update bug report template 45305a067ff4 Fix ARC ghost states eviction accounting 960a5a557b58 Tinker with slop space accounting with dedup 968dc135728d config/libatomic: require -latomic iff atomic.c doesn't link w/o it ba76bb30a697 Introduce dsl_dir_diduse_transfer_space() 056c273939c8 Correct zfs-send(8) on readonly sends f8c2e91db568 zpool_influxdb: fix -Werror=stringop-truncation c2c4d0570000 FreeBSD: Switch from MAXPHYS to maxphys on FreeBSD 13+ 0ca955856167 Remove unused fields from zvol_task_t 4affa09f3e6c A few fixes of callback typecasting (for the upcoming ClangCFI) 4dfb698aac43 dmu_redact.c does not call bqueue_destroy 6a49948c7309 Minor ARC optimizations 7c61e1ef9d9f CI: generate ABI files if changed 32c0b6468cbc Optimize allocation throttling eaa10257ca72 Remove old orig_fd variable from zfs send 93e11e257b9a FreeBSD: Ignore make_dev_s() errors 729eb4866695 zloop: Add a max iterations option, use default run/pass times 2f073cc9c670 Linux 5.14 compat: blk_alloc_disk() 6385f4e70e62 Fix unfortunate NULL in spa_update_dspace 4434baab1101 Linux 5.14 compat: explicity assign set_page_dirty fceda40c1e66 Initialize "autoreplace" in spa_ld_get_props() 9cc982101495 Initialize all fields in zfs_log_xvattr() bd910fdeb0ae Zero pad bytes when allocating a ZIL record 99df200ffce8 Zero pad bytes following TX_WRITE log data ac573e31053f Initialize dn_next_type[] in the dnode constructor 406534f807b9 Fixes in persistent L2ARC 898b1e173c72 Add missing properties to zfs allow manpage 8a969f3e2d07 Read past end of argv array in zpool_do_import() 94299107813a Assorted fixes for the performance tests e298ac5d04c9 Add comment on metaslab_class_throttle_reserve() locking 451d6da98838 Allow disabling of unmapped I/O on FreeBSD ddb732e2c8aa Modify checksum obtain method of QAT c07ed695778b Man zpool-scrub.8: describe sequential scrub 32a971e7499a Enable /proc/diskstats for zvols 23184b172a8b Make get_key_material_file fail more verbosely 477edd642c6d Run arc_evict thread at higher priority cc5527168129 Fix usage of find in tests/Makefile.am cacc48702bbd Add zfs.sh -r flag to reload modules 744f3009fc78 zfs: add missed dependency of zfs module on zlib 24e51e37495d Restore FreeBSD sysctl processing for arc.min and arc.max c6c0d30016ff ZTS: Avoid unset $tmpdir in redacted_panic 5afc35b69824 Use more atomics in refcounts c600f0687fef Avoid vq_lock drop in vdev_queue_aggregate() 40e02f49e9e6 Fix/improve dbuf hits accounting 61773f41b898 Optimize arc_l2c_only lists assertions a4862125b887 Remove b_pabd/b_rabd allocation from arc_hdr_alloc() 5de6e4ec9447 zfs.4: Fix typo s/compatiblity/compatibility/ 1655ce5619e1 Linux 4.11 compat: statx support 584b7a214e37 ZTS: Add tests for creation time 2016d7fb9c87 Initialize parity blocks before RAID-Z reconstruction benchmarking e78d06f89b02 zpool-remove.8: describe top-level vdev sector size limitation bc371b28067b vdev_id: Return an error if config file is not found 2904ec57f0ed Make 'zpool labelclear -f' work on offlined disks 6c3c7dc8462b Correct checking bdev_check_media_change message 6bb6410570e6 ZTS: Waiting for zvols to be available 72a989cf60b4 Fix cross-endian interoperability of zstd 81611683c877 FreeBSD: Don't remove SA xattr if not SA znode aef8a72afeec ZTS: Remove exceptions for flaky zhack on FreeBSD 004e7d3f9a53 Check for libabigail version 993d4b28af85 CI: use fresh libabigail via docker image d6dae009824b Libabigail: make .abi files more consistent 5331e2d216be Update ABI files via new libabigail version e16e05c9cf85 CI: don't install abigail-tools *** 12 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Sat Sep 18 00:38:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DC09D66E027; Sat, 18 Sep 2021 00:38:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HBBlM5YwNz4bVK; Sat, 18 Sep 2021 00:38:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9A82E1FFE3; Sat, 18 Sep 2021 00:38:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18I0ctNt096526; Sat, 18 Sep 2021 00:38:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18I0ctZG096525; Sat, 18 Sep 2021 00:38:55 GMT (envelope-from git) Date: Sat, 18 Sep 2021 00:38:55 GMT Message-Id: <202109180038.18I0ctZG096525@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 5f4ba94eb591 - stable/13 - e1000: Revert Update intel shared code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5f4ba94eb591bea8f41555a0738725a11ee29802 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2021 00:38:55 -0000 The branch stable/13 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=5f4ba94eb591bea8f41555a0738725a11ee29802 commit 5f4ba94eb591bea8f41555a0738725a11ee29802 Author: Kevin Bowling AuthorDate: 2021-09-08 22:43:13 +0000 Commit: Kevin Bowling CommitDate: 2021-09-18 00:38:35 +0000 e1000: Revert Update intel shared code This reverts commit fc7682b17f3738573099b8b03f5628dcc8148adb. This will be done incrementally to help with bisecting an issue in later I21x devices (ich8lan). PR: 258153 Approved by: imp MFC after: 1 day (cherry picked from commit a4378873e9ce1b35b55378c21f8eae69e58c2525) --- sys/dev/e1000/e1000_80003es2lan.c | 36 ++--- sys/dev/e1000/e1000_80003es2lan.h | 38 ++--- sys/dev/e1000/e1000_82540.c | 40 ++--- sys/dev/e1000/e1000_82541.c | 40 ++--- sys/dev/e1000/e1000_82541.h | 40 ++--- sys/dev/e1000/e1000_82542.c | 40 ++--- sys/dev/e1000/e1000_82543.c | 40 ++--- sys/dev/e1000/e1000_82543.h | 40 ++--- sys/dev/e1000/e1000_82571.c | 42 ++--- sys/dev/e1000/e1000_82571.h | 40 ++--- sys/dev/e1000/e1000_82575.c | 40 ++--- sys/dev/e1000/e1000_82575.h | 40 ++--- sys/dev/e1000/e1000_api.c | 56 +++---- sys/dev/e1000/e1000_api.h | 41 +++-- sys/dev/e1000/e1000_defines.h | 73 +++------ sys/dev/e1000/e1000_hw.h | 42 +++-- sys/dev/e1000/e1000_i210.c | 140 +++-------------- sys/dev/e1000/e1000_i210.h | 42 +++-- sys/dev/e1000/e1000_ich8lan.c | 316 ++++++++------------------------------ sys/dev/e1000/e1000_ich8lan.h | 47 +++--- sys/dev/e1000/e1000_mac.c | 40 ++--- sys/dev/e1000/e1000_mac.h | 40 ++--- sys/dev/e1000/e1000_manage.c | 40 ++--- sys/dev/e1000/e1000_manage.h | 40 ++--- sys/dev/e1000/e1000_mbx.c | 40 ++--- sys/dev/e1000/e1000_mbx.h | 40 ++--- sys/dev/e1000/e1000_nvm.c | 199 +++--------------------- sys/dev/e1000/e1000_nvm.h | 42 ++--- sys/dev/e1000/e1000_osdep.c | 40 ++--- sys/dev/e1000/e1000_osdep.h | 40 ++--- sys/dev/e1000/e1000_phy.c | 62 ++++---- sys/dev/e1000/e1000_phy.h | 49 +++--- sys/dev/e1000/e1000_regs.h | 55 +++---- sys/dev/e1000/e1000_vf.c | 43 +++--- sys/dev/e1000/e1000_vf.h | 40 ++--- sys/dev/e1000/if_em.c | 10 +- 36 files changed, 755 insertions(+), 1298 deletions(-) diff --git a/sys/dev/e1000/e1000_80003es2lan.c b/sys/dev/e1000/e1000_80003es2lan.c index c1aa47a73ac8..5c0220adfc6f 100644 --- a/sys/dev/e1000/e1000_80003es2lan.c +++ b/sys/dev/e1000/e1000_80003es2lan.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its + + 3. Neither the name of the Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_80003es2lan.h b/sys/dev/e1000/e1000_80003es2lan.h index 501cfc958819..cbf0eafa9407 100644 --- a/sys/dev/e1000/e1000_80003es2lan.h +++ b/sys/dev/e1000/e1000_80003es2lan.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82540.c b/sys/dev/e1000/e1000_82540.c index 720798260f8a..adc944a8ebb4 100644 --- a/sys/dev/e1000/e1000_82540.c +++ b/sys/dev/e1000/e1000_82540.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82541.c b/sys/dev/e1000/e1000_82541.c index aaa3de7f02ce..ead974cb1358 100644 --- a/sys/dev/e1000/e1000_82541.c +++ b/sys/dev/e1000/e1000_82541.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82541.h b/sys/dev/e1000/e1000_82541.h index d31065d9a182..ce29548a4d85 100644 --- a/sys/dev/e1000/e1000_82541.h +++ b/sys/dev/e1000/e1000_82541.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82542.c b/sys/dev/e1000/e1000_82542.c index 2fdf7066865b..09906699ab10 100644 --- a/sys/dev/e1000/e1000_82542.c +++ b/sys/dev/e1000/e1000_82542.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82543.c b/sys/dev/e1000/e1000_82543.c index 42c4726fa8c7..e247b01f6cda 100644 --- a/sys/dev/e1000/e1000_82543.c +++ b/sys/dev/e1000/e1000_82543.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82543.h b/sys/dev/e1000/e1000_82543.h index 27f8507fb63c..98289524f6d8 100644 --- a/sys/dev/e1000/e1000_82543.h +++ b/sys/dev/e1000/e1000_82543.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82571.c b/sys/dev/e1000/e1000_82571.c index 8db1fcb921a9..348a3daa3c05 100644 --- a/sys/dev/e1000/e1000_82571.c +++ b/sys/dev/e1000/e1000_82571.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. @@ -515,7 +515,7 @@ e1000_get_hw_semaphore_82574(struct e1000_hw *hw) u32 extcnf_ctrl; s32 i = 0; /* XXX assert that mutex is held */ - DEBUGFUNC("e1000_get_hw_semaphore_82574"); + DEBUGFUNC("e1000_get_hw_semaphore_82573"); ASSERT_CTX_LOCK_HELD(hw); extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); diff --git a/sys/dev/e1000/e1000_82571.h b/sys/dev/e1000/e1000_82571.h index 77303adb162f..a39f63c53e2d 100644 --- a/sys/dev/e1000/e1000_82571.h +++ b/sys/dev/e1000/e1000_82571.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index d588539ca8e8..81bd419fcf0d 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82575.h b/sys/dev/e1000/e1000_82575.h index 22c2f8c4a2f5..36045556661b 100644 --- a/sys/dev/e1000/e1000_82575.h +++ b/sys/dev/e1000/e1000_82575.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_api.c b/sys/dev/e1000/e1000_api.c index b28ab77f3794..b1d5ef74c24f 100644 --- a/sys/dev/e1000/e1000_api.c +++ b/sys/dev/e1000/e1000_api.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. @@ -383,7 +383,6 @@ s32 e1000_set_mac_type(struct e1000_hw *hw) break; case E1000_DEV_ID_I210_COPPER_FLASHLESS: case E1000_DEV_ID_I210_SERDES_FLASHLESS: - case E1000_DEV_ID_I210_SGMII_FLASHLESS: case E1000_DEV_ID_I210_COPPER: case E1000_DEV_ID_I210_COPPER_OEM1: case E1000_DEV_ID_I210_COPPER_IT: @@ -1269,21 +1268,6 @@ s32 e1000_read_pba_length(struct e1000_hw *hw, u32 *pba_num_size) return e1000_read_pba_length_generic(hw, pba_num_size); } -/** - * e1000_read_pba_num - Read device part number - * @hw: pointer to the HW structure - * @pba_num: pointer to device part number - * - * Reads the product board assembly (PBA) number from the EEPROM and stores - * the value in pba_num. - * Currently no func pointer exists and all implementations are handled in the - * generic version of this function. - **/ -s32 e1000_read_pba_num(struct e1000_hw *hw, u32 *pba_num) -{ - return e1000_read_pba_num_generic(hw, pba_num); -} - /** * e1000_validate_nvm_checksum - Verifies NVM (EEPROM) checksum * @hw: pointer to the HW structure diff --git a/sys/dev/e1000/e1000_api.h b/sys/dev/e1000/e1000_api.h index b558b1cf5f23..bf5f637cb3dd 100644 --- a/sys/dev/e1000/e1000_api.h +++ b/sys/dev/e1000/e1000_api.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. @@ -100,7 +100,6 @@ void e1000_power_down_phy(struct e1000_hw *hw); s32 e1000_read_mac_addr(struct e1000_hw *hw); s32 e1000_read_pba_string(struct e1000_hw *hw, u8 *pba_num, u32 pba_num_size); s32 e1000_read_pba_length(struct e1000_hw *hw, u32 *pba_num_size); -s32 e1000_read_pba_num(struct e1000_hw *hw, u32 *part_num); void e1000_reload_nvm(struct e1000_hw *hw); s32 e1000_update_nvm_checksum(struct e1000_hw *hw); s32 e1000_validate_nvm_checksum(struct e1000_hw *hw); diff --git a/sys/dev/e1000/e1000_defines.h b/sys/dev/e1000/e1000_defines.h index 6c1138ed9335..262b01dd5b64 100644 --- a/sys/dev/e1000/e1000_defines.h +++ b/sys/dev/e1000/e1000_defines.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. @@ -1070,44 +1070,11 @@ /* NVM Word Offsets */ #define NVM_COMPAT 0x0003 #define NVM_ID_LED_SETTINGS 0x0004 -#define NVM_VERSION 0x0005 #define NVM_SERDES_AMPLITUDE 0x0006 /* SERDES output amplitude */ #define NVM_PHY_CLASS_WORD 0x0007 #define E1000_I210_NVM_FW_MODULE_PTR 0x0010 #define E1000_I350_NVM_FW_MODULE_PTR 0x0051 #define NVM_FUTURE_INIT_WORD1 0x0019 -#define NVM_ETRACK_WORD 0x0042 -#define NVM_ETRACK_HIWORD 0x0043 -#define NVM_COMB_VER_OFF 0x0083 -#define NVM_COMB_VER_PTR 0x003D - -/* NVM version defines */ -#define NVM_MAJOR_MASK 0xF000 -#define NVM_MINOR_MASK 0x0FF0 -#define NVM_IMAGE_ID_MASK 0x000F -#define NVM_COMB_VER_MASK 0x00FF -#define NVM_MAJOR_SHIFT 12 -#define NVM_MINOR_SHIFT 4 -#define NVM_COMB_VER_SHFT 8 -#define NVM_VER_INVALID 0xFFFF -#define NVM_ETRACK_SHIFT 16 -#define NVM_ETRACK_VALID 0x8000 -#define NVM_NEW_DEC_MASK 0x0F00 *** 2215 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Sat Sep 18 00:39:39 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AED0866E202; Sat, 18 Sep 2021 00:39:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HBBmC4Rgwz4bZq; Sat, 18 Sep 2021 00:39:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 78A4A1FE23; Sat, 18 Sep 2021 00:39:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18I0ddDS096690; Sat, 18 Sep 2021 00:39:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18I0ddDn096689; Sat, 18 Sep 2021 00:39:39 GMT (envelope-from git) Date: Sat, 18 Sep 2021 00:39:39 GMT Message-Id: <202109180039.18I0ddDn096689@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 304bf88ad91e - stable/12 - e1000: Revert Update intel shared code MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 304bf88ad91e08fc61787b0de5ec43676df9c398 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2021 00:39:39 -0000 The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=304bf88ad91e08fc61787b0de5ec43676df9c398 commit 304bf88ad91e08fc61787b0de5ec43676df9c398 Author: Kevin Bowling AuthorDate: 2021-09-08 22:43:13 +0000 Commit: Kevin Bowling CommitDate: 2021-09-18 00:39:24 +0000 e1000: Revert Update intel shared code This reverts commit fc7682b17f3738573099b8b03f5628dcc8148adb. This will be done incrementally to help with bisecting an issue in later I21x devices (ich8lan). PR: 258153 Approved by: imp MFC after: 1 day (cherry picked from commit a4378873e9ce1b35b55378c21f8eae69e58c2525) --- sys/dev/e1000/e1000_80003es2lan.c | 36 ++--- sys/dev/e1000/e1000_80003es2lan.h | 38 ++--- sys/dev/e1000/e1000_82540.c | 40 ++--- sys/dev/e1000/e1000_82541.c | 40 ++--- sys/dev/e1000/e1000_82541.h | 40 ++--- sys/dev/e1000/e1000_82542.c | 40 ++--- sys/dev/e1000/e1000_82543.c | 40 ++--- sys/dev/e1000/e1000_82543.h | 40 ++--- sys/dev/e1000/e1000_82571.c | 42 ++--- sys/dev/e1000/e1000_82571.h | 40 ++--- sys/dev/e1000/e1000_82575.c | 40 ++--- sys/dev/e1000/e1000_82575.h | 40 ++--- sys/dev/e1000/e1000_api.c | 56 +++---- sys/dev/e1000/e1000_api.h | 41 +++-- sys/dev/e1000/e1000_defines.h | 73 +++------ sys/dev/e1000/e1000_hw.h | 42 +++-- sys/dev/e1000/e1000_i210.c | 140 +++-------------- sys/dev/e1000/e1000_i210.h | 42 +++-- sys/dev/e1000/e1000_ich8lan.c | 316 ++++++++------------------------------ sys/dev/e1000/e1000_ich8lan.h | 47 +++--- sys/dev/e1000/e1000_mac.c | 40 ++--- sys/dev/e1000/e1000_mac.h | 40 ++--- sys/dev/e1000/e1000_manage.c | 40 ++--- sys/dev/e1000/e1000_manage.h | 40 ++--- sys/dev/e1000/e1000_mbx.c | 40 ++--- sys/dev/e1000/e1000_mbx.h | 40 ++--- sys/dev/e1000/e1000_nvm.c | 199 +++--------------------- sys/dev/e1000/e1000_nvm.h | 42 ++--- sys/dev/e1000/e1000_osdep.c | 40 ++--- sys/dev/e1000/e1000_osdep.h | 40 ++--- sys/dev/e1000/e1000_phy.c | 62 ++++---- sys/dev/e1000/e1000_phy.h | 49 +++--- sys/dev/e1000/e1000_regs.h | 55 +++---- sys/dev/e1000/e1000_vf.c | 43 +++--- sys/dev/e1000/e1000_vf.h | 40 ++--- sys/dev/e1000/if_em.c | 10 +- 36 files changed, 755 insertions(+), 1298 deletions(-) diff --git a/sys/dev/e1000/e1000_80003es2lan.c b/sys/dev/e1000/e1000_80003es2lan.c index c1aa47a73ac8..5c0220adfc6f 100644 --- a/sys/dev/e1000/e1000_80003es2lan.c +++ b/sys/dev/e1000/e1000_80003es2lan.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its + + 3. Neither the name of the Intel Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_80003es2lan.h b/sys/dev/e1000/e1000_80003es2lan.h index 501cfc958819..cbf0eafa9407 100644 --- a/sys/dev/e1000/e1000_80003es2lan.h +++ b/sys/dev/e1000/e1000_80003es2lan.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82540.c b/sys/dev/e1000/e1000_82540.c index 0296397ee013..d90c8f9b73f1 100644 --- a/sys/dev/e1000/e1000_82540.c +++ b/sys/dev/e1000/e1000_82540.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82541.c b/sys/dev/e1000/e1000_82541.c index bd5ff7e0d11f..04f3b356b6f1 100644 --- a/sys/dev/e1000/e1000_82541.c +++ b/sys/dev/e1000/e1000_82541.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82541.h b/sys/dev/e1000/e1000_82541.h index d31065d9a182..ce29548a4d85 100644 --- a/sys/dev/e1000/e1000_82541.h +++ b/sys/dev/e1000/e1000_82541.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82542.c b/sys/dev/e1000/e1000_82542.c index 2bd38b674cc4..57deeb87a089 100644 --- a/sys/dev/e1000/e1000_82542.c +++ b/sys/dev/e1000/e1000_82542.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82543.c b/sys/dev/e1000/e1000_82543.c index ac81cbd296f2..48ad49294f31 100644 --- a/sys/dev/e1000/e1000_82543.c +++ b/sys/dev/e1000/e1000_82543.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82543.h b/sys/dev/e1000/e1000_82543.h index 27f8507fb63c..98289524f6d8 100644 --- a/sys/dev/e1000/e1000_82543.h +++ b/sys/dev/e1000/e1000_82543.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82571.c b/sys/dev/e1000/e1000_82571.c index 8db1fcb921a9..348a3daa3c05 100644 --- a/sys/dev/e1000/e1000_82571.c +++ b/sys/dev/e1000/e1000_82571.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. @@ -515,7 +515,7 @@ e1000_get_hw_semaphore_82574(struct e1000_hw *hw) u32 extcnf_ctrl; s32 i = 0; /* XXX assert that mutex is held */ - DEBUGFUNC("e1000_get_hw_semaphore_82574"); + DEBUGFUNC("e1000_get_hw_semaphore_82573"); ASSERT_CTX_LOCK_HELD(hw); extcnf_ctrl = E1000_READ_REG(hw, E1000_EXTCNF_CTRL); diff --git a/sys/dev/e1000/e1000_82571.h b/sys/dev/e1000/e1000_82571.h index 77303adb162f..a39f63c53e2d 100644 --- a/sys/dev/e1000/e1000_82571.h +++ b/sys/dev/e1000/e1000_82571.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82575.c b/sys/dev/e1000/e1000_82575.c index d588539ca8e8..81bd419fcf0d 100644 --- a/sys/dev/e1000/e1000_82575.c +++ b/sys/dev/e1000/e1000_82575.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_82575.h b/sys/dev/e1000/e1000_82575.h index 22c2f8c4a2f5..36045556661b 100644 --- a/sys/dev/e1000/e1000_82575.h +++ b/sys/dev/e1000/e1000_82575.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. diff --git a/sys/dev/e1000/e1000_api.c b/sys/dev/e1000/e1000_api.c index b28ab77f3794..b1d5ef74c24f 100644 --- a/sys/dev/e1000/e1000_api.c +++ b/sys/dev/e1000/e1000_api.c @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. @@ -383,7 +383,6 @@ s32 e1000_set_mac_type(struct e1000_hw *hw) break; case E1000_DEV_ID_I210_COPPER_FLASHLESS: case E1000_DEV_ID_I210_SERDES_FLASHLESS: - case E1000_DEV_ID_I210_SGMII_FLASHLESS: case E1000_DEV_ID_I210_COPPER: case E1000_DEV_ID_I210_COPPER_OEM1: case E1000_DEV_ID_I210_COPPER_IT: @@ -1269,21 +1268,6 @@ s32 e1000_read_pba_length(struct e1000_hw *hw, u32 *pba_num_size) return e1000_read_pba_length_generic(hw, pba_num_size); } -/** - * e1000_read_pba_num - Read device part number - * @hw: pointer to the HW structure - * @pba_num: pointer to device part number - * - * Reads the product board assembly (PBA) number from the EEPROM and stores - * the value in pba_num. - * Currently no func pointer exists and all implementations are handled in the - * generic version of this function. - **/ -s32 e1000_read_pba_num(struct e1000_hw *hw, u32 *pba_num) -{ - return e1000_read_pba_num_generic(hw, pba_num); -} - /** * e1000_validate_nvm_checksum - Verifies NVM (EEPROM) checksum * @hw: pointer to the HW structure diff --git a/sys/dev/e1000/e1000_api.h b/sys/dev/e1000/e1000_api.h index b558b1cf5f23..bf5f637cb3dd 100644 --- a/sys/dev/e1000/e1000_api.h +++ b/sys/dev/e1000/e1000_api.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. @@ -100,7 +100,6 @@ void e1000_power_down_phy(struct e1000_hw *hw); s32 e1000_read_mac_addr(struct e1000_hw *hw); s32 e1000_read_pba_string(struct e1000_hw *hw, u8 *pba_num, u32 pba_num_size); s32 e1000_read_pba_length(struct e1000_hw *hw, u32 *pba_num_size); -s32 e1000_read_pba_num(struct e1000_hw *hw, u32 *part_num); void e1000_reload_nvm(struct e1000_hw *hw); s32 e1000_update_nvm_checksum(struct e1000_hw *hw); s32 e1000_validate_nvm_checksum(struct e1000_hw *hw); diff --git a/sys/dev/e1000/e1000_defines.h b/sys/dev/e1000/e1000_defines.h index c3223123879c..43de1047ed0e 100644 --- a/sys/dev/e1000/e1000_defines.h +++ b/sys/dev/e1000/e1000_defines.h @@ -1,32 +1,32 @@ /****************************************************************************** SPDX-License-Identifier: BSD-3-Clause - Copyright (c) 2001-2020, Intel Corporation + Copyright (c) 2001-2015, Intel Corporation All rights reserved. - - Redistribution and use in source and binary forms, with or without + + 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, + + 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 + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - - 3. Neither the name of the Intel Corporation nor the names of its - contributors may be used to endorse or promote products derived from + + 3. Neither the name of the Intel Corporation nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. - + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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) + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. @@ -1070,44 +1070,11 @@ /* NVM Word Offsets */ #define NVM_COMPAT 0x0003 #define NVM_ID_LED_SETTINGS 0x0004 -#define NVM_VERSION 0x0005 #define NVM_SERDES_AMPLITUDE 0x0006 /* SERDES output amplitude */ #define NVM_PHY_CLASS_WORD 0x0007 #define E1000_I210_NVM_FW_MODULE_PTR 0x0010 #define E1000_I350_NVM_FW_MODULE_PTR 0x0051 #define NVM_FUTURE_INIT_WORD1 0x0019 -#define NVM_ETRACK_WORD 0x0042 -#define NVM_ETRACK_HIWORD 0x0043 -#define NVM_COMB_VER_OFF 0x0083 -#define NVM_COMB_VER_PTR 0x003D - -/* NVM version defines */ -#define NVM_MAJOR_MASK 0xF000 -#define NVM_MINOR_MASK 0x0FF0 -#define NVM_IMAGE_ID_MASK 0x000F -#define NVM_COMB_VER_MASK 0x00FF -#define NVM_MAJOR_SHIFT 12 -#define NVM_MINOR_SHIFT 4 -#define NVM_COMB_VER_SHFT 8 -#define NVM_VER_INVALID 0xFFFF -#define NVM_ETRACK_SHIFT 16 -#define NVM_ETRACK_VALID 0x8000 -#define NVM_NEW_DEC_MASK 0x0F00 *** 2215 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Sat Sep 18 10:18:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 93E88675014; Sat, 18 Sep 2021 10:18:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HBRbw3QcYz3MTN; Sat, 18 Sep 2021 10:18:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 563CF27CB6; Sat, 18 Sep 2021 10:18:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18IAIK7c065959; Sat, 18 Sep 2021 10:18:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18IAIK0I065958; Sat, 18 Sep 2021 10:18:20 GMT (envelope-from git) Date: Sat, 18 Sep 2021 10:18:20 GMT Message-Id: <202109181018.18IAIK0I065958@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 5d8e32a66c17 - main - vfs: retire VNODE_REFCOUNT_FENCE_* macros MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5d8e32a66c1700323c570d25b03672f35f4e0110 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2021 10:18:20 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=5d8e32a66c1700323c570d25b03672f35f4e0110 commit 5d8e32a66c1700323c570d25b03672f35f4e0110 Author: Mateusz Guzik AuthorDate: 2021-09-18 08:14:35 +0000 Commit: Mateusz Guzik CommitDate: 2021-09-18 10:16:00 +0000 vfs: retire VNODE_REFCOUNT_FENCE_* macros They are unused as of last year. --- sys/kern/vfs_subr.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 23f6ec9cf3fd..33a556fbfa2b 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -121,22 +121,6 @@ static int v_inval_buf_range_locked(struct vnode *vp, struct bufobj *bo, daddr_t startlbn, daddr_t endlbn); static void vnlru_recalc(void); -/* - * These fences are intended for cases where some synchronization is - * needed between access of v_iflags and lockless vnode refcount (v_holdcnt - * and v_usecount) updates. Access to v_iflags is generally synchronized - * by the interlock, but we have some internal assertions that check vnode - * flags without acquiring the lock. Thus, these fences are INVARIANTS-only - * for now. - */ -#ifdef INVARIANTS -#define VNODE_REFCOUNT_FENCE_ACQ() atomic_thread_fence_acq() -#define VNODE_REFCOUNT_FENCE_REL() atomic_thread_fence_rel() -#else -#define VNODE_REFCOUNT_FENCE_ACQ() -#define VNODE_REFCOUNT_FENCE_REL() -#endif - /* * Number of vnodes in existence. Increased whenever getnewvnode() * allocates a new vnode, decreased in vdropl() for VIRF_DOOMED vnode. From owner-dev-commits-src-all@freebsd.org Sat Sep 18 10:18:21 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C3B7967510B; Sat, 18 Sep 2021 10:18:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HBRbx4rCSz3M7F; Sat, 18 Sep 2021 10:18:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E09127EFA; Sat, 18 Sep 2021 10:18:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18IAILeb065983; Sat, 18 Sep 2021 10:18:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18IAILYX065982; Sat, 18 Sep 2021 10:18:21 GMT (envelope-from git) Date: Sat, 18 Sep 2021 10:18:21 GMT Message-Id: <202109181018.18IAILYX065982@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: a2cb65b8fe97 - main - cache: count vnodes in cache_purgevfs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a2cb65b8fe975a8f228258e3057b62e068dbf8e2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2021 10:18:21 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=a2cb65b8fe975a8f228258e3057b62e068dbf8e2 commit a2cb65b8fe975a8f228258e3057b62e068dbf8e2 Author: Mateusz Guzik AuthorDate: 2021-09-18 08:30:15 +0000 Commit: Mateusz Guzik CommitDate: 2021-09-18 10:16:50 +0000 cache: count vnodes in cache_purgevfs --- sys/kern/vfs_cache.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 732dbbe53cef..3c79395f5d92 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -237,7 +237,7 @@ SDT_PROBE_DEFINE2(vfs, namecache, removecnp, hit, "struct vnode *", "struct componentname *"); SDT_PROBE_DEFINE2(vfs, namecache, removecnp, miss, "struct vnode *", "struct componentname *"); -SDT_PROBE_DEFINE1(vfs, namecache, purge, done, "struct vnode *"); +SDT_PROBE_DEFINE3(vfs, namecache, purge, done, "struct vnode *", "size_t", "size_t"); SDT_PROBE_DEFINE1(vfs, namecache, purge, batch, "int"); SDT_PROBE_DEFINE1(vfs, namecache, purge_negative, done, "struct vnode *"); SDT_PROBE_DEFINE1(vfs, namecache, purgevfs, done, "struct mount *"); @@ -3012,13 +3012,15 @@ void cache_purgevfs(struct mount *mp) { struct vnode *vp, *mvp; + size_t visited, purged; - SDT_PROBE1(vfs, namecache, purgevfs, done, mp); + visited = purged = 0; /* * Somewhat wasteful iteration over all vnodes. Would be better to * support filtering and avoid the interlock to begin with. */ MNT_VNODE_FOREACH_ALL(vp, mp, mvp) { + visited++; if (!cache_has_entries(vp)) { VI_UNLOCK(vp); continue; @@ -3026,8 +3028,11 @@ cache_purgevfs(struct mount *mp) vholdl(vp); VI_UNLOCK(vp); cache_purge(vp); + purged++; vdrop(vp); } + + SDT_PROBE3(vfs, namecache, purgevfs, done, mp, visited, purged); } /* From owner-dev-commits-src-all@freebsd.org Sat Sep 18 10:18:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41727674D76; Sat, 18 Sep 2021 10:18:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HBRby5xYBz3MRy; Sat, 18 Sep 2021 10:18:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9AE15279F8; Sat, 18 Sep 2021 10:18:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18IAIMhS066007; Sat, 18 Sep 2021 10:18:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18IAIMfG066006; Sat, 18 Sep 2021 10:18:22 GMT (envelope-from git) Date: Sat, 18 Sep 2021 10:18:22 GMT Message-Id: <202109181018.18IAIMfG066006@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: f902e4bb04ad - main - lockmgr: fix lock profiling of face adaptive spinning MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f902e4bb04ad717935a97ce1ae59e2dd389d940d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2021 10:18:23 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=f902e4bb04ad717935a97ce1ae59e2dd389d940d commit f902e4bb04ad717935a97ce1ae59e2dd389d940d Author: Mateusz Guzik AuthorDate: 2021-09-11 18:23:51 +0000 Commit: Mateusz Guzik CommitDate: 2021-09-18 10:16:58 +0000 lockmgr: fix lock profiling of face adaptive spinning --- sys/kern/kern_lock.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index bec49f29d162..2eb4feb7c4b5 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -631,6 +631,9 @@ lockmgr_slock_hard(struct lock *lk, u_int flags, struct lock_object *ilk, if (lockmgr_slock_try(lk, &x, flags, false)) break; + lock_profile_obtain_lock_failed(&lk->lock_object, false, + &contested, &waittime); + if ((flags & (LK_ADAPTIVE | LK_INTERLOCK)) == LK_ADAPTIVE) { if (lockmgr_slock_adaptive(&lda, lk, &x, flags)) continue; @@ -639,8 +642,6 @@ lockmgr_slock_hard(struct lock *lk, u_int flags, struct lock_object *ilk, #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); #endif - lock_profile_obtain_lock_failed(&lk->lock_object, false, - &contested, &waittime); /* * If the lock is expected to not sleep just give up @@ -845,6 +846,10 @@ lockmgr_xlock_hard(struct lock *lk, u_int flags, struct lock_object *ilk, break; continue; } + + lock_profile_obtain_lock_failed(&lk->lock_object, false, + &contested, &waittime); + if ((flags & (LK_ADAPTIVE | LK_INTERLOCK)) == LK_ADAPTIVE) { if (lockmgr_xlock_adaptive(&lda, lk, &x)) continue; @@ -852,8 +857,6 @@ lockmgr_xlock_hard(struct lock *lk, u_int flags, struct lock_object *ilk, #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); #endif - lock_profile_obtain_lock_failed(&lk->lock_object, false, - &contested, &waittime); /* * If the lock is expected to not sleep just give up From owner-dev-commits-src-all@freebsd.org Sat Sep 18 13:50:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0DCE1677A83; Sat, 18 Sep 2021 13:50:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HBXJx5Lkdz3HQR; Sat, 18 Sep 2021 13:50:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BCAA2BB8; Sat, 18 Sep 2021 13:50:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18IDofxD053269; Sat, 18 Sep 2021 13:50:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18IDoffo053268; Sat, 18 Sep 2021 13:50:41 GMT (envelope-from git) Date: Sat, 18 Sep 2021 13:50:41 GMT Message-Id: <202109181350.18IDoffo053268@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 8e496ea1df1f - main - pf: always log nat rule and do it pre-rewrite MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8e496ea1df1f00ea7832eb41754dbbb56dd244c8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2021 13:50:42 -0000 The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=8e496ea1df1f00ea7832eb41754dbbb56dd244c8 commit 8e496ea1df1f00ea7832eb41754dbbb56dd244c8 Author: Franco Fichtner AuthorDate: 2021-09-18 11:42:43 +0000 Commit: Kristof Provost CommitDate: 2021-09-18 11:43:41 +0000 pf: always log nat rule and do it pre-rewrite See also https://github.com/opnsense/core/issues/5005 Reviewed by: kp Differential Revision: https://reviews.freebsd.org/D31504 --- sys/netpfil/pf/pf.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/netpfil/pf/pf.c b/sys/netpfil/pf/pf.c index 221e0c87c11f..1d492370953a 100644 --- a/sys/netpfil/pf/pf.c +++ b/sys/netpfil/pf/pf.c @@ -3629,6 +3629,11 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, int direction, KASSERT(sk != NULL, ("%s: null sk", __func__)); KASSERT(nk != NULL, ("%s: null nk", __func__)); + if (nr->log) { + PFLOG_PACKET(kif, m, af, direction, PFRES_MATCH, nr, a, + ruleset, pd, 1); + } + if (pd->ip_sum) bip_sum = *pd->ip_sum; @@ -3857,10 +3862,10 @@ pf_test_rule(struct pf_krule **rm, struct pf_kstate **sm, int direction, /* apply actions for last matching pass/block rule */ pf_rule_to_actions(r, &pd->act); - if (r->log || (nr != NULL && nr->log)) { + if (r->log) { if (rewrite) m_copyback(m, off, hdrlen, pd->hdr.any); - PFLOG_PACKET(kif, m, af, direction, reason, r->log ? r : nr, a, + PFLOG_PACKET(kif, m, af, direction, reason, r, a, ruleset, pd, 1); } From owner-dev-commits-src-all@freebsd.org Sat Sep 18 14:42:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 432A9677E40; Sat, 18 Sep 2021 14:42:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HBYSP1Dstz3lvf; Sat, 18 Sep 2021 14:42:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A66E38CB; Sat, 18 Sep 2021 14:42:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18IEgCdL024465; Sat, 18 Sep 2021 14:42:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18IEgCqN024464; Sat, 18 Sep 2021 14:42:12 GMT (envelope-from git) Date: Sat, 18 Sep 2021 14:42:12 GMT Message-Id: <202109181442.18IEgCqN024464@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 50b07c1f7131 - main - unix: Fix a use-after-free in unp_drop() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 50b07c1f7131fd535bbe1b53a3a2e4dfcdcc2e51 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2021 14:42:13 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=50b07c1f7131fd535bbe1b53a3a2e4dfcdcc2e51 commit 50b07c1f7131fd535bbe1b53a3a2e4dfcdcc2e51 Author: Mark Johnston AuthorDate: 2021-09-18 14:38:39 +0000 Commit: Mark Johnston CommitDate: 2021-09-18 14:38:39 +0000 unix: Fix a use-after-free in unp_drop() We need to load the socket pointer after locking the PCB, otherwise the socket may have been detached and freed by the time that unp_drop() sets so_error. This previously went unnoticed as the socket zone was _NOFREE. Reported by: pho MFC after: 1 week --- sys/kern/uipc_usrreq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 5add930bfa8e..0ee29143c731 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -1971,7 +1971,7 @@ unp_shutdown(struct unpcb *unp) static void unp_drop(struct unpcb *unp) { - struct socket *so = unp->unp_socket; + struct socket *so; struct unpcb *unp2; /* @@ -1981,6 +1981,7 @@ unp_drop(struct unpcb *unp) */ UNP_PCB_LOCK(unp); + so = unp->unp_socket; if (so) so->so_error = ECONNRESET; if ((unp2 = unp_pcb_lock_peer(unp)) != NULL) { From owner-dev-commits-src-all@freebsd.org Sat Sep 18 17:40:01 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F2B7A679EDB; Sat, 18 Sep 2021 17:40:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HBdPY6W4Jz3K80; Sat, 18 Sep 2021 17:40:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C01585DBD; Sat, 18 Sep 2021 17:40:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18IHe1oe053220; Sat, 18 Sep 2021 17:40:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18IHe1XK053217; Sat, 18 Sep 2021 17:40:01 GMT (envelope-from git) Date: Sat, 18 Sep 2021 17:40:01 GMT Message-Id: <202109181740.18IHe1XK053217@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: d3b9b83623f2 - stable/13 - [fib algo][dxr] Fix undefined behavior. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d3b9b83623f2b7ab89d9c09b3e93360e0b72402b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2021 17:40:02 -0000 The branch stable/13 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=d3b9b83623f2b7ab89d9c09b3e93360e0b72402b commit d3b9b83623f2b7ab89d9c09b3e93360e0b72402b Author: Marko Zec AuthorDate: 2021-09-15 20:23:17 +0000 Commit: Marko Zec CommitDate: 2021-09-18 17:36:32 +0000 [fib algo][dxr] Fix undefined behavior. The result of shifting uint32_t by 32 (or more) is undefined: fix it. (cherry picked from commit 442c8a245ee3c6640fc9321e18e8316edf469805) --- sys/netinet/in_fib_dxr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index ec32819a5a6d..7afe2a3da024 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -1150,7 +1150,10 @@ dxr_change_rib_batch(struct rib_head *rnh, struct fib_change_queue *q, #endif plen = q->entries[ui].plen; ip = ntohl(q->entries[ui].addr4.s_addr); - hmask = 0xffffffffU >> plen; + if (plen < 32) + hmask = 0xffffffffU >> plen; + else + hmask = 0; start = (ip & ~hmask) >> DXR_RANGE_SHIFT; end = (ip | hmask) >> DXR_RANGE_SHIFT; From owner-dev-commits-src-all@freebsd.org Sat Sep 18 17:40:03 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 211AE679FC0; Sat, 18 Sep 2021 17:40:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HBdPb0Mz7z3KCk; Sat, 18 Sep 2021 17:40:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE9BF5DBE; Sat, 18 Sep 2021 17:40:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18IHe2Qk053435; Sat, 18 Sep 2021 17:40:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18IHe2bw053433; Sat, 18 Sep 2021 17:40:02 GMT (envelope-from git) Date: Sat, 18 Sep 2021 17:40:02 GMT Message-Id: <202109181740.18IHe2bw053433@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: ad2cca48ed53 - stable/13 - [fib algo][dxr] Optimize trie updating. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ad2cca48ed53e3282e9bc490074e75ccb50bffb9 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2021 17:40:03 -0000 The branch stable/13 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=ad2cca48ed53e3282e9bc490074e75ccb50bffb9 commit ad2cca48ed53e3282e9bc490074e75ccb50bffb9 Author: Marko Zec AuthorDate: 2021-09-15 20:36:59 +0000 Commit: Marko Zec CommitDate: 2021-09-18 17:37:35 +0000 [fib algo][dxr] Optimize trie updating. Don't rebuild in vain trie parts unaffected by accumulated incremental RIB updates. PR: 257965 Tested by: Konrad Kreciwilk MFC after: 3 days (cherry picked from commit b51f8bae570b4e908191a1dae9da38aacf8c0fab) --- sys/netinet/in_fib_dxr.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 7afe2a3da024..3c4e5700cd6c 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -915,7 +915,14 @@ dxr2_try_squeeze: for (i = da->updates_low >> dxr_x; i <= da->updates_high >> dxr_x; i++) { - trie_unref(da, i); + if (!trie_rebuild) { + m = 0; + for (int j = 0; j < (1 << dxr_x); j += 32) + m |= da->updates_mask[((i << dxr_x) + j) >> 5]; + if (m == 0) + continue; + trie_unref(da, i); + } ti = trie_ref(da, i); if (ti < 0) return; From owner-dev-commits-src-all@freebsd.org Sat Sep 18 17:40:04 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 53396679FC5; Sat, 18 Sep 2021 17:40:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HBdPc1YXHz3KM2; Sat, 18 Sep 2021 17:40:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EAD426298; Sat, 18 Sep 2021 17:40:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18IHe3tK053650; Sat, 18 Sep 2021 17:40:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18IHe352053647; Sat, 18 Sep 2021 17:40:03 GMT (envelope-from git) Date: Sat, 18 Sep 2021 17:40:03 GMT Message-Id: <202109181740.18IHe352053647@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marko Zec Subject: git: ec47ee78b461 - stable/13 - [fib algo][dxr] Fix division by zero. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zec X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: ec47ee78b461f5c03c11fa44ad77f695371b7d13 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2021 17:40:04 -0000 The branch stable/13 has been updated by zec: URL: https://cgit.FreeBSD.org/src/commit/?id=ec47ee78b461f5c03c11fa44ad77f695371b7d13 commit ec47ee78b461f5c03c11fa44ad77f695371b7d13 Author: Marko Zec AuthorDate: 2021-09-16 14:34:05 +0000 Commit: Marko Zec CommitDate: 2021-09-18 17:38:09 +0000 [fib algo][dxr] Fix division by zero. A division by zero would occur if DXR would be activated on a vnet with no IP addresses configured on any interfaces. PR: 257965 MFC after: 3 days Reported by: Raul Munoz (cherry picked from commit eb3148cc4d256c20b5c7c9052539139b6f57f58b) --- sys/netinet/in_fib_dxr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/netinet/in_fib_dxr.c b/sys/netinet/in_fib_dxr.c index 3c4e5700cd6c..3aa357cadedc 100644 --- a/sys/netinet/in_fib_dxr.c +++ b/sys/netinet/in_fib_dxr.c @@ -982,7 +982,9 @@ dxr2_try_squeeze: FIB_PRINTF(LOG_INFO, da->fd, "D%dR, %d prefixes, %d nhops (max)", DXR_D, rinfo.num_prefixes, rinfo.num_nhops); #endif - i = dxr_tot_size * 100 / rinfo.num_prefixes; + i = dxr_tot_size * 100; + if (rinfo.num_prefixes) + i /= rinfo.num_prefixes; FIB_PRINTF(LOG_INFO, da->fd, "%d.%02d KBytes, %d.%02d Bytes/prefix", dxr_tot_size / 1024, dxr_tot_size * 100 / 1024 % 100, i / 100, i % 100); From owner-dev-commits-src-all@freebsd.org Sat Sep 18 19:15:27 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7AD367B5C0; Sat, 18 Sep 2021 19:15:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HBgWg4Mpcz4SYM; Sat, 18 Sep 2021 19:15:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 72B2E77A5; Sat, 18 Sep 2021 19:15:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18IJFR8T084509; Sat, 18 Sep 2021 19:15:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18IJFR7w084508; Sat, 18 Sep 2021 19:15:27 GMT (envelope-from git) Date: Sat, 18 Sep 2021 19:15:27 GMT Message-Id: <202109181915.18IJFR7w084508@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 0d9e99ce3b10 - main - vfs: add the missing vnode interlock in vfs_mountroot_shuffle MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0d9e99ce3b1071c76ff5a2d9d4158341c0371c2f Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2021 19:15:27 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=0d9e99ce3b1071c76ff5a2d9d4158341c0371c2f commit 0d9e99ce3b1071c76ff5a2d9d4158341c0371c2f Author: Mateusz Guzik AuthorDate: 2021-09-18 08:12:27 +0000 Commit: Mateusz Guzik CommitDate: 2021-09-18 19:13:51 +0000 vfs: add the missing vnode interlock in vfs_mountroot_shuffle Around v_mountedhere assignment. --- sys/kern/vfs_mountroot.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/kern/vfs_mountroot.c b/sys/kern/vfs_mountroot.c index e2a687511e11..5cf222901420 100644 --- a/sys/kern/vfs_mountroot.c +++ b/sys/kern/vfs_mountroot.c @@ -367,10 +367,12 @@ vfs_mountroot_shuffle(struct thread *td, struct mount *mpdevfs) error = vinvalbuf(vp, V_SAVE, 0, 0); if (!error) { cache_purge(vp); + VI_LOCK(vp); mporoot->mnt_vnodecovered = vp; vp->v_mountedhere = mporoot; strlcpy(mporoot->mnt_stat.f_mntonname, fspath, MNAMELEN); + VI_UNLOCK(vp); VOP_UNLOCK(vp); } else vput(vp); From owner-dev-commits-src-all@freebsd.org Sat Sep 18 19:15:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C739A67B90C; Sat, 18 Sep 2021 19:15:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HBgWh5BLTz4SQ1; Sat, 18 Sep 2021 19:15:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93CCB77A6; Sat, 18 Sep 2021 19:15:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18IJFSFZ084540; Sat, 18 Sep 2021 19:15:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18IJFSwE084539; Sat, 18 Sep 2021 19:15:28 GMT (envelope-from git) Date: Sat, 18 Sep 2021 19:15:28 GMT Message-Id: <202109181915.18IJFSwE084539@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 7b2ac8eb9be7 - main - vfs: add missing VIRF_MOUNTPOINT in vfs_mountroot_shuffle MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7b2ac8eb9be76c96356b6e9a7c06a8080ea841ae Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2021 19:15:28 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=7b2ac8eb9be76c96356b6e9a7c06a8080ea841ae commit 7b2ac8eb9be76c96356b6e9a7c06a8080ea841ae Author: Mateusz Guzik AuthorDate: 2021-09-18 08:13:33 +0000 Commit: Mateusz Guzik CommitDate: 2021-09-18 19:13:51 +0000 vfs: add missing VIRF_MOUNTPOINT in vfs_mountroot_shuffle Reported by: mav --- sys/kern/vfs_mountroot.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/kern/vfs_mountroot.c b/sys/kern/vfs_mountroot.c index 5cf222901420..54d5a442c9ee 100644 --- a/sys/kern/vfs_mountroot.c +++ b/sys/kern/vfs_mountroot.c @@ -369,6 +369,7 @@ vfs_mountroot_shuffle(struct thread *td, struct mount *mpdevfs) cache_purge(vp); VI_LOCK(vp); mporoot->mnt_vnodecovered = vp; + vn_irflag_set_locked(vp, VIRF_MOUNTPOINT); vp->v_mountedhere = mporoot; strlcpy(mporoot->mnt_stat.f_mntonname, fspath, MNAMELEN); From owner-dev-commits-src-all@freebsd.org Sat Sep 18 20:10:36 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C02E867BF34; Sat, 18 Sep 2021 20:10:36 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HBhlJ4kkcz4jHt; Sat, 18 Sep 2021 20:10:36 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from mail-qk1-f178.google.com (mail-qk1-f178.google.com [209.85.222.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: mhorne) by smtp.freebsd.org (Postfix) with ESMTPSA id 7E81C2B959; Sat, 18 Sep 2021 20:10:36 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: by mail-qk1-f178.google.com with SMTP id y144so28786551qkb.6; Sat, 18 Sep 2021 13:10:36 -0700 (PDT) X-Gm-Message-State: AOAM532yPCx3zaydJR0iZWU2IQiwS66RLsXLj7Rrtaoo5ss//bHBDTHk XDZZLDCuw1Ox7ZRCHONe3/IuRvl0P2ihzX2KJiA= X-Google-Smtp-Source: ABdhPJw1wC0ATl7ICJ3McCUYmSLwdmRBvjiuR8jXvJG9aPCAjGB2AGRaBrIJeqridJLW3uxGoVopKuWvUMrP8XvuopI= X-Received: by 2002:a25:3b04:: with SMTP id i4mr22207227yba.524.1631995835966; Sat, 18 Sep 2021 13:10:35 -0700 (PDT) MIME-Version: 1.0 References: <202109181018.18IAIMfG066006@gitrepo.freebsd.org> In-Reply-To: <202109181018.18IAIMfG066006@gitrepo.freebsd.org> From: Mitchell Horne Date: Sat, 18 Sep 2021 17:10:25 -0300 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: f902e4bb04ad - main - lockmgr: fix lock profiling of face adaptive spinning To: Mateusz Guzik Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2021 20:10:36 -0000 On Sat, Sep 18, 2021 at 7:18 AM Mateusz Guzik wrote: > > The branch main has been updated by mjg: > > URL: https://cgit.FreeBSD.org/src/commit/?id=f902e4bb04ad717935a97ce1ae59e2dd389d940d > > commit f902e4bb04ad717935a97ce1ae59e2dd389d940d > Author: Mateusz Guzik > AuthorDate: 2021-09-11 18:23:51 +0000 > Commit: Mateusz Guzik > CommitDate: 2021-09-18 10:16:58 +0000 > > lockmgr: fix lock profiling of face adaptive spinning In what way was it broken? Mitchell > --- > sys/kern/kern_lock.c | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c > index bec49f29d162..2eb4feb7c4b5 100644 > --- a/sys/kern/kern_lock.c > +++ b/sys/kern/kern_lock.c > @@ -631,6 +631,9 @@ lockmgr_slock_hard(struct lock *lk, u_int flags, struct lock_object *ilk, > if (lockmgr_slock_try(lk, &x, flags, false)) > break; > > + lock_profile_obtain_lock_failed(&lk->lock_object, false, > + &contested, &waittime); > + > if ((flags & (LK_ADAPTIVE | LK_INTERLOCK)) == LK_ADAPTIVE) { > if (lockmgr_slock_adaptive(&lda, lk, &x, flags)) > continue; > @@ -639,8 +642,6 @@ lockmgr_slock_hard(struct lock *lk, u_int flags, struct lock_object *ilk, > #ifdef HWPMC_HOOKS > PMC_SOFT_CALL( , , lock, failed); > #endif > - lock_profile_obtain_lock_failed(&lk->lock_object, false, > - &contested, &waittime); > > /* > * If the lock is expected to not sleep just give up > @@ -845,6 +846,10 @@ lockmgr_xlock_hard(struct lock *lk, u_int flags, struct lock_object *ilk, > break; > continue; > } > + > + lock_profile_obtain_lock_failed(&lk->lock_object, false, > + &contested, &waittime); > + > if ((flags & (LK_ADAPTIVE | LK_INTERLOCK)) == LK_ADAPTIVE) { > if (lockmgr_xlock_adaptive(&lda, lk, &x)) > continue; > @@ -852,8 +857,6 @@ lockmgr_xlock_hard(struct lock *lk, u_int flags, struct lock_object *ilk, > #ifdef HWPMC_HOOKS > PMC_SOFT_CALL( , , lock, failed); > #endif > - lock_profile_obtain_lock_failed(&lk->lock_object, false, > - &contested, &waittime); > > /* > * If the lock is expected to not sleep just give up From owner-dev-commits-src-all@freebsd.org Sat Sep 18 21:33:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D7DBD67D380; Sat, 18 Sep 2021 21:33:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HBkZN5kn3z53wM; Sat, 18 Sep 2021 21:33:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B03111797; Sat, 18 Sep 2021 21:33:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18ILX005070233; Sat, 18 Sep 2021 21:33:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ILX0cF070230; Sat, 18 Sep 2021 21:33:00 GMT (envelope-from git) Date: Sat, 18 Sep 2021 21:33:00 GMT Message-Id: <202109182133.18ILX0cF070230@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: f941f0a06298 - stable/13 - zfs: merge openzfs/zfs@71c609852 (zfs-2.1-release) into stable/13 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f941f0a062982f77faaf326752c80ed69201cff4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2021 21:33:00 -0000 The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=f941f0a062982f77faaf326752c80ed69201cff4 commit f941f0a062982f77faaf326752c80ed69201cff4 Merge: ec47ee78b461 71c6098526c6 Author: Martin Matuska AuthorDate: 2021-09-18 18:30:40 +0000 Commit: Martin Matuska CommitDate: 2021-09-18 18:44:14 +0000 zfs: merge openzfs/zfs@71c609852 (zfs-2.1-release) into stable/13 OpenZFS release 2.1.1 Notable upstream pull request merges: #11997 FreeBSD: Don't force xattr mount option #11997 FreeBSD: Implement xattr=sa #11997 FreeBSD: Use SET_ERROR to trace xattr name errors #12022 Fix endianness issues with zstd #12161 Restore FreeBSD sysctl processing for arc.min and arc.max #12183 Optimize small random numbers generation #12246 arc: Drop an incorrect assert #12271 Tinker with slop space accounting with dedup #12279 Fix ARC ghost states eviction accounting #12281 Move gethrtime() calls out of vdev queue lock #12289 Compact dbuf/buf hashes and lock arrays #12294 Upstream: dmu_zfetch_stream_fini leaks refcount #12295 Fix abd leak, kmem_free correct size of abd_t #12297 Avoid vq_lock drop in vdev_queue_aggregate() #12299 file reference counts can get corrupted #12300 Introduce dsl_dir_diduse_transfer_space() #12314 Optimize allocation throttling #12320 FreeBSD: Use unmapped I/O for scattered/gang ABD buffers #12328 FreeBSD: Hardcode abd_chunk_size to PAGE_SIZE #12339 Read past end of argv array in zpool_do_import() #12348 Minor ARC optimizations #12365 Fixes in persistent L2ARC #12375 FreeBSD: Ignore make_dev_s() errors #12378 FreeBSD: Switch from MAXPHYS to maxphys on FreeBSD 13+ #12383 Fixes for KMSAN reports #12397 Run arc_evict thread at higher priority #12398 Remove b_pabd/b_rabd allocation from arc_hdr_alloc() #12422 Fix/improve dbuf hits accounting #12428 Fix unfortunate NULL in spa_update_dspace #12443 Fixed data integrity issue when underlying disk returns error #12446 Allow disabling of unmapped I/O on FreeBSD #12473 Initialize parity blocks before RAID-Z reconstruction benchmarking #12511 Make 'zpool labelclear -f' work on offlined disks #12514 FreeBSD: Don't remove SA xattr if not SA znode #12522 Compressed receive with different ashift can result in incorrect PSIZE on disk #12535 Verify embedded blkptr's in arc_read() #12541 Allow sending corrupt snapshots even if metadata is corrupted Manually included upstream 2.1 backport pull request #12573: #12282 FreeBSD: fix compilation of FreeBSD world after 29274c9 Obtained from: OpenZFS OpenZFS commit: 71c6098526c6d5fbfa84a58cefe6cdc403488d8c OpenZFS tag: zfs-2.1.1 Relnotes: yes .../openzfs/.github/ISSUE_TEMPLATE/bug_report.md | 16 +- .../openzfs/.github/workflows/checkstyle.yaml | 18 +- sys/contrib/openzfs/.github/workflows/zloop.yml | 2 +- sys/contrib/openzfs/META | 4 +- sys/contrib/openzfs/Makefile.am | 14 +- sys/contrib/openzfs/cmd/vdev_id/vdev_id | 5 +- sys/contrib/openzfs/cmd/zdb/zdb.c | 6 +- sys/contrib/openzfs/cmd/zed/agents/zfs_mod.c | 40 +- sys/contrib/openzfs/cmd/zed/zed_disk_event.c | 2 + sys/contrib/openzfs/cmd/zfs/zfs_main.c | 2 +- sys/contrib/openzfs/cmd/zpool/zpool.d/media | 9 +- sys/contrib/openzfs/cmd/zpool/zpool_main.c | 50 +- .../openzfs/cmd/zpool_influxdb/zpool_influxdb.c | 3 +- sys/contrib/openzfs/cmd/zvol_id/zvol_id_main.c | 58 +- sys/contrib/openzfs/config/Abigail.am | 6 +- sys/contrib/openzfs/config/kernel-acl.m4 | 23 +- sys/contrib/openzfs/config/kernel-blk-queue.m4 | 40 + sys/contrib/openzfs/config/kernel-blkdev.m4 | 2 +- .../openzfs/config/kernel-make-request-fn.m4 | 20 + sys/contrib/openzfs/config/kernel-stdarg.m4 | 32 + .../openzfs/config/kernel-vfs-set_page_dirty.m4 | 34 + sys/contrib/openzfs/config/kernel.m4 | 4 + sys/contrib/openzfs/config/user-libatomic.m4 | 34 +- sys/contrib/openzfs/configure.ac | 1 + .../openzfs/include/os/freebsd/spl/sys/mod_os.h | 6 + .../openzfs/include/os/freebsd/spl/sys/random.h | 22 + .../include/os/linux/kernel/linux/blkdev_compat.h | 3 + .../openzfs/include/os/linux/spl/sys/cmn_err.h | 4 + .../openzfs/include/os/linux/spl/sys/random.h | 15 + .../openzfs/include/os/linux/zfs/sys/trace_arc.h | 4 +- .../include/os/linux/zfs/sys/zfs_znode_impl.h | 4 +- sys/contrib/openzfs/include/os/linux/zfs/sys/zpl.h | 4 + sys/contrib/openzfs/include/sys/abd.h | 1 - sys/contrib/openzfs/include/sys/abd_impl.h | 2 +- sys/contrib/openzfs/include/sys/arc.h | 9 +- sys/contrib/openzfs/include/sys/arc_impl.h | 26 +- sys/contrib/openzfs/include/sys/dbuf.h | 6 +- sys/contrib/openzfs/include/sys/dnode.h | 2 +- sys/contrib/openzfs/include/sys/dsl_dir.h | 3 + sys/contrib/openzfs/include/sys/fm/util.h | 5 +- sys/contrib/openzfs/include/sys/metaslab_impl.h | 2 +- sys/contrib/openzfs/include/sys/spa.h | 1 - sys/contrib/openzfs/include/sys/spa_impl.h | 15 +- sys/contrib/openzfs/include/sys/zfs_context.h | 15 + sys/contrib/openzfs/include/sys/zfs_file.h | 6 +- sys/contrib/openzfs/include/sys/zfs_ioctl.h | 2 +- sys/contrib/openzfs/include/sys/zfs_onexit.h | 4 +- sys/contrib/openzfs/include/sys/zfs_refcount.h | 8 +- sys/contrib/openzfs/include/sys/zio.h | 4 +- sys/contrib/openzfs/include/sys/zstd/zstd.h | 148 +- sys/contrib/openzfs/include/sys/zthr.h | 5 +- sys/contrib/openzfs/lib/libnvpair/libnvpair.abi | 4832 ++++---- sys/contrib/openzfs/lib/libuutil/libuutil.abi | 3351 +++-- sys/contrib/openzfs/lib/libzfs/libzfs.abi | 12225 +++++++++++-------- sys/contrib/openzfs/lib/libzfs/libzfs_crypto.c | 2 +- sys/contrib/openzfs/lib/libzfs/libzfs_pool.c | 4 +- sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c | 3 +- .../openzfs/lib/libzfs_core/libzfs_core.abi | 6159 +++++++--- .../openzfs/lib/libzfsbootenv/libzfsbootenv.abi | 596 +- sys/contrib/openzfs/lib/libzpool/kernel.c | 20 +- sys/contrib/openzfs/man/man4/zfs.4 | 26 +- sys/contrib/openzfs/man/man8/zfs-allow.8 | 28 +- sys/contrib/openzfs/man/man8/zfs-send.8 | 10 +- sys/contrib/openzfs/man/man8/zpool-remove.8 | 8 +- sys/contrib/openzfs/man/man8/zpool-scrub.8 | 29 +- sys/contrib/openzfs/module/nvpair/nvpair.c | 64 +- .../openzfs/module/os/freebsd/spl/acl_common.c | 6 +- sys/contrib/openzfs/module/os/freebsd/spl/callb.c | 16 +- sys/contrib/openzfs/module/os/freebsd/spl/list.c | 17 +- .../openzfs/module/os/freebsd/spl/spl_kmem.c | 6 +- .../openzfs/module/os/freebsd/spl/spl_kstat.c | 10 +- .../openzfs/module/os/freebsd/spl/spl_string.c | 2 +- .../openzfs/module/os/freebsd/spl/spl_sysevent.c | 2 +- .../openzfs/module/os/freebsd/spl/spl_uio.c | 4 +- .../openzfs/module/os/freebsd/spl/spl_vfs.c | 6 +- sys/contrib/openzfs/module/os/freebsd/zfs/abd_os.c | 137 +- sys/contrib/openzfs/module/os/freebsd/zfs/arc_os.c | 4 +- sys/contrib/openzfs/module/os/freebsd/zfs/dmu_os.c | 45 +- sys/contrib/openzfs/module/os/freebsd/zfs/spa_os.c | 83 +- .../openzfs/module/os/freebsd/zfs/sysctl_os.c | 53 +- .../openzfs/module/os/freebsd/zfs/vdev_file.c | 7 +- .../openzfs/module/os/freebsd/zfs/vdev_geom.c | 151 +- .../openzfs/module/os/freebsd/zfs/vdev_label_os.c | 2 +- .../openzfs/module/os/freebsd/zfs/zfs_acl.c | 37 +- .../openzfs/module/os/freebsd/zfs/zfs_ctldir.c | 22 +- .../openzfs/module/os/freebsd/zfs/zfs_dir.c | 23 +- .../openzfs/module/os/freebsd/zfs/zfs_file_os.c | 19 +- .../openzfs/module/os/freebsd/zfs/zfs_vfsops.c | 34 +- .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 558 +- .../openzfs/module/os/freebsd/zfs/zfs_znode.c | 98 +- .../openzfs/module/os/freebsd/zfs/zio_crypt.c | 2 +- .../openzfs/module/os/freebsd/zfs/zvol_os.c | 37 +- sys/contrib/openzfs/module/os/linux/zfs/abd_os.c | 3 +- sys/contrib/openzfs/module/os/linux/zfs/arc_os.c | 18 +- .../openzfs/module/os/linux/zfs/qat_compress.c | 27 +- .../openzfs/module/os/linux/zfs/zfs_file_os.c | 28 +- .../openzfs/module/os/linux/zfs/zfs_vnops_os.c | 8 +- .../openzfs/module/os/linux/zfs/zfs_znode.c | 12 +- sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c | 25 +- .../openzfs/module/os/linux/zfs/zpl_inode.c | 34 +- .../openzfs/module/os/linux/zfs/zpl_xattr.c | 34 +- sys/contrib/openzfs/module/os/linux/zfs/zvol_os.c | 44 +- sys/contrib/openzfs/module/zfs/abd.c | 2 +- sys/contrib/openzfs/module/zfs/arc.c | 603 +- sys/contrib/openzfs/module/zfs/dbuf.c | 6 +- sys/contrib/openzfs/module/zfs/ddt.c | 2 +- sys/contrib/openzfs/module/zfs/dmu_redact.c | 2 + sys/contrib/openzfs/module/zfs/dmu_send.c | 2 + sys/contrib/openzfs/module/zfs/dmu_zfetch.c | 2 + sys/contrib/openzfs/module/zfs/dnode.c | 1 + sys/contrib/openzfs/module/zfs/dsl_dataset.c | 10 +- sys/contrib/openzfs/module/zfs/dsl_dir.c | 112 +- sys/contrib/openzfs/module/zfs/fm.c | 20 +- sys/contrib/openzfs/module/zfs/metaslab.c | 29 +- sys/contrib/openzfs/module/zfs/mmp.c | 4 +- sys/contrib/openzfs/module/zfs/multilist.c | 5 +- sys/contrib/openzfs/module/zfs/refcount.c | 51 +- sys/contrib/openzfs/module/zfs/spa.c | 27 +- sys/contrib/openzfs/module/zfs/spa_misc.c | 78 +- sys/contrib/openzfs/module/zfs/space_map.c | 2 +- sys/contrib/openzfs/module/zfs/vdev_indirect.c | 6 +- sys/contrib/openzfs/module/zfs/vdev_mirror.c | 2 +- sys/contrib/openzfs/module/zfs/vdev_queue.c | 74 +- sys/contrib/openzfs/module/zfs/vdev_raidz_math.c | 7 + sys/contrib/openzfs/module/zfs/zcp_synctask.c | 15 +- sys/contrib/openzfs/module/zfs/zfs_ioctl.c | 71 +- sys/contrib/openzfs/module/zfs/zfs_log.c | 4 +- sys/contrib/openzfs/module/zfs/zfs_onexit.c | 23 +- sys/contrib/openzfs/module/zfs/zil.c | 60 +- sys/contrib/openzfs/module/zfs/zio.c | 65 +- sys/contrib/openzfs/module/zfs/zio_compress.c | 2 +- sys/contrib/openzfs/module/zfs/zio_inject.c | 8 +- sys/contrib/openzfs/module/zfs/zthr.c | 19 +- sys/contrib/openzfs/module/zfs/zvol.c | 15 +- sys/contrib/openzfs/module/zstd/Makefile.in | 1 + .../openzfs/module/zstd/include/sparc_compat.h | 4 + sys/contrib/openzfs/module/zstd/zfs_zstd.c | 14 +- sys/contrib/openzfs/module/zstd/zstd_sparc.c | 11 + sys/contrib/openzfs/scripts/zfs-tests.sh | 27 +- sys/contrib/openzfs/scripts/zfs.sh | 12 +- sys/contrib/openzfs/scripts/zloop.sh | 60 +- sys/contrib/openzfs/tests/Makefile.am | 2 +- sys/contrib/openzfs/tests/runfiles/common.run | 7 +- sys/contrib/openzfs/tests/runfiles/linux.run | 9 +- .../openzfs/tests/test-runner/bin/zts-report.py.in | 17 +- .../openzfs/tests/zfs-tests/include/blkdev.shlib | 2 +- .../openzfs/tests/zfs-tests/include/libtest.shlib | 28 + .../openzfs/tests/zfs-tests/include/tunables.cfg | 2 +- .../tests/zfs-tests/tests/functional/Makefile.am | 1 + .../cli_root/zfs_copies/zfs_copies.kshlib | 7 +- .../cli_root/zfs_diff/zfs_diff_timestamp.ksh | 6 +- .../cli_root/zfs_rename/zfs_rename_006_pos.ksh | 2 +- .../cli_root/zfs_rename/zfs_rename_007_pos.ksh | 8 +- .../cli_root/zpool_import/zpool_import_errata3.ksh | 4 +- .../zfs-tests/tests/functional/crtime/Makefile.am | 5 + .../zfs-tests/tests/functional/crtime/cleanup.ksh | 34 + .../tests/functional/crtime/crtime_001_pos.ksh | 71 + .../zfs-tests/tests/functional/crtime/setup.ksh | 35 + .../zfs-tests/tests/functional/fault/Makefile.am | 1 + .../tests/functional/fault/auto_online_002_pos.ksh | 94 + .../zfs-tests/tests/functional/l2arc/Makefile.am | 5 +- .../tests/functional/l2arc/l2arc_arcstats_pos.ksh | 1 - .../functional/l2arc/persist_l2arc_004_pos.ksh | 55 +- .../functional/l2arc/persist_l2arc_005_pos.ksh | 69 +- .../functional/l2arc/persist_l2arc_006_pos.ksh | 101 - .../functional/l2arc/persist_l2arc_007_pos.ksh | 97 - .../functional/l2arc/persist_l2arc_008_pos.ksh | 143 - .../functional/redacted_send/redacted_panic.ksh | 10 +- .../functional/rsend/recv_dedup_encrypted_zvol.ksh | 2 +- .../rsend/send-c_stream_size_estimate.ksh | 2 +- .../zvol/zvol_misc/zvol_misc_volmode.ksh | 2 + .../zvol/zvol_swap/zvol_swap_004_pos.ksh | 2 +- .../openzfs/tests/zfs-tests/tests/perf/perf.shlib | 61 +- .../tests/perf/regression/random_reads.ksh | 30 +- .../tests/perf/regression/random_readwrite.ksh | 30 +- .../perf/regression/random_readwrite_fixed.ksh | 30 +- .../tests/perf/regression/random_writes.ksh | 30 +- .../tests/perf/regression/random_writes_zil.ksh | 31 +- .../tests/perf/regression/sequential_reads.ksh | 30 +- .../regression/sequential_reads_arc_cached.ksh | 30 +- .../sequential_reads_arc_cached_clone.ksh | 31 +- .../regression/sequential_reads_dbuf_cached.ksh | 32 +- .../tests/perf/regression/sequential_writes.ksh | 30 +- .../zfs-tests/tests/perf/regression/setup.ksh | 3 +- sys/contrib/openzfs/udev/rules.d/60-zvol.rules.in | 2 +- sys/modules/zfs/Makefile | 3 +- sys/modules/zfs/zfs_config.h | 50 +- sys/modules/zfs/zfs_gitrev.h | 2 +- 188 files changed, 19722 insertions(+), 12707 deletions(-) diff --cc sys/contrib/openzfs/config/kernel-stdarg.m4 index 000000000000,5bc8dd859d6b..5bc8dd859d6b mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-stdarg.m4 +++ b/sys/contrib/openzfs/config/kernel-stdarg.m4 diff --cc sys/contrib/openzfs/config/kernel-vfs-set_page_dirty.m4 index 000000000000,a9d252e4e01e..a9d252e4e01e mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-vfs-set_page_dirty.m4 +++ b/sys/contrib/openzfs/config/kernel-vfs-set_page_dirty.m4 diff --cc sys/contrib/openzfs/include/os/freebsd/spl/sys/random.h index b3c9115f5305,000000000000..7583166e727b mode 100644,000000..100644 --- a/sys/contrib/openzfs/include/os/freebsd/spl/sys/random.h +++ b/sys/contrib/openzfs/include/os/freebsd/spl/sys/random.h @@@ -1,48 -1,0 +1,70 @@@ +/* + * Copyright (c) 2007 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS 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 _OPENSOLARIS_SYS_RANDOM_H_ +#define _OPENSOLARIS_SYS_RANDOM_H_ + +#include_next ++#if __FreeBSD_version >= 1300108 ++#include ++#endif + +static inline int +random_get_bytes(uint8_t *p, size_t s) +{ + arc4rand(p, (int)s, 0); + return (0); +} + +static inline int +random_get_pseudo_bytes(uint8_t *p, size_t s) +{ + arc4rand(p, (int)s, 0); + return (0); +} + ++static inline uint32_t ++random_in_range(uint32_t range) ++{ ++#if defined(_KERNEL) && __FreeBSD_version >= 1300108 ++ return (prng32_bounded(range)); ++#else ++ uint32_t r; ++ ++ ASSERT(range != 0); ++ ++ if (range == 1) ++ return (0); ++ ++ (void) random_get_pseudo_bytes((uint8_t *)&r, sizeof (r)); ++ ++ return (r % range); ++#endif ++} ++ +#endif /* !_OPENSOLARIS_SYS_RANDOM_H_ */ diff --cc sys/contrib/openzfs/include/os/linux/spl/sys/random.h index 1b8cb60d094f,000000000000..52e97e1ce068 mode 100644,000000..100644 --- a/sys/contrib/openzfs/include/os/linux/spl/sys/random.h +++ b/sys/contrib/openzfs/include/os/linux/spl/sys/random.h @@@ -1,39 -1,0 +1,54 @@@ +/* + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . + */ + +#ifndef _SPL_RANDOM_H +#define _SPL_RANDOM_H + +#include +#include + +static __inline__ int +random_get_bytes(uint8_t *ptr, size_t len) +{ + get_random_bytes((void *)ptr, (int)len); + return (0); +} + +extern int random_get_pseudo_bytes(uint8_t *ptr, size_t len); + ++static __inline__ uint32_t ++random_in_range(uint32_t range) ++{ ++ uint32_t r; ++ ++ ASSERT(range != 0); ++ ++ if (range == 1) ++ return (0); ++ ++ (void) random_get_pseudo_bytes((uint8_t *)&r, sizeof (r)); ++ ++ return (r % range); ++} ++ +#endif /* _SPL_RANDOM_H */ diff --cc sys/contrib/openzfs/include/sys/zfs_context.h index ffb20e1fefad,dbeb323ba428..e430d17a5f9b --- a/sys/contrib/openzfs/include/sys/zfs_context.h +++ b/sys/contrib/openzfs/include/sys/zfs_context.h @@@ -640,6 -640,21 +640,21 @@@ extern int lowbit64(uint64_t i) extern int random_get_bytes(uint8_t *ptr, size_t len); extern int random_get_pseudo_bytes(uint8_t *ptr, size_t len); + static __inline__ uint32_t + random_in_range(uint32_t range) + { + uint32_t r; + + ASSERT(range != 0); + + if (range == 1) + return (0); + - (void) random_get_pseudo_bytes((void *)&r, sizeof (r)); ++ (void) random_get_pseudo_bytes((uint8_t *)&r, sizeof (r)); + + return (r % range); + } + extern void kernel_init(int mode); extern void kernel_fini(void); extern void random_init(void); diff --cc sys/contrib/openzfs/module/zstd/include/sparc_compat.h index 000000000000,14c1bdde917c..14c1bdde917c mode 000000,100644..100644 --- a/sys/contrib/openzfs/module/zstd/include/sparc_compat.h +++ b/sys/contrib/openzfs/module/zstd/include/sparc_compat.h diff --cc sys/contrib/openzfs/module/zstd/zstd_sparc.c index 000000000000,463df99bd7e3..463df99bd7e3 mode 000000,100644..100644 --- a/sys/contrib/openzfs/module/zstd/zstd_sparc.c +++ b/sys/contrib/openzfs/module/zstd/zstd_sparc.c diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/Makefile.am index 000000000000,13e1c2dde31b..13e1c2dde31b mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/Makefile.am +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/Makefile.am diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/cleanup.ksh index 000000000000,3166bd6ec16e..3166bd6ec16e mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/cleanup.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/cleanup.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/crtime_001_pos.ksh index 000000000000,4f9810553fa6..4f9810553fa6 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/crtime_001_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/crtime_001_pos.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/setup.ksh index 000000000000,fc5cec3063a6..fc5cec3063a6 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/setup.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/setup.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/fault/auto_online_002_pos.ksh index 000000000000,60185ace34bb..60185ace34bb mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/fault/auto_online_002_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/fault/auto_online_002_pos.ksh diff --cc sys/modules/zfs/Makefile index 983f0aa0e994,000000000000..d185fdf259a5 mode 100644,000000..100644 --- a/sys/modules/zfs/Makefile +++ b/sys/modules/zfs/Makefile @@@ -1,340 -1,0 +1,341 @@@ +# $FreeBSD$ + +SRCDIR=${SRCTOP}/sys/contrib/openzfs/module +INCDIR=${SRCTOP}/sys/contrib/openzfs/include + +KMOD= zfs + +.PATH: ${SRCDIR}/avl \ + ${SRCDIR}/lua \ + ${SRCDIR}/nvpair \ + ${SRCDIR}/os/freebsd/spl \ + ${SRCDIR}/os/freebsd/zfs \ + ${SRCDIR}/unicode \ + ${SRCDIR}/zcommon \ + ${SRCDIR}/zfs \ + ${SRCDIR}/zstd \ + ${SRCDIR}/zstd/lib + + +CFLAGS+= -I${INCDIR} +CFLAGS+= -I${INCDIR}/os/freebsd +CFLAGS+= -I${INCDIR}/os/freebsd/spl +CFLAGS+= -I${INCDIR}/os/freebsd/zfs +CFLAGS+= -I${SRCDIR}/zstd/include +CFLAGS+= -I${.CURDIR} + +CFLAGS+= -D__KERNEL__ -DFREEBSD_NAMECACHE -DBUILDING_ZFS \ + -DHAVE_UIO_ZEROCOPY -DWITHOUT_NETDUMP -D__KERNEL -D_SYS_CONDVAR_H_ \ + -D_SYS_VMEM_H_ -DIN_FREEBSD_BASE -DHAVE_KSID + +.if ${MACHINE_ARCH} == "amd64" +CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_SSE2 -DHAVE_AVX512F -DHAVE_AVX512BW -DHAVE_SSSE3 +.endif + +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \ + ${MACHINE_ARCH} == "powerpcspe" || ${MACHINE_ARCH} == "arm" +CFLAGS+= -DBITS_PER_LONG=32 +.else +CFLAGS+= -DBITS_PER_LONG=64 +.endif + +SRCS= vnode_if.h device_if.h bus_if.h + +# avl +SRCS+= avl.c + +#lua +SRCS+= lapi.c \ + lauxlib.c \ + lbaselib.c \ + lcode.c \ + lcompat.c \ + lcorolib.c \ + lctype.c \ + ldebug.c \ + ldo.c \ + lfunc.c \ + lgc.c \ + llex.c \ + lmem.c \ + lobject.c \ + lopcodes.c \ + lparser.c \ + lstate.c \ + lstring.c \ + lstrlib.c \ + ltable.c \ + ltablib.c \ + ltm.c \ + lvm.c \ + lzio.c + +#nvpair +SRCS+= nvpair.c \ + fnvpair.c \ + nvpair_alloc_spl.c \ + nvpair_alloc_fixed.c + +#os/freebsd/spl +SRCS+= acl_common.c \ + btree.c \ + callb.c \ + list.c \ + spl_acl.c \ + spl_cmn_err.c \ + spl_dtrace.c \ + spl_kmem.c \ + spl_kstat.c \ + spl_misc.c \ + spl_policy.c \ + spl_string.c \ + spl_sunddi.c \ + spl_sysevent.c \ + spl_taskq.c \ + spl_uio.c \ + spl_vfs.c \ + spl_vm.c \ + spl_zone.c \ + sha256c.c \ + sha512c.c \ + spl_procfs_list.c \ + spl_zlib.c + + +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \ + ${MACHINE_ARCH} == "powerpcspe" || ${MACHINE_ARCH} == "arm" +SRCS+= spl_atomic.c +.endif + +#os/freebsd/zfs +SRCS+= abd_os.c \ + crypto_os.c \ + dmu_os.c \ + hkdf.c \ + kmod_core.c \ + spa_os.c \ + sysctl_os.c \ + vdev_file.c \ + vdev_label_os.c \ + vdev_geom.c \ + zfs_acl.c \ + zfs_ctldir.c \ + zfs_dir.c \ + zfs_ioctl_compat.c \ + zfs_ioctl_os.c \ + zfs_log.c \ + zfs_racct.c \ + zfs_replay.c \ + zfs_vfsops.c \ + zfs_vnops_os.c \ + zfs_znode.c \ + zio_crypt.c \ + zvol_os.c + +#unicode +SRCS+= uconv.c \ + u8_textprep.c + +#zcommon +SRCS+= zfeature_common.c \ + zfs_comutil.c \ + zfs_deleg.c \ + zfs_fletcher.c \ + zfs_fletcher_avx512.c \ + zfs_fletcher_intel.c \ + zfs_fletcher_sse.c \ + zfs_fletcher_superscalar.c \ + zfs_fletcher_superscalar4.c \ + zfs_namecheck.c \ + zfs_prop.c \ + zpool_prop.c \ + zprop_common.c + +#zfs +SRCS+= abd.c \ + aggsum.c \ + arc.c \ + arc_os.c \ + blkptr.c \ + bplist.c \ + bpobj.c \ + cityhash.c \ + dbuf.c \ + dbuf_stats.c \ + bptree.c \ + bqueue.c \ + dataset_kstats.c \ + ddt.c \ + ddt_zap.c \ + dmu.c \ + dmu_diff.c \ + dmu_object.c \ + dmu_objset.c \ + dmu_recv.c \ + dmu_redact.c \ + dmu_send.c \ + dmu_traverse.c \ + dmu_tx.c \ + dmu_zfetch.c \ + dnode.c \ + dnode_sync.c \ + dsl_dataset.c \ + dsl_deadlist.c \ + dsl_deleg.c \ + dsl_bookmark.c \ + dsl_dir.c \ + dsl_crypt.c \ + dsl_destroy.c \ + dsl_pool.c \ + dsl_prop.c \ + dsl_scan.c \ + dsl_synctask.c \ + dsl_userhold.c \ + fm.c \ + gzip.c \ + lzjb.c \ + lz4.c \ + metaslab.c \ + mmp.c \ + multilist.c \ + objlist.c \ + pathname.c \ + range_tree.c \ + refcount.c \ + rrwlock.c \ + sa.c \ + sha256.c \ + skein_zfs.c \ + spa.c \ + spa_boot.c \ + spa_checkpoint.c \ + spa_config.c \ + spa_errlog.c \ + spa_history.c \ + spa_log_spacemap.c \ + spa_misc.c \ + spa_stats.c \ + space_map.c \ + space_reftree.c \ + txg.c \ + uberblock.c \ + unique.c \ + vdev.c \ + vdev_cache.c \ + vdev_draid.c \ + vdev_draid_rand.c \ + vdev_indirect.c \ + vdev_indirect_births.c \ + vdev_indirect_mapping.c \ + vdev_initialize.c \ + vdev_label.c \ + vdev_mirror.c \ + vdev_missing.c \ + vdev_queue.c \ + vdev_raidz.c \ + vdev_raidz_math.c \ + vdev_raidz_math_scalar.c \ + vdev_raidz_math_avx2.c \ + vdev_raidz_math_avx512bw.c \ + vdev_raidz_math_avx512f.c \ + vdev_raidz_math_sse2.c \ + vdev_raidz_math_ssse3.c \ + vdev_rebuild.c \ + vdev_removal.c \ + vdev_root.c \ + vdev_trim.c \ + zap.c \ + zap_leaf.c \ + zap_micro.c \ + zcp.c \ + zcp_get.c \ + zcp_global.c \ + zcp_iter.c \ + zcp_set.c \ + zcp_synctask.c \ + zfeature.c \ + zfs_byteswap.c \ + zfs_debug.c \ + zfs_file_os.c \ + zfs_fm.c \ + zfs_fuid.c \ + zfs_ioctl.c \ + zfs_onexit.c \ + zfs_quota.c \ + zfs_ratelimit.c \ + zfs_rlock.c \ + zfs_sa.c \ + zfs_vnops.c \ + zil.c \ + zio.c \ + zio_checksum.c \ + zio_compress.c \ + zio_inject.c \ + zle.c \ + zrlock.c \ + zthr.c \ + zvol.c + +SRCS+= zfs_zstd.c \ - zstd.c ++ zstd.c \ ++ zstd_sparc.c + +.include + +CFLAGS+= -include ${SRCTOP}/sys/cddl/compat/opensolaris/sys/debug_compat.h +CFLAGS+= -include ${INCDIR}/os/freebsd/spl/sys/ccompile.h +CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/static_ccompile.h + +CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} + +CFLAGS.gcc+= -Wno-pointer-to-int-cast + +CFLAGS.lapi.c= -Wno-cast-qual +CFLAGS.lcompat.c= -Wno-cast-qual +CFLAGS.lobject.c= -Wno-cast-qual +CFLAGS.ltable.c= -Wno-cast-qual +CFLAGS.lvm.c= -Wno-cast-qual +CFLAGS.nvpair.c= -Wno-cast-qual -DHAVE_RPC_TYPES +CFLAGS.spl_string.c= -Wno-cast-qual +CFLAGS.spl_vm.c= -Wno-cast-qual +CFLAGS.spl_zlib.c= -Wno-cast-qual +CFLAGS.abd.c= -Wno-cast-qual +CFLAGS.zfs_log.c= -Wno-cast-qual +CFLAGS.zfs_vnops_os.c= -Wno-pointer-arith +CFLAGS.u8_textprep.c= -Wno-cast-qual +CFLAGS.zfs_fletcher.c= -Wno-cast-qual -Wno-pointer-arith +CFLAGS.zfs_fletcher_intel.c= -Wno-cast-qual -Wno-pointer-arith +CFLAGS.zfs_fletcher_sse.c= -Wno-cast-qual -Wno-pointer-arith +CFLAGS.zfs_fletcher_avx512.c= -Wno-cast-qual -Wno-pointer-arith +CFLAGS.zprop_common.c= -Wno-cast-qual +CFLAGS.ddt.c= -Wno-cast-qual +CFLAGS.dmu.c= -Wno-cast-qual +CFLAGS.dmu_traverse.c= -Wno-cast-qual +CFLAGS.dsl_dir.c= -Wno-cast-qual +CFLAGS.dsl_deadlist.c= -Wno-cast-qual +CFLAGS.dsl_prop.c= -Wno-cast-qual +CFLAGS.fm.c= -Wno-cast-qual +CFLAGS.lz4.c= -Wno-cast-qual +CFLAGS.spa.c= -Wno-cast-qual +CFLAGS.spa_misc.c= -Wno-cast-qual +CFLAGS.sysctl_os.c= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h +CFLAGS.vdev_draid.c= -Wno-cast-qual +CFLAGS.vdev_raidz.c= -Wno-cast-qual +CFLAGS.vdev_raidz_math.c= -Wno-cast-qual +CFLAGS.vdev_raidz_math_scalar.c= -Wno-cast-qual +CFLAGS.vdev_raidz_math_avx2.c= -Wno-cast-qual -Wno-duplicate-decl-specifier +CFLAGS.vdev_raidz_math_avx512f.c= -Wno-cast-qual -Wno-duplicate-decl-specifier +CFLAGS.vdev_raidz_math_sse2.c= -Wno-cast-qual -Wno-duplicate-decl-specifier +CFLAGS.zap_leaf.c= -Wno-cast-qual +CFLAGS.zap_micro.c= -Wno-cast-qual +CFLAGS.zcp.c= -Wno-cast-qual +CFLAGS.zfs_fm.c= -Wno-cast-qual +CFLAGS.zfs_ioctl.c= -Wno-cast-qual +CFLAGS.zil.c= -Wno-cast-qual +CFLAGS.zio.c= -Wno-cast-qual +CFLAGS.zrlock.c= -Wno-cast-qual +CFLAGS.zfs_zstd.c= -Wno-cast-qual -Wno-pointer-arith +CFLAGS.zstd.c= -U__BMI__ -fno-tree-vectorize +.if ${MACHINE_CPUARCH} == "aarch64" +CFLAGS.zstd.c+= -include ${SRCDIR}/zstd/include/aarch64_compat.h +.endif diff --cc sys/modules/zfs/zfs_config.h index ebad45d3def7,000000000000..fa3d4feec5de mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,852 -1,0 +1,852 @@@ +/* + * $FreeBSD$ + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* bio_end_io_t wants 1 arg */ +/* #undef HAVE_1ARG_BIO_END_IO_T */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* submit_bio() wants 1 arg */ +/* #undef HAVE_1ARG_SUBMIT_BIO */ + +/* bdi_setup_and_register() wants 2 args */ +/* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 2 args */ +/* #undef HAVE_2ARGS_VFS_GETATTR */ + +/* zlib_deflate_workspacesize() wants 2 args */ +/* #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */ + +/* bdi_setup_and_register() wants 3 args */ +/* #undef HAVE_3ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 3 args */ +/* #undef HAVE_3ARGS_VFS_GETATTR */ + +/* vfs_getattr wants 4 args */ +/* #undef HAVE_4ARGS_VFS_GETATTR */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* posix_acl has refcount_t */ +/* #undef HAVE_ACL_REFCOUNT */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio->bi_bdev->bd_disk exists */ +/* #undef HAVE_BIO_BDEV_DISK */ + +/* bio->bi_opf is defined */ +/* #undef HAVE_BIO_BI_OPF */ + +/* bio->bi_status exists */ +/* #undef HAVE_BIO_BI_STATUS */ + +/* bio has bi_iter */ +/* #undef HAVE_BIO_BVEC_ITER */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_max_segs() is implemented */ +/* #undef HAVE_BIO_MAX_SEGS */ + +/* bio_set_dev() is available */ +/* #undef HAVE_BIO_SET_DEV */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + ++/* blk_alloc_disk() exists */ ++/* #undef HAVE_BLK_ALLOC_DISK */ ++ +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_flag_clear() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_CLEAR */ + +/* blk_queue_flag_set() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_SET */ + +/* blk_queue_flush() is available */ +/* #undef HAVE_BLK_QUEUE_FLUSH */ + +/* blk_queue_flush() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_FLUSH_GPL_ONLY */ + +/* blk_queue_secdiscard() is available */ +/* #undef HAVE_BLK_QUEUE_SECDISCARD */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + ++/* blk_queue_update_readahead() exists */ ++/* #undef HAVE_BLK_QUEUE_UPDATE_READAHEAD */ ++ +/* blk_queue_write_cache() exists */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE */ + +/* blk_queue_write_cache() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY */ + +/* Define if revalidate_disk() in block_device_operations */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK */ + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + *** 717 LINES SKIPPED *** From owner-dev-commits-src-all@freebsd.org Sat Sep 18 21:41:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4928A67D3A0; Sat, 18 Sep 2021 21:41:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HBkmh1Vc4z55cZ; Sat, 18 Sep 2021 21:41:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0953011460; Sat, 18 Sep 2021 21:41:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18ILftTd080045; Sat, 18 Sep 2021 21:41:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ILftR3080044; Sat, 18 Sep 2021 21:41:55 GMT (envelope-from git) Date: Sat, 18 Sep 2021 21:41:55 GMT Message-Id: <202109182141.18ILftR3080044@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Rick Macklem Subject: git: ad6dc3652023 - main - nfscl: Use vfs.nfs.maxalloclen to limit Deallocate RPC RTT MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rmacklem X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ad6dc365202390edffb14d725155e230b96f59ae Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2021 21:41:56 -0000 The branch main has been updated by rmacklem: URL: https://cgit.FreeBSD.org/src/commit/?id=ad6dc365202390edffb14d725155e230b96f59ae commit ad6dc365202390edffb14d725155e230b96f59ae Author: Rick Macklem AuthorDate: 2021-09-18 21:38:43 +0000 Commit: Rick Macklem CommitDate: 2021-09-18 21:38:43 +0000 nfscl: Use vfs.nfs.maxalloclen to limit Deallocate RPC RTT Unlike Copy, the NFSv4.2 Allocate and Deallocate operations do not allow a reply with partial completion. As such, the only way to limit the time the operation takes to provide a reasonable RPC RTT is to limit the size of the allocation/deallocation in the NFSv4.2 client. This patch uses the sysctl vfs.nfs.maxalloclen to set the limit on the size of the Deallocate operation. There is no way to know how long a server will take to do an deallocate operation, but 64Mbytes results in a reasonable RPC RTT for the slow hardware I test on. For an 8Gbyte deallocation, the elapsed time for doing it in 64Mbyte chunks was the same (within margin of variability) as the elapsed time taken for a single large deallocation operation for a FreeBSD server with a UFS file system. --- sys/fs/nfsclient/nfs_clvnops.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index 85b5dd9cfbb1..0b60100d1fc9 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -3702,12 +3702,15 @@ nfs_deallocate(struct vop_deallocate_args *ap) struct thread *td = curthread; struct nfsvattr nfsva; struct nfsmount *nmp; - off_t tlen; + struct nfsnode *np; + off_t tlen, mlen; int attrflag, error, ret; + bool clipped; error = 0; attrflag = 0; nmp = VFSTONFS(vp->v_mount); + np = VTONFS(vp); mtx_lock(&nmp->nm_mtx); if (NFSHASNFSV4(nmp) && nmp->nm_minorvers >= NFSV42_MINORVERSION && (nmp->nm_privflag & NFSMNTP_NODEALLOCATE) == 0) { @@ -3721,8 +3724,18 @@ nfs_deallocate(struct vop_deallocate_args *ap) *ap->a_len = 0; return (0); } + clipped = false; if ((uint64_t)*ap->a_offset + tlen > nmp->nm_maxfilesize) tlen = nmp->nm_maxfilesize - *ap->a_offset; + if ((uint64_t)*ap->a_offset < np->n_size) { + /* Limit the len to nfs_maxalloclen before EOF. */ + mlen = omin((off_t)np->n_size - *ap->a_offset, tlen); + if ((uint64_t)mlen > nfs_maxalloclen) { + NFSCL_DEBUG(4, "dealloc: tlen maxalloclen\n"); + tlen = nfs_maxalloclen; + clipped = true; + } + } if (error == 0) error = ncl_vinvalbuf(vp, V_SAVE, td, 1); if (error == 0) { @@ -3741,7 +3754,10 @@ nfs_deallocate(struct vop_deallocate_args *ap) nfsva.na_size - *ap->a_offset, tlen); } - *ap->a_len = 0; + if (clipped && tlen < *ap->a_len) + *ap->a_len -= tlen; + else + *ap->a_len = 0; } else if (error == NFSERR_NOTSUPP) { mtx_lock(&nmp->nm_mtx); nmp->nm_privflag |= NFSMNTP_NODEALLOCATE; From owner-dev-commits-src-all@freebsd.org Sun Sep 19 00:03:05 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 34F2B67F2B0; Sun, 19 Sep 2021 00:03:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HBnvX6McKz4RD4; Sun, 19 Sep 2021 00:03:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BA60313681; Sun, 19 Sep 2021 00:03:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18J034Qq070413; Sun, 19 Sep 2021 00:03:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18J034X8070412; Sun, 19 Sep 2021 00:03:04 GMT (envelope-from git) Date: Sun, 19 Sep 2021 00:03:04 GMT Message-Id: <202109190003.18J034X8070412@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kirk McKusick Subject: git: d7770a5495b1 - main - Eliminate snaplk / bufwait LOR when creating UFS snapshots MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mckusick X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d7770a5495b19a987dddc77cabcdeadf18413b4d Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2021 00:03:05 -0000 The branch main has been updated by mckusick: URL: https://cgit.FreeBSD.org/src/commit/?id=d7770a5495b19a987dddc77cabcdeadf18413b4d commit d7770a5495b19a987dddc77cabcdeadf18413b4d Author: Kirk McKusick AuthorDate: 2021-09-18 23:51:07 +0000 Commit: Kirk McKusick CommitDate: 2021-09-19 00:02:30 +0000 Eliminate snaplk / bufwait LOR when creating UFS snapshots Each vnode has an embedded lock that controls access to its contents. However vnodes describing a UFS snapshot all share a single snapshot lock to coordinate their access and update. As part of creating a new UFS snapshot, it has to have its individual vnode lock replaced with the filesystem's snapshot lock. The lock order for regular vnodes with respect to buffer locks is that they must first acquire the vnode lock, then a buffer lock. The order for the snapshot lock is reversed: a buffer lock must be acquired before the snapshot lock. When creating a new snapshot, the snapshot file must retain its vnode lock until it has allocated all the blocks that it needs before switching to the snapshot lock. This update moves one final piece of the initial snapshot block allocation so that it is done before the newly created snapshot is switched to use the snapshot lock. Reported by: Witness code MFC after: 1 week Sponsored by: Netflix --- sys/ufs/ffs/ffs_snapshot.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index 6da84fb46bb0..baad50cab2ba 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -650,6 +650,27 @@ loop: BLK_NOCOPY, 0); vput(xvp); } + /* + * Preallocate all the direct blocks in the snapshot inode so + * that we never have to write the inode itself to commit an + * update to the contents of the snapshot. Note that once + * created, the size of the snapshot will never change, so + * there will never be a need to write the inode except to + * update the non-integrity-critical time fields and + * allocated-block count. + */ + for (blockno = 0; blockno < UFS_NDADDR; blockno++) { + if (DIP(ip, i_db[blockno]) != 0) + continue; + error = UFS_BALLOC(vp, lblktosize(fs, blockno), + fs->fs_bsize, KERNCRED, BA_CLRBUF, &bp); + if (error) + goto resumefs; + error = readblock(vp, bp, blockno); + bawrite(bp); + if (error != 0) + goto resumefs; + } /* * Acquire a lock on the snapdata structure, creating it if necessary. */ @@ -691,27 +712,6 @@ loop: sn->sn_listsize = blkp - snapblklist; VI_UNLOCK(devvp); } - /* - * Preallocate all the direct blocks in the snapshot inode so - * that we never have to write the inode itself to commit an - * update to the contents of the snapshot. Note that once - * created, the size of the snapshot will never change, so - * there will never be a need to write the inode except to - * update the non-integrity-critical time fields and - * allocated-block count. - */ - for (blockno = 0; blockno < UFS_NDADDR; blockno++) { - if (DIP(ip, i_db[blockno]) != 0) - continue; - error = UFS_BALLOC(vp, lblktosize(fs, blockno), - fs->fs_bsize, KERNCRED, BA_CLRBUF, &bp); - if (error) - goto resumefs; - error = readblock(vp, bp, blockno); - bawrite(bp); - if (error != 0) - goto resumefs; - } /* * Record snapshot inode. Since this is the newest snapshot, * it must be placed at the end of the list. From owner-dev-commits-src-all@freebsd.org Sun Sep 19 08:17:19 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A08BB6AEE93; Sun, 19 Sep 2021 08:17:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HC0sq3Vlnz4kvp; Sun, 19 Sep 2021 08:17:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D0491977C; Sun, 19 Sep 2021 08:17:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18J8HJwP028957; Sun, 19 Sep 2021 08:17:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18J8HJCK028956; Sun, 19 Sep 2021 08:17:19 GMT (envelope-from git) Date: Sun, 19 Sep 2021 08:17:19 GMT Message-Id: <202109190817.18J8HJCK028956@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 8e698cd2ab2f - stable/13 - Add -Wno-error=unused-but-set-variable when building with Clang 13+ MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8e698cd2ab2f40d172d5c12c516b99f9553853d5 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2021 08:17:19 -0000 The branch stable/13 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=8e698cd2ab2f40d172d5c12c516b99f9553853d5 commit 8e698cd2ab2f40d172d5c12c516b99f9553853d5 Author: Dimitry Andric AuthorDate: 2021-08-26 15:36:03 +0000 Commit: Dimitry Andric CommitDate: 2021-09-19 08:13:48 +0000 Add -Wno-error=unused-but-set-variable when building with Clang 13+ This warning triggers many times while building world. Downgrade it to a warning until all occurrences have been fixed. Once the Clang warnings have been fixed we should be able to turn it on for GCC as well. See also f4fed768bba45a406f73ed1491d7e52fd1a8711d which did the same for the kernel builds. Reviewed by: arichardson, imp Differential Revision: https://reviews.freebsd.org/D31927 (cherry picked from commit 45feade38ec3e8e30086dedc6ee81cbf816293e3) --- share/mk/bsd.sys.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index e53994484c93..745382a32bc9 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -80,6 +80,9 @@ CWARNFLAGS+= -Wno-pointer-sign .if ${WARNS} <= 6 CWARNFLAGS.clang+= -Wno-empty-body -Wno-string-plus-int CWARNFLAGS.clang+= -Wno-unused-const-variable +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 130000 +CWARNFLAGS.clang+= -Wno-error=unused-but-set-variable +.endif .endif # WARNS <= 6 .if ${WARNS} <= 3 CWARNFLAGS.clang+= -Wno-tautological-compare -Wno-unused-value\ From owner-dev-commits-src-all@freebsd.org Sun Sep 19 08:17:44 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E31A66AEA72; Sun, 19 Sep 2021 08:17:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HC0tJ5K5pz4lFh; Sun, 19 Sep 2021 08:17:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E5B419E54; Sun, 19 Sep 2021 08:17:44 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18J8HiA2029102; Sun, 19 Sep 2021 08:17:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18J8HinG029101; Sun, 19 Sep 2021 08:17:44 GMT (envelope-from git) Date: Sun, 19 Sep 2021 08:17:44 GMT Message-Id: <202109190817.18J8HinG029101@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dimitry Andric Subject: git: 371456b17b0f - stable/12 - Add -Wno-error=unused-but-set-variable when building with Clang 13+ MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 371456b17b0f0290db1fb8fc57f67a29dc943549 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2021 08:17:45 -0000 The branch stable/12 has been updated by dim: URL: https://cgit.FreeBSD.org/src/commit/?id=371456b17b0f0290db1fb8fc57f67a29dc943549 commit 371456b17b0f0290db1fb8fc57f67a29dc943549 Author: Dimitry Andric AuthorDate: 2021-08-26 15:36:03 +0000 Commit: Dimitry Andric CommitDate: 2021-09-19 08:16:19 +0000 Add -Wno-error=unused-but-set-variable when building with Clang 13+ This warning triggers many times while building world. Downgrade it to a warning until all occurrences have been fixed. Once the Clang warnings have been fixed we should be able to turn it on for GCC as well. See also f4fed768bba45a406f73ed1491d7e52fd1a8711d which did the same for the kernel builds. Reviewed by: arichardson, imp Differential Revision: https://reviews.freebsd.org/D31927 (cherry picked from commit 45feade38ec3e8e30086dedc6ee81cbf816293e3) --- share/mk/bsd.sys.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk index 26f5c59063ae..e787d4f439df 100644 --- a/share/mk/bsd.sys.mk +++ b/share/mk/bsd.sys.mk @@ -84,6 +84,9 @@ CWARNFLAGS.clang+= -Wno-empty-body -Wno-string-plus-int .if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30400 CWARNFLAGS.clang+= -Wno-unused-const-variable .endif +.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 130000 +CWARNFLAGS.clang+= -Wno-error=unused-but-set-variable +.endif .endif # WARNS <= 6 .if ${WARNS} <= 3 CWARNFLAGS.clang+= -Wno-tautological-compare -Wno-unused-value\ From owner-dev-commits-src-all@freebsd.org Sun Sep 19 08:28:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECF7F6AF292 for ; Sun, 19 Sep 2021 08:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HC16X686Yz4nG3; Sun, 19 Sep 2021 08:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ACA1619FC4; Sun, 19 Sep 2021 08:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18J8SKO9042318; Sun, 19 Sep 2021 08:28:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18J8SKLL042317; Sun, 19 Sep 2021 08:28:20 GMT (envelope-from git) Date: Sun, 19 Sep 2021 08:28:20 GMT Message-Id: <202109190828.18J8SKLL042317@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dimitry Andric Subject: git: e57a5a3e2fe9 - Create tag vendor/llvm-project/llvmorg-13.0.0-rc3-8-g08642a395f23 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/tags/vendor/llvm-project/llvmorg-13.0.0-rc3-8-g08642a395f23 X-Git-Reftype: annotated tag X-Git-Commit: e57a5a3e2fe91b511bd672ea95dfa34db70da243 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2021 08:28:21 -0000 The annotated tag vendor/llvm-project/llvmorg-13.0.0-rc3-8-g08642a395f23 has been created by dim: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/llvm-project/llvmorg-13.0.0-rc3-8-g08642a395f23 tag vendor/llvm-project/llvmorg-13.0.0-rc3-8-g08642a395f23 Tagger: Dimitry Andric TaggerDate: 2021-09-19 08:27:21 +0000 Tag llvm-project branch release/13.x llvmorg-13.0.0-rc3-8-g08642a395f23. commit 392ac508a0589dec2c854a6466a07a8bfd694e25 Author: Dimitry Andric AuthorDate: 2021-09-19 08:25:59 +0000 Commit: Dimitry Andric CommitDate: 2021-09-19 08:25:59 +0000 Vendor import of llvm-project branch release/13.x llvmorg-13.0.0-rc3-8-g08642a395f23. From owner-dev-commits-src-all@freebsd.org Sun Sep 19 08:28:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC8C86AF3B0 for ; Sun, 19 Sep 2021 08:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HC16X5zf6z4n2M; Sun, 19 Sep 2021 08:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D5D519EE4; Sun, 19 Sep 2021 08:28:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18J8SKNm042294; Sun, 19 Sep 2021 08:28:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18J8SKvY042293; Sun, 19 Sep 2021 08:28:20 GMT (envelope-from git) Date: Sun, 19 Sep 2021 08:28:20 GMT Message-Id: <202109190828.18J8SKvY042293@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: Dimitry Andric Subject: git: f9ef3ff6e2ee..392ac508a058 - vendor/llvm-project/release-13.x - vendor branch updated MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dim X-Git-Repository: src X-Git-Refname: refs/heads/vendor/llvm-project/release-13.x X-Git-Reftype: branch X-Git-Commit: 392ac508a0589dec2c854a6466a07a8bfd694e25 X-Git-Oldrev: f9ef3ff6e2ee04c09e09e68d6ffcafc094485c1e X-Git-Newrev: 392ac508a0589dec2c854a6466a07a8bfd694e25 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2021 08:28:21 -0000 The branch vendor/llvm-project/release-13.x has been updated by dim: URL: https://cgit.FreeBSD.org/src/log/?id=f9ef3ff6e2ee..392ac508a058 392ac508a058 Vendor import of llvm-project branch release/13.x llvmorg-13.0.0-rc3-8-g08642a395f23. From owner-dev-commits-src-all@freebsd.org Sun Sep 19 08:37:23 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A9B16AF546; Sun, 19 Sep 2021 08:37:23 +0000 (UTC) (envelope-from herbert@gojira.at) Received: from mail.bsd4all.net (mail.bsd4all.net [94.130.200.20]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mail.bsd4all.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HC1Jx4mJNz4pSJ; Sun, 19 Sep 2021 08:37:21 +0000 (UTC) (envelope-from herbert@gojira.at) Date: Sun, 19 Sep 2021 10:34:52 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=gojira.at; s=mail202005; t=1632040634; bh=rjjS9omAeRTKnIdzQi4iSJa1fRHWABd+ER8AB0iBrTs=; h=Date:Message-ID:From:To:Subject:MIME-Version:Content-Type; b=JiUWZ24b4H7kZZwZQUz/mW+DXyg9A0vAL74xeBHp2nwXXZpElM8pwtrI3LZTLpbAP foNr7hUIfmbLLhyXJ9rX9g1JdI8+YeuPaUp0IgyUvJyfJRtFgciPVeTmfP1tTs9lqG eAWuYlbxy6Md3D5O6IQqRuN1qPAXqviu9AR4HGvn9YCDjfz/2pq2Ss/ECIjHERTtQ3 6x82B1JP0bgMXyUA8KlOSKygGebh9KpWRGuK3MM1Gq6Eud5v4UzlF+7+2+9xbHQf28 Ga5z4b/kZTZ9HvJlQKomxp/+6M8iZfZLftwdy6inbwWdTz7SJpuLtRQ/+FHRu2xATn gs0d6xZHznE8w== Message-ID: <87sfy1rmj7.wl-herbert@gojira.at> From: "Herbert J. Skuhra" To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: Re: git: 021385aba562 - main - Add WITH_LLVM_BINUTILS to install LLVM binutils instead of Elftoolchain In-Reply-To: <202109060924.1869O2Dk045877@gitrepo.freebsd.org> References: <202109060924.1869O2Dk045877@gitrepo.freebsd.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/28.0 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 4HC1Jx4mJNz4pSJ X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gojira.at header.s=mail202005 header.b=JiUWZ24b; dmarc=none; spf=pass (mx1.freebsd.org: domain of herbert@gojira.at designates 94.130.200.20 as permitted sender) smtp.mailfrom=herbert@gojira.at X-Spamd-Result: default: False [-2.50 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gojira.at:s=mail202005]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:94.130.200.20:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[gojira.at]; NEURAL_HAM_LONG(-1.00)[-1.000]; DKIM_TRACE(0.00)[gojira.at:+]; NEURAL_HAM_SHORT(-1.00)[-0.995]; MID_CONTAINS_FROM(1.00)[]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:94.130.0.0/16, country:DE]; MAILMAN_DEST(0.00)[dev-commits-src-all,dev-commits-src-main] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2021 08:37:23 -0000 On Mon, 06 Sep 2021 11:24:02 +0200, Alex Richardson wrote: > > The branch main has been updated by arichardson: > > URL: https://cgit.FreeBSD.org/src/commit/?id=021385aba56279febcfdcc64d23673a0106ae45d > > commit 021385aba56279febcfdcc64d23673a0106ae45d > Author: Alex Richardson > AuthorDate: 2021-09-06 08:49:49 +0000 > Commit: Alex Richardson > CommitDate: 2021-09-06 08:49:49 +0000 > > Add WITH_LLVM_BINUTILS to install LLVM binutils instead of Elftoolchain > > When WITH_LLVM_BINUTILS is set, we will install the LLVM binutils as > ar/ranlib/nm/objcopy/etc. instead of the elftoolchain ones. > Having the LLVM binutils instead of the elftoolchain ones allows us to use > features such as LTO that depend on binutils that understand LLVM IR. > Another benefit will be an improved user-experience when compiling with > AddressSanitizer, since ASAN does not symbolize backtraces correctly if > addr2line is elftoolchain addr2line instead of llvm-symbolizer. > See https://lists.freebsd.org/archives/freebsd-toolchain/2021-July/000062.html > for more details. > > This is currently off by default but will be turned on by default at some > point in the near future. > > Reviewed By: emaste > > Differential Revision: https://reviews.freebsd.org/D31060 > --- > Makefile.inc1 | 4 +++- > lib/Makefile | 5 ++++- > lib/clang/Makefile | 4 +++- > lib/clang/libllvm/Makefile | 6 +++--- > share/mk/src.opts.mk | 8 ++++++++ > tools/build/options/WITH_LLVM_BINUTILS | 2 ++ > usr.bin/Makefile | 16 +++++++++++----- > usr.bin/clang/Makefile | 13 +++++++++---- > usr.bin/clang/llvm-ar/Makefile | 7 +++++++ > usr.bin/clang/llvm-nm/Makefile | 7 +++++++ > usr.bin/clang/llvm-objcopy/Makefile | 7 +++++++ > usr.bin/clang/llvm-objdump/Makefile | 7 +++++++ > usr.bin/clang/llvm-size/Makefile | 7 +++++++ > usr.bin/clang/llvm-symbolizer/Makefile | 7 +++++++ > 14 files changed, 85 insertions(+), 15 deletions(-) > > diff --git a/Makefile.inc1 b/Makefile.inc1 > index b59c1913f8ce..478824675382 100644 > --- a/Makefile.inc1 > +++ b/Makefile.inc1 > @@ -771,6 +771,7 @@ XMAKE= ${BMAKE} \ > TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ > MK_CLANG_IS_CC=${MK_CLANG_BOOTSTRAP} \ > MK_LLDB=no \ > + MK_LLVM_BINUTILS=no \ > MK_TESTS=no > > # kernel-tools stage > @@ -2339,9 +2340,10 @@ _gensnmptree= usr.sbin/bsnmpd/gensnmptree > > # We need to build tblgen when we're building clang or lld, either as > # bootstrap tools, or as the part of the normal build. > +# llvm-tblgen is also needed for various llvm binutils (e.g. objcopy). > .if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_CLANG} != "no" || \ > ${MK_LLD_BOOTSTRAP} != "no" || ${MK_LLD} != "no" || \ > - ${MK_LLDB} != "no" > + ${MK_LLDB} != "no" || ${MK_LLVM_BINUTILS} != "no" > _clang_tblgen= \ > lib/clang/libllvmminimal \ > usr.bin/clang/llvm-tblgen > diff --git a/lib/Makefile b/lib/Makefile > index 674368a19ffd..1e375bb456e6 100644 > --- a/lib/Makefile > +++ b/lib/Makefile > @@ -157,7 +157,10 @@ SUBDIR.${MK_BLUETOOTH}+=libbluetooth libsdp > SUBDIR.${MK_BSNMP}+= libbsnmp > > .if !defined(COMPAT_32BIT) && !defined(COMPAT_SOFTFP) > -SUBDIR.${MK_CLANG}+= clang > +.if ${MK_CLANG} != "no" || ${MK_LLD} != "no" || \ > + ${MK_LLDB} != "no" || ${MK_LLVM_BINUTILS} != "no" > +SUBDIR+= clang > +.endif > .endif > > SUBDIR.${MK_CUSE}+= libcuse > diff --git a/lib/clang/Makefile b/lib/clang/Makefile > index bc09ea62dc67..df4aa01a2653 100644 > --- a/lib/clang/Makefile > +++ b/lib/clang/Makefile > @@ -4,10 +4,12 @@ > > # These have to be built in order. > SUBDIR= libllvm > +.if ${MK_CLANG} != "no" > SUBDIR+= libclang > +SUBDIR+= headers > +.endif > .if ${MK_LLDB} != "no" > SUBDIR+= liblldb > .endif > -SUBDIR+= headers > > .include > diff --git a/lib/clang/libllvm/Makefile b/lib/clang/libllvm/Makefile > index 09d6336c01d9..7eaedf65dcb3 100644 > --- a/lib/clang/libllvm/Makefile > +++ b/lib/clang/libllvm/Makefile > @@ -830,7 +830,7 @@ SRCS_MIN+= Object/IRObjectFile.cpp > SRCS_MIN+= Object/IRSymtab.cpp > SRCS_MIN+= Object/MachOObjectFile.cpp > SRCS_MIW+= Object/MachOUniversal.cpp > -SRCS_EXT+= Object/MachOUniversalWriter.cpp > +SRCS_MIW+= Object/MachOUniversalWriter.cpp > SRCS_MIW+= Object/Minidump.cpp > SRCS_MIN+= Object/ModuleSymbolTable.cpp > SRCS_EXT+= Object/Object.cpp > @@ -920,7 +920,7 @@ SRCS_MIN+= Support/Errno.cpp > SRCS_MIN+= Support/Error.cpp > SRCS_MIN+= Support/ErrorHandling.cpp > SRCS_MIN+= Support/FileCollector.cpp > -SRCS_EXL+= Support/FileOutputBuffer.cpp > +SRCS_MIW+= Support/FileOutputBuffer.cpp > SRCS_MIN+= Support/FileUtilities.cpp > SRCS_MIN+= Support/FoldingSet.cpp > SRCS_MIN+= Support/FormatVariadic.cpp > @@ -945,7 +945,7 @@ SRCS_MIN+= Support/MD5.cpp > SRCS_MIN+= Support/ManagedStatic.cpp > SRCS_MIN+= Support/MathExtras.cpp > SRCS_MIN+= Support/MemAlloc.cpp > -SRCS_XDL+= Support/Memory.cpp > +SRCS_MIW+= Support/Memory.cpp > SRCS_MIN+= Support/MemoryBuffer.cpp > SRCS_MIN+= Support/MemoryBufferRef.cpp > SRCS_MIN+= Support/NativeFormatting.cpp > diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk > index 32346e31a752..5363cb6e78f9 100644 > --- a/share/mk/src.opts.mk > +++ b/share/mk/src.opts.mk > @@ -203,6 +203,7 @@ __DEFAULT_NO_OPTIONS = \ > LOADER_FIREWIRE \ > LOADER_VERBOSE \ > LOADER_VERIEXEC_PASS_MANIFEST \ > + LLVM_BINUTILS \ > MALLOC_PRODUCTION \ > OFED_EXTRA \ > OPENLDAP \ > @@ -459,6 +460,7 @@ MK_CLANG:= no > MK_INCLUDES:= no > MK_LLD:= no > MK_LLDB:= no > +MK_LLVM_BINUTILS:= no > .endif > > .if ${MK_CLANG} == "no" > @@ -468,6 +470,12 @@ MK_CLANG_FULL:= no > MK_LLVM_COV:= no > .endif > > +.if ${MK_LLVM_BINUTILS} == "yes" > +# MK_LLVM_CXXFILT is a subset of MK_LLVM_BINUTILS and should therefore be > +# enabled if MK_LLVM_BINUTILS is set. > +MK_LLVM_CXXFILT:= yes > +.endif > + > .if ${MK_LOADER_VERIEXEC} == "no" > MK_LOADER_VERIEXEC_PASS_MANIFEST := no > .endif > diff --git a/tools/build/options/WITH_LLVM_BINUTILS b/tools/build/options/WITH_LLVM_BINUTILS > new file mode 100644 > index 000000000000..8fa2c55f31a9 > --- /dev/null > +++ b/tools/build/options/WITH_LLVM_BINUTILS > @@ -0,0 +1,2 @@ > +.\" $FreeBSD$ > +Install LLVM's binutils (ar, addr2line, nm, etc.) instead of ELF Tool Chain's. > diff --git a/usr.bin/Makefile b/usr.bin/Makefile > index f1b07a7007be..e8be161db01a 100644 > --- a/usr.bin/Makefile > +++ b/usr.bin/Makefile > @@ -195,7 +195,10 @@ SUBDIR.${MK_ATM}+= atm > SUBDIR.${MK_BLUETOOTH}+= bluetooth > SUBDIR.${MK_BSD_CPIO}+= cpio > SUBDIR.${MK_CALENDAR}+= calendar > -SUBDIR.${MK_CLANG}+= clang > +.if ${MK_CLANG} != "no" || ${MK_LLVM_BINUTILS} != "no" || \ > + ${MK_LLD} != "no" || ${MK_LLDB} != "no" > +SUBDIR+= clang > +.endif > SUBDIR.${MK_DIALOG}+= dpv > SUBDIR.${MK_EE}+= ee > SUBDIR.${MK_FILE}+= file > @@ -251,25 +254,28 @@ SUBDIR.${MK_TESTS_SUPPORT}.${MK_CXX}+= kyua > SUBDIR.${MK_TESTS}+= tests > SUBDIR.${MK_TEXTPROC}+= ul > SUBDIR.${MK_TFTP}+= tftp > +.if ${MK_LLVM_BINUTILS} == "no" > +# Only build the elftoolchain tools if we aren't using the LLVM ones. > SUBDIR.${MK_TOOLCHAIN}+= addr2line > SUBDIR.${MK_TOOLCHAIN}+= ar > +SUBDIR.${MK_TOOLCHAIN}+= nm > +SUBDIR.${MK_TOOLCHAIN}+= objcopy > +SUBDIR.${MK_TOOLCHAIN}+= readelf > +SUBDIR.${MK_TOOLCHAIN}+= size > +.endif > SUBDIR.${MK_TOOLCHAIN}+= c89 > SUBDIR.${MK_TOOLCHAIN}+= c99 > SUBDIR.${MK_TOOLCHAIN}+= ctags > .if ${MK_LLVM_CXXFILT} == "no" > SUBDIR.${MK_TOOLCHAIN}+= cxxfilt > .endif > -SUBDIR.${MK_TOOLCHAIN}+= objcopy > SUBDIR.${MK_TOOLCHAIN}+= file2c > SUBDIR.${MK_TOOLCHAIN}+= gprof > SUBDIR.${MK_TOOLCHAIN}+= indent > SUBDIR.${MK_TOOLCHAIN}+= lex > SUBDIR.${MK_TOOLCHAIN}+= mkstr > -SUBDIR.${MK_TOOLCHAIN}+= nm > -SUBDIR.${MK_TOOLCHAIN}+= readelf > SUBDIR.${MK_TOOLCHAIN}+= rpcgen > SUBDIR.${MK_TOOLCHAIN}+= unifdef > -SUBDIR.${MK_TOOLCHAIN}+= size > SUBDIR.${MK_TOOLCHAIN}+= xstr > SUBDIR.${MK_TOOLCHAIN}+= yacc > SUBDIR.${MK_VI}+= vi > diff --git a/usr.bin/clang/Makefile b/usr.bin/clang/Makefile > index 1c53e94965f7..7fc31e8df194 100644 > --- a/usr.bin/clang/Makefile > +++ b/usr.bin/clang/Makefile > @@ -7,12 +7,20 @@ SUBDIR+= clang > .endif > > .if !defined(TOOLS_PREFIX) > +# LLVM binutils are needed to support features such as LTO, so we build them > +# by default if clang is enabled. If MK_LLVM_BINUTILS is set, we also use them > +# as the default binutils (ar,nm,addr2line, etc.). > +.if ${MK_CLANG} != "no" || ${MK_LLVM_BINUTILS} != "no" > SUBDIR+= llvm-ar > SUBDIR+= llvm-nm > +SUBDIR+= llvm-objcopy > SUBDIR+= llvm-objdump > +SUBDIR+= llvm-size > +SUBDIR+= llvm-strings > SUBDIR+= llvm-symbolizer > +.endif Update tools/build/mk/OptionalObsoleteFiles.inc? # make delete-old >>> Removing old files (only deletes safe to delete libs) remove /usr/bin/llvm-objcopy? n remove /usr/bin/llvm-size? n remove /usr/bin/llvm-strings? n remove /usr/share/man/man1/llvm-objcopy.1.gz? n remove /usr/share/man/man1/llvm-size.1.gz? n remove /usr/share/man/man1/llvm-strings.1.gz? n -- Herbert From owner-dev-commits-src-all@freebsd.org Sun Sep 19 10:00:56 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D361766828E; Sun, 19 Sep 2021 10:00:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HC39N56Ndz3kg6; Sun, 19 Sep 2021 10:00:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8FD541B50C; Sun, 19 Sep 2021 10:00:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18JA0uvj071412; Sun, 19 Sep 2021 10:00:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18JA0uHK071411; Sun, 19 Sep 2021 10:00:56 GMT (envelope-from git) Date: Sun, 19 Sep 2021 10:00:56 GMT Message-Id: <202109191000.18JA0uHK071411@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Michael Tuexen Subject: git: e19d93b19dce - main - sctp: fix FCFS stream scheduler MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tuexen X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e19d93b19dce276bdf178bb6a449728238d1c6f8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2021 10:00:56 -0000 The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=e19d93b19dce276bdf178bb6a449728238d1c6f8 commit e19d93b19dce276bdf178bb6a449728238d1c6f8 Author: Michael Tuexen AuthorDate: 2021-09-19 09:56:26 +0000 Commit: Michael Tuexen CommitDate: 2021-09-19 09:56:26 +0000 sctp: fix FCFS stream scheduler Reported by: syzbot+c6793f0f0ce698bce230@syzkaller.appspotmail.com MFC after: 1 week --- sys/netinet/sctp_ss_functions.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/sys/netinet/sctp_ss_functions.c b/sys/netinet/sctp_ss_functions.c index 5557015cd2a9..0a5a788428bc 100644 --- a/sys/netinet/sctp_ss_functions.c +++ b/sys/netinet/sctp_ss_functions.c @@ -809,23 +809,22 @@ sctp_ss_fcfs_init(struct sctp_tcb *stcb, struct sctp_association *asoc, static void sctp_ss_fcfs_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, - int clear_values, int holds_lock) + int clear_values SCTP_UNUSED, int holds_lock) { struct sctp_stream_queue_pending *sp; - if (clear_values) { - if (holds_lock == 0) { - SCTP_TCB_SEND_LOCK(stcb); - } - while (!TAILQ_EMPTY(&asoc->ss_data.out.list)) { - sp = TAILQ_FIRST(&asoc->ss_data.out.list); - TAILQ_REMOVE(&asoc->ss_data.out.list, sp, ss_next); - sp->ss_next.tqe_next = NULL; - sp->ss_next.tqe_prev = NULL; - } - if (holds_lock == 0) { - SCTP_TCB_SEND_UNLOCK(stcb); - } + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + while (!TAILQ_EMPTY(&asoc->ss_data.out.list)) { + sp = TAILQ_FIRST(&asoc->ss_data.out.list); + TAILQ_REMOVE(&asoc->ss_data.out.list, sp, ss_next); + sp->ss_next.tqe_next = NULL; + sp->ss_next.tqe_prev = NULL; + } + asoc->ss_data.last_out_stream = NULL; + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); } return; } From owner-dev-commits-src-all@freebsd.org Sun Sep 19 11:18:37 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5D8F066933E; Sun, 19 Sep 2021 11:18:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HC4v11PjLz4bJB; Sun, 19 Sep 2021 11:18:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0272A1C58C; Sun, 19 Sep 2021 11:18:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18JBIaN1068793; Sun, 19 Sep 2021 11:18:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18JBIaI9068792; Sun, 19 Sep 2021 11:18:36 GMT (envelope-from git) Date: Sun, 19 Sep 2021 11:18:36 GMT Message-Id: <202109191118.18JBIaI9068792@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 9eb77afb4df1 - stable/13 - test/ptrace/scescx.c: fix printing of braces for syscalls without args MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9eb77afb4df14160426319582e101c5b9c1f8dfb Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2021 11:18:37 -0000 The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=9eb77afb4df14160426319582e101c5b9c1f8dfb commit 9eb77afb4df14160426319582e101c5b9c1f8dfb Author: Konstantin Belousov AuthorDate: 2021-09-16 17:23:11 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-19 11:18:12 +0000 test/ptrace/scescx.c: fix printing of braces for syscalls without args (cherry picked from commit 9a8eb5db55964c2fc7aca0db5939d8300badc9ab) --- tools/test/ptrace/scescx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/test/ptrace/scescx.c b/tools/test/ptrace/scescx.c index 782a43d69bf4..582d1734427e 100644 --- a/tools/test/ptrace/scescx.c +++ b/tools/test/ptrace/scescx.c @@ -196,16 +196,17 @@ wait_info(int pid, int status, struct ptrace_lwpinfo *lwpinfo) (caddr_t)args, lwpinfo->pl_syscall_narg * sizeof(long)); if (error == 0) { + printf("("); for (i = 0; i < (int)lwpinfo->pl_syscall_narg; i++) { - printf("%c%#lx", i == 0 ? '(' : ',', + printf("%s%#lx", i == 0 ? "" : ",", args[i]); } + printf(")"); } else { fprintf(stderr, "PT_GET_SC_ARGS failed: %s", strerror(errno)); } - printf(")"); free(args); } } From owner-dev-commits-src-all@freebsd.org Sun Sep 19 11:20:16 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1203A669723; Sun, 19 Sep 2021 11:20:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HC4wv6gzwz4brp; Sun, 19 Sep 2021 11:20:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C37AB1C58D; Sun, 19 Sep 2021 11:20:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18JBKFoW074442; Sun, 19 Sep 2021 11:20:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18JBKFKj074440; Sun, 19 Sep 2021 11:20:15 GMT (envelope-from git) Date: Sun, 19 Sep 2021 11:20:15 GMT Message-Id: <202109191120.18JBKFKj074440@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 4e762fab7085 - stable/12 - test/ptrace/scescx.c: fix printing of braces for syscalls without args MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 4e762fab7085a414480a423848b03308bfc225c2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2021 11:20:16 -0000 The branch stable/12 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4e762fab7085a414480a423848b03308bfc225c2 commit 4e762fab7085a414480a423848b03308bfc225c2 Author: Konstantin Belousov AuthorDate: 2021-09-16 17:23:11 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-19 11:19:29 +0000 test/ptrace/scescx.c: fix printing of braces for syscalls without args (cherry picked from commit 9a8eb5db55964c2fc7aca0db5939d8300badc9ab) --- tools/test/ptrace/scescx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/test/ptrace/scescx.c b/tools/test/ptrace/scescx.c index 782a43d69bf4..582d1734427e 100644 --- a/tools/test/ptrace/scescx.c +++ b/tools/test/ptrace/scescx.c @@ -196,16 +196,17 @@ wait_info(int pid, int status, struct ptrace_lwpinfo *lwpinfo) (caddr_t)args, lwpinfo->pl_syscall_narg * sizeof(long)); if (error == 0) { + printf("("); for (i = 0; i < (int)lwpinfo->pl_syscall_narg; i++) { - printf("%c%#lx", i == 0 ? '(' : ',', + printf("%s%#lx", i == 0 ? "" : ",", args[i]); } + printf(")"); } else { fprintf(stderr, "PT_GET_SC_ARGS failed: %s", strerror(errno)); } - printf(")"); free(args); } } From owner-dev-commits-src-all@freebsd.org Sun Sep 19 11:53:40 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 45979669D8F; Sun, 19 Sep 2021 11:53:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HC5gS1HFVz4l4x; Sun, 19 Sep 2021 11:53:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0C6B91CBC2; Sun, 19 Sep 2021 11:53:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18JBrd3E021236; Sun, 19 Sep 2021 11:53:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18JBrdOc021235; Sun, 19 Sep 2021 11:53:39 GMT (envelope-from git) Date: Sun, 19 Sep 2021 11:53:39 GMT Message-Id: <202109191153.18JBrdOc021235@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: b8ff849cbddf - main - sh: improve command completion MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b8ff849cbddfee3404d6550cf98f53d6bb617707 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2021 11:53:40 -0000 The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=b8ff849cbddfee3404d6550cf98f53d6bb617707 commit b8ff849cbddfee3404d6550cf98f53d6bb617707 Author: Piotr Pawel Stefaniak AuthorDate: 2021-09-18 11:26:51 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-19 11:51:45 +0000 sh: improve command completion When multiple matches are found, we keep the provided string on the input line and print unique matches as suggestions. But the multiple matches might be the same command found in different directories, so we should deduplicate the matches first and then decide whether to autocomplete the command or not, based on the number of unique matches. --- bin/sh/histedit.c | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c index b680a99c4ace..1a1e11e6f885 100644 --- a/bin/sh/histedit.c +++ b/bin/sh/histedit.c @@ -590,7 +590,7 @@ static char char *free_path = NULL, *path; const char *dirname; char **matches = NULL; - size_t i = 0, size = 16, j, k; + size_t i = 0, size = 16, uniq; size_t curpos = end - start; if (start > 0 || memchr("/.~", text[0], 3) != NULL) @@ -639,6 +639,21 @@ static char } out: free(free_path); + if (i == 0) { + free(matches); + return (NULL); + } + uniq = 1; + if (i > 1) { + qsort_s(matches + 1, i, sizeof(matches[0]), comparator, + (void *)(intptr_t)curpos); + for (size_t k = 2; k <= i; k++) + if (strcmp(matches[uniq] + curpos, matches[k] + curpos) == 0) + free(matches[k]); + else + matches[++uniq] = matches[k]; + } + matches[uniq + 1] = NULL; /* * matches[0] is special: it's not a real matching file name but a common * prefix for all matching names. It can't be null, unlike any other @@ -648,30 +663,13 @@ out: * string in matches[0] which is the reason to copy the full name of the * only match. */ - if (i == 0) { - free(matches); - return (NULL); - } else if (i == 1) { - matches[0] = strdup(matches[1]); - matches[2] = NULL; - if (matches[0] != NULL) - return (matches); - } else - matches[0] = strdup(text); + matches[0] = strdup(uniq == 1 ? matches[1] : text); if (matches[0] == NULL) { - for (j = 1; j <= i; j++) - free(matches[j]); + for (size_t k = 1; k <= uniq; k++) + free(matches[k]); free(matches); return (NULL); } - qsort_s(matches + 1, i, sizeof(matches[0]), comparator, - (void *)(intptr_t)curpos); - for (j = 1, k = 2; k <= i; k++) - if (strcmp(matches[j] + curpos, matches[k] + curpos) == 0) - free(matches[k]); - else - matches[++j] = matches[k]; - matches[j + 1] = NULL; return (matches); } From owner-dev-commits-src-all@freebsd.org Sun Sep 19 11:53:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 91364669E13; Sun, 19 Sep 2021 11:53:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HC5gT2Zqwz4lJH; Sun, 19 Sep 2021 11:53:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EA201CD61; Sun, 19 Sep 2021 11:53:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18JBrfVA021260; Sun, 19 Sep 2021 11:53:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18JBrfTA021259; Sun, 19 Sep 2021 11:53:41 GMT (envelope-from git) Date: Sun, 19 Sep 2021 11:53:41 GMT Message-Id: <202109191153.18JBrfTA021259@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: da0c0e012157 - main - fstyp: bump WARNS to default and work around warnings MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: da0c0e0121574a1d82f417cc7e245ecd5506325c Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2021 11:53:41 -0000 The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=da0c0e0121574a1d82f417cc7e245ecd5506325c commit da0c0e0121574a1d82f417cc7e245ecd5506325c Author: Piotr Pawel Stefaniak AuthorDate: 2021-08-17 15:46:08 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-19 11:52:12 +0000 fstyp: bump WARNS to default and work around warnings Differential Revision: https://reviews.freebsd.org/D31588 --- usr.sbin/fstyp/Makefile | 2 -- usr.sbin/fstyp/apfs.c | 2 ++ usr.sbin/fstyp/fstyp.c | 4 ++-- usr.sbin/fstyp/hammer.c | 3 +++ usr.sbin/fstyp/hfsplus.c | 2 ++ 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/usr.sbin/fstyp/Makefile b/usr.sbin/fstyp/Makefile index 384e2f7dee60..161cd0cf3764 100644 --- a/usr.sbin/fstyp/Makefile +++ b/usr.sbin/fstyp/Makefile @@ -12,8 +12,6 @@ SRCS += zfs.c MAN= fstyp.8 -WARNS?= 2 - .if ${MK_ICONV} == "yes" CFLAGS+= -DWITH_ICONV .endif diff --git a/usr.sbin/fstyp/apfs.c b/usr.sbin/fstyp/apfs.c index 049a9f862f2b..7f8543a5a108 100644 --- a/usr.sbin/fstyp/apfs.c +++ b/usr.sbin/fstyp/apfs.c @@ -100,6 +100,8 @@ fstyp_apfs(FILE *fp, char *label, size_t size) retval = 0; /* No label support yet. */ + (void)size; + (void)label; fail: free(csb); diff --git a/usr.sbin/fstyp/fstyp.c b/usr.sbin/fstyp/fstyp.c index b39277914aed..91c36d9d9191 100644 --- a/usr.sbin/fstyp/fstyp.c +++ b/usr.sbin/fstyp/fstyp.c @@ -61,7 +61,7 @@ static struct { const char *name; fstyp_function function; bool unmountable; - char *precache_encoding; + const char *precache_encoding; } fstypes[] = { { "apfs", &fstyp_apfs, true, NULL }, { "befs", &fstyp_befs, false, NULL }, @@ -206,7 +206,7 @@ main(int argc, char **argv) #ifdef WITH_ICONV /* Cache iconv conversion data before entering capability mode. */ if (show_label) { - for (i = 0; i < nitems(fstypes); i++) { + for (i = 0; i < (int)nitems(fstypes); i++) { iconv_t cd; if (fstypes[i].precache_encoding == NULL) diff --git a/usr.sbin/fstyp/hammer.c b/usr.sbin/fstyp/hammer.c index 6fdad1d642a4..777f5d312371 100644 --- a/usr.sbin/fstyp/hammer.c +++ b/usr.sbin/fstyp/hammer.c @@ -43,6 +43,9 @@ __FBSDID("$FreeBSD$"); #include "fstyp.h" +extern int fsvtyp_hammer(const char *blkdevs, char *label, size_t size); +extern int fsvtyp_hammer_partial(const char *blkdevs, char *label, size_t size); + static hammer_volume_ondisk_t read_ondisk(FILE *fp) { diff --git a/usr.sbin/fstyp/hfsplus.c b/usr.sbin/fstyp/hfsplus.c index 71287465e4ff..3a94faf7766f 100644 --- a/usr.sbin/fstyp/hfsplus.c +++ b/usr.sbin/fstyp/hfsplus.c @@ -118,6 +118,8 @@ fstyp_hfsp(FILE *fp, char *label, size_t size) retval = 0; /* No label support yet. */ + (void)size; + (void)label; fail: free(hdr); From owner-dev-commits-src-all@freebsd.org Sun Sep 19 11:53:42 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E0D47669FC9; Sun, 19 Sep 2021 11:53:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HC5gV5n3Qz4lTp; Sun, 19 Sep 2021 11:53:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56E991CD62; Sun, 19 Sep 2021 11:53:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18JBrgNK021284; Sun, 19 Sep 2021 11:53:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18JBrgLr021283; Sun, 19 Sep 2021 11:53:42 GMT (envelope-from git) Date: Sun, 19 Sep 2021 11:53:42 GMT Message-Id: <202109191153.18JBrgLr021283@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 97c31821eb0b - main - ls(1): Allow LSCOLORS to specify an underline MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 97c31821eb0b1180778ad2da660a1778c2cb4b62 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2021 11:53:43 -0000 The branch main has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=97c31821eb0b1180778ad2da660a1778c2cb4b62 commit 97c31821eb0b1180778ad2da660a1778c2cb4b62 Author: Cameron Katri AuthorDate: 2021-09-19 11:36:41 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-19 11:52:12 +0000 ls(1): Allow LSCOLORS to specify an underline Allows capitalizing the background color character to enable an underline instead of bold, capitalizing the foreground color char will still do bold. Differential Revision: https://reviews.freebsd.org/D30547 --- bin/ls/extern.h | 1 + bin/ls/ls.1 | 19 +++++++++++-------- bin/ls/ls.c | 2 ++ bin/ls/print.c | 21 ++++++++++++++++----- 4 files changed, 30 insertions(+), 13 deletions(-) diff --git a/bin/ls/extern.h b/bin/ls/extern.h index 8dab2bcc9d8c..247c2c4a1d5b 100644 --- a/bin/ls/extern.h +++ b/bin/ls/extern.h @@ -66,6 +66,7 @@ extern char *ansi_bgcol; extern char *ansi_coloff; extern char *attrs_off; extern char *enter_bold; +extern char *enter_underline; extern int colorflag; extern bool explicitansi; diff --git a/bin/ls/ls.1 b/bin/ls/ls.1 index 8510ca609cda..ef412dd2927d 100644 --- a/bin/ls/ls.1 +++ b/bin/ls/ls.1 @@ -740,6 +740,7 @@ where is the foreground color and .Ar b is the background color. +When the background color is capitalized, the text will underlined. .Pp The color designators are as follows: .Pp @@ -761,23 +762,25 @@ cyan .It Sy h light grey .It Sy A -bold black, usually shows up as dark grey +bold or underlined black, usually shows up as dark grey .It Sy B -bold red +bold or underlined red .It Sy C -bold green +bold or underlined green .It Sy D -bold brown, usually shows up as yellow +bold or underlined brown, usually shows up as yellow .It Sy E -bold blue +bold or underlined blue .It Sy F -bold magenta +bold or underlined magenta .It Sy G -bold cyan +bold or underlined cyan .It Sy H -bold light grey; looks like bright white +bold or underlined light grey; looks like bright white .It Sy x default foreground or background +.It Sy X +default foreground or background, with an underline or bold .El .Pp Note that the above are standard diff --git a/bin/ls/ls.c b/bin/ls/ls.c index 92575711251d..8a30dd326b4e 100644 --- a/bin/ls/ls.c +++ b/bin/ls/ls.c @@ -159,6 +159,7 @@ char *ansi_fgcol; /* ANSI sequence to set foreground colour */ char *ansi_coloff; /* ANSI sequence to reset colours */ char *attrs_off; /* ANSI sequence to turn off attributes */ char *enter_bold; /* ANSI sequence to set color to bold mode */ +char *enter_underline; /* ANSI sequence to enter underline mode */ #endif static int rval; @@ -485,6 +486,7 @@ main(int argc, char *argv[]) ansi_bgcol = tgetstr("AB", &bp); attrs_off = tgetstr("me", &bp); enter_bold = tgetstr("md", &bp); + enter_underline = tgetstr("us", &bp); /* To switch colours off use 'op' if * available, otherwise use 'oc', or diff --git a/bin/ls/print.c b/bin/ls/print.c index 9a537418f7b9..bbe5c6f8a6f6 100644 --- a/bin/ls/print.c +++ b/bin/ls/print.c @@ -106,7 +106,8 @@ static const char *defcolors = "exfxcxdxbxegedabagacad"; /* colors for file types */ static struct { int num[2]; - int bold; + bool bold; + bool underline; } colors[C_NUMCOLORS]; #endif @@ -548,6 +549,8 @@ printcolor_termcap(Colors c) if (colors[c].bold) tputs(enter_bold, 1, putch); + if (colors[c].underline) + tputs(enter_underline, 1, putch); if (colors[c].num[0] != -1) { ansiseq = tgoto(ansi_fgcol, 0, colors[c].num[0]); @@ -569,6 +572,8 @@ printcolor_ansi(Colors c) if (colors[c].bold) printf("1"); + if (colors[c].underline) + printf(";4"); if (colors[c].num[0] != -1) printf(";3%d", colors[c].num[0]); if (colors[c].num[1] != -1) @@ -666,7 +671,8 @@ parsecolors(const char *cs) cs = ""; /* LSCOLORS not set */ len = strlen(cs); for (i = 0; i < (int)C_NUMCOLORS; i++) { - colors[i].bold = 0; + colors[i].bold = false; + colors[i].underline = false; if (len <= 2 * (size_t)i) { c[0] = defcolors[2 * i]; @@ -689,10 +695,15 @@ parsecolors(const char *cs) colors[i].num[j] = c[j] - 'a'; else if (c[j] >= 'A' && c[j] <= 'H') { colors[i].num[j] = c[j] - 'A'; - colors[i].bold = 1; - } else if (tolower((unsigned char)c[j]) == 'x') + if (j == 1) + colors[i].underline = true; + else + colors[i].bold = true; + } else if (tolower((unsigned char)c[j]) == 'x') { + if (j == 1 && c[j] == 'X') + colors[i].underline = true; colors[i].num[j] = -1; - else { + } else { warnx("invalid character '%c' in LSCOLORS" " env var", c[j]); colors[i].num[j] = -1; From owner-dev-commits-src-all@freebsd.org Sun Sep 19 12:45:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5634866A952 for ; Sun, 19 Sep 2021 12:45:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HC6py1XQdz3DhY; Sun, 19 Sep 2021 12:45:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15DCC1D649; Sun, 19 Sep 2021 12:45:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18JCjEs3088261; Sun, 19 Sep 2021 12:45:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18JCjEWn088260; Sun, 19 Sep 2021 12:45:14 GMT (envelope-from git) Date: Sun, 19 Sep 2021 12:45:14 GMT Message-Id: <202109191245.18JCjEWn088260@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: =?utf-8?Q?Stefan E=C3=9Fer?= Subject: git: 249846635991 - Create tag vendor/bc/5.0.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/tags/vendor/bc/5.0.2 X-Git-Reftype: annotated tag X-Git-Commit: 249846635991fa7ec2460559b036e291e4834bbc Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2021 12:45:14 -0000 The annotated tag vendor/bc/5.0.2 has been created by se: URL: https://cgit.FreeBSD.org/src/tag/?h=vendor/bc/5.0.2 tag vendor/bc/5.0.2 Tagger: Stefan Eßer TaggerDate: 2021-09-19 12:43:52 +0000 vendor/bc: tag version 5.0.2 commit a60ef1802a36f2f2a5611564191440ea1c1e2f17 Author: Stefan Eßer AuthorDate: 2021-09-19 12:41:20 +0000 Commit: Stefan Eßer CommitDate: 2021-09-19 12:41:20 +0000 vendor/bc: update to upstream version 5.0.2 From owner-dev-commits-src-all@freebsd.org Sun Sep 19 12:45:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5660C66A953 for ; Sun, 19 Sep 2021 12:45:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HC6py1XPmz3DWD; Sun, 19 Sep 2021 12:45:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0A6671D648; Sun, 19 Sep 2021 12:45:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18JCjDIt088233; Sun, 19 Sep 2021 12:45:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18JCjDIe088232; Sun, 19 Sep 2021 12:45:13 GMT (envelope-from git) Date: Sun, 19 Sep 2021 12:45:13 GMT Message-Id: <202109191245.18JCjDIe088232@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org From: =?utf-8?Q?Stefan E=C3=9Fer?= Subject: git: 2f57ecae4b98..a60ef1802a36 - vendor/bc - vendor branch updated MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: se X-Git-Repository: src X-Git-Refname: refs/heads/vendor/bc X-Git-Reftype: branch X-Git-Commit: a60ef1802a36f2f2a5611564191440ea1c1e2f17 X-Git-Oldrev: 2f57ecae4b98e76e5d675563785a7e6c59c868c4 X-Git-Newrev: a60ef1802a36f2f2a5611564191440ea1c1e2f17 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2021 12:45:14 -0000 The branch vendor/bc has been updated by se: URL: https://cgit.FreeBSD.org/src/log/?id=2f57ecae4b98..a60ef1802a36 a60ef1802a36 vendor/bc: update to upstream version 5.0.2 From owner-dev-commits-src-all@freebsd.org Sun Sep 19 13:58:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C968266BB90; Sun, 19 Sep 2021 13:58:50 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HC8Rt4kccz3mvF; Sun, 19 Sep 2021 13:58:50 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-lf1-x135.google.com with SMTP id y28so54443493lfb.0; Sun, 19 Sep 2021 06:58:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=KPBGb51m44Ri6kXs0efNUNg3SLGcHfKF+lvNP9svil0=; b=mGkakUQEzZeRmHKOphYmMfO0CnVYwDYVyaMOOrDQZNEXjcacLSrEPwqaWxjMpcUh7T zk/F1VLOIUd5AoLpMQozhBqqasOXD09pH4uwrXFwy1SNWabHx9Tr/SwjMSA09fs2f7qw HMOs5rd+h1PEnZhGTkjm/tlGxyw9gKa3NeQsLSU8sQwbSYqjLnapEVRhYGcsr2ww8Qwt hxOBd1k58JZJrioDQKeEHe+i8R8NDJ6W7Fl2hS3jGOMtWTb0vi0iFzQPLTiXNhdUkadl 6IBiMVdkSDGEZZHys+t2DrkdmkjMplk8iKSlsZNFey2Bz4mYxqpoj3m8V2yvBll0Hokz ks9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=KPBGb51m44Ri6kXs0efNUNg3SLGcHfKF+lvNP9svil0=; b=bQD6bvKV8Gj8/yzSRJ4kAG8vsYaG8CdMNjmNivTttH8UZ292Z8HZY0bEiEsaiRSaGW aWUODVFmj/BrMJt56FAfJkFubIiAFtCJ9Fu2eOsICFH4qJ1WaFdLfhR4i1sDrt+lqWDM j+J1Dlz1pp1LlaTY+5QHfINUIsPbh7SQ1aJFYk6de3z68JtaZ202qTVhQ96Uufn4IOUR pACZKjs1JWA7j2rQIVnnVrg+sS8LyTulYGwgeR4VO+3CYeF5wYti+IunxX5KKQgVtyNs R+zE49BY1OU5q3oD0Zts3bBujBEpRq04mPGzk7G9S/IkdZeFLzSJAqYbud0WvlC6zh/k f8lQ== X-Gm-Message-State: AOAM531PaksPEQpxm7AN8pTMmy5qZj44/N7w7+fdV8VG8NMpVrAAW0JA pO78b6BNE+7Ys2//jeZ3bh7wwJl+4ZwmyYVudpO/q6/6 X-Google-Smtp-Source: ABdhPJz0WSjLviFMbTYhobSwbzS10IsVtSfTAn7K2FusAJqrBiPzJp+uW3IQAkgi90RvDE9aRInt1QcaphSoYNqR280= X-Received: by 2002:a05:6512:110a:: with SMTP id l10mr3005475lfg.550.1632059929359; Sun, 19 Sep 2021 06:58:49 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a05:651c:2115:0:0:0:0 with HTTP; Sun, 19 Sep 2021 06:58:48 -0700 (PDT) In-Reply-To: References: <202109181018.18IAIMfG066006@gitrepo.freebsd.org> From: Mateusz Guzik Date: Sun, 19 Sep 2021 15:58:48 +0200 Message-ID: Subject: Re: git: f902e4bb04ad - main - lockmgr: fix lock profiling of face adaptive spinning To: Mitchell Horne Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4HC8Rt4kccz3mvF X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2021 13:58:50 -0000 On 9/18/21, Mitchell Horne wrote: > On Sat, Sep 18, 2021 at 7:18 AM Mateusz Guzik wrote: >> >> The branch main has been updated by mjg: >> >> URL: >> https://cgit.FreeBSD.org/src/commit/?id=f902e4bb04ad717935a97ce1ae59e2dd389d940d >> >> commit f902e4bb04ad717935a97ce1ae59e2dd389d940d >> Author: Mateusz Guzik >> AuthorDate: 2021-09-11 18:23:51 +0000 >> Commit: Mateusz Guzik >> CommitDate: 2021-09-18 10:16:58 +0000 >> >> lockmgr: fix lock profiling of face adaptive spinning > > In what way was it broken? > If there was only spinning the time would fail to register. > Mitchell > >> --- >> sys/kern/kern_lock.c | 11 +++++++---- >> 1 file changed, 7 insertions(+), 4 deletions(-) >> >> diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c >> index bec49f29d162..2eb4feb7c4b5 100644 >> --- a/sys/kern/kern_lock.c >> +++ b/sys/kern/kern_lock.c >> @@ -631,6 +631,9 @@ lockmgr_slock_hard(struct lock *lk, u_int flags, >> struct lock_object *ilk, >> if (lockmgr_slock_try(lk, &x, flags, false)) >> break; >> >> + lock_profile_obtain_lock_failed(&lk->lock_object, false, >> + &contested, &waittime); >> + >> if ((flags & (LK_ADAPTIVE | LK_INTERLOCK)) == LK_ADAPTIVE) >> { >> if (lockmgr_slock_adaptive(&lda, lk, &x, flags)) >> continue; >> @@ -639,8 +642,6 @@ lockmgr_slock_hard(struct lock *lk, u_int flags, >> struct lock_object *ilk, >> #ifdef HWPMC_HOOKS >> PMC_SOFT_CALL( , , lock, failed); >> #endif >> - lock_profile_obtain_lock_failed(&lk->lock_object, false, >> - &contested, &waittime); >> >> /* >> * If the lock is expected to not sleep just give up >> @@ -845,6 +846,10 @@ lockmgr_xlock_hard(struct lock *lk, u_int flags, >> struct lock_object *ilk, >> break; >> continue; >> } >> + >> + lock_profile_obtain_lock_failed(&lk->lock_object, false, >> + &contested, &waittime); >> + >> if ((flags & (LK_ADAPTIVE | LK_INTERLOCK)) == LK_ADAPTIVE) >> { >> if (lockmgr_xlock_adaptive(&lda, lk, &x)) >> continue; >> @@ -852,8 +857,6 @@ lockmgr_xlock_hard(struct lock *lk, u_int flags, >> struct lock_object *ilk, >> #ifdef HWPMC_HOOKS >> PMC_SOFT_CALL( , , lock, failed); >> #endif >> - lock_profile_obtain_lock_failed(&lk->lock_object, false, >> - &contested, &waittime); >> >> /* >> * If the lock is expected to not sleep just give up > -- Mateusz Guzik From owner-dev-commits-src-all@freebsd.org Sun Sep 19 17:55:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 971A166EAB0; Sun, 19 Sep 2021 17:55:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HCFhd3vCCz3rQ2; Sun, 19 Sep 2021 17:55:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65BDE2166B; Sun, 19 Sep 2021 17:55:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18JHtDeu099695; Sun, 19 Sep 2021 17:55:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18JHtDFk099694; Sun, 19 Sep 2021 17:55:13 GMT (envelope-from git) Date: Sun, 19 Sep 2021 17:55:13 GMT Message-Id: <202109191755.18JHtDFk099694@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 4bda16ff184b - main - freebsd32: Provide an ANSI definition for freebsd32_recvmsg() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4bda16ff184bfca5ee4bf9709a06323d9cf5945b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2021 17:55:13 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4bda16ff184bfca5ee4bf9709a06323d9cf5945b commit 4bda16ff184bfca5ee4bf9709a06323d9cf5945b Author: Mark Johnston AuthorDate: 2021-09-19 17:41:43 +0000 Commit: Mark Johnston CommitDate: 2021-09-19 17:53:57 +0000 freebsd32: Provide an ANSI definition for freebsd32_recvmsg() Fix style in the freebsd32_sendmsg() definition. MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/compat/freebsd32/freebsd32_misc.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index f4b1edb6c7b0..be942f9fafd3 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -1411,13 +1411,7 @@ exit: } int -freebsd32_recvmsg(td, uap) - struct thread *td; - struct freebsd32_recvmsg_args /* { - int s; - struct msghdr32 *msg; - int flags; - } */ *uap; +freebsd32_recvmsg(struct thread *td, struct freebsd32_recvmsg_args *uap) { struct msghdr msg; struct msghdr32 m32; @@ -1562,8 +1556,7 @@ out: } int -freebsd32_sendmsg(struct thread *td, - struct freebsd32_sendmsg_args *uap) +freebsd32_sendmsg(struct thread *td, struct freebsd32_sendmsg_args *uap) { struct msghdr msg; struct msghdr32 m32; From owner-dev-commits-src-all@freebsd.org Sun Sep 19 17:55:14 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B2BBD66E8EB; Sun, 19 Sep 2021 17:55:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HCFhf4ZcLz3rZd; Sun, 19 Sep 2021 17:55:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EE272166C; Sun, 19 Sep 2021 17:55:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18JHtE98099719; Sun, 19 Sep 2021 17:55:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18JHtEo2099718; Sun, 19 Sep 2021 17:55:14 GMT (envelope-from git) Date: Sun, 19 Sep 2021 17:55:14 GMT Message-Id: <202109191755.18JHtEo2099718@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: fea1a98ead91 - main - freebsd32: Fix a double copyin in sendmsg() and recvmsg() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fea1a98ead918b39280b586773a923e76194400b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2021 17:55:14 -0000 The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=fea1a98ead918b39280b586773a923e76194400b commit fea1a98ead918b39280b586773a923e76194400b Author: Mark Johnston AuthorDate: 2021-09-19 17:45:09 +0000 Commit: Mark Johnston CommitDate: 2021-09-19 17:54:16 +0000 freebsd32: Fix a double copyin in sendmsg() and recvmsg() freebsd32_sendmsg() and freebsd32_recvmsg() both copyin the message header twice, once directly and once in freebsd32_copyinmsghdr(). The iovec length from the former is used when copying in msg_iov, but the rest of the kernel uses the iovec length from the latter. When kern_sendit() and kern_recvit() iterate over the iovec to compute the residual for I/O, they can therefore end up walking past the end of the copied in iovec, either resulting in a system call error, userspace memory corruption from uiomove() with invalid iovecs, or a kernel page fault if the copied-in iovec is followed by an unmapped KVA region. Reported by: syzbot+7cc64cd0c49605acd421@syzkaller.appspotmail.com Reviewed by: kib, emaste MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D32010 --- sys/compat/freebsd32/freebsd32_misc.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index be942f9fafd3..08941ebc5be9 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -1414,19 +1414,15 @@ int freebsd32_recvmsg(struct thread *td, struct freebsd32_recvmsg_args *uap) { struct msghdr msg; - struct msghdr32 m32; struct iovec *uiov, *iov; struct mbuf *control = NULL; struct mbuf **controlp; - int error; - error = copyin(uap->msg, &m32, sizeof(m32)); - if (error) - return (error); + error = freebsd32_copyinmsghdr(uap->msg, &msg); if (error) return (error); - error = freebsd32_copyiniov(PTRIN(m32.msg_iov), m32.msg_iovlen, &iov, + error = freebsd32_copyiniov((void *)msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE); if (error) return (error); @@ -1559,19 +1555,15 @@ int freebsd32_sendmsg(struct thread *td, struct freebsd32_sendmsg_args *uap) { struct msghdr msg; - struct msghdr32 m32; struct iovec *iov; struct mbuf *control = NULL; struct sockaddr *to = NULL; int error; - error = copyin(uap->msg, &m32, sizeof(m32)); - if (error) - return (error); error = freebsd32_copyinmsghdr(uap->msg, &msg); if (error) return (error); - error = freebsd32_copyiniov(PTRIN(m32.msg_iov), m32.msg_iovlen, &iov, + error = freebsd32_copyiniov((void *)msg.msg_iov, msg.msg_iovlen, &iov, EMSGSIZE); if (error) return (error); From owner-dev-commits-src-all@freebsd.org Sun Sep 19 18:08:28 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65E3566EC38; Sun, 19 Sep 2021 18:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HCFzw2J67z3wTl; Sun, 19 Sep 2021 18:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F4B1217D1; Sun, 19 Sep 2021 18:08:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18JI8SVB014636; Sun, 19 Sep 2021 18:08:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18JI8SHe014635; Sun, 19 Sep 2021 18:08:28 GMT (envelope-from git) Date: Sun, 19 Sep 2021 18:08:28 GMT Message-Id: <202109191808.18JI8SHe014635@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: e8144a13e075 - main - ciss(4): Properly handle data underrun. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e8144a13e075ff13c1f162690c7f14dd3f0a4862 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2021 18:08:28 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=e8144a13e075ff13c1f162690c7f14dd3f0a4862 commit e8144a13e075ff13c1f162690c7f14dd3f0a4862 Author: Alexander Motin AuthorDate: 2021-09-19 17:45:51 +0000 Commit: Alexander Motin CommitDate: 2021-09-19 18:08:22 +0000 ciss(4): Properly handle data underrun. For SCSI data underrun is a part of normal life. It should not be reported as error. This fixes MODE SENSE used by modern CAM. MFC after: 1 month --- sys/dev/ciss/ciss.c | 48 ++++++++++++++---------------------------------- 1 file changed, 14 insertions(+), 34 deletions(-) diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c index 74baf164b860..36d1225fbe4a 100644 --- a/sys/dev/ciss/ciss.c +++ b/sys/dev/ciss/ciss.c @@ -2331,13 +2331,15 @@ _ciss_report_request(struct ciss_request *cr, int *command_status, int *scsi_sta if (command_status != NULL) *command_status = ce->command_status; if (scsi_status != NULL) { - if (ce->command_status == CISS_CMD_STATUS_TARGET_STATUS) { + if (ce->command_status == CISS_CMD_STATUS_DATA_UNDERRUN) { + *scsi_status = SCSI_STATUS_OK; + } else if (ce->command_status == CISS_CMD_STATUS_TARGET_STATUS) { *scsi_status = ce->scsi_status; } else { *scsi_status = -1; } } - if (bootverbose) + if (bootverbose && ce->command_status != CISS_CMD_STATUS_DATA_UNDERRUN) ciss_printf(cr->cr_sc, "command status 0x%x (%s) scsi status 0x%x\n", ce->command_status, ciss_name_command_status(ce->command_status), ce->scsi_status); @@ -3311,28 +3313,17 @@ ciss_cam_complete(struct ciss_request *cr) * Extract status values from request. */ ciss_report_request(cr, &command_status, &scsi_status); - csio->scsi_status = scsi_status; - - /* - * Handle specific SCSI status values. - */ - switch(scsi_status) { - /* no status due to adapter error */ - case -1: - debug(0, "adapter error"); - csio->ccb_h.status |= CAM_REQ_CMP_ERR; - break; - - /* no status due to command completed OK */ - case SCSI_STATUS_OK: /* CISS_SCSI_STATUS_GOOD */ + switch(command_status) { + case CISS_CMD_STATUS_DATA_UNDERRUN: + csio->resid = ce->residual_count; + /* FALLTHROUGH */ + case CISS_CMD_STATUS_SUCCESS: + csio->scsi_status = scsi_status; debug(2, "SCSI_STATUS_OK"); csio->ccb_h.status |= CAM_REQ_CMP; break; - - /* check condition, sense data included */ - case SCSI_STATUS_CHECK_COND: /* CISS_SCSI_STATUS_CHECK_CONDITION */ - debug(0, "SCSI_STATUS_CHECK_COND sense size %d resid %d\n", - ce->sense_length, ce->residual_count); + case CISS_CMD_STATUS_TARGET_STATUS: + csio->scsi_status = scsi_status; bzero(&csio->sense_data, SSD_FULL_SIZE); bcopy(&ce->sense_info[0], &csio->sense_data, ce->sense_length); if (csio->sense_len > ce->sense_length) @@ -3341,22 +3332,11 @@ ciss_cam_complete(struct ciss_request *cr) csio->sense_resid = 0; csio->resid = ce->residual_count; csio->ccb_h.status |= CAM_SCSI_STATUS_ERROR | CAM_AUTOSNS_VALID; -#ifdef CISS_DEBUG - { - struct scsi_sense_data *sns = (struct scsi_sense_data *)&ce->sense_info[0]; - debug(0, "sense key %x", scsi_get_sense_key(sns, csio->sense_len - - csio->sense_resid, /*show_errors*/ 1)); - } -#endif break; - - case SCSI_STATUS_BUSY: /* CISS_SCSI_STATUS_BUSY */ - debug(0, "SCSI_STATUS_BUSY"); - csio->ccb_h.status |= CAM_SCSI_BUSY; + case CISS_CMD_STATUS_DATA_OVERRUN: + csio->ccb_h.status |= CAM_DATA_RUN_ERR; break; - default: - debug(0, "unknown status 0x%x", csio->scsi_status); csio->ccb_h.status |= CAM_REQ_CMP_ERR; break; } From owner-dev-commits-src-all@freebsd.org Sun Sep 19 18:08:29 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8CEF266EE81; Sun, 19 Sep 2021 18:08:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HCFzx3Rmfz4QrM; Sun, 19 Sep 2021 18:08:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50EA7217D2; Sun, 19 Sep 2021 18:08:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18JI8Tio014660; Sun, 19 Sep 2021 18:08:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18JI8TI6014659; Sun, 19 Sep 2021 18:08:29 GMT (envelope-from git) Date: Sun, 19 Sep 2021 18:08:29 GMT Message-Id: <202109191808.18JI8TI6014659@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 5f8cb13cfb0c - main - ciss(4): Fix typo. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f8cb13cfb0c91a4ec1a9648a3ae245b1dff36f6 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2021 18:08:29 -0000 The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=5f8cb13cfb0c91a4ec1a9648a3ae245b1dff36f6 commit 5f8cb13cfb0c91a4ec1a9648a3ae245b1dff36f6 Author: Alexander Motin AuthorDate: 2021-09-19 18:01:40 +0000 Commit: Alexander Motin CommitDate: 2021-09-19 18:08:22 +0000 ciss(4): Fix typo. --- sys/dev/ciss/ciss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c index 36d1225fbe4a..d87f32610b20 100644 --- a/sys/dev/ciss/ciss.c +++ b/sys/dev/ciss/ciss.c @@ -1283,7 +1283,7 @@ ciss_identify_adapter(struct ciss_softc *sc) "\20\1ultra2\2ultra3\10fibre1\11fibre2\n"); ciss_printf(sc, " server name '%.16s'\n", sc->ciss_cfg->server_name); ciss_printf(sc, " heartbeat 0x%x\n", sc->ciss_cfg->heartbeat); - ciss_printf(sc, " max logical logical volumes: %d\n", sc->ciss_cfg->max_logical_supported); + ciss_printf(sc, " max logical volumes: %d\n", sc->ciss_cfg->max_logical_supported); ciss_printf(sc, " max physical disks supported: %d\n", sc->ciss_cfg->max_physical_supported); ciss_printf(sc, " max physical disks per logical volume: %d\n", sc->ciss_cfg->max_physical_per_logical); ciss_printf(sc, " JBOD Support is %s\n", (sc->ciss_id->uiYetMoreControllerFlags & YMORE_CONTROLLER_FLAGS_JBOD_SUPPORTED) ? From owner-dev-commits-src-all@freebsd.org Sun Sep 19 18:31:41 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 61C7866F594; Sun, 19 Sep 2021 18:31:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HCGVj2LKrz4X5b; Sun, 19 Sep 2021 18:31:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 312AA22068; Sun, 19 Sep 2021 18:31:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18JIVfe5053295; Sun, 19 Sep 2021 18:31:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18JIVfIW053294; Sun, 19 Sep 2021 18:31:41 GMT (envelope-from git) Date: Sun, 19 Sep 2021 18:31:41 GMT Message-Id: <202109191831.18JIVfIW053294@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: bd3a668087ef - main - vm_page_startup: correct calculation of the starting page MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bd3a668087efb02e8e84315f7cc29d3813270dff Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2021 18:31:41 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bd3a668087efb02e8e84315f7cc29d3813270dff commit bd3a668087efb02e8e84315f7cc29d3813270dff Author: Konstantin Belousov AuthorDate: 2021-09-17 18:48:42 +0000 Commit: Konstantin Belousov CommitDate: 2021-09-19 18:27:55 +0000 vm_page_startup: correct calculation of the starting page Also avoid unneded calculations when phys segment end is the phys_avail[] start. Submitted by: alc Reviewed by: markj MFC after: 1 week Fixes: 181bfb42fd01bfa9f46 Differential revision: https://reviews.freebsd.org/D32009 --- sys/vm/vm_page.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index d2e94ced6766..25e6dce32aa6 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -775,27 +775,25 @@ vm_page_startup(vm_offset_t vaddr) * phys_avail's ranges to the free lists. */ for (i = 0; phys_avail[i + 1] != 0; i += 2) { - if (seg->end < phys_avail[i] || + if (seg->end <= phys_avail[i] || seg->start >= phys_avail[i + 1]) continue; startp = MAX(seg->start, phys_avail[i]); - m = seg->first_page + atop(seg->start - startp); endp = MIN(seg->end, phys_avail[i + 1]); pagecount = (u_long)atop(endp - startp); if (pagecount == 0) continue; + m = seg->first_page + atop(startp - seg->start); vmd = VM_DOMAIN(seg->domain); vm_domain_free_lock(vmd); vm_phys_enqueue_contig(m, pagecount); vm_domain_free_unlock(vmd); vm_domain_freecnt_inc(vmd, pagecount); vm_cnt.v_page_count += (u_int)pagecount; - - vmd = VM_DOMAIN(seg->domain); vmd->vmd_page_count += (u_int)pagecount; - vmd->vmd_segs |= 1UL << m->segind; + vmd->vmd_segs |= 1UL << segind; } } From owner-dev-commits-src-all@freebsd.org Sun Sep 19 22:26:20 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E7C0D672A32; Sun, 19 Sep 2021 22:26:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HCMjS5zYbz4h45; Sun, 19 Sep 2021 22:26:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A967B25026; Sun, 19 Sep 2021 22:26:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18JMQKXk061693; Sun, 19 Sep 2021 22:26:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18JMQKbU061692; Sun, 19 Sep 2021 22:26:20 GMT (envelope-from git) Date: Sun, 19 Sep 2021 22:26:20 GMT Message-Id: <202109192226.18JMQKbU061692@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 5a01dea7e8c9 - main - style: Fix leading whitespace in bcache.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5a01dea7e8c9640605e5731a9fc7f600c07ace61 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Sep 2021 22:26:21 -0000 The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=5a01dea7e8c9640605e5731a9fc7f600c07ace61 commit 5a01dea7e8c9640605e5731a9fc7f600c07ace61 Author: Colin Percival AuthorDate: 2021-09-19 22:24:00 +0000 Commit: Colin Percival CommitDate: 2021-09-19 22:24:00 +0000 style: Fix leading whitespace in bcache.c MFC after: 2 weeks X-MFC-with: Further bcache changes to come --- stand/common/bcache.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stand/common/bcache.c b/stand/common/bcache.c index 526f9fe3fa5c..0eeb7e74ee96 100644 --- a/stand/common/bcache.c +++ b/stand/common/bcache.c @@ -246,12 +246,12 @@ read_strategy(void *devdata, int rw, daddr_t blk, size_t size, } } - if (complete) { /* whole set was in cache, return it */ + if (complete) { /* whole set was in cache, return it */ if (bc->ra < BCACHE_READAHEAD) bc->ra <<= 1; /* increase read ahead */ bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)), buf, size); goto done; - } + } /* * Fill in any misses. From check we have i pointing to first missing @@ -351,7 +351,7 @@ read_strategy(void *devdata, int rw, daddr_t blk, size_t size, result = 0; } - done: +done: if (result == 0) { if (rsize != NULL) *rsize = size;