diff options
| author | Wei Hu <whu@FreeBSD.org> | 2025-12-23 04:23:39 +0000 |
|---|---|---|
| committer | Wei Hu <whu@FreeBSD.org> | 2025-12-23 05:38:40 +0000 |
| commit | 44f656641c238cb3db31026f3e3bef36cd5231a8 (patch) | |
| tree | 085f01f7427f96a75e67b807be8d53f6d1518506 | |
| parent | b94e4c7037b0face3206cf313fd8966d6aa1eaae (diff) | |
Hyper-V: hn: just call vf's ioctl when changing mtu
When changing mtu, if a vf is attached to the netvsc interface, just
calling its ioctl to change vf's mtu is good enough.
Tested by: whu
MFC after: 3 days
Sponsored by: Microsoft
| -rw-r--r-- | sys/dev/hyperv/netvsc/if_hn.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/hyperv/netvsc/if_hn.c b/sys/dev/hyperv/netvsc/if_hn.c index 2ae9e710978e..79fdea371fbb 100644 --- a/sys/dev/hyperv/netvsc/if_hn.c +++ b/sys/dev/hyperv/netvsc/if_hn.c @@ -3750,14 +3750,16 @@ hn_ioctl(if_t ifp, u_long cmd, caddr_t data) ifr_vf = *ifr; strlcpy(ifr_vf.ifr_name, if_name(vf_ifp), sizeof(ifr_vf.ifr_name)); - error = ifhwioctl(SIOCSIFMTU,vf_ifp, + error = ifhwioctl(SIOCSIFMTU, vf_ifp, (caddr_t)&ifr_vf, curthread); + HN_UNLOCK(sc); if (error) { - HN_UNLOCK(sc); if_printf(ifp, "%s SIOCSIFMTU %d failed: %d\n", if_name(vf_ifp), ifr->ifr_mtu, error); - break; + } else { + if_setmtu(ifp, ifr->ifr_mtu); } + break; } /* |
