From owner-svn-src-all@freebsd.org Mon Jun 15 16:35:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5373A33980B; Mon, 15 Jun 2020 16:35:29 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49lxlP1YqFz3d87; Mon, 15 Jun 2020 16:35:29 +0000 (UTC) (envelope-from freqlabs@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 30CFB2045A; Mon, 15 Jun 2020 16:35:29 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05FGZSmr076675; Mon, 15 Jun 2020 16:35:28 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05FGZRDA076670; Mon, 15 Jun 2020 16:35:27 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202006151635.05FGZRDA076670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Mon, 15 Jun 2020 16:35:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362201 - in head/sys/dev: cxgb cxgbe mlx4/mlx4_en mlx5/mlx5_en mxge oce X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in head/sys/dev: cxgb cxgbe mlx4/mlx4_en mlx5/mlx5_en mxge oce X-SVN-Commit-Revision: 362201 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jun 2020 16:35:29 -0000 Author: freqlabs Date: Mon Jun 15 16:35:27 2020 New Revision: 362201 URL: https://svnweb.freebsd.org/changeset/base/362201 Log: Avoid trying to toggle TSO twice Remove TSO from the toggle mask when automatically disabled by TXCKSUM* in various NIC drivers. Reviewed by: hselasky, np, gallatin, jpaetzel Approved by: mav (mentor) MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D25120 Modified: head/sys/dev/cxgb/cxgb_main.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mxge/if_mxge.c head/sys/dev/oce/oce_if.c Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Mon Jun 15 15:59:44 2020 (r362200) +++ head/sys/dev/cxgb/cxgb_main.c Mon Jun 15 16:35:27 2020 (r362201) @@ -1964,6 +1964,7 @@ fail: if (IFCAP_TSO4 & ifp->if_capenable && !(IFCAP_TXCSUM & ifp->if_capenable)) { + mask &= ~IFCAP_TSO4; ifp->if_capenable &= ~IFCAP_TSO4; if_printf(ifp, "tso4 disabled due to -txcsum.\n"); @@ -1975,6 +1976,7 @@ fail: if (IFCAP_TSO6 & ifp->if_capenable && !(IFCAP_TXCSUM_IPV6 & ifp->if_capenable)) { + mask &= ~IFCAP_TSO6; ifp->if_capenable &= ~IFCAP_TSO6; if_printf(ifp, "tso6 disabled due to -txcsum6.\n"); Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Jun 15 15:59:44 2020 (r362200) +++ head/sys/dev/cxgbe/t4_main.c Mon Jun 15 16:35:27 2020 (r362201) @@ -1989,6 +1989,7 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, cadd if (IFCAP_TSO4 & ifp->if_capenable && !(IFCAP_TXCSUM & ifp->if_capenable)) { + mask &= ~IFCAP_TSO4; ifp->if_capenable &= ~IFCAP_TSO4; if_printf(ifp, "tso4 disabled due to -txcsum.\n"); @@ -2000,6 +2001,7 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, cadd if (IFCAP_TSO6 & ifp->if_capenable && !(IFCAP_TXCSUM_IPV6 & ifp->if_capenable)) { + mask &= ~IFCAP_TSO6; ifp->if_capenable &= ~IFCAP_TSO6; if_printf(ifp, "tso6 disabled due to -txcsum6.\n"); Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c ============================================================================== --- head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Mon Jun 15 15:59:44 2020 (r362200) +++ head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c Mon Jun 15 16:35:27 2020 (r362201) @@ -2006,6 +2006,7 @@ static int mlx4_en_ioctl(struct ifnet *dev, u_long com if (IFCAP_TSO4 & dev->if_capenable && !(IFCAP_TXCSUM & dev->if_capenable)) { + mask &= ~IFCAP_TSO4; dev->if_capenable &= ~IFCAP_TSO4; dev->if_hwassist &= ~CSUM_IP_TSO; if_printf(dev, @@ -2018,6 +2019,7 @@ static int mlx4_en_ioctl(struct ifnet *dev, u_long com if (IFCAP_TSO6 & dev->if_capenable && !(IFCAP_TXCSUM_IPV6 & dev->if_capenable)) { + mask &= ~IFCAP_TSO6; dev->if_capenable &= ~IFCAP_TSO6; dev->if_hwassist &= ~CSUM_IP6_TSO; if_printf(dev, Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jun 15 15:59:44 2020 (r362200) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Jun 15 16:35:27 2020 (r362201) @@ -3323,6 +3323,7 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t if (IFCAP_TSO4 & ifp->if_capenable && !(IFCAP_TXCSUM & ifp->if_capenable)) { + mask &= ~IFCAP_TSO4; ifp->if_capenable &= ~IFCAP_TSO4; ifp->if_hwassist &= ~CSUM_IP_TSO; mlx5_en_err(ifp, @@ -3335,6 +3336,7 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t if (IFCAP_TSO6 & ifp->if_capenable && !(IFCAP_TXCSUM_IPV6 & ifp->if_capenable)) { + mask &= ~IFCAP_TSO6; ifp->if_capenable &= ~IFCAP_TSO6; ifp->if_hwassist &= ~CSUM_IP6_TSO; mlx5_en_err(ifp, Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Mon Jun 15 15:59:44 2020 (r362200) +++ head/sys/dev/mxge/if_mxge.c Mon Jun 15 16:35:27 2020 (r362201) @@ -4223,13 +4223,15 @@ mxge_ioctl(struct ifnet *ifp, u_long command, caddr_t mask = ifr->ifr_reqcap ^ ifp->if_capenable; if (mask & IFCAP_TXCSUM) { if (IFCAP_TXCSUM & ifp->if_capenable) { + mask &= ~IFCAP_TSO4; ifp->if_capenable &= ~(IFCAP_TXCSUM|IFCAP_TSO4); ifp->if_hwassist &= ~(CSUM_TCP | CSUM_UDP); } else { ifp->if_capenable |= IFCAP_TXCSUM; ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP); } - } else if (mask & IFCAP_RXCSUM) { + } + if (mask & IFCAP_RXCSUM) { if (IFCAP_RXCSUM & ifp->if_capenable) { ifp->if_capenable &= ~IFCAP_RXCSUM; } else { @@ -4251,6 +4253,7 @@ mxge_ioctl(struct ifnet *ifp, u_long command, caddr_t #if IFCAP_TSO6 if (mask & IFCAP_TXCSUM_IPV6) { if (IFCAP_TXCSUM_IPV6 & ifp->if_capenable) { + mask &= ~IFCAP_TSO6; ifp->if_capenable &= ~(IFCAP_TXCSUM_IPV6 | IFCAP_TSO6); ifp->if_hwassist &= ~(CSUM_TCP_IPV6 @@ -4260,7 +4263,8 @@ mxge_ioctl(struct ifnet *ifp, u_long command, caddr_t ifp->if_hwassist |= (CSUM_TCP_IPV6 | CSUM_UDP_IPV6); } - } else if (mask & IFCAP_RXCSUM_IPV6) { + } + if (mask & IFCAP_RXCSUM_IPV6) { if (IFCAP_RXCSUM_IPV6 & ifp->if_capenable) { ifp->if_capenable &= ~IFCAP_RXCSUM_IPV6; } else { Modified: head/sys/dev/oce/oce_if.c ============================================================================== --- head/sys/dev/oce/oce_if.c Mon Jun 15 15:59:44 2020 (r362200) +++ head/sys/dev/oce/oce_if.c Mon Jun 15 16:35:27 2020 (r362201) @@ -539,6 +539,7 @@ oce_ioctl(struct ifnet *ifp, u_long command, caddr_t d if (IFCAP_TSO & ifp->if_capenable && !(IFCAP_TXCSUM & ifp->if_capenable)) { + u &= ~IFCAP_TSO; ifp->if_capenable &= ~IFCAP_TSO; ifp->if_hwassist &= ~CSUM_TSO; if_printf(ifp,