From 99c67a0ae7755e742bc8c28fb5b63f1903b4f7cd Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 31 Mar 2020 10:14:03 -0700 Subject: [PATCH] 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 --- drivers/bus/vmbus/vmbus_bufring.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; } -- 2.20.1