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
This commit is contained in:
parent
ccb9fc3218
commit
cbb9ccf735
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=362201
@ -1964,6 +1964,7 @@ cxgb_ioctl(struct ifnet *ifp, unsigned long command, caddr_t data)
|
|||||||
|
|
||||||
if (IFCAP_TSO4 & ifp->if_capenable &&
|
if (IFCAP_TSO4 & ifp->if_capenable &&
|
||||||
!(IFCAP_TXCSUM & ifp->if_capenable)) {
|
!(IFCAP_TXCSUM & ifp->if_capenable)) {
|
||||||
|
mask &= ~IFCAP_TSO4;
|
||||||
ifp->if_capenable &= ~IFCAP_TSO4;
|
ifp->if_capenable &= ~IFCAP_TSO4;
|
||||||
if_printf(ifp,
|
if_printf(ifp,
|
||||||
"tso4 disabled due to -txcsum.\n");
|
"tso4 disabled due to -txcsum.\n");
|
||||||
@ -1975,6 +1976,7 @@ cxgb_ioctl(struct ifnet *ifp, unsigned long command, caddr_t data)
|
|||||||
|
|
||||||
if (IFCAP_TSO6 & ifp->if_capenable &&
|
if (IFCAP_TSO6 & ifp->if_capenable &&
|
||||||
!(IFCAP_TXCSUM_IPV6 & ifp->if_capenable)) {
|
!(IFCAP_TXCSUM_IPV6 & ifp->if_capenable)) {
|
||||||
|
mask &= ~IFCAP_TSO6;
|
||||||
ifp->if_capenable &= ~IFCAP_TSO6;
|
ifp->if_capenable &= ~IFCAP_TSO6;
|
||||||
if_printf(ifp,
|
if_printf(ifp,
|
||||||
"tso6 disabled due to -txcsum6.\n");
|
"tso6 disabled due to -txcsum6.\n");
|
||||||
|
@ -1989,6 +1989,7 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data)
|
|||||||
|
|
||||||
if (IFCAP_TSO4 & ifp->if_capenable &&
|
if (IFCAP_TSO4 & ifp->if_capenable &&
|
||||||
!(IFCAP_TXCSUM & ifp->if_capenable)) {
|
!(IFCAP_TXCSUM & ifp->if_capenable)) {
|
||||||
|
mask &= ~IFCAP_TSO4;
|
||||||
ifp->if_capenable &= ~IFCAP_TSO4;
|
ifp->if_capenable &= ~IFCAP_TSO4;
|
||||||
if_printf(ifp,
|
if_printf(ifp,
|
||||||
"tso4 disabled due to -txcsum.\n");
|
"tso4 disabled due to -txcsum.\n");
|
||||||
@ -2000,6 +2001,7 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data)
|
|||||||
|
|
||||||
if (IFCAP_TSO6 & ifp->if_capenable &&
|
if (IFCAP_TSO6 & ifp->if_capenable &&
|
||||||
!(IFCAP_TXCSUM_IPV6 & ifp->if_capenable)) {
|
!(IFCAP_TXCSUM_IPV6 & ifp->if_capenable)) {
|
||||||
|
mask &= ~IFCAP_TSO6;
|
||||||
ifp->if_capenable &= ~IFCAP_TSO6;
|
ifp->if_capenable &= ~IFCAP_TSO6;
|
||||||
if_printf(ifp,
|
if_printf(ifp,
|
||||||
"tso6 disabled due to -txcsum6.\n");
|
"tso6 disabled due to -txcsum6.\n");
|
||||||
|
@ -2006,6 +2006,7 @@ static int mlx4_en_ioctl(struct ifnet *dev, u_long command, caddr_t data)
|
|||||||
|
|
||||||
if (IFCAP_TSO4 & dev->if_capenable &&
|
if (IFCAP_TSO4 & dev->if_capenable &&
|
||||||
!(IFCAP_TXCSUM & dev->if_capenable)) {
|
!(IFCAP_TXCSUM & dev->if_capenable)) {
|
||||||
|
mask &= ~IFCAP_TSO4;
|
||||||
dev->if_capenable &= ~IFCAP_TSO4;
|
dev->if_capenable &= ~IFCAP_TSO4;
|
||||||
dev->if_hwassist &= ~CSUM_IP_TSO;
|
dev->if_hwassist &= ~CSUM_IP_TSO;
|
||||||
if_printf(dev,
|
if_printf(dev,
|
||||||
@ -2018,6 +2019,7 @@ static int mlx4_en_ioctl(struct ifnet *dev, u_long command, caddr_t data)
|
|||||||
|
|
||||||
if (IFCAP_TSO6 & dev->if_capenable &&
|
if (IFCAP_TSO6 & dev->if_capenable &&
|
||||||
!(IFCAP_TXCSUM_IPV6 & dev->if_capenable)) {
|
!(IFCAP_TXCSUM_IPV6 & dev->if_capenable)) {
|
||||||
|
mask &= ~IFCAP_TSO6;
|
||||||
dev->if_capenable &= ~IFCAP_TSO6;
|
dev->if_capenable &= ~IFCAP_TSO6;
|
||||||
dev->if_hwassist &= ~CSUM_IP6_TSO;
|
dev->if_hwassist &= ~CSUM_IP6_TSO;
|
||||||
if_printf(dev,
|
if_printf(dev,
|
||||||
|
@ -3323,6 +3323,7 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
|
|||||||
|
|
||||||
if (IFCAP_TSO4 & ifp->if_capenable &&
|
if (IFCAP_TSO4 & ifp->if_capenable &&
|
||||||
!(IFCAP_TXCSUM & ifp->if_capenable)) {
|
!(IFCAP_TXCSUM & ifp->if_capenable)) {
|
||||||
|
mask &= ~IFCAP_TSO4;
|
||||||
ifp->if_capenable &= ~IFCAP_TSO4;
|
ifp->if_capenable &= ~IFCAP_TSO4;
|
||||||
ifp->if_hwassist &= ~CSUM_IP_TSO;
|
ifp->if_hwassist &= ~CSUM_IP_TSO;
|
||||||
mlx5_en_err(ifp,
|
mlx5_en_err(ifp,
|
||||||
@ -3335,6 +3336,7 @@ mlx5e_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
|
|||||||
|
|
||||||
if (IFCAP_TSO6 & ifp->if_capenable &&
|
if (IFCAP_TSO6 & ifp->if_capenable &&
|
||||||
!(IFCAP_TXCSUM_IPV6 & ifp->if_capenable)) {
|
!(IFCAP_TXCSUM_IPV6 & ifp->if_capenable)) {
|
||||||
|
mask &= ~IFCAP_TSO6;
|
||||||
ifp->if_capenable &= ~IFCAP_TSO6;
|
ifp->if_capenable &= ~IFCAP_TSO6;
|
||||||
ifp->if_hwassist &= ~CSUM_IP6_TSO;
|
ifp->if_hwassist &= ~CSUM_IP6_TSO;
|
||||||
mlx5_en_err(ifp,
|
mlx5_en_err(ifp,
|
||||||
|
@ -4223,13 +4223,15 @@ mxge_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
|
|||||||
mask = ifr->ifr_reqcap ^ ifp->if_capenable;
|
mask = ifr->ifr_reqcap ^ ifp->if_capenable;
|
||||||
if (mask & IFCAP_TXCSUM) {
|
if (mask & IFCAP_TXCSUM) {
|
||||||
if (IFCAP_TXCSUM & ifp->if_capenable) {
|
if (IFCAP_TXCSUM & ifp->if_capenable) {
|
||||||
|
mask &= ~IFCAP_TSO4;
|
||||||
ifp->if_capenable &= ~(IFCAP_TXCSUM|IFCAP_TSO4);
|
ifp->if_capenable &= ~(IFCAP_TXCSUM|IFCAP_TSO4);
|
||||||
ifp->if_hwassist &= ~(CSUM_TCP | CSUM_UDP);
|
ifp->if_hwassist &= ~(CSUM_TCP | CSUM_UDP);
|
||||||
} else {
|
} else {
|
||||||
ifp->if_capenable |= IFCAP_TXCSUM;
|
ifp->if_capenable |= IFCAP_TXCSUM;
|
||||||
ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP);
|
ifp->if_hwassist |= (CSUM_TCP | CSUM_UDP);
|
||||||
}
|
}
|
||||||
} else if (mask & IFCAP_RXCSUM) {
|
}
|
||||||
|
if (mask & IFCAP_RXCSUM) {
|
||||||
if (IFCAP_RXCSUM & ifp->if_capenable) {
|
if (IFCAP_RXCSUM & ifp->if_capenable) {
|
||||||
ifp->if_capenable &= ~IFCAP_RXCSUM;
|
ifp->if_capenable &= ~IFCAP_RXCSUM;
|
||||||
} else {
|
} else {
|
||||||
@ -4251,6 +4253,7 @@ mxge_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
|
|||||||
#if IFCAP_TSO6
|
#if IFCAP_TSO6
|
||||||
if (mask & IFCAP_TXCSUM_IPV6) {
|
if (mask & IFCAP_TXCSUM_IPV6) {
|
||||||
if (IFCAP_TXCSUM_IPV6 & ifp->if_capenable) {
|
if (IFCAP_TXCSUM_IPV6 & ifp->if_capenable) {
|
||||||
|
mask &= ~IFCAP_TSO6;
|
||||||
ifp->if_capenable &= ~(IFCAP_TXCSUM_IPV6
|
ifp->if_capenable &= ~(IFCAP_TXCSUM_IPV6
|
||||||
| IFCAP_TSO6);
|
| IFCAP_TSO6);
|
||||||
ifp->if_hwassist &= ~(CSUM_TCP_IPV6
|
ifp->if_hwassist &= ~(CSUM_TCP_IPV6
|
||||||
@ -4260,7 +4263,8 @@ mxge_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
|
|||||||
ifp->if_hwassist |= (CSUM_TCP_IPV6
|
ifp->if_hwassist |= (CSUM_TCP_IPV6
|
||||||
| CSUM_UDP_IPV6);
|
| CSUM_UDP_IPV6);
|
||||||
}
|
}
|
||||||
} else if (mask & IFCAP_RXCSUM_IPV6) {
|
}
|
||||||
|
if (mask & IFCAP_RXCSUM_IPV6) {
|
||||||
if (IFCAP_RXCSUM_IPV6 & ifp->if_capenable) {
|
if (IFCAP_RXCSUM_IPV6 & ifp->if_capenable) {
|
||||||
ifp->if_capenable &= ~IFCAP_RXCSUM_IPV6;
|
ifp->if_capenable &= ~IFCAP_RXCSUM_IPV6;
|
||||||
} else {
|
} else {
|
||||||
|
@ -539,6 +539,7 @@ oce_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
|
|||||||
|
|
||||||
if (IFCAP_TSO & ifp->if_capenable &&
|
if (IFCAP_TSO & ifp->if_capenable &&
|
||||||
!(IFCAP_TXCSUM & ifp->if_capenable)) {
|
!(IFCAP_TXCSUM & ifp->if_capenable)) {
|
||||||
|
u &= ~IFCAP_TSO;
|
||||||
ifp->if_capenable &= ~IFCAP_TSO;
|
ifp->if_capenable &= ~IFCAP_TSO;
|
||||||
ifp->if_hwassist &= ~CSUM_TSO;
|
ifp->if_hwassist &= ~CSUM_TSO;
|
||||||
if_printf(ifp,
|
if_printf(ifp,
|
||||||
|
Loading…
Reference in New Issue
Block a user