From: Stephen Hemminger Date: Tue, 31 Mar 2020 17:14:03 +0000 (-0700) Subject: bus/vmbus: simplify arguments to need signal function X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=99c67a0ae7755e742bc8c28fb5b63f1903b4f7cd;p=dpdk.git bus/vmbus: simplify arguments to need signal function The transmit need signal function can avoid an unnecessary dereference by passing the right pointer. This also makes code better match FreeBSD driver. Signed-off-by: Stephen Hemminger --- diff --git a/drivers/bus/vmbus/vmbus_bufring.c b/drivers/bus/vmbus/vmbus_bufring.c index c88001605d..c4aa07b307 100644 --- a/drivers/bus/vmbus/vmbus_bufring.c +++ b/drivers/bus/vmbus/vmbus_bufring.c @@ -54,10 +54,10 @@ void vmbus_br_setup(struct vmbus_br *br, void *buf, unsigned int blen) * data have arrived. */ static inline bool -vmbus_txbr_need_signal(const struct vmbus_br *tbr, uint32_t old_windex) +vmbus_txbr_need_signal(const struct vmbus_bufring *vbr, uint32_t old_windex) { rte_smp_mb(); - if (tbr->vbr->imask) + if (vbr->imask) return false; rte_smp_rmb(); @@ -66,7 +66,7 @@ vmbus_txbr_need_signal(const struct vmbus_br *tbr, uint32_t old_windex) * This is the only case we need to signal when the * ring transitions from being empty to non-empty. */ - return old_windex == tbr->vbr->rindex; + return old_windex == vbr->rindex; } static inline uint32_t @@ -163,7 +163,7 @@ vmbus_txbr_write(struct vmbus_br *tbr, const struct iovec iov[], int iovlen, rte_pause(); /* If host had read all data before this, then need to signal */ - *need_sig |= vmbus_txbr_need_signal(tbr, old_windex); + *need_sig |= vmbus_txbr_need_signal(vbr, old_windex); return 0; }