svn commit: r308194 - in head/sys/dev/hyperv: include vmbus
Sepherosa Ziehau
sephe at FreeBSD.org
Wed Nov 2 05:41:25 UTC 2016
Author: sephe
Date: Wed Nov 2 05:41:23 2016
New Revision: 308194
URL: https://svnweb.freebsd.org/changeset/base/308194
Log:
hyperv: GC unused functions.
MFC after: 1 week
Sponsored by: Microsoft
Differential Revision: https://reviews.freebsd.org/D8406
Modified:
head/sys/dev/hyperv/include/hyperv.h
head/sys/dev/hyperv/include/vmbus.h
head/sys/dev/hyperv/vmbus/vmbus_chan.c
Modified: head/sys/dev/hyperv/include/hyperv.h
==============================================================================
--- head/sys/dev/hyperv/include/hyperv.h Wed Nov 2 05:13:27 2016 (r308193)
+++ head/sys/dev/hyperv/include/hyperv.h Wed Nov 2 05:41:23 2016 (r308194)
@@ -44,15 +44,4 @@ struct hyperv_guid {
int hyperv_guid2str(const struct hyperv_guid *, char *, size_t);
-/**
- * @brief Get physical address from virtual
- */
-static inline unsigned long
-hv_get_phys_addr(void *virt)
-{
- unsigned long ret;
- ret = (vtophys(virt) | ((vm_offset_t) virt & PAGE_MASK));
- return (ret);
-}
-
#endif /* _HYPERV_H_ */
Modified: head/sys/dev/hyperv/include/vmbus.h
==============================================================================
--- head/sys/dev/hyperv/include/vmbus.h Wed Nov 2 05:13:27 2016 (r308193)
+++ head/sys/dev/hyperv/include/vmbus.h Wed Nov 2 05:41:23 2016 (r308194)
@@ -146,8 +146,6 @@ int vmbus_chan_gpadl_disconnect(struct
void vmbus_chan_cpu_set(struct vmbus_channel *chan, int cpu);
void vmbus_chan_cpu_rr(struct vmbus_channel *chan);
-struct vmbus_channel *
- vmbus_chan_cpu2chan(struct vmbus_channel *chan, int cpu);
void vmbus_chan_set_readbatch(struct vmbus_channel *chan, bool on);
struct vmbus_channel **
Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c
==============================================================================
--- head/sys/dev/hyperv/vmbus/vmbus_chan.c Wed Nov 2 05:13:27 2016 (r308193)
+++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Wed Nov 2 05:41:23 2016 (r308194)
@@ -1534,65 +1534,6 @@ vmbus_chan_destroy_all(struct vmbus_soft
}
}
-/*
- * The channel whose vcpu binding is closest to the currect vcpu will
- * be selected.
- * If no multi-channel, always select primary channel.
- */
-struct vmbus_channel *
-vmbus_chan_cpu2chan(struct vmbus_channel *prichan, int cpu)
-{
- struct vmbus_channel *sel, *chan;
- uint32_t vcpu, sel_dist;
-
- KASSERT(cpu >= 0 && cpu < mp_ncpus, ("invalid cpuid %d", cpu));
- if (TAILQ_EMPTY(&prichan->ch_subchans))
- return prichan;
-
- vcpu = VMBUS_PCPU_GET(prichan->ch_vmbus, vcpuid, cpu);
-
-#define CHAN_VCPU_DIST(ch, vcpu) \
- (((ch)->ch_vcpuid > (vcpu)) ? \
- ((ch)->ch_vcpuid - (vcpu)) : ((vcpu) - (ch)->ch_vcpuid))
-
-#define CHAN_SELECT(ch) \
-do { \
- sel = ch; \
- sel_dist = CHAN_VCPU_DIST(ch, vcpu); \
-} while (0)
-
- CHAN_SELECT(prichan);
-
- mtx_lock(&prichan->ch_subchan_lock);
- TAILQ_FOREACH(chan, &prichan->ch_subchans, ch_sublink) {
- uint32_t dist;
-
- KASSERT(chan->ch_stflags & VMBUS_CHAN_ST_OPENED,
- ("chan%u is not opened", chan->ch_id));
-
- if (chan->ch_vcpuid == vcpu) {
- /* Exact match; done */
- CHAN_SELECT(chan);
- break;
- }
-
- dist = CHAN_VCPU_DIST(chan, vcpu);
- if (sel_dist <= dist) {
- /* Far or same distance; skip */
- continue;
- }
-
- /* Select the closer channel. */
- CHAN_SELECT(chan);
- }
- mtx_unlock(&prichan->ch_subchan_lock);
-
-#undef CHAN_SELECT
-#undef CHAN_VCPU_DIST
-
- return sel;
-}
-
struct vmbus_channel **
vmbus_subchan_get(struct vmbus_channel *pri_chan, int subchan_cnt)
{
More information about the svn-src-all
mailing list