From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0FCD3A0A0A; Fri, 22 Jan 2021 18:12:49 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 13950141059; Fri, 22 Jan 2021 18:12:24 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 38461141045 for ; Fri, 22 Jan 2021 18:12:21 +0100 (CET) IronPort-SDR: N8Tj9i35imcXRi/ahNBdue9qsFn7wR0gHAUWNEQoWx0AA/6NFH9iFVi4Pu5Vw5rs5PUTWstPrf XhYfQrJy9MyQ== X-IronPort-AV: E=McAfee;i="6000,8403,9872"; a="176901756" X-IronPort-AV: E=Sophos;i="5.79,367,1602572400"; d="scan'208";a="176901756" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2021 09:12:20 -0800 IronPort-SDR: aG9Ab5MfHzqxNGd3CMSqUPu5Y0okcScocT9IllVqzGBxkgq3CmZuIKzvs6s07hezEms5UYgfPp P+rICHgwHVBg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,367,1602572400"; d="scan'208";a="571191483" Received: from silpixa00399498.ir.intel.com (HELO silpixa00399498.ger.corp.intel.com) ([10.237.222.179]) by orsmga005.jf.intel.com with ESMTP; 22 Jan 2021 09:12:18 -0800 From: Anatoly Burakov To: dev@dpdk.org Cc: Timothy McDaniel , Beilei Xing , Jeff Guo , Qiming Yang , Qi Zhang , Haiyue Wang , Bruce Richardson , Konstantin Ananyev , thomas@monjalon.net Date: Fri, 22 Jan 2021 17:12:14 +0000 Message-Id: <70f9d194e2714113c21a68da0fca93ff75e765d1.1611335511.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v20 1/4] eal: rename power monitor condition member X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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 `data_sz` name is fine, but it looks out of place because nothing else has "data" prefix in that structure. Rename it to "size", as well as add more clarity to the comments around each struct member. Fixes: 6a17919b0e2a ("eal: change power intrinsics API") Signed-off-by: Anatoly Burakov --- drivers/event/dlb/dlb.c | 2 +- drivers/event/dlb2/dlb2.c | 2 +- drivers/net/i40e/i40e_rxtx.c | 2 +- drivers/net/ice/ice_rxtx.c | 2 +- drivers/net/ixgbe/ixgbe_rxtx.c | 2 +- .../include/generic/rte_power_intrinsics.h | 19 +++++++++++-------- lib/librte_eal/x86/rte_power_intrinsics.c | 4 ++-- 7 files changed, 18 insertions(+), 15 deletions(-) diff --git a/drivers/event/dlb/dlb.c b/drivers/event/dlb/dlb.c index d2f2026291..a65f70882f 100644 --- a/drivers/event/dlb/dlb.c +++ b/drivers/event/dlb/dlb.c @@ -3185,7 +3185,7 @@ dlb_dequeue_wait(struct dlb_eventdev *dlb, pmc.addr = monitor_addr; pmc.val = expected_value; pmc.mask = qe_mask.raw_qe[1]; - pmc.data_sz = sizeof(uint64_t); + pmc.size = sizeof(uint64_t); rte_power_monitor(&pmc, timeout + start_ticks); diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c index c9a8a02278..5782960158 100644 --- a/drivers/event/dlb2/dlb2.c +++ b/drivers/event/dlb2/dlb2.c @@ -2894,7 +2894,7 @@ dlb2_dequeue_wait(struct dlb2_eventdev *dlb2, pmc.addr = monitor_addr; pmc.val = expected_value; pmc.mask = qe_mask.raw_qe[1]; - pmc.data_sz = sizeof(uint64_t); + pmc.size = sizeof(uint64_t); rte_power_monitor(&pmc, timeout + start_ticks); diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c index 89560d4ee5..668edd6626 100644 --- a/drivers/net/i40e/i40e_rxtx.c +++ b/drivers/net/i40e/i40e_rxtx.c @@ -92,7 +92,7 @@ i40e_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond *pmc) pmc->mask = rte_cpu_to_le_64(1 << I40E_RX_DESC_STATUS_DD_SHIFT); /* registers are 64-bit */ - pmc->data_sz = sizeof(uint64_t); + pmc->size = sizeof(uint64_t); return 0; } diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c index 7286e3a445..69f994579a 100644 --- a/drivers/net/ice/ice_rxtx.c +++ b/drivers/net/ice/ice_rxtx.c @@ -46,7 +46,7 @@ ice_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond *pmc) pmc->mask = rte_cpu_to_le_16(1 << ICE_RX_FLEX_DESC_STATUS0_DD_S); /* register is 16-bit */ - pmc->data_sz = sizeof(uint16_t); + pmc->size = sizeof(uint16_t); return 0; } diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c index cc8f70e6dd..c0305a8238 100644 --- a/drivers/net/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/ixgbe/ixgbe_rxtx.c @@ -1389,7 +1389,7 @@ ixgbe_get_monitor_addr(void *rx_queue, struct rte_power_monitor_cond *pmc) pmc->mask = rte_cpu_to_le_32(IXGBE_RXDADV_STAT_DD); /* the registers are 32-bit */ - pmc->data_sz = sizeof(uint32_t); + pmc->size = sizeof(uint32_t); return 0; } diff --git a/lib/librte_eal/include/generic/rte_power_intrinsics.h b/lib/librte_eal/include/generic/rte_power_intrinsics.h index 6109d28faa..5960c48c80 100644 --- a/lib/librte_eal/include/generic/rte_power_intrinsics.h +++ b/lib/librte_eal/include/generic/rte_power_intrinsics.h @@ -20,14 +20,17 @@ struct rte_power_monitor_cond { volatile void *addr; /**< Address to monitor for changes */ - uint64_t val; /**< Before attempting the monitoring, the address - * may be read and compared against this value. - **/ - uint64_t mask; /**< 64-bit mask to extract current value from addr */ - uint8_t data_sz; /**< Data size (in bytes) that will be used to compare - * expected value with the memory address. Can be 1, - * 2, 4, or 8. Supplying any other value will lead to - * undefined result. */ + uint64_t val; /**< If the `mask` is non-zero, location pointed + * to by `addr` will be read and compared + * against this value. + */ + uint64_t mask; /**< 64-bit mask to extract value read from `addr` */ + uint8_t size; /**< Data size (in bytes) that will be used to compare + * expected value (`val`) with data read from the + * monitored memory location (`addr`). Can be 1, 2, + * 4, or 8. Supplying any other value will result in + * an error. + */ }; /** diff --git a/lib/librte_eal/x86/rte_power_intrinsics.c b/lib/librte_eal/x86/rte_power_intrinsics.c index af3ae3237c..39ea9fdecd 100644 --- a/lib/librte_eal/x86/rte_power_intrinsics.c +++ b/lib/librte_eal/x86/rte_power_intrinsics.c @@ -88,7 +88,7 @@ rte_power_monitor(const struct rte_power_monitor_cond *pmc, if (pmc == NULL) return -EINVAL; - if (__check_val_size(pmc->data_sz) < 0) + if (__check_val_size(pmc->size) < 0) return -EINVAL; s = &wait_status[lcore_id]; @@ -113,7 +113,7 @@ rte_power_monitor(const struct rte_power_monitor_cond *pmc, /* if we have a comparison mask, we might not need to sleep at all */ if (pmc->mask) { const uint64_t cur_value = __get_umwait_val( - pmc->addr, pmc->data_sz); + pmc->addr, pmc->size); const uint64_t masked = cur_value & pmc->mask; /* if the masked value is already matching, abort */ -- 2.25.1