From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 23277A0562; Tue, 31 Mar 2020 19:15:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 50A0B1C113; Tue, 31 Mar 2020 19:14:37 +0200 (CEST) Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id 501B91C0CC for ; Tue, 31 Mar 2020 19:14:29 +0200 (CEST) Received: by mail-pf1-f194.google.com with SMTP id 22so10603432pfa.9 for ; Tue, 31 Mar 2020 10:14:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hQIjjxLRdWDnUCFgt6/FtHGYslkCYHvDfR3jz/areDc=; b=mkgtoVJQEGyBIjOBIJjycA57fABrX3C+L4zUOQir8yPmFCeL18ms84GiADFiA9m4eV 8MmmEiltmSu9VJcJFkbCVJSxIpy7fGjR0FwqX3zrk3LAtpj+1DT5hKsPmWs62SJ0vHAZ pGOpaXAvn0F8Jp0GTVmUJfgndUhqL1m7o+JUXGfCUVB9XBo6HMZ0jsdY4p8NVmErI/BF //67aMGM6r1q/YxaKtbyqJs9kGTqmjdxf0st16FzJJPRtUNHeOsQpxxpDt2SdM+xYGsw G9Jo5u26KTDZG4+jhR6ig8uPednfkoZMdQLOokoR93lMbGnaqYFS6n+hDbBOmcbCtQfI e8kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hQIjjxLRdWDnUCFgt6/FtHGYslkCYHvDfR3jz/areDc=; b=a28xjwkOzUojRTwfQU9oWaDhVGcDNFHwDw1s0A4i+RuHGPk+s+TxjmV+bmajmnVUvZ 5/FN6L8d6YFDb/axi0Rtn02kXKGOi/oREqS+pbRdqcGGh6qyq50b5QmOxaIbRFEu4n8M 6osik6CKzQIcLoP5meCSs0i4vkavXf/CKwMg0JDipjHTp0ne1aJ1IOhRMSTyUTt6Xyy1 uJ4wbiKOmqFs2tRnxYMGerKEGM7iaM/bTSzgvs3bs8gfrJG4qU+7xUffdza7tEJS1HDd uYHOBF87kTUzdKSCIBS0ESxoVX/UrZxEXGbTcM1NJ7hT0YpJIBHNh8a7HrTAJEPIXOKz 8BOw== X-Gm-Message-State: ANhLgQ1LZpjWRKuiVDJaEI0anmEH6RxmMu1PIPF0XCTUkjGFannl6pyI 7a1OwFxVN+lp9hGdqp6+gFTp+xgoLfgkZQ== X-Google-Smtp-Source: ADFU+vtF/CGeG5BEQv664cQOfTXezaND/8AkAOCqWk196C/Tig254FaYwI+tFn5AXCAQZJs1mg8G3A== X-Received: by 2002:a65:4544:: with SMTP id x4mr17781271pgr.388.1585674867856; Tue, 31 Mar 2020 10:14:27 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id i124sm12869764pfg.14.2020.03.31.10.14.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Mar 2020 10:14:26 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Tue, 31 Mar 2020 10:14:03 -0700 Message-Id: <20200331171404.23596-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200331171404.23596-1-stephen@networkplumber.org> References: <20200316235612.29854-1-stephen@networkplumber.org> <20200331171404.23596-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4 7/8] bus/vmbus: simplify args to need_signal X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 c88001605dbb..c4aa07b307ff 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