Skip to content

Commit

Permalink
toggle v4/v6 rxcsum together; only re-init if driver is running
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Macy committed Oct 14, 2016
1 parent 90004cf commit 106518e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sys/net/iflib.c
Original file line number Diff line number Diff line change
Expand Up @@ -3171,8 +3171,6 @@ iflib_if_qflush(if_t ifp)
IFCAP_TSO4 | IFCAP_TSO6 | IFCAP_VLAN_HWTAGGING | \
IFCAP_VLAN_MTU | IFCAP_VLAN_HWFILTER | IFCAP_VLAN_HWTSO)

#define IFCAP_REINIT IFCAP_FLAGS

static int
iflib_if_ioctl(if_t ifp, u_long command, caddr_t data)
{
Expand Down Expand Up @@ -3297,6 +3295,8 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data)
#endif
setmask |= (mask & IFCAP_FLAGS);

if (setmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6))
setmask |= (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6);
if ((mask & IFCAP_WOL) &&
(if_getcapabilities(ifp) & IFCAP_WOL) != 0)
setmask |= (mask & (IFCAP_WOL_MCAST|IFCAP_WOL_MAGIC));
Expand All @@ -3307,10 +3307,10 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data)
if (setmask) {
CTX_LOCK(ctx);
bits = if_getdrvflags(ifp);
if (setmask & IFCAP_REINIT)
if (bits & IFF_DRV_RUNNING)
iflib_stop(ctx);
if_togglecapenable(ifp, setmask);
if (setmask & IFCAP_REINIT)
if (bits & IFF_DRV_RUNNING)
iflib_init_locked(ctx);
if_setdrvflags(ifp, bits);
CTX_UNLOCK(ctx);
Expand Down

0 comments on commit 106518e

Please sign in to comment.