git: b0f19adbd5df - stable/14 - Hyper-V: hn: just call vf's ioctl when changing mtu
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 11 May 2026 08:41:52 UTC
The branch stable/14 has been updated by whu:
URL: https://cgit.FreeBSD.org/src/commit/?id=b0f19adbd5df12aee46f00a0c1edbee1600c9712
commit b0f19adbd5df12aee46f00a0c1edbee1600c9712
Author: Wei Hu <whu@FreeBSD.org>
AuthorDate: 2025-12-23 04:23:39 +0000
Commit: Wei Hu <whu@FreeBSD.org>
CommitDate: 2026-05-11 08:28:29 +0000
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
(cherry picked from commit 44f656641c238cb3db31026f3e3bef36cd5231a8)
---
sys/dev/hyperv/netvsc/if_hn.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/sys/dev/hyperv/netvsc/if_hn.c b/sys/dev/hyperv/netvsc/if_hn.c
index 24b0beac8075..937aae05320d 100644
--- a/sys/dev/hyperv/netvsc/if_hn.c
+++ b/sys/dev/hyperv/netvsc/if_hn.c
@@ -3763,14 +3763,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;
}
/*