From owner-dev-commits-src-branches@freebsd.org Mon Sep 13 01:13:16 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Mon Sep 13 01:13:17 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Mon Sep 13 01:16:05 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Mon Sep 13 01:16:06 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Mon Sep 13 01:17:10 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Mon Sep 13 14:40:41 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Mon Sep 13 14:40:42 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Mon Sep 13 14:48:06 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Mon Sep 13 14:52:56 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Mon Sep 13 21:13:00 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Mon Sep 13 21:13:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Mon Sep 13 21:13:04 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Mon Sep 13 21:13:05 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Mon Sep 13 21:13:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Mon Sep 13 21:13:03 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Mon Sep 13 21:13:07 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Mon Sep 13 21:13:07 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Mon Sep 13 21:13:09 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:04 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:06 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:07 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:10 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:41:09 -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-branches@freebsd.org Tue Sep 14 00:41:12 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:11 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:15 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:15 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:17 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:13 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:22 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:19 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:21 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:27 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:30 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:20 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:24 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:27 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:28 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:32 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:35 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:36 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:38 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:36 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:41:40 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:48:00 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:48:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:48:02 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:48:04 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:48:03 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:03 -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-branches@freebsd.org Tue Sep 14 00:48:06 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:48:07 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:48:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:48:09 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:48:10 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:48:12 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:48:14 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:48:15 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:48:16 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:48:12 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:48:23 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:48:18 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:48:17 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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=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-branches@freebsd.org Tue Sep 14 00:48:22 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:48:21 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:48:25 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 00:48:25 -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-branches@freebsd.org Tue Sep 14 00:48:22 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:48:29 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:48:30 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:48:27 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:48:27 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:48:28 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 00:50:15 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 12:52:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 12:52:10 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 12:52:11 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 12:52:12 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 12:52:14 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 12:52:13 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 12:52:17 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 12:52:17 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 20:01:15 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 20:01:16 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 20:01:19 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 20:01:17 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 20:01:21 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 20:01:19 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 20:01:32 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 20:01:33 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 20:01:36 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 20:01:38 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 20:01:37 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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=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-branches@freebsd.org Tue Sep 14 20:01:39 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 20:01:40 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 20:01:41 -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-branches@freebsd.org Tue Sep 14 20:01:42 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 20:01:44 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 20:01:45 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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=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-branches@freebsd.org Tue Sep 14 20:01:47 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Tue Sep 14 20:01:49 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Wed Sep 15 01:32:41 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Wed Sep 15 01:33:04 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Wed Sep 15 01:44:09 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Wed Sep 15 01:53:16 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Wed Sep 15 02:03:30 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Wed Sep 15 02:03:31 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Wed Sep 15 03:08:43 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Wed Sep 15 03:08:44 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Wed Sep 15 03:10:59 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F3386765A0 for ; Wed, 15 Sep 2021 03:10:59 +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 4H8QGC2MF8z4RQc for ; Wed, 15 Sep 2021 03:10:56 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: (qmail 57340 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: 4H8QGC2MF8z4RQc 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:14618, ipnet:54.86.0.0/16, country:US] X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Sep 2021 03:10:59 -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-branches@freebsd.org Wed Sep 15 10:31:31 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Wed Sep 15 10:32:40 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Wed Sep 15 13:09:42 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Wed Sep 15 13:09:43 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Wed Sep 15 15:39:57 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Wed Sep 15 15:39:59 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Wed Sep 15 23:05:16 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Thu Sep 16 01:43:43 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Thu Sep 16 01:44:13 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Thu Sep 16 11:21:08 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Thu Sep 16 11:21:09 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Thu Sep 16 11:21:11 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Thu Sep 16 11:21:11 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Thu Sep 16 12:41:39 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Thu Sep 16 12:41:40 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Thu Sep 16 13:50:45 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Fri Sep 17 00:35:52 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Fri Sep 17 00:36:17 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Fri Sep 17 01:39:10 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Fri Sep 17 01:39:23 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Fri Sep 17 01:40:17 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Fri Sep 17 13:14:33 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Fri Sep 17 13:14:34 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Fri Sep 17 13:14:36 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Fri Sep 17 17:53:52 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Fri Sep 17 17:53:53 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Fri Sep 17 17:53:54 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Fri Sep 17 17:53:55 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Fri Sep 17 17:53:56 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Fri Sep 17 17:53:55 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Fri Sep 17 17:53:58 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Fri Sep 17 17:53:56 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Fri Sep 17 23:08:32 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Fri Sep 17 23:10:06 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Sat Sep 18 00:38:55 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Sat Sep 18 00:39:39 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Sat Sep 18 17:40:01 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Sat Sep 18 17:40:03 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Sat Sep 18 17:40:04 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Sat Sep 18 21:33:00 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Sun Sep 19 08:17:19 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Sun Sep 19 08:17:44 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Sun Sep 19 11:18:37 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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-branches@freebsd.org Sun Sep 19 11:20:16 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org 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-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD 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); } }