X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ofproto%2Fofproto-dpif-upcall.c;h=db78af3817bc9c4b3b5bb8472ec785ba63c54045;hb=015ac88281952a1b43ad46e9e6300db1c6e3647b;hp=111b779790b885e7fe63a60dea6aa519456136d3;hpb=834d6cafe4797861b7547966b4dcc95b374331be;p=sliver-openvswitch.git diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c index 111b77979..db78af381 100644 --- a/ofproto/ofproto-dpif-upcall.c +++ b/ofproto/ofproto-dpif-upcall.c @@ -554,30 +554,30 @@ recv_upcalls(struct udpif *udpif) } } } - hash = mhash_finish(hash, n_bytes); - - handler = &udpif->handlers[hash % udpif->n_handlers]; - - ovs_mutex_lock(&handler->mutex); - if (handler->n_upcalls < MAX_QUEUE_LENGTH) { - list_push_back(&handler->upcalls, &upcall->list_node); - handler->n_upcalls++; - xpthread_cond_signal(&handler->wake_cond); - ovs_mutex_unlock(&handler->mutex); - if (!VLOG_DROP_DBG(&rl)) { - struct ds ds = DS_EMPTY_INITIALIZER; - - odp_flow_key_format(upcall->dpif_upcall.key, - upcall->dpif_upcall.key_len, - &ds); - VLOG_DBG("dispatcher: miss enqueue (%s)", ds_cstr(&ds)); - ds_destroy(&ds); - } - } else { - ovs_mutex_unlock(&handler->mutex); - COVERAGE_INC(miss_queue_overflow); - upcall_destroy(upcall); - } + hash = mhash_finish(hash, n_bytes); + + handler = &udpif->handlers[hash % udpif->n_handlers]; + + ovs_mutex_lock(&handler->mutex); + if (handler->n_upcalls < MAX_QUEUE_LENGTH) { + list_push_back(&handler->upcalls, &upcall->list_node); + handler->n_upcalls++; + xpthread_cond_signal(&handler->wake_cond); + ovs_mutex_unlock(&handler->mutex); + if (!VLOG_DROP_DBG(&rl)) { + struct ds ds = DS_EMPTY_INITIALIZER; + + odp_flow_key_format(upcall->dpif_upcall.key, + upcall->dpif_upcall.key_len, + &ds); + VLOG_DBG("dispatcher: miss enqueue (%s)", ds_cstr(&ds)); + ds_destroy(&ds); + } + } else { + ovs_mutex_unlock(&handler->mutex); + COVERAGE_INC(miss_queue_overflow); + upcall_destroy(upcall); + } } else { ovs_mutex_lock(&udpif->upcall_mutex); if (udpif->n_upcalls < MAX_QUEUE_LENGTH) {