Summary: | VIMAGE regression: breaks netfront suspend/resume | ||
---|---|---|---|
Product: | Base System | Reporter: | Roger Pau Monné <royger> |
Component: | kern | Assignee: | Kristof Provost <kp> |
Status: | Closed FIXED | ||
Severity: | Affects Many People | CC: | kp, net, xen |
Priority: | --- | Keywords: | crash, regression, vimage |
Version: | CURRENT | ||
Hardware: | amd64 | ||
OS: | Any |
Description
Roger Pau Monné
2018-08-23 15:25:07 UTC
This likely means you wound up calling arp_ifnet() without a curvnet set. That's important context for basically all networking operations, but it's not going to be set when called from a kernel thread, as appears to be the case here. Usually all you have to do is ensure that the correct vnet is set. This is untested (and may not even compile), but might fix it: diff --git a/sys/dev/xen/netfront/netfront.c b/sys/dev/xen/netfront/netfront.c index ba8ac3caf7f..12938354f9c 100644 --- a/sys/dev/xen/netfront/netfront.c +++ b/sys/dev/xen/netfront/netfront.c @@ -962,6 +962,8 @@ netfront_backend_changed(device_t dev, XenbusState newstate) DPRINTK("newstate=%d\n", newstate); + CURVNET_SET(sc->xn_ifp->vnet); + switch (newstate) { case XenbusStateInitialising: case XenbusStateInitialised: @@ -994,6 +996,8 @@ netfront_backend_changed(device_t dev, XenbusState newstate) #endif break; } + + CURVNET_RESTORE(); } /** (In reply to Kristof Provost from comment #1) Thanks! That does indeed seems to solve the issue, it just has a minor typo: s/vnet/if_vnet/. Would you like to commit it? A commit references this bug: Author: kp Date: Thu Aug 23 16:52:53 UTC 2018 New revision: 338256 URL: https://svnweb.freebsd.org/changeset/base/338256 Log: xen/netfront: Ensure curvnet is set netfront_backend_changed() is called from the xenwatch_thread(), which means that the curvnet is not set. We have to set it before we can call things like arp_ifinit(). PR: 230845 Changes: head/sys/dev/xen/netfront/netfront.c |