svn commit: r303137 - stable/10/sys/dev/vmware/vmxnet3
Alexander Motin
mav at FreeBSD.org
Thu Jul 21 11:41:29 UTC 2016
Author: mav
Date: Thu Jul 21 11:41:27 2016
New Revision: 303137
URL: https://svnweb.freebsd.org/changeset/base/303137
Log:
MFC r303000: Update if_hwassist when interface options are changed.
In particular for me this fixes checksum problem when if_bridge attached
to the interface requests TXCSUM to be disabled, but effectively ignored.
Modified:
stable/10/sys/dev/vmware/vmxnet3/if_vmx.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/dev/vmware/vmxnet3/if_vmx.c
==============================================================================
--- stable/10/sys/dev/vmware/vmxnet3/if_vmx.c Thu Jul 21 11:39:43 2016 (r303136)
+++ stable/10/sys/dev/vmware/vmxnet3/if_vmx.c Thu Jul 21 11:41:27 2016 (r303137)
@@ -128,6 +128,7 @@ static int vmxnet3_alloc_queue_data(stru
static void vmxnet3_free_queue_data(struct vmxnet3_softc *);
static int vmxnet3_alloc_mcast_table(struct vmxnet3_softc *);
static void vmxnet3_init_shared_data(struct vmxnet3_softc *);
+static void vmxnet3_init_hwassist(struct vmxnet3_softc *);
static void vmxnet3_reinit_interface(struct vmxnet3_softc *);
static void vmxnet3_reinit_rss_shared_data(struct vmxnet3_softc *);
static void vmxnet3_reinit_shared_data(struct vmxnet3_softc *);
@@ -1584,6 +1585,24 @@ vmxnet3_init_shared_data(struct vmxnet3_
}
static void
+vmxnet3_init_hwassist(struct vmxnet3_softc *sc)
+{
+ struct ifnet *ifp = sc->vmx_ifp;
+ uint64_t hwassist;
+
+ hwassist = 0;
+ if (ifp->if_capenable & IFCAP_TXCSUM)
+ hwassist |= VMXNET3_CSUM_OFFLOAD;
+ if (ifp->if_capenable & IFCAP_TXCSUM_IPV6)
+ hwassist |= VMXNET3_CSUM_OFFLOAD_IPV6;
+ if (ifp->if_capenable & IFCAP_TSO4)
+ hwassist |= CSUM_IP_TSO;
+ if (ifp->if_capenable & IFCAP_TSO6)
+ hwassist |= CSUM_IP6_TSO;
+ ifp->if_hwassist = hwassist;
+}
+
+static void
vmxnet3_reinit_interface(struct vmxnet3_softc *sc)
{
struct ifnet *ifp;
@@ -1594,15 +1613,7 @@ vmxnet3_reinit_interface(struct vmxnet3_
bcopy(IF_LLADDR(sc->vmx_ifp), sc->vmx_lladdr, ETHER_ADDR_LEN);
vmxnet3_set_lladdr(sc);
- ifp->if_hwassist = 0;
- if (ifp->if_capenable & IFCAP_TXCSUM)
- ifp->if_hwassist |= VMXNET3_CSUM_OFFLOAD;
- if (ifp->if_capenable & IFCAP_TXCSUM_IPV6)
- ifp->if_hwassist |= VMXNET3_CSUM_OFFLOAD_IPV6;
- if (ifp->if_capenable & IFCAP_TSO4)
- ifp->if_hwassist |= CSUM_IP_TSO;
- if (ifp->if_capenable & IFCAP_TSO6)
- ifp->if_hwassist |= CSUM_IP6_TSO;
+ vmxnet3_init_hwassist(sc);
}
static void
@@ -3284,6 +3295,8 @@ vmxnet3_ioctl(struct ifnet *ifp, u_long
if (reinit && (ifp->if_drv_flags & IFF_DRV_RUNNING)) {
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
vmxnet3_init_locked(sc);
+ } else {
+ vmxnet3_init_hwassist(sc);
}
VMXNET3_CORE_UNLOCK(sc);
More information about the svn-src-stable-10
mailing list