svn commit: r366721 - head/sys/dev/hyperv/netvsc
Author: whu Date: Thu Oct 15 11:44:28 2020 New Revision: 366721 URL: https://svnweb.freebsd.org/changeset/base/366721 Log: Hyper-V: hn: Relinquish cpu in HN_LOCK to avoid deadlock The try lock loop in HN_LOCK put the thread spinning on cpu if the lock is not available. It is possible to cause deadlock if the thread holding the lock is sleeping. Relinquish the cpu to work around this problem even it doesn't completely solve the issue. The priority inversion could cause the livelock no matter how less likely it could happen. A more complete solution may be needed in the future. Reported by: Microsoft, Netapp MFC after:2 weeks Sponsored by: Microsoft Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c == --- head/sys/dev/hyperv/netvsc/if_hn.c Thu Oct 15 05:57:20 2020 (r366720) +++ head/sys/dev/hyperv/netvsc/if_hn.c Thu Oct 15 11:44:28 2020 (r366721) @@ -71,8 +71,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include #include #include #include @@ -165,8 +167,11 @@ __FBSDID("$FreeBSD$"); #define HN_LOCK_ASSERT(sc) sx_assert(&(sc)->hn_lock, SA_XLOCKED) #define HN_LOCK(sc)\ do { \ - while (sx_try_xlock(&(sc)->hn_lock) == 0) \ + while (sx_try_xlock(&(sc)->hn_lock) == 0) { \ + /* Relinquish cpu to avoid deadlock */ \ + sched_relinquish(curthread);\ DELAY(1000);\ + } \ } while (0) #define HN_UNLOCK(sc) sx_xunlock(&(sc)->hn_lock) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r366720 - head/sys/dev/hyperv/pcib
Author: whu Date: Thu Oct 15 05:57:20 2020 New Revision: 366720 URL: https://svnweb.freebsd.org/changeset/base/366720 Log: Hyper-V: pcib: Check revoke status during device attach It is possible that the vmbus pcib channel is revoked during attach path. The attach path could be waiting for response from host and this response will never arrive since the channel has already been revoked from host point of view. Check this situation during wait complete and return failed if this happens. Reported by: Netapp MFC after:2 weeks Sponsored by: Microsoft Differential Revision:https://reviews.freebsd.org/D26486 Modified: head/sys/dev/hyperv/pcib/vmbus_pcib.c Modified: head/sys/dev/hyperv/pcib/vmbus_pcib.c == --- head/sys/dev/hyperv/pcib/vmbus_pcib.c Thu Oct 15 05:11:16 2020 (r366719) +++ head/sys/dev/hyperv/pcib/vmbus_pcib.c Thu Oct 15 05:57:20 2020 (r366720) @@ -117,6 +117,31 @@ wait_for_completion(struct completion *c) mtx_unlock(>lock); } +/* + * Return: 0 if completed, a non-zero value if timed out. + */ +static int +wait_for_completion_timeout(struct completion *c, int timeout) +{ + int ret; + + mtx_lock(>lock); + + if (c->done == 0) + mtx_sleep(c, >lock, 0, "hvwfc", timeout); + + if (c->done > 0) { + c->done--; + ret = 0; + } else { + ret = 1; + } + + mtx_unlock(>lock); + + return (ret); +} + #define PCI_MAKE_VERSION(major, minor) ((uint32_t)(((major) << 16) | (major))) enum { @@ -438,6 +463,25 @@ struct compose_comp_ctxt { struct tran_int_desc int_desc; }; +/* + * It is possible the device is revoked during initialization. + * Check if this happens during wait. + * Return: 0 if response arrived, ENODEV if device revoked. + */ +static int +wait_for_response(struct hv_pcibus *hbus, struct completion *c) +{ + do { + if (vmbus_chan_is_revoked(hbus->sc->chan)) { + device_printf(hbus->pcib, + "The device is revoked.\n"); + return (ENODEV); + } + } while (wait_for_completion_timeout(c, hz /10) != 0); + + return 0; +} + static void hv_pci_generic_compl(void *context, struct pci_response *resp, int resp_packet_size) @@ -568,7 +612,9 @@ new_pcichild_device(struct hv_pcibus *hbus, struct pci if (ret) goto err; - wait_for_completion(_pkt.host_event); + if (wait_for_response(hbus, _pkt.host_event)) + goto err; + free_completion(_pkt.host_event); hpdev->desc = *desc; @@ -1011,11 +1057,16 @@ hv_pci_protocol_negotiation(struct hv_pcibus *hbus) ret = vmbus_chan_send(hbus->sc->chan, VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, version_req, sizeof(*version_req), (uint64_t)(uintptr_t)); - if (ret) + if (!ret) + ret = wait_for_response(hbus, _pkt.host_event); + + if (ret) { + device_printf(hbus->pcib, + "vmbus_pcib failed to request version: %d\n", + ret); goto out; + } - wait_for_completion(_pkt.host_event); - if (comp_pkt.completion_status < 0) { device_printf(hbus->pcib, "vmbus_pcib version negotiation failed: %x\n", @@ -1072,11 +1123,12 @@ hv_pci_enter_d0(struct hv_pcibus *hbus) ret = vmbus_chan_send(hbus->sc->chan, VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, d0_entry, sizeof(*d0_entry), (uint64_t)(uintptr_t)); + if (!ret) + ret = wait_for_response(hbus, _pkt.host_event); + if (ret) goto out; - wait_for_completion(_pkt.host_event); - if (comp_pkt.completion_status < 0) { device_printf(hbus->pcib, "vmbus_pcib failed to enable D0\n"); ret = EPROTO; @@ -1125,14 +1177,14 @@ hv_send_resources_allocated(struct hv_pcibus *hbus) VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, >message, sizeof(*res_assigned), (uint64_t)(uintptr_t)pkt); - if (ret) { - free_completion(_pkt.host_event); - break; - } + if (!ret) + ret = wait_for_response(hbus, _pkt.host_event); - wait_for_completion(_pkt.host_event); free_completion(_pkt.host_event); + if (ret) + break; + if (comp_pkt.completion_status < 0) { ret = EPROTO; device_printf(hbus->pcib, @@ -1413,9 +1465,11 @@ vmbus_pcib_attach(device_t dev) goto vmbus_close; ret =
svn commit: r364984 - head/sys/dev/hyperv/storvsc
Author: whu Date: Mon Aug 31 09:05:45 2020 New Revision: 364984 URL: https://svnweb.freebsd.org/changeset/base/364984 Log: Hyper-V: storvsc: Enhance srb_status code handling. In hv_storvsc_io_request() when coring, prevent changing of the send channel from the base channel to another one. storvsc_poll always probes on the base channel. Based upon conversations with Microsoft, changed the handling of srb_status codes. Most we should never get, others yes. All are treated as retry-able except for two. We should not get these statuses, but if we ever do, the I/O state is not known. Submitted by: Alexander Sideropoulos Reviewed by: trasz, allanjude, whu MFC after:1 week Sponsored by: Netapp Inc Differential Revision:https://reviews.freebsd.org/D25756 Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c head/sys/dev/hyperv/storvsc/hv_vstorage.h Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c == --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cMon Aug 31 05:25:13 2020(r364983) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cMon Aug 31 09:05:45 2020(r364984) @@ -151,6 +151,12 @@ SYSCTL_UINT(_hw_storvsc, OID_AUTO, max_io, CTLFLAG_RDT static int hv_storvsc_chan_cnt = 0; SYSCTL_INT(_hw_storvsc, OID_AUTO, chan_cnt, CTLFLAG_RDTUN, _storvsc_chan_cnt, 0, "# of channels to use"); +#ifdef DIAGNOSTIC +static int hv_storvsc_srb_status = -1; +SYSCTL_INT(_hw_storvsc, OID_AUTO, srb_status, CTLFLAG_RW, + _storvsc_srb_status, 0, "srb_status to inject"); +TUNABLE_INT("hw_storvsc.srb_status", _storvsc_srb_status); +#endif /* DIAGNOSTIC */ #define STORVSC_MAX_IO \ vmbus_chan_prplist_nelem(hv_storvsc_ringbuffer_size,\ @@ -704,7 +710,16 @@ hv_storvsc_io_request(struct storvsc_softc *sc, vstor_packet->operation = VSTOR_OPERATION_EXECUTESRB; ch_sel = (vstor_packet->u.vm_srb.lun + curcpu) % sc->hs_nchan; - outgoing_channel = sc->hs_sel_chan[ch_sel]; + /* +* If we are panic'ing, then we are dumping core. Since storvsc_polls +* always uses sc->hs_chan, then we must send to that channel or a poll +* timeout will occur. +*/ + if (panicstr) { + outgoing_channel = sc->hs_chan; + } else { + outgoing_channel = sc->hs_sel_chan[ch_sel]; + } mtx_unlock(>softc->hs_lock); if (request->prp_list.gpa_range.gpa_len) { @@ -2155,26 +2170,133 @@ storvsc_io_done(struct hv_storvsc_request *reqp) ccb->ccb_h.status &= ~CAM_SIM_QUEUED; ccb->ccb_h.status &= ~CAM_STATUS_MASK; int srb_status = SRB_STATUS(vm_srb->srb_status); +#ifdef DIAGNOSTIC + if (hv_storvsc_srb_status != -1) { + srb_status = SRB_STATUS(hv_storvsc_srb_status & 0x3f); + hv_storvsc_srb_status = -1; + } +#endif /* DIAGNOSTIC */ if (vm_srb->scsi_status == SCSI_STATUS_OK) { if (srb_status != SRB_STATUS_SUCCESS) { - /* -* If there are errors, for example, invalid LUN, -* host will inform VM through SRB status. -*/ - if (bootverbose) { - if (srb_status == SRB_STATUS_INVALID_LUN) { - xpt_print(ccb->ccb_h.path, - "invalid LUN %d for op: %s\n", - vm_srb->lun, - scsi_op_desc(cmd->opcode, NULL)); - } else { - xpt_print(ccb->ccb_h.path, - "Unknown SRB flag: %d for op: %s\n", - srb_status, - scsi_op_desc(cmd->opcode, NULL)); - } + bool log_error = true; + switch (srb_status) { + case SRB_STATUS_PENDING: + /* We should never get this */ + panic("storvsc_io_done: SRB_STATUS_PENDING"); + break; + case SRB_STATUS_ABORTED: + /* +* storvsc doesn't support aborts yet +* but if we ever get this status +* the I/O is complete - treat it as a +* timeout +*/ + ccb->ccb_h.status |= CAM_CMD_TIMEOUT; +
svn commit: r363689 - head/sys/dev/hyperv/vmbus
Author: whu Date: Thu Jul 30 07:26:11 2020 New Revision: 363689 URL: https://svnweb.freebsd.org/changeset/base/363689 Log: Prevent framebuffer mmio space from being allocated to other devices on HyperV. On Gen2 VMs, Hyper-V provides mmio space for framebuffer. This mmio address range is not useable for other PCI devices. Currently only efifb driver is using this range without reserving it from system. Therefore, vmbus driver reserves it before any other PCI device drivers start to request mmio addresses. PR: 222996 Submitted by: w...@microsoft.com Reported by: dmitry_kules...@ukr.net Reviewed by: de...@microsoft.com Sponsored by: Microsoft Modified: head/sys/dev/hyperv/vmbus/vmbus.c Modified: head/sys/dev/hyperv/vmbus/vmbus.c == --- head/sys/dev/hyperv/vmbus/vmbus.c Thu Jul 30 07:11:08 2020 (r363688) +++ head/sys/dev/hyperv/vmbus/vmbus.c Thu Jul 30 07:26:11 2020 (r363689) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -46,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1332,12 +1334,66 @@ vmbus_get_mmio_res(device_t dev) vmbus_get_mmio_res_pass(dev, parse_32); } +/* + * On Gen2 VMs, Hyper-V provides mmio space for framebuffer. + * This mmio address range is not useable for other PCI devices. + * Currently only efifb driver is using this range without reserving + * it from system. + * Therefore, vmbus driver reserves it before any other PCI device + * drivers start to request mmio addresses. + */ +static struct resource *hv_fb_res; + static void +vmbus_fb_mmio_res(device_t dev) +{ + struct efi_fb *efifb; + caddr_t kmdp; + + struct vmbus_softc *sc = device_get_softc(dev); + int rid = 0; + + kmdp = preload_search_by_type("elf kernel"); + if (kmdp == NULL) + kmdp = preload_search_by_type("elf64 kernel"); + efifb = (struct efi_fb *)preload_search_info(kmdp, + MODINFO_METADATA | MODINFOMD_EFI_FB); + if (efifb == NULL) { + if (bootverbose) + device_printf(dev, + "fb has no preloaded kernel efi information\n"); + /* We are on Gen1 VM, just return. */ + return; + } else { + if (bootverbose) + device_printf(dev, + "efifb: fb_addr: %#jx, size: %#jx, " + "actual size needed: 0x%x\n", + efifb->fb_addr, efifb->fb_size, + (int) efifb->fb_height * efifb->fb_width); + } + + hv_fb_res = pcib_host_res_alloc(>vmbus_mmio_res, dev, + SYS_RES_MEMORY, , + efifb->fb_addr, efifb->fb_addr + efifb->fb_size, efifb->fb_size, + RF_ACTIVE | rman_make_alignment_flags(PAGE_SIZE)); + + if (hv_fb_res && bootverbose) + device_printf(dev, + "successfully reserved memory for framebuffer " + "starting at %#jx, size %#jx\n", + efifb->fb_addr, efifb->fb_size); +} + +static void vmbus_free_mmio_res(device_t dev) { struct vmbus_softc *sc = device_get_softc(dev); pcib_host_res_free(dev, >vmbus_mmio_res); + + if (hv_fb_res) + hv_fb_res = NULL; } #endif /* NEW_PCIB */ @@ -1387,6 +1443,7 @@ vmbus_doattach(struct vmbus_softc *sc) #ifdef NEW_PCIB vmbus_get_mmio_res(sc->vmbus_dev); + vmbus_fb_mmio_res(sc->vmbus_dev); #endif sc->vmbus_flags |= VMBUS_FLAG_ATTACHED; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
RE: svn commit: r361360 - head/sys/dev/hyperv/hvsock
> -Original Message- > From: Kyle Evans > Sent: Saturday, May 30, 2020 4:34 AM > To: Wei Hu > Cc: src-committers ; svn-src-all a...@freebsd.org>; svn-src-head > Subject: Re: svn commit: r361360 - head/sys/dev/hyperv/hvsock > > On Fri, May 22, 2020 at 10:51 AM Kyle Evans wrote: > > > > On Fri, May 22, 2020 at 4:17 AM Wei Hu wrote: > > > > > > Author: whu > > > Date: Fri May 22 09:17:07 2020 > > > New Revision: 361360 > > > URL: > > > https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsv > > > > nweb.freebsd.org%2Fchangeset%2Fbase%2F361360data=02%7C01%7C > weh% > > > > 40microsoft.com%7Cc97d223b440a8f1708d8040f9563%7C72f988bf86f1 > 41a > > > > f91ab2d7cd011db47%7C1%7C0%7C637263812262686264sdata=xPJ95 > nVsWPV > > > f8qxlxSyMplJXuaFcbp5bd9FiGgvHhao%3Dreserved=0 > > > > > > Log: > > > Socket AF_HYPERV should return failure when it is not running on > > > HyperV > > > > > > [... snip ...] > > > @@ -354,6 +354,9 @@ hvs_trans_attach(struct socket *so, int proto, > > > struct { > > > struct hvs_pcb *pcb = so2hvspcb(so); > > > > > > + if (vm_guest != VM_GUEST_HV) > > > + return (ESOCKTNOSUPPORT); > > > + > > > HVSOCK_DBG(HVSOCK_DBG_VERBOSE, > > > "%s: HyperV Socket hvs_trans_attach called\n", > > > __func__); > > > > > > > This one may be OK, but none of these other methods should be able to > > be invoked if the attach failed. See this comment at around > > ^/sys/kern/uipc_socket.c#50: > > > > 50 * pru_detach() disassociates protocol layer state from an attached > > socket, > > 51 * and will be called exactly once for sockets in which pru_attach() > > has > > 52 * been successfully called. If pru_attach() returned an error, > > 53 * pru_detach() will not be called. Socket layer private. > > > > That said, I wonder if VNET_DOMAIN_SET provides the correct semantics > > here at all. You can't fail domain_init, but I don't think there's any > > value in this domain actually getting registered on non-HyperV guests, > > a fact which presumably won't change at runtime. > > > > I'm considering the patch below, which is almost certainly going to be mangled > by my mail client, for solving this style of problem. It gives the domain a > chance > to probe the system and opt out, for cases like hvsock where leaving the > domain around and fully-initialized when there's no way it can work is both > wasteful and a bit of an accident waiting to happen -- IMO it's much less > error > prone and more comforting if we just reject it early on, since we can. The > vm_guest detection and hyperv's false-positive aversion stuff in hyperv_init > should run much earlier than this. > > diff --git a/sys/dev/hyperv/hvsock/hv_sock.c > b/sys/dev/hyperv/hvsock/hv_sock.c index d212c2d8c2d..d3bc1ab0f2c 100644 > --- a/sys/dev/hyperv/hvsock/hv_sock.c > +++ b/sys/dev/hyperv/hvsock/hv_sock.c > @@ -74,6 +74,8 @@ SYSCTL_INT(_net_hvsock, OID_AUTO, hvs_dbg_level, > CTLFLAG_RWTUN, _dbg_level, > > MALLOC_DEFINE(M_HVSOCK, "hyperv_socket", "hyperv socket control > structures"); > > +static int hvs_dom_probe(void); > + > /* The MTU is 16KB per host side's design */ > #define HVSOCK_MTU_SIZE(1024 * 16) > #define HVSOCK_SEND_BUF_SZ (PAGE_SIZE - sizeof(struct > vmpipe_proto_header)) > @@ -124,6 +126,7 @@ static struct protosw hv_socket_protosw[] = > { > static struct domain hv_socket_domain = { > .dom_family = AF_HYPERV, > .dom_name = "hyperv", > + .dom_probe =hvs_dom_probe, > .dom_protosw = hv_socket_protosw, > .dom_protoswNPROTOSW = > _socket_protosw[nitems(hv_socket_protosw)] > }; > @@ -322,6 +325,16 @@ hvs_trans_unlock(void) > sx_xunlock(_trans_socks_sx); } > > +static int > +hvs_dom_probe(void) > +{ > + > + /* Don't even give us a chance to attach on non-HyperV. */ > + if (vm_guest != VM_GUEST_HV) > + return (ENXIO); > + return (0); > +} > + > void > hvs_trans_init(void) > { > @@ -329,9 +342,6 @@ hvs_trans_init(void) > if (!IS_DEFAULT_VNET(curvnet)) > return; > > - if (vm_guest != VM_GUEST_HV) > - return; > - > HVSOCK_DBG(HVSOCK_DBG_VERBOSE, > "%s: HyperV Socket hvs_trans_init called\n", __func__);
RE: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys
> -Original Message- > From: Kyle Evans > Sent: Saturday, May 30, 2020 2:33 AM > To: Wei Hu > Cc: src-committers ; svn-src-all a...@freebsd.org>; svn-src-head > Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock > dev/hyperv/include dev/hyperv/vmbus modules/hyperv > modules/hyperv/hvsock sys > > On Fri, May 29, 2020 at 12:08 PM Wei Hu wrote: > > > -Original Message- > > > > > [... snip ...] > > > > > +void > > > > > +hvs_trans_init(void) > > > > > +{ > > > > > + /* Skip initialization of globals for non-default instances. > > > > > */ > > > > > + if (!IS_DEFAULT_VNET(curvnet)) > > > > > + return; > > > > > + > > > > > + if (vm_guest != VM_GUEST_HV) > > > > > + return; > > > > > + > > > > > + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, > > > > > + "%s: HyperV Socket hvs_trans_init called\n", > > > > > + __func__); > > > > > + > > > > > + /* Initialize Globals */ > > > > > + previous_auto_bound_port = MAX_PORT; > > > > > + sx_init(_trans_socks_sx, "hvs_trans_sock_sx"); > > > > > + mtx_init(_trans_socks_mtx, > > > > > + "hvs_trans_socks_mtx", NULL, MTX_DEF); > > > > > + LIST_INIT(_trans_bound_socks); > > > > > + LIST_INIT(_trans_connected_socks); > > > > > +} > > > > > + > > > > > > > > I have a suspicion that all of these should really be per-vnet for > > > > correct semantics with VIMAGE, with the IS_DEFAULT_VNET check > > > > earlier dropped completely. I haven't read around the rest all > > > > that much, but this would at least seem to prevent port re-use by > > > > a different vnet, which is perhaps "good enough" but I think this > > > > is something that should be fixed in the mid-term. > > > > > > > > > > I have a follow-up concern about whether this is actually going to > > > be maintained... it's been a full week with not even an > > > acknowledgement or rebuttal of any of the concerns I've raised, with > > > some of them being completely trivial to address in the short-term. > > > I don't think that we really want this in the tree in its current state > > > given > this level of engagement. > > > > > Sorry for my late response, Kyle. I read your comments last week. To > > be honest I am not familiar to VNET and VIMAGE, so I don't quite > > understand. I got distracted into other work so my response to this was > delayed. > > > > Do you mean to drop these two lines? > >if (!IS_DEFAULT_VNET(curvnet)) > >return > > I copied these from other socket init code. If they are not necessary I can > remove them. > > > > Alright, let's rewind a little bit here. =-) Consider while reading the below > that I > have no idea what the host-side of these sockets look like beyond what I just > very quickly skimmed from [0]. > > It's a little more involved than that; consider each vnet as its own > independent > network stack that's largely isolated from other vnets. > The host starts out with a vnet, vnet0 (the default vnet), and root may spawn > additional vnets attached to jails to allow the jail to operate its own > network > stack as well. Your pr_init will get called once per vnet spawned, including > the > obvious default vnet, which is why the check is there in the first place -- > you > may have some global state that only needs to be initialized once, at which > point you would exclude non-default vnets from executing those bits. > > The more I think about it, though, the more I wonder if hvsock makes sense at > all in non-default vnet contexts and whether hvs_trans_attach should really be > attaching to sockets outside of the default vnet. You can bind in your FreeBSD > HyperV guest to a port, and a host service's option for connecting is > specifying > guest GUID + port; there's not really any wiggle room for multiple entities > within a guest to be binding to a given port anyways. It may very well be the > case that the status quo is the optimal outcome. > > Given that, does it make sense that the host connects via the guest GUID and > can potentially end up connected to some jail of unknown trust operating its > own network stack? > > As a final scattere
RE: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys
> -Original Message- > > > [... snip ...] > > > +void > > > +hvs_trans_init(void) > > > +{ > > > + /* Skip initialization of globals for non-default instances. */ > > > + if (!IS_DEFAULT_VNET(curvnet)) > > > + return; > > > + > > > + if (vm_guest != VM_GUEST_HV) > > > + return; > > > + > > > + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, > > > + "%s: HyperV Socket hvs_trans_init called\n", __func__); > > > + > > > + /* Initialize Globals */ > > > + previous_auto_bound_port = MAX_PORT; > > > + sx_init(_trans_socks_sx, "hvs_trans_sock_sx"); > > > + mtx_init(_trans_socks_mtx, > > > + "hvs_trans_socks_mtx", NULL, MTX_DEF); > > > + LIST_INIT(_trans_bound_socks); > > > + LIST_INIT(_trans_connected_socks); > > > +} > > > + > > > > I have a suspicion that all of these should really be per-vnet for > > correct semantics with VIMAGE, with the IS_DEFAULT_VNET check earlier > > dropped completely. I haven't read around the rest all that much, but > > this would at least seem to prevent port re-use by a different vnet, > > which is perhaps "good enough" but I think this is something that > > should be fixed in the mid-term. > > > > I have a follow-up concern about whether this is actually going to be > maintained... it's been a full week with not even an acknowledgement or > rebuttal of any of the concerns I've raised, with some of them being > completely > trivial to address in the short-term. I don't think that we really want this > in the > tree in its current state given this level of engagement. > Sorry for my late response, Kyle. I read your comments last week. To be honest I am not familiar to VNET and VIMAGE, so I don't quite understand. I got distracted into other work so my response to this was delayed. Do you mean to drop these two lines? if (!IS_DEFAULT_VNET(curvnet)) return I copied these from other socket init code. If they are not necessary I can remove them. Thanks, Wei ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361362 - head/sys/sys
Author: whu Date: Fri May 22 10:50:29 2020 New Revision: 361362 URL: https://svnweb.freebsd.org/changeset/base/361362 Log: Bump __FreeBSD_version after r361275, HyperV socket support Sponsored by: Microsoft Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h == --- head/sys/sys/param.hFri May 22 09:38:44 2020(r361361) +++ head/sys/sys/param.hFri May 22 10:50:29 2020(r361362) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300094 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300095 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361360 - head/sys/dev/hyperv/hvsock
Author: whu Date: Fri May 22 09:17:07 2020 New Revision: 361360 URL: https://svnweb.freebsd.org/changeset/base/361360 Log: Socket AF_HYPERV should return failure when it is not running on HyperV Reported by: pho Sponsored by: Microsoft Modified: head/sys/dev/hyperv/hvsock/hv_sock.c Modified: head/sys/dev/hyperv/hvsock/hv_sock.c == --- head/sys/dev/hyperv/hvsock/hv_sock.cFri May 22 09:02:40 2020 (r361359) +++ head/sys/dev/hyperv/hvsock/hv_sock.cFri May 22 09:17:07 2020 (r361360) @@ -354,6 +354,9 @@ hvs_trans_attach(struct socket *so, int proto, struct { struct hvs_pcb *pcb = so2hvspcb(so); + if (vm_guest != VM_GUEST_HV) + return (ESOCKTNOSUPPORT); + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: HyperV Socket hvs_trans_attach called\n", __func__); @@ -380,6 +383,9 @@ hvs_trans_detach(struct socket *so) { struct hvs_pcb *pcb; + if (vm_guest != VM_GUEST_HV) + return; + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: HyperV Socket hvs_trans_detach called\n", __func__); @@ -589,6 +595,9 @@ hvs_trans_disconnect(struct socket *so) { struct hvs_pcb *pcb; + if (vm_guest != VM_GUEST_HV) + return (ESOCKTNOSUPPORT); + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: HyperV Socket hvs_trans_disconnect called\n", __func__); @@ -916,6 +925,9 @@ hvs_trans_close(struct socket *so) { struct hvs_pcb *pcb; + if (vm_guest != VM_GUEST_HV) + return; + HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: HyperV Socket hvs_trans_close called\n", __func__); @@ -956,6 +968,9 @@ void hvs_trans_abort(struct socket *so) { struct hvs_pcb *pcb = so2hvspcb(so); + + if (vm_guest != VM_GUEST_HV) + return; HVSOCK_DBG(HVSOCK_DBG_VERBOSE, "%s: HyperV Socket hvs_trans_abort called\n", __func__); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
RE: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys
> -Original Message- > From: Peter Holm > Sent: Thursday, May 21, 2020 8:24 PM > To: Wei Hu > Cc: src-committ...@freebsd.org; svn-src-all@freebsd.org; svn-src- > h...@freebsd.org > Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock > dev/hyperv/include dev/hyperv/vmbus modules/hyperv > modules/hyperv/hvsock sys > > On Wed, May 20, 2020 at 11:03:59AM +, Wei Hu wrote: > > Author: whu > > Date: Wed May 20 11:03:59 2020 > > New Revision: 361275 > > URL: > https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsvnweb > .freebsd.org%2Fchangeset%2Fbase%2F361275data=02%7C01%7Cweh% > 40microsoft.com%7C61c524b5022b47b2c4e108d7fd81e75f%7C72f988bf86f14 > 1af91ab2d7cd011db47%7C1%7C0%7C637256606689750658sdata=mw > 4IXP3DnxICnK4U%2F8MzLbvMAzCuxih2f0waDyMSCTE%3Dreserved=0 > > > > Log: > > HyperV socket implementation for FreeBSD > > > > This change adds Hyper-V socket feature in FreeBSD. New socket address > > family AF_HYPERV and its kernel support are added. > > > > Found this with a syscall fuzz test: > > panic: page fault > cpuid = 2 > time = 1590050529 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > 0xfe033d21d530 > vpanic() at vpanic+0x182/frame 0xfe033d21d580 > panic() at panic+0x43/frame 0xfe033d21d5e0 > trap_fatal() at trap_fatal+0x387/frame 0xfe033d21d640 > trap_pfault() at trap_pfault+0x99/frame 0xfe033d21d6a0 > trap() at trap+0x2a5/frame 0xfe033d21d7b0 > calltrap() at calltrap+0x8/frame 0xfe033d21d7b0 > --- trap 0xc, rip = 0x80bcd3ba, rsp = 0xfe033d21d880, rbp = > 0xfe033d21d910 --- > _sx_xlock_hard() at _sx_xlock_hard+0x17a/frame 0xfe033d21d910 > _sx_xlock() at _sx_xlock+0xba/frame 0xfe033d21d950 > hvs_trans_close() at hvs_trans_close+0x42/frame 0xfe033d21d970 > soclose() at soclose+0x161/frame 0xfe033d21d9e0 > _fdrop() at _fdrop+0x1a/frame 0xfe033d21da00 > closef() at closef+0x1db/frame 0xfe033d21da90 > closefp() at closefp+0x96/frame 0xfe033d21dad0 > amd64_syscall() at amd64_syscall+0x159/frame 0xfe033d21dbf0 > fast_syscall_common() at fast_syscall_common+0x101/frame > 0xfe033d21dbf0 > --- syscall (6, FreeBSD ELF64, sys_close), rip = 0x8004283ca, rsp = > 0x7fffe328, > rbp = 0x7fffe460 --- > > https://nam06.safelinks.protection.outlook.com/?url=https:%2F%2Fpeople.free > bsd.org%2F~pho%2Fstress%2Flog%2Fsetsockopt2- > 2.txtdata=02%7C01%7Cweh%40microsoft.com%7C61c524b5022b47b2c > 4e108d7fd81e75f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C63 > 7256606689750658sdata=RuBmWrBv7lGnhF2IHZ5NOP2rmV0c%2BJXuk > RZl260KSIw%3Dreserved=0 > > Could this be yours? Yes. Looks the lock was not initialized. The lock only gets initialized when it is running on HyperV. This type of socket only works on HyperV. How to reproduce it? Was it on HyperV? I am not sure how it can enter this state. Wei ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
RE: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys
> -Original Message- > From: Enji Cooper > Sent: Wednesday, May 20, 2020 11:58 PM > To: Shawn Webb > Cc: Wei Hu ; src-committ...@freebsd.org; svn-src- > a...@freebsd.org; svn-src-h...@freebsd.org > Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock > dev/hyperv/include dev/hyperv/vmbus modules/hyperv > modules/hyperv/hvsock sys > > > > On May 20, 2020, at 08:54, Enji Cooper wrote: > > > >>> On May 20, 2020, at 08:11, Shawn Webb > wrote: > >>> > >>> On Wed, May 20, 2020 at 11:03:59AM +, Wei Hu wrote: > >>> Author: whu > >>> Date: Wed May 20 11:03:59 2020 > >>> New Revision: 361275 > >>> URL: > >>> https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsv > >>> > nweb.freebsd.org%2Fchangeset%2Fbase%2F361275data=02%7C01%7C > weh% > >>> > 40microsoft.com%7Cd6ff3617bffa43d10a7708d7fcd68470%7C72f988bf86f141 > a > >>> > f91ab2d7cd011db47%7C1%7C0%7C637255870581110888sdata=mzz6R > ILCVBk > >>> q06RI1PAfVNKWZO2y7jBO0C1E%2F%2FEJwUY%3Dreserved=0 > >>> > >>> Log: > >>> HyperV socket implementation for FreeBSD > >>> > >>> This change adds Hyper-V socket feature in FreeBSD. New socket > >>> address family AF_HYPERV and its kernel support are added. > > > > Hi Wei, > >Could you please further describe what this feature is/does? > > I realize after looking at the review that it contains the content I was > hoping > for. It would have been helpful to folks if this context had been included in > the > commit message. Hi Enji, I thought I just keep it simple for the commit log message while people can refer to the review site for details. Sorry about that. Let me know if there is anyway to make up for it. Wei ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
RE: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys
> -Original Message- > From: Shawn Webb > Sent: Wednesday, May 20, 2020 11:11 PM > To: Wei Hu > Cc: src-committ...@freebsd.org; svn-src-all@freebsd.org; svn-src- > h...@freebsd.org > Subject: Re: svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock > dev/hyperv/include dev/hyperv/vmbus modules/hyperv > modules/hyperv/hvsock sys > > On Wed, May 20, 2020 at 11:03:59AM +, Wei Hu wrote: > > Author: whu > > Date: Wed May 20 11:03:59 2020 > > New Revision: 361275 > > URL: https://svnweb.freebsd.org/changeset/base/361275 > > > > Log: > > HyperV socket implementation for FreeBSD > > > > This change adds Hyper-V socket feature in FreeBSD. New socket address > > family AF_HYPERV and its kernel support are added. > > > > Submitted by: Wei Hu > > Reviewed by: Dexuan Cui > > Relnotes: yes > > Sponsored by: Microsoft > > Differential Revision:https://reviews.freebsd.org/D24061 > > Hey Wei Hu, > > Would it be good to bump __FreeBSD_version after a change like this? > Hi Shawn, I was not familiar to the mechanism of __FreeBSD_version. But it looks like a good idea. However I am not sure if I have the right to update the chapter.xml file. Can you help on what I need to do the update this version number? Thanks, Wei ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r361275 - in head/sys: conf dev/hyperv/hvsock dev/hyperv/include dev/hyperv/vmbus modules/hyperv modules/hyperv/hvsock sys
Author: whu Date: Wed May 20 11:03:59 2020 New Revision: 361275 URL: https://svnweb.freebsd.org/changeset/base/361275 Log: HyperV socket implementation for FreeBSD This change adds Hyper-V socket feature in FreeBSD. New socket address family AF_HYPERV and its kernel support are added. Submitted by: Wei Hu Reviewed by: Dexuan Cui Relnotes: yes Sponsored by: Microsoft Differential Revision:https://reviews.freebsd.org/D24061 Added: head/sys/dev/hyperv/hvsock/ head/sys/dev/hyperv/hvsock/hv_sock.c (contents, props changed) head/sys/dev/hyperv/hvsock/hv_sock.h (contents, props changed) head/sys/modules/hyperv/hvsock/ head/sys/modules/hyperv/hvsock/Makefile (contents, props changed) Modified: head/sys/conf/files.x86 head/sys/dev/hyperv/include/vmbus.h head/sys/dev/hyperv/vmbus/vmbus.c head/sys/dev/hyperv/vmbus/vmbus_br.c head/sys/dev/hyperv/vmbus/vmbus_brvar.h head/sys/dev/hyperv/vmbus/vmbus_chan.c head/sys/dev/hyperv/vmbus/vmbus_chanvar.h head/sys/dev/hyperv/vmbus/vmbus_reg.h head/sys/modules/hyperv/Makefile head/sys/sys/socket.h Modified: head/sys/conf/files.x86 == --- head/sys/conf/files.x86 Wed May 20 11:01:10 2020(r361274) +++ head/sys/conf/files.x86 Wed May 20 11:03:59 2020(r361275) @@ -133,6 +133,7 @@ dev/hwpmc/hwpmc_core.c optionalhwpmc dev/hwpmc/hwpmc_uncore.c optionalhwpmc dev/hwpmc/hwpmc_tsc.c optionalhwpmc dev/hwpmc/hwpmc_x86.c optionalhwpmc +dev/hyperv/hvsock/hv_sock.coptionalhyperv dev/hyperv/input/hv_kbd.c optionalhyperv dev/hyperv/input/hv_kbdc.c optionalhyperv dev/hyperv/pcib/vmbus_pcib.c optionalhyperv pci Added: head/sys/dev/hyperv/hvsock/hv_sock.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/hyperv/hvsock/hv_sock.cWed May 20 11:03:59 2020 (r361275) @@ -0,0 +1,1748 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Microsoft Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice unmodified, this list of conditions, and the following + *disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include "hv_sock.h" + +#define HVSOCK_DBG_NONE0x0 +#define HVSOCK_DBG_INFO0x1 +#define HVSOCK_DBG_ERR 0x2 +#define HVSOCK_DBG_VERBOSE 0x3 + + +SYSCTL_NODE(_net, OID_AUTO, hvsock, CTLFLAG_RD, 0, "HyperV socket"); + +static int hvs_dbg_level; +SYSCTL_INT(_net_hvsock, OID_AUTO, hvs_dbg_level, CTLFLAG_RWTUN, _dbg_level, +0, "hyperv socket debug level: 0 = none, 1 = info, 2 = error, 3 = verbose"); + + +#define HVSOCK_DBG(level, ...) do {\ + if (hvs_dbg_level >= (level)) \ + printf(__VA_ARGS__);\ + } while (0) + +MALLOC_DEFINE(M_HVSOCK, "hyperv_socket", "hyperv socket control structures"); + +/* The MTU is 16KB per host side's design */ +#define HVSOCK_MTU_SIZE(1024 * 16) +#define HVSOCK_SEND_BUF_SZ (PAGE_SIZE - sizeof(struct vmpipe_proto_header)) + +#define HV
svn commit: r349857 - head/sys/dev/hyperv/netvsc
Author: whu Date: Tue Jul 9 08:21:14 2019 New Revision: 349857 URL: https://svnweb.freebsd.org/changeset/base/349857 Log: hyperv/vmbus: Fix the wrong size in ndis_offload structure Submitted by: whu MFC after:2 weeks Sponsored by: Microsoft Modified: head/sys/dev/hyperv/netvsc/ndis.h Modified: head/sys/dev/hyperv/netvsc/ndis.h == --- head/sys/dev/hyperv/netvsc/ndis.h Tue Jul 9 07:24:18 2019 (r349856) +++ head/sys/dev/hyperv/netvsc/ndis.h Tue Jul 9 08:21:14 2019 (r349857) @@ -115,8 +115,8 @@ struct ndis_offload_params { /* NDIS >= 6.30 */ uint8_t ndis_rsc_ip4; /* NDIS_OFFLOAD_RSC_ */ uint8_t ndis_rsc_ip6; /* NDIS_OFFLOAD_RSC_ */ - uint8_t ndis_encap; /* NDIS_OFFLOAD_SET_ */ - uint8_t ndis_encap_types;/* NDIS_ENCAP_TYPE_ */ + uint32_tndis_encap; /* NDIS_OFFLOAD_SET_ */ + uint32_tndis_encap_types;/* NDIS_ENCAP_TYPE_ */ }; #defineNDIS_OFFLOAD_PARAMS_SIZEsizeof(struct ndis_offload_params) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r349856 - in head/sys/dev/hyperv: include netvsc vmbus
Author: whu Date: Tue Jul 9 07:24:18 2019 New Revision: 349856 URL: https://svnweb.freebsd.org/changeset/base/349856 Log: hyperv/vmbus: Update VMBus version 4.0 and 5.0 support. Add VMBus protocol version 4.0. and 5.0 to support Windows 10 and newer HyperV hosts. For VMBus 4.0 and newer HyperV, the netvsc gpadl teardown must be done after vmbus close. Submitted by: whu MFC after:2 weeks Sponsored by: Microsoft Modified: head/sys/dev/hyperv/include/hyperv.h head/sys/dev/hyperv/include/vmbus.h head/sys/dev/hyperv/netvsc/hn_nvs.c head/sys/dev/hyperv/netvsc/if_hn.c head/sys/dev/hyperv/vmbus/vmbus.c Modified: head/sys/dev/hyperv/include/hyperv.h == --- head/sys/dev/hyperv/include/hyperv.hTue Jul 9 07:21:33 2019 (r349855) +++ head/sys/dev/hyperv/include/hyperv.hTue Jul 9 07:24:18 2019 (r349856) @@ -94,6 +94,11 @@ extern hyperv_tc64_t hyperv_tc64; extern u_int hyperv_features;/* CPUID_HV_MSR_ */ extern u_int hyperv_ver_major; +/* + * Vmbus version after negotiation with host. + */ +extern uint32_tvmbus_current_version; + #endif /* _KERNEL */ #endif /* _HYPERV_H_ */ Modified: head/sys/dev/hyperv/include/vmbus.h == --- head/sys/dev/hyperv/include/vmbus.h Tue Jul 9 07:21:33 2019 (r349855) +++ head/sys/dev/hyperv/include/vmbus.h Tue Jul 9 07:24:18 2019 (r349856) @@ -40,11 +40,15 @@ * 1.1 -- Windows 7 * 2.4 -- Windows 8 * 3.0 -- Windows 8.1 + * 4.0 -- Windows 10 + * 5.0 -- Newer Windows 10 */ #define VMBUS_VERSION_WS2008 ((0 << 16) | (13)) #define VMBUS_VERSION_WIN7 ((1 << 16) | (1)) #define VMBUS_VERSION_WIN8 ((2 << 16) | (4)) #define VMBUS_VERSION_WIN8_1 ((3 << 16) | (0)) +#define VMBUS_VERSION_WIN10((4 << 16) | (0)) +#define VMBUS_VERSION_WIN10_V5 ((5 << 16) | (0)) #define VMBUS_VERSION_MAJOR(ver) (((uint32_t)(ver)) >> 16) #define VMBUS_VERSION_MINOR(ver) (((uint32_t)(ver)) & 0x) Modified: head/sys/dev/hyperv/netvsc/hn_nvs.c == --- head/sys/dev/hyperv/netvsc/hn_nvs.c Tue Jul 9 07:21:33 2019 (r349855) +++ head/sys/dev/hyperv/netvsc/hn_nvs.c Tue Jul 9 07:24:18 2019 (r349856) @@ -365,7 +365,7 @@ hn_nvs_disconn_rxbuf(struct hn_softc *sc) pause("lingtx", (200 * hz) / 1000); } - if (sc->hn_rxbuf_gpadl != 0) { + if (vmbus_current_version < VMBUS_VERSION_WIN10 && sc->hn_rxbuf_gpadl != 0) { /* * Disconnect RXBUF from primary channel. */ @@ -426,7 +426,7 @@ hn_nvs_disconn_chim(struct hn_softc *sc) pause("lingtx", (200 * hz) / 1000); } - if (sc->hn_chim_gpadl != 0) { + if (vmbus_current_version < VMBUS_VERSION_WIN10 && sc->hn_chim_gpadl != 0) { /* * Disconnect chimney sending buffer from primary channel. */ Modified: head/sys/dev/hyperv/netvsc/if_hn.c == --- head/sys/dev/hyperv/netvsc/if_hn.c Tue Jul 9 07:21:33 2019 (r349855) +++ head/sys/dev/hyperv/netvsc/if_hn.c Tue Jul 9 07:24:18 2019 (r349856) @@ -6630,6 +6630,38 @@ hn_synth_detach(struct hn_softc *sc) /* Detach all of the channels. */ hn_detach_allchans(sc); + if (vmbus_current_version >= VMBUS_VERSION_WIN10 && sc->hn_rxbuf_gpadl != 0) { + /* +* Host is post-Win2016, disconnect RXBUF from primary channel here. +*/ + int error; + + error = vmbus_chan_gpadl_disconnect(sc->hn_prichan, + sc->hn_rxbuf_gpadl); + if (error) { + if_printf(sc->hn_ifp, + "rxbuf gpadl disconn failed: %d\n", error); + sc->hn_flags |= HN_FLAG_RXBUF_REF; + } + sc->hn_rxbuf_gpadl = 0; + } + + if (vmbus_current_version >= VMBUS_VERSION_WIN10 && sc->hn_chim_gpadl != 0) { + /* +* Host is post-Win2016, disconnect chimney sending buffer from +* primary channel here. +*/ + int error; + + error = vmbus_chan_gpadl_disconnect(sc->hn_prichan, + sc->hn_chim_gpadl); + if (error) { + if_printf(sc->hn_ifp, + "chim gpadl disconn failed: %d\n", error); + sc->hn_flags |= HN_FLAG_CHIM_REF; + } + sc->hn_chim_gpadl = 0; + } sc->hn_flags &= ~HN_FLAG_SYNTH_ATTACHED; } Modified:
svn commit: r339984 - stable/12/sys/dev/hyperv/netvsc
Author: whu Date: Thu Nov 1 08:08:08 2018 New Revision: 339984 URL: https://svnweb.freebsd.org/changeset/base/339984 Log: MFC r339585: Do not drop UDP traffic when TXCSUM_IPV6 flag is on. PR: 231797 Submitted by: whu Reviewed by: dexuan Obtained from:Kevin Morse Approved by: re (rgrimes) Sponsored by: Microsoft Modified: stable/12/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/hyperv/netvsc/if_hn.c == --- stable/12/sys/dev/hyperv/netvsc/if_hn.c Thu Nov 1 03:38:57 2018 (r339983) +++ stable/12/sys/dev/hyperv/netvsc/if_hn.c Thu Nov 1 08:08:08 2018 (r339984) @@ -861,7 +861,8 @@ hn_set_hlen(struct mbuf *m_head) PULLUP_HDR(m_head, ehlen + sizeof(*ip6)); ip6 = mtodo(m_head, ehlen); - if (ip6->ip6_nxt != IPPROTO_TCP) { + if (ip6->ip6_nxt != IPPROTO_TCP && + ip6->ip6_nxt != IPPROTO_UDP) { m_freem(m_head); return (NULL); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r339942 - stable/10/sys/dev/hyperv/netvsc
Author: whu Date: Wed Oct 31 06:24:07 2018 New Revision: 339942 URL: https://svnweb.freebsd.org/changeset/base/339942 Log: MFC: 339585 r339585: Do not drop UDP traffic when TXCSUM_IPV6 flag is on PR: 231797 Submitted by: whu Reviewed by:dexuan Obtained from: Kevin Morse Sponsored by: Microsoft Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/if_hn.c == --- stable/10/sys/dev/hyperv/netvsc/if_hn.c Wed Oct 31 05:17:53 2018 (r339941) +++ stable/10/sys/dev/hyperv/netvsc/if_hn.c Wed Oct 31 06:24:07 2018 (r339942) @@ -857,7 +857,8 @@ hn_set_hlen(struct mbuf *m_head) PULLUP_HDR(m_head, ehlen + sizeof(*ip6)); ip6 = mtodo(m_head, ehlen); - if (ip6->ip6_nxt != IPPROTO_TCP) { + if (ip6->ip6_nxt != IPPROTO_TCP && + ip6->ip6_nxt != IPPROTO_UDP) { m_freem(m_head); return (NULL); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r339863 - stable/11/sys/dev/hyperv/netvsc
Author: whu Date: Mon Oct 29 15:12:15 2018 New Revision: 339863 URL: https://svnweb.freebsd.org/changeset/base/339863 Log: MFC: 339585 r339585: Do not drop UDP traffic when TXCSUM_IPV6 flag is on PR: 231797 Submitted by: whu Reviewed by:dexuan Obtained from: Kevin Morse Sponsored by: Microsoft Differential Revision: https://bugs.freebsd.org/bugzilla/attachment.cgi?id=198333=diff Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c == --- stable/11/sys/dev/hyperv/netvsc/if_hn.c Mon Oct 29 14:37:27 2018 (r339862) +++ stable/11/sys/dev/hyperv/netvsc/if_hn.c Mon Oct 29 15:12:15 2018 (r339863) @@ -861,7 +861,8 @@ hn_set_hlen(struct mbuf *m_head) PULLUP_HDR(m_head, ehlen + sizeof(*ip6)); ip6 = mtodo(m_head, ehlen); - if (ip6->ip6_nxt != IPPROTO_TCP) { + if (ip6->ip6_nxt != IPPROTO_TCP && + ip6->ip6_nxt != IPPROTO_UDP) { m_freem(m_head); return (NULL); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r339585 - head/sys/dev/hyperv/netvsc
Author: whu Date: Mon Oct 22 11:23:51 2018 New Revision: 339585 URL: https://svnweb.freebsd.org/changeset/base/339585 Log: Do not trop UDP traffic when TXCSUM_IPV6 flag is on PR: 231797 Submitted by: whu Reviewed by: dexuan Obtained from:Kevin Morse MFC after:3 days Sponsored by: Microsoft Differential Revision: https://bugs.freebsd.org/bugzilla/attachment.cgi?id=198333=diff Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c == --- head/sys/dev/hyperv/netvsc/if_hn.c Mon Oct 22 10:38:38 2018 (r339584) +++ head/sys/dev/hyperv/netvsc/if_hn.c Mon Oct 22 11:23:51 2018 (r339585) @@ -861,7 +861,8 @@ hn_set_hlen(struct mbuf *m_head) PULLUP_HDR(m_head, ehlen + sizeof(*ip6)); ip6 = mtodo(m_head, ehlen); - if (ip6->ip6_nxt != IPPROTO_TCP) { + if (ip6->ip6_nxt != IPPROTO_TCP && + ip6->ip6_nxt != IPPROTO_UDP) { m_freem(m_head); return (NULL); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r291156 - head/sys/dev/hyperv/netvsc
Author: whu Date: Sun Nov 22 05:26:13 2015 New Revision: 291156 URL: https://svnweb.freebsd.org/changeset/base/291156 Log: Ignore the inbound checksum flags when doing packet forwarding in netvsc driver. PR: 20363 Submitted by: whu Reviewed by: royger, whu Approved by: royger MFC after: 1 week Relnotes: No Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4131 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Sun Nov 22 02:43:14 2015(r291155) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Sun Nov 22 05:26:13 2015(r291156) @@ -128,6 +128,15 @@ __FBSDID("$FreeBSD$"); #define HV_NV_SC_PTR_OFFSET_IN_BUF 0 #define HV_NV_PACKET_OFFSET_IN_BUF 16 +/* + * A unified flag for all outbound check sum flags is useful, + * and it helps avoiding unnecessary check sum calculation in + * network forwarding scenario. + */ +#define HV_CSUM_FOR_OUTBOUND \ +(CSUM_IP|CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP|CSUM_IP_TSO| \ +CSUM_IP_ISCSI|CSUM_IP6_UDP|CSUM_IP6_TCP|CSUM_IP6_SCTP| \ +CSUM_IP6_TSO|CSUM_IP6_ISCSI) /* * Data types @@ -570,7 +579,8 @@ hn_start_locked(struct ifnet *ifp) packet->vlan_tci & 0xfff; } - if (0 == m_head->m_pkthdr.csum_flags) { + /* Only check the flags for outbound and ignore the ones for inbound */ + if (0 == (m_head->m_pkthdr.csum_flags & HV_CSUM_FOR_OUTBOUND)) { goto pre_send; } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r286058 - releng/10.2/sys/dev/hyperv/netvsc
Author: whu Date: Thu Jul 30 02:22:38 2015 New Revision: 286058 URL: https://svnweb.freebsd.org/changeset/base/286058 Log: MFC r285928 Do not enable UDP checksum offloading when running on the Hyper-V on Windows Server 2012 and earlier hosts. Submitted by: whu Reviewed by: royger Approved by: re (gjb) Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D3102 Modified: releng/10.2/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Directory Properties: releng/10.2/ (props changed) Modified: releng/10.2/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- releng/10.2/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Jul 30 02:09:03 2015(r286057) +++ releng/10.2/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Jul 30 02:22:38 2015(r286058) @@ -343,7 +343,15 @@ netvsc_attach(device_t dev) IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TSO; ifp-if_capenable |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TSO; - ifp-if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_TSO; + /* +* Only enable UDP checksum offloading when it is on 2012R2 or +* later. UDP checksum offloading doesn't work on earlier +* Windows releases. +*/ + if (hv_vmbus_protocal_version = HV_VMBUS_VERSION_WIN8_1) + ifp-if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_TSO; + else + ifp-if_hwassist = CSUM_TCP | CSUM_TSO; ret = hv_rf_on_device_add(device_ctx, device_info); if (ret != 0) { @@ -1110,7 +1118,17 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, ifp-if_hwassist = ~(CSUM_TCP | CSUM_UDP); } else { ifp-if_capenable |= IFCAP_TXCSUM; - ifp-if_hwassist |= (CSUM_TCP | CSUM_UDP); + /* +* Only enable UDP checksum offloading on +* Windows Server 2012R2 or later releases. +*/ + if (hv_vmbus_protocal_version = + HV_VMBUS_VERSION_WIN8_1) { + ifp-if_hwassist |= + (CSUM_TCP | CSUM_UDP); + } else { + ifp-if_hwassist |= CSUM_TCP; + } } } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r285928 - stable/10/sys/dev/hyperv/netvsc
Author: whu Date: Tue Jul 28 05:46:37 2015 New Revision: 285928 URL: https://svnweb.freebsd.org/changeset/base/285928 Log: MFC r285785 Do not enable UDP checksum offloading when running on the Hyper-V on Windows Server 2012 and earlier hosts. Submitted by: whu Reviewed by: royger Approved by: royger Relnotes: No Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D3217 Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Jul 28 04:54:05 2015(r285927) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Jul 28 05:46:37 2015(r285928) @@ -343,7 +343,15 @@ netvsc_attach(device_t dev) IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TSO; ifp-if_capenable |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TSO; - ifp-if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_TSO; + /* +* Only enable UDP checksum offloading when it is on 2012R2 or +* later. UDP checksum offloading doesn't work on earlier +* Windows releases. +*/ + if (hv_vmbus_protocal_version = HV_VMBUS_VERSION_WIN8_1) + ifp-if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_TSO; + else + ifp-if_hwassist = CSUM_TCP | CSUM_TSO; ret = hv_rf_on_device_add(device_ctx, device_info); if (ret != 0) { @@ -1110,7 +1118,17 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, ifp-if_hwassist = ~(CSUM_TCP | CSUM_UDP); } else { ifp-if_capenable |= IFCAP_TXCSUM; - ifp-if_hwassist |= (CSUM_TCP | CSUM_UDP); + /* +* Only enable UDP checksum offloading on +* Windows Server 2012R2 or later releases. +*/ + if (hv_vmbus_protocal_version = + HV_VMBUS_VERSION_WIN8_1) { + ifp-if_hwassist |= + (CSUM_TCP | CSUM_UDP); + } else { + ifp-if_hwassist |= CSUM_TCP; + } } } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r285785 - head/sys/dev/hyperv/netvsc
Author: whu Date: Wed Jul 22 05:05:01 2015 New Revision: 285785 URL: https://svnweb.freebsd.org/changeset/base/285785 Log: Do not enable UDP checksum offloading when running on the Hyper-V on Windows Server 2012 and earlier hosts. Submitted by: whu Reviewed by: royger Approved by: royger MFC after: 3 days Relnotes: No Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D3086 Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Jul 22 04:18:33 2015(r285784) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Jul 22 05:05:01 2015(r285785) @@ -343,7 +343,15 @@ netvsc_attach(device_t dev) IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TSO; ifp-if_capenable |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | IFCAP_TSO; - ifp-if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_TSO; + /* +* Only enable UDP checksum offloading when it is on 2012R2 or +* later. UDP checksum offloading doesn't work on earlier +* Windows releases. +*/ + if (hv_vmbus_protocal_version = HV_VMBUS_VERSION_WIN8_1) + ifp-if_hwassist = CSUM_TCP | CSUM_UDP | CSUM_TSO; + else + ifp-if_hwassist = CSUM_TCP | CSUM_TSO; ret = hv_rf_on_device_add(device_ctx, device_info); if (ret != 0) { @@ -1108,7 +1116,17 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, ifp-if_hwassist = ~(CSUM_TCP | CSUM_UDP); } else { ifp-if_capenable |= IFCAP_TXCSUM; - ifp-if_hwassist |= (CSUM_TCP | CSUM_UDP); + /* +* Only enable UDP checksum offloading on +* Windows Server 2012R2 or later releases. +*/ + if (hv_vmbus_protocal_version = + HV_VMBUS_VERSION_WIN8_1) { + ifp-if_hwassist |= + (CSUM_TCP | CSUM_UDP); + } else { + ifp-if_hwassist |= CSUM_TCP; + } } } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r285236 - in stable/10/sys/dev/hyperv: include netvsc
Author: whu Date: Tue Jul 7 04:15:22 2015 New Revision: 285236 URL: https://svnweb.freebsd.org/changeset/base/285236 Log: MFC r284746 and r284889 TSO and checksum offloading support for Netvsc driver on Hyper-V. Submitted by: whu Reviewed by: royger Approved by: re Relnotes: yes Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D2906 Modified: stable/10/sys/dev/hyperv/include/hyperv.h stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c stable/10/sys/dev/hyperv/netvsc/hv_rndis.h stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/include/hyperv.h == --- stable/10/sys/dev/hyperv/include/hyperv.h Tue Jul 7 04:09:35 2015 (r285235) +++ stable/10/sys/dev/hyperv/include/hyperv.h Tue Jul 7 04:15:22 2015 (r285236) @@ -107,7 +107,7 @@ typedef uint8_t hv_bool_uint8_t; #define HV_MAX_PIPE_USER_DEFINED_BYTES 116 -#define HV_MAX_PAGE_BUFFER_COUNT 16 +#define HV_MAX_PAGE_BUFFER_COUNT 32 #define HV_MAX_MULTIPAGE_BUFFER_COUNT 32 #define HV_ALIGN_UP(value, align) \ Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c == --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.cTue Jul 7 04:09:35 2015(r285235) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.cTue Jul 7 04:15:22 2015(r285236) @@ -48,6 +48,7 @@ #include hv_rndis.h #include hv_rndis_filter.h +MALLOC_DEFINE(M_NETVSC, netvsc, Hyper-V netvsc driver); /* * Forward declarations @@ -58,13 +59,10 @@ static int hv_nv_init_rx_buffer_with_ne static int hv_nv_destroy_send_buffer(netvsc_dev *net_dev); static int hv_nv_destroy_rx_buffer(netvsc_dev *net_dev); static int hv_nv_connect_to_vsp(struct hv_device *device); -static void hv_nv_on_send_completion(struct hv_device *device, -hv_vm_packet_descriptor *pkt); -static void hv_nv_on_receive(struct hv_device *device, -hv_vm_packet_descriptor *pkt); -static void hv_nv_send_receive_completion(struct hv_device *device, - uint64_t tid); - +static void hv_nv_on_send_completion(netvsc_dev *net_dev, +struct hv_device *device, hv_vm_packet_descriptor *pkt); +static void hv_nv_on_receive(netvsc_dev *net_dev, +struct hv_device *device, hv_vm_packet_descriptor *pkt); /* * @@ -75,7 +73,7 @@ hv_nv_alloc_net_device(struct hv_device netvsc_dev *net_dev; hn_softc_t *sc = device_get_softc(device-device); - net_dev = malloc(sizeof(netvsc_dev), M_DEVBUF, M_NOWAIT | M_ZERO); + net_dev = malloc(sizeof(netvsc_dev), M_NETVSC, M_NOWAIT | M_ZERO); if (net_dev == NULL) { return (NULL); } @@ -127,6 +125,34 @@ hv_nv_get_inbound_net_device(struct hv_d return (net_dev); } +int +hv_nv_get_next_send_section(netvsc_dev *net_dev) +{ + unsigned long bitsmap_words = net_dev-bitsmap_words; + unsigned long *bitsmap = net_dev-send_section_bitsmap; + unsigned long idx; + int ret = NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX; + int i; + + for (i = 0; i bitsmap_words; i++) { + idx = ffs(~bitsmap[i]); + if (0 == idx) + continue; + + idx--; + if (i * BITS_PER_LONG + idx = net_dev-send_section_count) + return (ret); + + if (synch_test_and_set_bit(idx, bitsmap[i])) + continue; + + ret = i * BITS_PER_LONG + idx; + break; + } + + return (ret); +} + /* * Net VSC initialize receive buffer with net VSP * @@ -145,12 +171,8 @@ hv_nv_init_rx_buffer_with_net_vsp(struct return (ENODEV); } - net_dev-rx_buf = contigmalloc(net_dev-rx_buf_size, M_DEVBUF, + net_dev-rx_buf = contigmalloc(net_dev-rx_buf_size, M_NETVSC, M_ZERO, 0UL, BUS_SPACE_MAXADDR, PAGE_SIZE, 0); - if (net_dev-rx_buf == NULL) { - ret = ENOMEM; - goto cleanup; - } /* * Establish the GPADL handle for this buffer on this channel. @@ -201,7 +223,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct init_pkt-msgs.vers_1_msgs.send_rx_buf_complete.num_sections; net_dev-rx_sections = malloc(net_dev-rx_section_count * - sizeof(nvsp_1_rx_buf_section), M_DEVBUF, M_NOWAIT); + sizeof(nvsp_1_rx_buf_section), M_NETVSC, M_NOWAIT); if (net_dev-rx_sections == NULL) { ret = EINVAL; goto
svn commit: r284746 - in head/sys/dev/hyperv: include netvsc
Author: whu Date: Wed Jun 24 06:01:29 2015 New Revision: 284746 URL: https://svnweb.freebsd.org/changeset/base/284746 Log: TSO and checksum offloading support for Netvsc driver on Hyper-V. Submitted by: whu Reviewed by: royger Approved by: royger MFC after:1 week Relnotes: yes Sponsored by: Microsoft OSTC Differential Revision:https://reviews.freebsd.org/D2517 Modified: head/sys/dev/hyperv/include/hyperv.h head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis.h head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Modified: head/sys/dev/hyperv/include/hyperv.h == --- head/sys/dev/hyperv/include/hyperv.hWed Jun 24 01:48:44 2015 (r284745) +++ head/sys/dev/hyperv/include/hyperv.hWed Jun 24 06:01:29 2015 (r284746) @@ -107,7 +107,7 @@ typedef uint8_t hv_bool_uint8_t; #define HV_MAX_PIPE_USER_DEFINED_BYTES 116 -#define HV_MAX_PAGE_BUFFER_COUNT 16 +#define HV_MAX_PAGE_BUFFER_COUNT 32 #define HV_MAX_MULTIPAGE_BUFFER_COUNT 32 #define HV_ALIGN_UP(value, align) \ Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c == --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Jun 24 01:48:44 2015 (r284745) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Jun 24 06:01:29 2015 (r284746) @@ -49,6 +49,7 @@ #include hv_rndis.h #include hv_rndis_filter.h +MALLOC_DEFINE(M_NETVSC, netvsc, Hyper-V netvsc driver); /* * Forward declarations @@ -59,13 +60,10 @@ static int hv_nv_init_rx_buffer_with_ne static int hv_nv_destroy_send_buffer(netvsc_dev *net_dev); static int hv_nv_destroy_rx_buffer(netvsc_dev *net_dev); static int hv_nv_connect_to_vsp(struct hv_device *device); -static void hv_nv_on_send_completion(struct hv_device *device, -hv_vm_packet_descriptor *pkt); -static void hv_nv_on_receive(struct hv_device *device, -hv_vm_packet_descriptor *pkt); -static void hv_nv_send_receive_completion(struct hv_device *device, - uint64_t tid); - +static void hv_nv_on_send_completion(netvsc_dev *net_dev, +struct hv_device *device, hv_vm_packet_descriptor *pkt); +static void hv_nv_on_receive(netvsc_dev *net_dev, +struct hv_device *device, hv_vm_packet_descriptor *pkt); /* * @@ -76,7 +74,7 @@ hv_nv_alloc_net_device(struct hv_device netvsc_dev *net_dev; hn_softc_t *sc = device_get_softc(device-device); - net_dev = malloc(sizeof(netvsc_dev), M_DEVBUF, M_NOWAIT | M_ZERO); + net_dev = malloc(sizeof(netvsc_dev), M_NETVSC, M_NOWAIT | M_ZERO); if (net_dev == NULL) { return (NULL); } @@ -128,6 +126,34 @@ hv_nv_get_inbound_net_device(struct hv_d return (net_dev); } +int +hv_nv_get_next_send_section(netvsc_dev *net_dev) +{ + unsigned long bitsmap_words = net_dev-bitsmap_words; + unsigned long *bitsmap = net_dev-send_section_bitsmap; + unsigned long idx; + int ret = NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX; + int i; + + for (i = 0; i bitsmap_words; i++) { + idx = ffs(~bitsmap[i]); + if (0 == idx) + continue; + + idx--; + if (i * BITS_PER_LONG + idx = net_dev-send_section_count) + return (ret); + + if (synch_test_and_set_bit(idx, bitsmap[i])) + continue; + + ret = i * BITS_PER_LONG + idx; + break; + } + + return (ret); +} + /* * Net VSC initialize receive buffer with net VSP * @@ -146,12 +172,8 @@ hv_nv_init_rx_buffer_with_net_vsp(struct return (ENODEV); } - net_dev-rx_buf = contigmalloc(net_dev-rx_buf_size, M_DEVBUF, + net_dev-rx_buf = contigmalloc(net_dev-rx_buf_size, M_NETVSC, M_ZERO, 0UL, BUS_SPACE_MAXADDR, PAGE_SIZE, 0); - if (net_dev-rx_buf == NULL) { - ret = ENOMEM; - goto cleanup; - } /* * Establish the GPADL handle for this buffer on this channel. @@ -202,7 +224,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct init_pkt-msgs.vers_1_msgs.send_rx_buf_complete.num_sections; net_dev-rx_sections = malloc(net_dev-rx_section_count * - sizeof(nvsp_1_rx_buf_section), M_DEVBUF, M_NOWAIT); + sizeof(nvsp_1_rx_buf_section), M_NETVSC, M_NOWAIT); if (net_dev-rx_sections == NULL) { ret = EINVAL; goto cleanup; @@ -246,7 +268,7 @@ hv_nv_init_send_buffer_with_net_vsp(stru return (ENODEV);
svn commit: r283644 - stable/10/sys/dev/hyperv/storvsc
Author: whu Date: Thu May 28 09:20:35 2015 New Revision: 283644 URL: https://svnweb.freebsd.org/changeset/base/283644 Log: MFC r283053 Submitted by: whu Reviewed by: royger Approved by: royger Sponsored by: Microsoft OSTC Differential Revision:https://reviews.freebsd.org/D2661 Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c stable/10/sys/dev/hyperv/storvsc/hv_vstorage.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c == --- stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu May 28 08:00:11 2015(r283643) +++ stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Thu May 28 09:20:35 2015(r283644) @@ -87,6 +87,8 @@ __FBSDID($FreeBSD$); #define STORVSC_WIN8_MAJOR 5 #define STORVSC_WIN8_MINOR 1 +#define VSTOR_PKT_SIZE (sizeof(struct vstor_packet) - vmscsi_size_delta) + #define HV_ALIGN(x, a) roundup2(x, a) struct storvsc_softc; @@ -202,6 +204,21 @@ static struct storvsc_driver_props g_drv STORVSC_RINGBUFFER_SIZE} }; +/* + * Sense buffer size changed in win8; have a run-time + * variable to track the size we should use. + */ +static int sense_buffer_size; + +/* + * The size of the vmscsi_request has changed in win8. The + * additional size is for the newly added elements in the + * structure. These elements are valid only when we are talking + * to a win8 host. + * Track the correct size we need to apply. + */ +static int vmscsi_size_delta; + static int storvsc_current_major; static int storvsc_current_minor; @@ -214,6 +231,7 @@ static void storvsc_action(struct cam_si static int create_storvsc_request(union ccb *ccb, struct hv_storvsc_request *reqp); static void storvsc_free_request(struct storvsc_softc *sc, struct hv_storvsc_request *reqp); static enum hv_storage_type storvsc_get_storage_type(device_t dev); +static void hv_storvsc_rescan_target(struct storvsc_softc *sc); static void hv_storvsc_on_channel_callback(void *context); static void hv_storvsc_on_iocompletion( struct storvsc_softc *sc, struct vstor_packet *vstor_packet, @@ -381,7 +399,7 @@ storvsc_send_multichannel_request(struct ret = hv_vmbus_channel_send_packet( dev-channel, vstor_packet, - sizeof(struct vstor_packet), + VSTOR_PKT_SIZE, (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -448,7 +466,7 @@ hv_storvsc_channel_init(struct hv_device ret = hv_vmbus_channel_send_packet( dev-channel, vstor_packet, - sizeof(struct vstor_packet), + VSTOR_PKT_SIZE, (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -481,7 +499,7 @@ hv_storvsc_channel_init(struct hv_device ret = hv_vmbus_channel_send_packet( dev-channel, vstor_packet, - sizeof(struct vstor_packet), + VSTOR_PKT_SIZE, (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -510,7 +528,7 @@ hv_storvsc_channel_init(struct hv_device ret = hv_vmbus_channel_send_packet( dev-channel, vstor_packet, - sizeof(struct vstor_packet), + VSTOR_PKT_SIZE, (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -546,7 +564,7 @@ hv_storvsc_channel_init(struct hv_device ret = hv_vmbus_channel_send_packet( dev-channel, vstor_packet, - sizeof(struct vstor_packet), + VSTOR_PKT_SIZE, (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -644,7 +662,7 @@ hv_storvsc_host_reset(struct hv_device * ret = hv_vmbus_channel_send_packet(dev-channel, vstor_packet, - sizeof(struct vstor_packet), + VSTOR_PKT_SIZE, (uint64_t)(uintptr_t)sc-hs_reset_req, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -695,9 +713,9 @@
svn commit: r283280 - in stable/10/sys: amd64/amd64 amd64/conf amd64/include conf dev/hyperv/include dev/hyperv/storvsc dev/hyperv/utilities dev/hyperv/vmbus i386/conf i386/i386
Author: whu Date: Fri May 22 09:03:55 2015 New Revision: 283280 URL: https://svnweb.freebsd.org/changeset/base/283280 Log: MFC r282212: Microsoft vmbus, storage and other related driver enhancements for HyperV. - Vmbus multi channel support. - Vector interrupt support. - Signal optimization. - Storvsc driver performance improvement. - Scatter and gather support for storvsc driver. - Minor bug fix for KVP driver. Thanks royger, jhb and delphij from FreeBSD community for the reviews and comments. Also thanks Hovy Xu from NetApp for the contributions to the storvsc driver. PR: 195238 Submitted by: whu Reviewed by:royger Approved by:royger Relnotes: yes Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D2575 Modified: stable/10/sys/amd64/amd64/apic_vector.S stable/10/sys/amd64/conf/GENERIC stable/10/sys/amd64/conf/NOTES stable/10/sys/amd64/include/apicvar.h stable/10/sys/conf/options.amd64 stable/10/sys/conf/options.i386 stable/10/sys/dev/hyperv/include/hyperv.h stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c stable/10/sys/dev/hyperv/storvsc/hv_vstorage.h stable/10/sys/dev/hyperv/utilities/hv_kvp.c stable/10/sys/dev/hyperv/utilities/hv_util.c stable/10/sys/dev/hyperv/vmbus/hv_channel.c stable/10/sys/dev/hyperv/vmbus/hv_channel_mgmt.c stable/10/sys/dev/hyperv/vmbus/hv_connection.c stable/10/sys/dev/hyperv/vmbus/hv_hv.c stable/10/sys/dev/hyperv/vmbus/hv_ring_buffer.c stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h stable/10/sys/i386/conf/GENERIC stable/10/sys/i386/i386/apic_vector.s Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/apic_vector.S == --- stable/10/sys/amd64/amd64/apic_vector.S Fri May 22 08:11:31 2015 (r283279) +++ stable/10/sys/amd64/amd64/apic_vector.S Fri May 22 09:03:55 2015 (r283280) @@ -150,6 +150,22 @@ IDTVEC(xen_intr_upcall) jmp doreti #endif +#ifdef HYPERV +/* + * This is the Hyper-V vmbus channel direct callback interrupt. + * Only used when it is running on Hyper-V. + */ + .text + SUPERALIGN_TEXT +IDTVEC(hv_vmbus_callback) + PUSH_FRAME + FAKE_MCOUNT(TF_RIP(%rsp)) + movq%rsp, %rdi + callhv_vector_handler + MEXITCOUNT + jmp doreti +#endif + #ifdef SMP /* * Global address space TLB shootdown. Modified: stable/10/sys/amd64/conf/GENERIC == --- stable/10/sys/amd64/conf/GENERICFri May 22 08:11:31 2015 (r283279) +++ stable/10/sys/amd64/conf/GENERICFri May 22 09:03:55 2015 (r283280) @@ -346,7 +346,9 @@ device virtio_blk # VirtIO Block devic device virtio_scsi # VirtIO SCSI device device virtio_balloon # VirtIO Memory Balloon device -# HyperV drivers +# HyperV drivers and enchancement support +# NOTE: HYPERV depends on hyperv. They must be added or removed together. +optionsHYPERV # Hyper-V kernel infrastructure device hyperv # HyperV drivers # Xen HVM Guest Optimizations Modified: stable/10/sys/amd64/conf/NOTES == --- stable/10/sys/amd64/conf/NOTES Fri May 22 08:11:31 2015 (r283279) +++ stable/10/sys/amd64/conf/NOTES Fri May 22 09:03:55 2015 (r283280) @@ -479,6 +479,8 @@ device virtio_balloon # VirtIO Memory B device virtio_random # VirtIO Entropy device device virtio_console # VirtIO Console device +# Microsoft Hyper-V enchancement support +optionsHYPERV # Hyper-V kernel infrastructure device hyperv # HyperV drivers # Xen HVM Guest Optimizations Modified: stable/10/sys/amd64/include/apicvar.h == --- stable/10/sys/amd64/include/apicvar.h Fri May 22 08:11:31 2015 (r283279) +++ stable/10/sys/amd64/include/apicvar.h Fri May 22 09:03:55 2015 (r283280) @@ -216,6 +216,7 @@ int lapic_set_lvt_triggermode(u_int apic void lapic_set_tpr(u_int vector); void lapic_setup(int boot); void xen_intr_handle_upcall(struct trapframe *frame); +void hv_vector_handler(struct trapframe *frame); #endif /* !LOCORE */ #endif /* _MACHINE_APICVAR_H_ */ Modified: stable/10/sys/conf/options.amd64 == --- stable/10/sys/conf/options.amd64Fri May 22 08:11:31 2015 (r283279) +++ stable/10/sys/conf/options.amd64Fri May 22 09:03:55 2015 (r283280) @@ -67,5 +67,7 @@ BPF_JITTER
svn commit: r283284 - stable/10/sys/i386/include
Author: whu Date: Fri May 22 11:20:59 2015 New Revision: 283284 URL: https://svnweb.freebsd.org/changeset/base/283284 Log: Fix a i386 build failure cause by commit r283280. Modified: stable/10/sys/i386/include/apicvar.h Modified: stable/10/sys/i386/include/apicvar.h == --- stable/10/sys/i386/include/apicvar.hFri May 22 11:09:41 2015 (r283283) +++ stable/10/sys/i386/include/apicvar.hFri May 22 11:20:59 2015 (r283284) @@ -215,6 +215,7 @@ int lapic_set_lvt_triggermode(u_int apic void lapic_set_tpr(u_int vector); void lapic_setup(int boot); void xen_intr_handle_upcall(struct trapframe *frame); +void hv_vector_handler(struct trapframe *frame); #endif /* !LOCORE */ #endif /* _MACHINE_APICVAR_H_ */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r283053 - head/sys/dev/hyperv/storvsc
Author: whu Date: Mon May 18 10:31:23 2015 New Revision: 283053 URL: https://svnweb.freebsd.org/changeset/base/283053 Log: Add support for SCSI disk hot add and remove. Also add padding according to the requirement of different hypervisor releases. Submitted by: whu Reviewed by: royger Approved by: royger MFC after:1 week Sponsored by: Microsoft OSTC Differential Revision:https://reviews.freebsd.org/D2512 Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c head/sys/dev/hyperv/storvsc/hv_vstorage.h Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c == --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cMon May 18 08:12:08 2015(r283052) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.cMon May 18 10:31:23 2015(r283053) @@ -87,6 +87,8 @@ __FBSDID($FreeBSD$); #define STORVSC_WIN8_MAJOR 5 #define STORVSC_WIN8_MINOR 1 +#define VSTOR_PKT_SIZE (sizeof(struct vstor_packet) - vmscsi_size_delta) + #define HV_ALIGN(x, a) roundup2(x, a) struct storvsc_softc; @@ -202,6 +204,21 @@ static struct storvsc_driver_props g_drv STORVSC_RINGBUFFER_SIZE} }; +/* + * Sense buffer size changed in win8; have a run-time + * variable to track the size we should use. + */ +static int sense_buffer_size; + +/* + * The size of the vmscsi_request has changed in win8. The + * additional size is for the newly added elements in the + * structure. These elements are valid only when we are talking + * to a win8 host. + * Track the correct size we need to apply. + */ +static int vmscsi_size_delta; + static int storvsc_current_major; static int storvsc_current_minor; @@ -214,6 +231,7 @@ static void storvsc_action(struct cam_si static int create_storvsc_request(union ccb *ccb, struct hv_storvsc_request *reqp); static void storvsc_free_request(struct storvsc_softc *sc, struct hv_storvsc_request *reqp); static enum hv_storage_type storvsc_get_storage_type(device_t dev); +static void hv_storvsc_rescan_target(struct storvsc_softc *sc); static void hv_storvsc_on_channel_callback(void *context); static void hv_storvsc_on_iocompletion( struct storvsc_softc *sc, struct vstor_packet *vstor_packet, @@ -381,7 +399,7 @@ storvsc_send_multichannel_request(struct ret = hv_vmbus_channel_send_packet( dev-channel, vstor_packet, - sizeof(struct vstor_packet), + VSTOR_PKT_SIZE, (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -448,7 +466,7 @@ hv_storvsc_channel_init(struct hv_device ret = hv_vmbus_channel_send_packet( dev-channel, vstor_packet, - sizeof(struct vstor_packet), + VSTOR_PKT_SIZE, (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -481,7 +499,7 @@ hv_storvsc_channel_init(struct hv_device ret = hv_vmbus_channel_send_packet( dev-channel, vstor_packet, - sizeof(struct vstor_packet), + VSTOR_PKT_SIZE, (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -510,7 +528,7 @@ hv_storvsc_channel_init(struct hv_device ret = hv_vmbus_channel_send_packet( dev-channel, vstor_packet, - sizeof(struct vstor_packet), + VSTOR_PKT_SIZE, (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -546,7 +564,7 @@ hv_storvsc_channel_init(struct hv_device ret = hv_vmbus_channel_send_packet( dev-channel, vstor_packet, - sizeof(struct vstor_packet), + VSTOR_PKT_SIZE, (uint64_t)(uintptr_t)request, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND, HV_VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); @@ -644,7 +662,7 @@ hv_storvsc_host_reset(struct hv_device * ret = hv_vmbus_channel_send_packet(dev-channel, vstor_packet, - sizeof(struct vstor_packet), + VSTOR_PKT_SIZE, (uint64_t)(uintptr_t)sc-hs_reset_req, HV_VMBUS_PACKET_TYPE_DATA_IN_BAND,
svn commit: r282212 - in head/sys: amd64/amd64 amd64/conf conf dev/hyperv/include dev/hyperv/storvsc dev/hyperv/utilities dev/hyperv/vmbus i386/conf i386/i386 x86/include
Author: whu Date: Wed Apr 29 10:12:34 2015 New Revision: 282212 URL: https://svnweb.freebsd.org/changeset/base/282212 Log: Microsoft vmbus, storage and other related driver enhancements for HyperV. - Vmbus multi channel support. - Vector interrupt support. - Signal optimization. - Storvsc driver performance improvement. - Scatter and gather support for storvsc driver. - Minor bug fix for KVP driver. Thanks royger, jhb and delphij from FreeBSD community for the reviews and comments. Also thanks Hovy Xu from NetApp for the contributions to the storvsc driver. PR: 195238 Submitted by: whu Reviewed by:royger, jhb, delphij Approved by:royger MFC after: 2 weeks Relnotes: yes Sponsored by: Microsoft OSTC Modified: head/sys/amd64/amd64/apic_vector.S head/sys/amd64/conf/GENERIC head/sys/amd64/conf/NOTES head/sys/conf/options.amd64 head/sys/conf/options.i386 head/sys/dev/hyperv/include/hyperv.h head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c head/sys/dev/hyperv/storvsc/hv_vstorage.h head/sys/dev/hyperv/utilities/hv_kvp.c head/sys/dev/hyperv/utilities/hv_util.c head/sys/dev/hyperv/vmbus/hv_channel.c head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c (contents, props changed) head/sys/dev/hyperv/vmbus/hv_connection.c (contents, props changed) head/sys/dev/hyperv/vmbus/hv_hv.c head/sys/dev/hyperv/vmbus/hv_ring_buffer.c (contents, props changed) head/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c head/sys/dev/hyperv/vmbus/hv_vmbus_priv.h head/sys/i386/conf/GENERIC head/sys/i386/i386/apic_vector.s head/sys/x86/include/apicvar.h Modified: head/sys/amd64/amd64/apic_vector.S == --- head/sys/amd64/amd64/apic_vector.S Wed Apr 29 08:56:56 2015 (r282211) +++ head/sys/amd64/amd64/apic_vector.S Wed Apr 29 10:12:34 2015 (r282212) @@ -174,6 +174,22 @@ IDTVEC(xen_intr_upcall) jmp doreti #endif +#ifdef HYPERV +/* + * This is the Hyper-V vmbus channel direct callback interrupt. + * Only used when it is running on Hyper-V. + */ + .text + SUPERALIGN_TEXT +IDTVEC(hv_vmbus_callback) + PUSH_FRAME + FAKE_MCOUNT(TF_RIP(%rsp)) + movq%rsp, %rdi + callhv_vector_handler + MEXITCOUNT + jmp doreti +#endif + #ifdef SMP /* * Global address space TLB shootdown. Modified: head/sys/amd64/conf/GENERIC == --- head/sys/amd64/conf/GENERIC Wed Apr 29 08:56:56 2015(r282211) +++ head/sys/amd64/conf/GENERIC Wed Apr 29 10:12:34 2015(r282212) @@ -340,7 +340,9 @@ device virtio_blk # VirtIO Block devic device virtio_scsi # VirtIO SCSI device device virtio_balloon # VirtIO Memory Balloon device -# HyperV drivers +# HyperV drivers and enchancement support +# NOTE: HYPERV depends on hyperv. They must be added or removed together. +optionsHYPERV # Hyper-V kernel infrastructure device hyperv # HyperV drivers # Xen HVM Guest Optimizations Modified: head/sys/amd64/conf/NOTES == --- head/sys/amd64/conf/NOTES Wed Apr 29 08:56:56 2015(r282211) +++ head/sys/amd64/conf/NOTES Wed Apr 29 10:12:34 2015(r282212) @@ -494,6 +494,8 @@ device virtio_balloon # VirtIO Memory B device virtio_random # VirtIO Entropy device device virtio_console # VirtIO Console device +# Microsoft Hyper-V enchancement support +optionsHYPERV # Hyper-V kernel infrastructure device hyperv # HyperV drivers # Xen HVM Guest Optimizations Modified: head/sys/conf/options.amd64 == --- head/sys/conf/options.amd64 Wed Apr 29 08:56:56 2015(r282211) +++ head/sys/conf/options.amd64 Wed Apr 29 10:12:34 2015(r282212) @@ -63,5 +63,7 @@ BPF_JITTERopt_bpf.h XENHVM opt_global.h +HYPERV opt_global.h + # options for the Intel C600 SAS driver (isci) ISCI_LOGGING opt_isci.h Modified: head/sys/conf/options.i386 == --- head/sys/conf/options.i386 Wed Apr 29 08:56:56 2015(r282211) +++ head/sys/conf/options.i386 Wed Apr 29 10:12:34 2015(r282212) @@ -125,5 +125,7 @@ NATIVE opt_global.h XENopt_global.h XENHVM opt_global.h +HYPERV opt_global.h + # options for the Intel C600 SAS driver (isci) ISCI_LOGGING opt_isci.h Modified: head/sys/dev/hyperv/include/hyperv.h
svn commit: r279581 - head/share/misc
Author: whu Date: Wed Mar 4 09:05:20 2015 New Revision: 279581 URL: https://svnweb.freebsd.org/changeset/base/279581 Log: Add myself (whu) to committers-src.dot. Approved by: royger (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot == --- head/share/misc/committers-src.dot Wed Mar 4 06:03:25 2015 (r279580) +++ head/share/misc/committers-src.dot Wed Mar 4 09:05:20 2015 (r279581) @@ -300,6 +300,7 @@ vanhu [label=Yvan Vanhullebus\nvanhu@Fr versus [label=Konrad Jankowski\nver...@freebsd.org\n2008/10/27] weongyo [label=Weongyo Jeong\nweon...@freebsd.org\n2007/12/21] wes [label=Wes Peters\n...@freebsd.org\n1998/11/25] +whu [label=Wei Hu\n...@freebsd.org\n2015/02/11] wkoszek [label=Wojciech A. Koszek\nwkos...@freebsd.org\n2006/02/21] wollman [label=Garrett Wollman\nwoll...@freebsd.org\n/??/??] wsalamon [label=Wayne Salamon\nwsala...@freebsd.org\n2005/06/25] @@ -430,6 +431,7 @@ gavin - versus gibbs - mjacob gibbs - njl gibbs - royger +gibbs - whu glebius - mav @@ -631,6 +633,8 @@ rgrimes - markm rmacklem - jwd +royger - whu + rpaulo - avg rpaulo - bschmidt rpaulo - dim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org