Author: sephe
Date: Thu Jul 14 06:10:00 2016
New Revision: 302806
URL: https://svnweb.freebsd.org/changeset/base/302806

Log:
  hyperv/vmbus: Get rid of rel{_id,id}, use channel id consistently.
  
  MFC after:    1 week
  Sponsored by: Microsoft OSTC
  Differential Revision:        https://reviews.freebsd.org/D7100

Modified:
  head/sys/dev/hyperv/vmbus/hv_channel.c
  head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c

Modified: head/sys/dev/hyperv/vmbus/hv_channel.c
==============================================================================
--- head/sys/dev/hyperv/vmbus/hv_channel.c      Thu Jul 14 06:00:40 2016        
(r302805)
+++ head/sys/dev/hyperv/vmbus/hv_channel.c      Thu Jul 14 06:10:00 2016        
(r302806)
@@ -897,25 +897,23 @@ vmbus_event_flags_proc(struct vmbus_soft
        int f;
 
        for (f = 0; f < flag_cnt; ++f) {
-               uint32_t rel_id_base;
+               uint32_t chid_base;
                u_long flags;
-               int bit;
+               int chid_ofs;
 
                if (event_flags[f] == 0)
                        continue;
 
                flags = atomic_swap_long(&event_flags[f], 0);
-               rel_id_base = f << VMBUS_EVTFLAG_SHIFT;
+               chid_base = f << VMBUS_EVTFLAG_SHIFT;
 
-               while ((bit = ffsl(flags)) != 0) {
+               while ((chid_ofs = ffsl(flags)) != 0) {
                        struct hv_vmbus_channel *channel;
-                       uint32_t rel_id;
 
-                       --bit;  /* NOTE: ffsl is 1-based */
-                       flags &= ~(1UL << bit);
+                       --chid_ofs; /* NOTE: ffsl is 1-based */
+                       flags &= ~(1UL << chid_ofs);
 
-                       rel_id = rel_id_base + bit;
-                       channel = sc->vmbus_chmap[rel_id];
+                       channel = sc->vmbus_chmap[chid_base + chid_ofs];
 
                        /* if channel is closed or closing */
                        if (channel == NULL || channel->rxq == NULL)

Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c
==============================================================================
--- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Thu Jul 14 06:00:40 2016        
(r302805)
+++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Thu Jul 14 06:10:00 2016        
(r302806)
@@ -113,20 +113,18 @@ vmbus_channel_process_offer(hv_vmbus_cha
 {
        struct vmbus_softc *sc = new_channel->vmbus_sc;
        hv_vmbus_channel*       channel;
-       uint32_t                relid;
 
-       relid = new_channel->ch_id;
        /*
         * Make sure this is a new offer
         */
        mtx_lock(&sc->vmbus_chlist_lock);
-       if (relid == 0) {
+       if (new_channel->ch_id == 0) {
                /*
                 * XXX channel0 will not be processed; skip it.
                 */
                printf("VMBUS: got channel0 offer\n");
        } else {
-               sc->vmbus_chmap[relid] = new_channel;
+               sc->vmbus_chmap[new_channel->ch_id] = new_channel;
        }
 
        TAILQ_FOREACH(channel, &sc->vmbus_chlist, ch_link) {
_______________________________________________
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"

Reply via email to