Date: Wed, 30 Nov 2016 07:45:05 +0000 (UTC) From: Sepherosa Ziehau <sephe@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309316 - head/sys/dev/hyperv/vmbus Message-ID: <201611300745.uAU7j5eT010034@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sephe Date: Wed Nov 30 07:45:05 2016 New Revision: 309316 URL: https://svnweb.freebsd.org/changeset/base/309316 Log: hyperv/vmbus: Add DEVMETHOD to map cpu to event taskq. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8658 Modified: head/sys/dev/hyperv/vmbus/vmbus.c head/sys/dev/hyperv/vmbus/vmbus_if.m Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Wed Nov 30 07:22:46 2016 (r309315) +++ head/sys/dev/hyperv/vmbus/vmbus.c Wed Nov 30 07:45:05 2016 (r309316) @@ -97,6 +97,8 @@ static int vmbus_probe_guid_method(dev const struct hyperv_guid *); static uint32_t vmbus_get_vcpu_id_method(device_t bus, device_t dev, int cpu); +static struct taskqueue *vmbus_get_eventtq_method(device_t, device_t, + int); static int vmbus_init(struct vmbus_softc *); static int vmbus_connect(struct vmbus_softc *, uint32_t); @@ -172,6 +174,7 @@ static device_method_t vmbus_methods[] = DEVMETHOD(vmbus_get_version, vmbus_get_version_method), DEVMETHOD(vmbus_probe_guid, vmbus_probe_guid_method), DEVMETHOD(vmbus_get_vcpu_id, vmbus_get_vcpu_id_method), + DEVMETHOD(vmbus_get_event_taskq, vmbus_get_eventtq_method), DEVMETHOD_END }; @@ -1126,6 +1129,15 @@ vmbus_get_vcpu_id_method(device_t bus, d return (VMBUS_PCPU_GET(sc, vcpuid, cpu)); } +static struct taskqueue * +vmbus_get_eventtq_method(device_t bus, device_t dev __unused, int cpu) +{ + const struct vmbus_softc *sc = device_get_softc(bus); + + KASSERT(cpu >= 0 && cpu < mp_ncpus, ("invalid cpu%d", cpu)); + return (VMBUS_PCPU_GET(sc, event_tq, cpu)); +} + #ifdef NEW_PCIB #define VTPM_BASE_ADDR 0xfed40000 #define FOUR_GB (1ULL << 32) Modified: head/sys/dev/hyperv/vmbus/vmbus_if.m ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_if.m Wed Nov 30 07:22:46 2016 (r309315) +++ head/sys/dev/hyperv/vmbus/vmbus_if.m Wed Nov 30 07:45:05 2016 (r309316) @@ -33,6 +33,7 @@ INTERFACE vmbus; HEADER { struct hyperv_guid; + struct taskqueue; }; METHOD uint32_t get_version { @@ -51,3 +52,9 @@ METHOD uint32_t get_vcpu_id { device_t dev; int cpu; }; + +METHOD struct taskqueue * get_event_taskq { + device_t bus; + device_t dev; + int cpu; +};
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611300745.uAU7j5eT010034>