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>
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);
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);
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;
}
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;
}
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;
}
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.
+ */
};
/**
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];
/* 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 */