From owner-svn-src-stable@freebsd.org Fri Sep 21 23:31:06 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3011110A7154; Fri, 21 Sep 2018 23:31:06 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9B1B755DE; Fri, 21 Sep 2018 23:31:05 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D48F313B93; Fri, 21 Sep 2018 23:31:05 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w8LNV5Rb071613; Fri, 21 Sep 2018 23:31:05 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w8LNV5C5071609; Fri, 21 Sep 2018 23:31:05 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201809212331.w8LNV5C5071609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Fri, 21 Sep 2018 23:31:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r338871 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 338871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Sep 2018 23:31:06 -0000 Author: erj Date: Fri Sep 21 23:31:04 2018 New Revision: 338871 URL: https://svnweb.freebsd.org/changeset/base/338871 Log: MFC r334231, r334779, r335322, and r338208 to stable/11 from head These include: r334231: iflib: Add new shared flag: IFLIB_ADMIN_ALWAYS_RUN r334779: iflib: Record TCP checksum info in iflib when TCP checksum is requested r335322: iflib: Style fixes r338208: if_media: Add new 2.5G/5G/25G/40G/50G/100G/200G/400G media types Sponsored by: Intel Corporation Modified: stable/11/sys/net/ieee8023ad_lacp.c stable/11/sys/net/if_media.h stable/11/sys/net/iflib.c stable/11/sys/net/iflib.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/ieee8023ad_lacp.c ============================================================================== --- stable/11/sys/net/ieee8023ad_lacp.c Fri Sep 21 22:26:00 2018 (r338870) +++ stable/11/sys/net/ieee8023ad_lacp.c Fri Sep 21 23:31:04 2018 (r338871) @@ -1071,6 +1071,7 @@ lacp_compose_key(struct lacp_port *lp) case IFM_100_VG: case IFM_100_T2: case IFM_100_T: + case IFM_100_SGMII: key = IFM_100_TX; break; case IFM_1000_SX: @@ -1102,14 +1103,31 @@ lacp_compose_key(struct lacp_port *lp) break; case IFM_2500_KX: case IFM_2500_T: + case IFM_2500_X: key = IFM_2500_KX; break; case IFM_5000_T: + case IFM_5000_KR: + case IFM_5000_KR_S: + case IFM_5000_KR1: key = IFM_5000_T; break; case IFM_50G_PCIE: case IFM_50G_CR2: case IFM_50G_KR2: + case IFM_50G_SR2: + case IFM_50G_LR2: + case IFM_50G_LAUI2_AC: + case IFM_50G_LAUI2: + case IFM_50G_AUI2_AC: + case IFM_50G_AUI2: + case IFM_50G_CP: + case IFM_50G_SR: + case IFM_50G_LR: + case IFM_50G_FR: + case IFM_50G_KR_PAM4: + case IFM_50G_AUI1_AC: + case IFM_50G_AUI1: key = IFM_50G_PCIE; break; case IFM_56G_R4: @@ -1122,6 +1140,12 @@ lacp_compose_key(struct lacp_port *lp) case IFM_25G_LR: case IFM_25G_ACC: case IFM_25G_AOC: + case IFM_25G_T: + case IFM_25G_CR_S: + case IFM_25G_CR1: + case IFM_25G_KR_S: + case IFM_25G_AUI: + case IFM_25G_KR1: key = IFM_25G_PCIE; break; case IFM_40G_CR4: @@ -1129,13 +1153,49 @@ lacp_compose_key(struct lacp_port *lp) case IFM_40G_LR4: case IFM_40G_XLPPI: case IFM_40G_KR4: + case IFM_40G_XLAUI: + case IFM_40G_XLAUI_AC: + case IFM_40G_ER4: key = IFM_40G_CR4; break; case IFM_100G_CR4: case IFM_100G_SR4: case IFM_100G_KR4: case IFM_100G_LR4: + case IFM_100G_CAUI4_AC: + case IFM_100G_CAUI4: + case IFM_100G_AUI4_AC: + case IFM_100G_AUI4: + case IFM_100G_CR_PAM4: + case IFM_100G_KR_PAM4: + case IFM_100G_CP2: + case IFM_100G_SR2: + case IFM_100G_DR: + case IFM_100G_KR2_PAM4: + case IFM_100G_CAUI2_AC: + case IFM_100G_CAUI2: + case IFM_100G_AUI2_AC: + case IFM_100G_AUI2: key = IFM_100G_CR4; + break; + case IFM_200G_CR4_PAM4: + case IFM_200G_SR4: + case IFM_200G_FR4: + case IFM_200G_LR4: + case IFM_200G_DR4: + case IFM_200G_KR4_PAM4: + case IFM_200G_AUI4_AC: + case IFM_200G_AUI4: + case IFM_200G_AUI8_AC: + case IFM_200G_AUI8: + key = IFM_200G_CR4_PAM4; + break; + case IFM_400G_FR8: + case IFM_400G_LR8: + case IFM_400G_DR4: + case IFM_400G_AUI8_AC: + case IFM_400G_AUI8: + key = IFM_400G_FR8; break; default: key = subtype; Modified: stable/11/sys/net/if_media.h ============================================================================== --- stable/11/sys/net/if_media.h Fri Sep 21 22:26:00 2018 (r338870) +++ stable/11/sys/net/if_media.h Fri Sep 21 23:31:04 2018 (r338871) @@ -200,6 +200,62 @@ uint64_t ifmedia_baudrate(int); #define IFM_10G_AOC IFM_X(59) /* 10G active optical cable */ #define IFM_25G_ACC IFM_X(60) /* 25G active copper cable */ #define IFM_25G_AOC IFM_X(61) /* 25G active optical cable */ +#define IFM_100_SGMII IFM_X(62) /* 100M media interface */ +#define IFM_2500_X IFM_X(63) /* 2500BaseX */ +#define IFM_5000_KR IFM_X(64) /* 5GBase-KR backplane */ +#define IFM_25G_T IFM_X(65) /* 25GBase-T - RJ45 */ +#define IFM_25G_CR_S IFM_X(66) /* 25GBase-CR (short) */ +#define IFM_25G_CR1 IFM_X(67) /* 25GBase-CR1 DA cable */ +#define IFM_25G_KR_S IFM_X(68) /* 25GBase-KR (short) */ +#define IFM_5000_KR_S IFM_X(69) /* 5GBase-KR backplane (short) */ +#define IFM_5000_KR1 IFM_X(70) /* 5GBase-KR backplane */ +#define IFM_25G_AUI IFM_X(71) /* 25G-AUI-C2C (chip to chip) */ +#define IFM_40G_XLAUI IFM_X(72) /* 40G-XLAUI */ +#define IFM_40G_XLAUI_AC IFM_X(73) /* 40G active copper/optical */ +#define IFM_40G_ER4 IFM_X(74) /* 40GBase-ER4 */ +#define IFM_50G_SR2 IFM_X(75) /* 50GBase-SR2 */ +#define IFM_50G_LR2 IFM_X(76) /* 50GBase-LR2 */ +#define IFM_50G_LAUI2_AC IFM_X(77) /* 50G active copper/optical */ +#define IFM_50G_LAUI2 IFM_X(78) /* 50G-LAUI2 */ +#define IFM_50G_AUI2_AC IFM_X(79) /* 50G active copper/optical */ +#define IFM_50G_AUI2 IFM_X(80) /* 50G-AUI2 */ +#define IFM_50G_CP IFM_X(81) /* 50GBase-CP */ +#define IFM_50G_SR IFM_X(82) /* 50GBase-SR */ +#define IFM_50G_LR IFM_X(83) /* 50GBase-LR */ +#define IFM_50G_FR IFM_X(84) /* 50GBase-FR */ +#define IFM_50G_KR_PAM4 IFM_X(85) /* 50GBase-KR PAM4 */ +#define IFM_25G_KR1 IFM_X(86) /* 25GBase-KR1 */ +#define IFM_50G_AUI1_AC IFM_X(87) /* 50G active copper/optical */ +#define IFM_50G_AUI1 IFM_X(88) /* 50G-AUI1 */ +#define IFM_100G_CAUI4_AC IFM_X(89) /* 100G-CAUI4 active copper/optical */ +#define IFM_100G_CAUI4 IFM_X(90) /* 100G-CAUI4 */ +#define IFM_100G_AUI4_AC IFM_X(91) /* 100G-AUI4 active copper/optical */ +#define IFM_100G_AUI4 IFM_X(92) /* 100G-AUI4 */ +#define IFM_100G_CR_PAM4 IFM_X(93) /* 100GBase-CR PAM4 */ +#define IFM_100G_KR_PAM4 IFM_X(94) /* 100GBase-CR PAM4 */ +#define IFM_100G_CP2 IFM_X(95) /* 100GBase-CP2 */ +#define IFM_100G_SR2 IFM_X(96) /* 100GBase-SR2 */ +#define IFM_100G_DR IFM_X(97) /* 100GBase-DR */ +#define IFM_100G_KR2_PAM4 IFM_X(98) /* 100GBase-KR2 PAM4 */ +#define IFM_100G_CAUI2_AC IFM_X(99) /* 100G-CAUI2 active copper/optical */ +#define IFM_100G_CAUI2 IFM_X(100) /* 100G-CAUI2 */ +#define IFM_100G_AUI2_AC IFM_X(101) /* 100G-AUI2 active copper/optical */ +#define IFM_100G_AUI2 IFM_X(102) /* 100G-AUI2 */ +#define IFM_200G_CR4_PAM4 IFM_X(103) /* 200GBase-CR4 PAM4 */ +#define IFM_200G_SR4 IFM_X(104) /* 200GBase-SR4 */ +#define IFM_200G_FR4 IFM_X(105) /* 200GBase-FR4 */ +#define IFM_200G_LR4 IFM_X(106) /* 200GBase-LR4 */ +#define IFM_200G_DR4 IFM_X(107) /* 200GBase-DR4 */ +#define IFM_200G_KR4_PAM4 IFM_X(108) /* 200GBase-KR4 PAM4 */ +#define IFM_200G_AUI4_AC IFM_X(109) /* 200G-AUI4 active copper/optical */ +#define IFM_200G_AUI4 IFM_X(110) /* 200G-AUI4 */ +#define IFM_200G_AUI8_AC IFM_X(111) /* 200G-AUI8 active copper/optical */ +#define IFM_200G_AUI8 IFM_X(112) /* 200G-AUI8 */ +#define IFM_400G_FR8 IFM_X(113) /* 400GBase-FR8 */ +#define IFM_400G_LR8 IFM_X(114) /* 400GBase-LR8 */ +#define IFM_400G_DR4 IFM_X(115) /* 400GBase-DR4 */ +#define IFM_400G_AUI8_AC IFM_X(116) /* 400G-AUI8 active copper/optical */ +#define IFM_400G_AUI8 IFM_X(117) /* 400G-AUI8 */ /* * Please update ieee8023ad_lacp.c:lacp_compose_key() @@ -455,6 +511,62 @@ struct ifmedia_description { { IFM_10G_AOC, "10GBase-AOC" }, \ { IFM_25G_ACC, "25GBase-ACC" }, \ { IFM_25G_AOC, "25GBase-AOC" }, \ + { IFM_100_SGMII, "100M-SGMII" }, \ + { IFM_2500_X, "2500Base-X" }, \ + { IFM_5000_KR, "5000Base-KR" }, \ + { IFM_25G_T, "25GBase-T" }, \ + { IFM_25G_CR_S, "25GBase-CR-S" }, \ + { IFM_25G_CR1, "25GBase-CR1" }, \ + { IFM_25G_KR_S, "25GBase-KR-S" }, \ + { IFM_5000_KR_S, "5000Base-KR-S" }, \ + { IFM_5000_KR1, "5000Base-KR1" }, \ + { IFM_25G_AUI, "25G-AUI" }, \ + { IFM_40G_XLAUI, "40G-XLAUI" }, \ + { IFM_40G_XLAUI_AC, "40G-XLAUI-AC" }, \ + { IFM_40G_ER4, "40GBase-ER4" }, \ + { IFM_50G_SR2, "50GBase-SR2" }, \ + { IFM_50G_LR2, "50GBase-LR2" }, \ + { IFM_50G_LAUI2_AC, "50G-LAUI2-AC" }, \ + { IFM_50G_LAUI2, "50G-LAUI2" }, \ + { IFM_50G_AUI2_AC, "50G-AUI2-AC" }, \ + { IFM_50G_AUI2, "50G-AUI2" }, \ + { IFM_50G_CP, "50GBase-CP" }, \ + { IFM_50G_SR, "50GBase-SR" }, \ + { IFM_50G_LR, "50GBase-LR" }, \ + { IFM_50G_FR, "50GBase-FR" }, \ + { IFM_50G_KR_PAM4, "50GBase-KR-PAM4" }, \ + { IFM_25G_KR1, "25GBase-KR1" }, \ + { IFM_50G_AUI1_AC, "50G-AUI1-AC" }, \ + { IFM_50G_AUI1, "50G-AUI1" }, \ + { IFM_100G_CAUI4_AC, "100G-CAUI4-AC" }, \ + { IFM_100G_CAUI4, "100G-CAUI4" }, \ + { IFM_100G_AUI4_AC, "100G-AUI4-AC" }, \ + { IFM_100G_AUI4, "100G-AUI4" }, \ + { IFM_100G_CR_PAM4, "100GBase-CR-PAM4" }, \ + { IFM_100G_KR_PAM4, "100GBase-KR-PAM4" }, \ + { IFM_100G_CP2, "100GBase-CP2" }, \ + { IFM_100G_SR2, "100GBase-SR2" }, \ + { IFM_100G_DR, "100GBase-DR" }, \ + { IFM_100G_KR2_PAM4, "100GBase-KR2-PAM4" }, \ + { IFM_100G_CAUI2_AC, "100G-CAUI2-AC" }, \ + { IFM_100G_CAUI2, "100G-CAUI2" }, \ + { IFM_100G_AUI2_AC, "100G-AUI2-AC" }, \ + { IFM_100G_AUI2, "100G-AUI2" }, \ + { IFM_200G_CR4_PAM4, "200GBase-CR4-PAM4" }, \ + { IFM_200G_SR4, "200GBase-SR4" }, \ + { IFM_200G_FR4, "200GBase-FR4" }, \ + { IFM_200G_LR4, "200GBase-LR4" }, \ + { IFM_200G_DR4, "200GBase-DR4" }, \ + { IFM_200G_KR4_PAM4, "200GBase-KR4-PAM4" }, \ + { IFM_200G_AUI4_AC, "200G-AUI4-AC" }, \ + { IFM_200G_AUI4, "200G-AUI4" }, \ + { IFM_200G_AUI8_AC, "200G-AUI8-AC" }, \ + { IFM_200G_AUI8, "200G-AUI8" }, \ + { IFM_400G_FR8, "400GBase-FR8" }, \ + { IFM_400G_LR8, "400GBase-LR8" }, \ + { IFM_400G_DR4, "400GBase-DR4" }, \ + { IFM_400G_AUI8_AC, "400G-AUI8-AC" }, \ + { IFM_400G_AUI8, "400G-AUI8" }, \ { 0, NULL }, \ } @@ -787,6 +899,62 @@ struct ifmedia_baudrate { { IFM_ETHER | IFM_10G_AOC, IF_Gbps(10ULL) }, \ { IFM_ETHER | IFM_25G_ACC, IF_Gbps(25ULL) }, \ { IFM_ETHER | IFM_25G_AOC, IF_Gbps(25ULL) }, \ + { IFM_ETHER | IFM_100_SGMII, IF_Mbps(100) }, \ + { IFM_ETHER | IFM_2500_X, IF_Mbps(2500ULL) }, \ + { IFM_ETHER | IFM_5000_KR, IF_Mbps(5000ULL) }, \ + { IFM_ETHER | IFM_25G_T, IF_Gbps(25ULL) }, \ + { IFM_ETHER | IFM_25G_CR_S, IF_Gbps(25ULL) }, \ + { IFM_ETHER | IFM_25G_CR1, IF_Gbps(25ULL) }, \ + { IFM_ETHER | IFM_25G_KR_S, IF_Gbps(25ULL) }, \ + { IFM_ETHER | IFM_5000_KR_S, IF_Mbps(5000ULL) }, \ + { IFM_ETHER | IFM_5000_KR1, IF_Mbps(5000ULL) }, \ + { IFM_ETHER | IFM_25G_AUI, IF_Gbps(25ULL) }, \ + { IFM_ETHER | IFM_40G_XLAUI, IF_Gbps(40ULL) }, \ + { IFM_ETHER | IFM_40G_XLAUI_AC, IF_Gbps(40ULL) }, \ + { IFM_ETHER | IFM_40G_ER4, IF_Gbps(40ULL) }, \ + { IFM_ETHER | IFM_50G_SR2, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_50G_LR2, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_50G_LAUI2_AC, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_50G_LAUI2, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_50G_AUI2_AC, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_50G_AUI2, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_50G_CP, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_50G_SR, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_50G_LR, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_50G_FR, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_50G_KR_PAM4, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_25G_KR1, IF_Gbps(25ULL) }, \ + { IFM_ETHER | IFM_50G_AUI1_AC, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_50G_AUI1, IF_Gbps(50ULL) }, \ + { IFM_ETHER | IFM_100G_CAUI4_AC, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_CAUI4, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_AUI4_AC, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_AUI4, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_CR_PAM4, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_KR_PAM4, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_CP2, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_SR2, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_DR, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_KR2_PAM4, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_CAUI2_AC, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_CAUI2, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_AUI2_AC, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_100G_AUI2, IF_Gbps(100ULL) }, \ + { IFM_ETHER | IFM_200G_CR4_PAM4, IF_Gbps(200ULL) }, \ + { IFM_ETHER | IFM_200G_SR4, IF_Gbps(200ULL) }, \ + { IFM_ETHER | IFM_200G_FR4, IF_Gbps(200ULL) }, \ + { IFM_ETHER | IFM_200G_LR4, IF_Gbps(200ULL) }, \ + { IFM_ETHER | IFM_200G_DR4, IF_Gbps(200ULL) }, \ + { IFM_ETHER | IFM_200G_KR4_PAM4, IF_Gbps(200ULL) }, \ + { IFM_ETHER | IFM_200G_AUI4_AC, IF_Gbps(200ULL) }, \ + { IFM_ETHER | IFM_200G_AUI4, IF_Gbps(200ULL) }, \ + { IFM_ETHER | IFM_200G_AUI8_AC, IF_Gbps(200ULL) }, \ + { IFM_ETHER | IFM_200G_AUI8, IF_Gbps(200ULL) }, \ + { IFM_ETHER | IFM_400G_FR8, IF_Gbps(400ULL) }, \ + { IFM_ETHER | IFM_400G_LR8, IF_Gbps(400ULL) }, \ + { IFM_ETHER | IFM_400G_DR4, IF_Gbps(400ULL) }, \ + { IFM_ETHER | IFM_400G_AUI8_AC, IF_Gbps(400ULL) }, \ + { IFM_ETHER | IFM_400G_AUI8, IF_Gbps(400ULL) }, \ \ { IFM_TOKEN | IFM_TOK_STP4, IF_Mbps(4) }, \ { IFM_TOKEN | IFM_TOK_STP16, IF_Mbps(16) }, \ Modified: stable/11/sys/net/iflib.c ============================================================================== --- stable/11/sys/net/iflib.c Fri Sep 21 22:26:00 2018 (r338870) +++ stable/11/sys/net/iflib.c Fri Sep 21 23:31:04 2018 (r338871) @@ -2192,7 +2192,7 @@ iflib_init_locked(if_ctx_t ctx) } } } - done: +done: if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_RUNNING, IFF_DRV_OACTIVE); IFDI_INTR_ENABLE(ctx); txq = ctx->ifc_txqs; @@ -2739,7 +2739,9 @@ print_pkt(if_pkt_info_t pi) #endif #define IS_TSO4(pi) ((pi)->ipi_csum_flags & CSUM_IP_TSO) +#define IS_TX_OFFLOAD4(pi) ((pi)->ipi_csum_flags & (CSUM_IP_TCP | CSUM_IP_TSO)) #define IS_TSO6(pi) ((pi)->ipi_csum_flags & CSUM_IP6_TSO) +#define IS_TX_OFFLOAD6(pi) ((pi)->ipi_csum_flags & (CSUM_IP6_TCP | CSUM_IP6_TSO)) static int iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, struct mbuf **mp) @@ -2825,8 +2827,9 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, if ((sctx->isc_flags & IFLIB_NEED_ZERO_CSUM) && (pi->ipi_csum_flags & CSUM_IP)) ip->ip_sum = 0; - if (IS_TSO4(pi)) { - if (pi->ipi_ipproto == IPPROTO_TCP) { + /* TCP checksum offload may require TCP header length */ + if (IS_TX_OFFLOAD4(pi)) { + if (__predict_true(pi->ipi_ipproto == IPPROTO_TCP)) { if (__predict_false(th == NULL)) { txq->ift_pullups++; if (__predict_false((m = m_pullup(m, (ip->ip_hl << 2) + sizeof(*th))) == NULL)) @@ -2837,14 +2840,16 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, pi->ipi_tcp_hlen = th->th_off << 2; pi->ipi_tcp_seq = th->th_seq; } - if (__predict_false(ip->ip_p != IPPROTO_TCP)) - return (ENXIO); - th->th_sum = in_pseudo(ip->ip_src.s_addr, - ip->ip_dst.s_addr, htons(IPPROTO_TCP)); - pi->ipi_tso_segsz = m->m_pkthdr.tso_segsz; - if (sctx->isc_flags & IFLIB_TSO_INIT_IP) { - ip->ip_sum = 0; - ip->ip_len = htons(pi->ipi_ip_hlen + pi->ipi_tcp_hlen + pi->ipi_tso_segsz); + if (IS_TSO4(pi)) { + if (__predict_false(ip->ip_p != IPPROTO_TCP)) + return (ENXIO); + th->th_sum = in_pseudo(ip->ip_src.s_addr, + ip->ip_dst.s_addr, htons(IPPROTO_TCP)); + pi->ipi_tso_segsz = m->m_pkthdr.tso_segsz; + if (sctx->isc_flags & IFLIB_TSO_INIT_IP) { + ip->ip_sum = 0; + ip->ip_len = htons(pi->ipi_ip_hlen + pi->ipi_tcp_hlen + pi->ipi_tso_segsz); + } } } break; @@ -2867,26 +2872,30 @@ iflib_parse_header(iflib_txq_t txq, if_pkt_info_t pi, pi->ipi_ipproto = ip6->ip6_nxt; pi->ipi_flags |= IPI_TX_IPV6; - if (IS_TSO6(pi)) { + /* TCP checksum offload may require TCP header length */ + if (IS_TX_OFFLOAD6(pi)) { if (pi->ipi_ipproto == IPPROTO_TCP) { if (__predict_false(m->m_len < pi->ipi_ehdrlen + sizeof(struct ip6_hdr) + sizeof(struct tcphdr))) { + txq->ift_pullups++; if (__predict_false((m = m_pullup(m, pi->ipi_ehdrlen + sizeof(struct ip6_hdr) + sizeof(struct tcphdr))) == NULL)) return (ENOMEM); } pi->ipi_tcp_hflags = th->th_flags; pi->ipi_tcp_hlen = th->th_off << 2; + pi->ipi_tcp_seq = th->th_seq; } - - if (__predict_false(ip6->ip6_nxt != IPPROTO_TCP)) - return (ENXIO); - /* - * The corresponding flag is set by the stack in the IPv4 - * TSO case, but not in IPv6 (at least in FreeBSD 10.2). - * So, set it here because the rest of the flow requires it. - */ - pi->ipi_csum_flags |= CSUM_TCP_IPV6; - th->th_sum = in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); - pi->ipi_tso_segsz = m->m_pkthdr.tso_segsz; + if (IS_TSO6(pi)) { + if (__predict_false(ip6->ip6_nxt != IPPROTO_TCP)) + return (ENXIO); + /* + * The corresponding flag is set by the stack in the IPv4 + * TSO case, but not in IPv6 (at least in FreeBSD 10.2). + * So, set it here because the rest of the flow requires it. + */ + pi->ipi_csum_flags |= CSUM_IP6_TCP; + th->th_sum = in6_cksum_pseudo(ip6, 0, IPPROTO_TCP, 0); + pi->ipi_tso_segsz = m->m_pkthdr.tso_segsz; + } } break; } @@ -3694,6 +3703,10 @@ _task_fn_admin(void *context) } } + if ((!running & !oactive) && + !(ctx->ifc_sctx->isc_flags & IFLIB_ADMIN_ALWAYS_RUN)) + return; + CTX_LOCK(ctx); for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, txq++) { CALLOUT_LOCK(txq); @@ -3896,7 +3909,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) */ if (avoid_reset) { if_setflagbits(ifp, IFF_UP,0); - if (!(if_getdrvflags(ifp)& IFF_DRV_RUNNING)) + if (!(if_getdrvflags(ifp) & IFF_DRV_RUNNING)) reinit = 1; #ifdef INET if (!(if_getflags(ifp) & IFF_NOARP)) @@ -3993,7 +4006,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) #endif setmask |= (mask & IFCAP_FLAGS); - if (setmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) + if (setmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) setmask |= (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6); if ((mask & IFCAP_WOL) && (if_getcapabilities(ifp) & IFCAP_WOL) != 0) @@ -4014,7 +4027,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) CTX_UNLOCK(ctx); } break; - } + } case SIOCGPRIVATE_0: case SIOCSDRVSPEC: case SIOCGDRVSPEC: @@ -4722,7 +4735,7 @@ iflib_queues_alloc(if_ctx_t ctx) KASSERT(ntxqs > 0, ("number of queues per qset must be at least 1")); KASSERT(nrxqs > 0, ("number of queues per qset must be at least 1")); -/* Allocate the TX ring struct memory */ + /* Allocate the TX ring struct memory */ if (!(ctx->ifc_txqs = (iflib_txq_t) malloc(sizeof(struct iflib_txq) * ntxqsets, M_IFLIB, M_NOWAIT | M_ZERO))) { Modified: stable/11/sys/net/iflib.h ============================================================================== --- stable/11/sys/net/iflib.h Fri Sep 21 22:26:00 2018 (r338870) +++ stable/11/sys/net/iflib.h Fri Sep 21 23:31:04 2018 (r338871) @@ -321,7 +321,10 @@ typedef enum { * Driver needs frames padded to some minimum length */ #define IFLIB_NEED_ETHER_PAD 0x100 - +/* + * Interface needs admin task to ignore interface up/down status + */ +#define IFLIB_ADMIN_ALWAYS_RUN 0x10000 /*