Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Jun 2020 21:28:51 +0000 (UTC)
From:      Ryan Moeller <freqlabs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r362511 - in stable: 11/sys/dev/cxgb 11/sys/dev/cxgbe 11/sys/dev/mlx4/mlx4_en 11/sys/dev/mlx5/mlx5_en 11/sys/dev/mxge 11/sys/dev/oce 12/sys/dev/cxgb 12/sys/dev/cxgbe 12/sys/dev/mlx4/mlx...
Message-ID:  <202006222128.05MLSpQZ048464@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: freqlabs
Date: Mon Jun 22 21:28:51 2020
New Revision: 362511
URL: https://svnweb.freebsd.org/changeset/base/362511

Log:
  MFC r362201:
  
  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)
  Sponsored by:   iXsystems, Inc.
  Differential Revision:  https://reviews.freebsd.org/D25120

Modified:
  stable/11/sys/dev/cxgb/cxgb_main.c
  stable/11/sys/dev/cxgbe/t4_main.c
  stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
  stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
  stable/11/sys/dev/mxge/if_mxge.c
  stable/11/sys/dev/oce/oce_if.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/sys/dev/cxgb/cxgb_main.c
  stable/12/sys/dev/cxgbe/t4_main.c
  stable/12/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
  stable/12/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
  stable/12/sys/dev/mxge/if_mxge.c
  stable/12/sys/dev/oce/oce_if.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/sys/dev/cxgb/cxgb_main.c
==============================================================================
--- stable/11/sys/dev/cxgb/cxgb_main.c	Mon Jun 22 20:55:45 2020	(r362510)
+++ stable/11/sys/dev/cxgb/cxgb_main.c	Mon Jun 22 21:28:51 2020	(r362511)
@@ -1952,6 +1952,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");
@@ -1963,6 +1964,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: stable/11/sys/dev/cxgbe/t4_main.c
==============================================================================
--- stable/11/sys/dev/cxgbe/t4_main.c	Mon Jun 22 20:55:45 2020	(r362510)
+++ stable/11/sys/dev/cxgbe/t4_main.c	Mon Jun 22 21:28:51 2020	(r362511)
@@ -1865,6 +1865,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");
@@ -1876,6 +1877,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: stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
==============================================================================
--- stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c	Mon Jun 22 20:55:45 2020	(r362510)
+++ stable/11/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c	Mon Jun 22 21:28:51 2020	(r362511)
@@ -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: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==============================================================================
--- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Mon Jun 22 20:55:45 2020	(r362510)
+++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Mon Jun 22 21:28:51 2020	(r362511)
@@ -3167,6 +3167,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,
@@ -3179,6 +3180,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: stable/11/sys/dev/mxge/if_mxge.c
==============================================================================
--- stable/11/sys/dev/mxge/if_mxge.c	Mon Jun 22 20:55:45 2020	(r362510)
+++ stable/11/sys/dev/mxge/if_mxge.c	Mon Jun 22 21:28:51 2020	(r362511)
@@ -4201,13 +4201,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 {
@@ -4229,6 +4231,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
@@ -4238,7 +4241,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: stable/11/sys/dev/oce/oce_if.c
==============================================================================
--- stable/11/sys/dev/oce/oce_if.c	Mon Jun 22 20:55:45 2020	(r362510)
+++ stable/11/sys/dev/oce/oce_if.c	Mon Jun 22 21:28:51 2020	(r362511)
@@ -534,6 +534,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?202006222128.05MLSpQZ048464>