Date: Mon, 15 Jun 2020 16:35:27 +0000 (UTC) From: Ryan Moeller <freqlabs@FreeBSD.org> 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 Message-ID: <202006151635.05FGZRDA076670@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202006151635.05FGZRDA076670>