]> git.droids-corp.org - dpdk.git/commitdiff
eal: rename power monitor condition member
authorAnatoly Burakov <anatoly.burakov@intel.com>
Fri, 22 Jan 2021 17:12:14 +0000 (17:12 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 29 Jan 2021 14:29:48 +0000 (15:29 +0100)
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 <anatoly.burakov@intel.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
drivers/event/dlb/dlb.c
drivers/event/dlb2/dlb2.c
drivers/net/i40e/i40e_rxtx.c
drivers/net/ice/ice_rxtx.c
drivers/net/ixgbe/ixgbe_rxtx.c
lib/librte_eal/include/generic/rte_power_intrinsics.h
lib/librte_eal/x86/rte_power_intrinsics.c

index d2f20262917594abe5a6fde23959cc423d97eae0..a65f70882f004444bbde34964e7c4a45449c6a20 100644 (file)
@@ -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);
 
index c9a8a02278b22e6b88bd52456c7dec5857780c94..578296015885d632ccfa2ce3656e3031ba8ca41d 100644 (file)
@@ -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);
 
index 89560d4ee5fb08db93ee397181604e177eec0c68..668edd66268312c2463009b26380247844596c9f 100644 (file)
@@ -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;
 }
index 7286e3a44552c321b56d35a6351708f67d4eb25e..69f994579af1e3eb225bb8f894126a699a28085c 100644 (file)
@@ -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;
 }
index cc8f70e6dd96f1338139899f828554120694612f..c0305a8238494810a7f5d51a969742b882e4076a 100644 (file)
@@ -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;
 }
index 6109d28faa06dfd5f9116c12c99b729c04b9638d..5960c48c8002ef1247729a5fe48a1554f9cc76be 100644 (file)
 
 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.
+                         */
 };
 
 /**
index af3ae3237c1e93e25bb87b2f6d47f255d1ac1242..39ea9fdecdafe7ffe77391abb659c7a80691c637 100644 (file)
@@ -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 */