Spdk/lib
Amir Haroush 6984eff3c5 ocf: fix env_ticks_to_{msec,usec,nsec} precision & accuracy
- fix precision
 when one convert to seconds and then multiply
 we can have precision errors
 for example if one have 77ms, it will go to 0 when converted to seconds
 and then multiply that 0 by 1000 will return 0 instead of 77ms.

- fix mismatch nsec/usec
 nsec was multiplied by 1000*1000 while usec by 1000*1000*1000
 it should be the opposite.
 anyway the implementation had changed.

- implementation description
* env_ticks_to_msec: j / (tick_hz / 1000)
  this is exactly the same as (j * 1000) / tick_hz (eq #2).
  but this implementation (eq #2) can only handle 54b in j (before overflowing)
  because of the multiplication by 1000 (10b).
  with the correct implementation we use all 64b in j.
  we assume that tick_hz will be prefectly divisible by 1000 so we are ok.

* env_ticks_to_usec: j / (tick_hz / (1000 * 1000))
  same as in msec case, we use all 64b in j.
  here we assume that tick_hz is perfectly divisible by (1000 * 1000)
  i.e. we assume that CPU frequency is some multiple of 1MHz.

* env_ticks_to_nsec: (j * 1000) / (tick_hz / (1000 * 1000))
  in this case we can't assume that tick_hz is divisible by 10^9
  because there are many CPUs with 2.8GHz or 3.3GHz for example.
  so we multiply j by 1000
  this means that we can only handle correctly j up to 54b.
  (64b - 10b, 10b for the *1000 operation)

Signed-off-by: Amir Haroush <amir.haroush@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>
Change-Id: Ia8ea7f88b718df206fa0731e3f39f419ee922aa7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/17078
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2023-03-21 19:08:59 +00:00
..
accel accel: don't modify user iovs when allocating buffers 2023-03-13 21:02:27 +00:00
bdev bdev: prevent aborting reqs doing push/pull or accel seq exec 2023-03-13 21:02:27 +00:00
blob blob: track last md_page index correctly during resize 2023-03-15 09:27:17 +00:00
blobfs so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
conf so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
dma so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
env_dpdk env: expose function to get main core 2023-01-31 10:31:04 +00:00
env_ocf ocf: fix env_ticks_to_{msec,usec,nsec} precision & accuracy 2023-03-21 19:08:59 +00:00
event trace: update description of tracepoint number 2023-03-10 11:42:23 +00:00
ftl so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
idxd lib/idxd: Removed SPDK_IDXD_FLAG_PERSISTENT flag 2023-03-03 11:20:03 +00:00
init so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
ioat so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
iscsi freebsd: return negated error from getaddrinfo() 2023-03-10 16:44:37 +00:00
json so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
jsonrpc freebsd: return negated error from getaddrinfo() 2023-03-10 16:44:37 +00:00
log so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
lvol bdev/lvol: retry lvol open if it fails due to insufficient resources 2023-02-24 21:01:11 +00:00
mlx5 so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
nbd so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
notify so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
nvme lib/nvme_rdma: return negated error from nvme_rdma_parse_addr 2023-03-10 16:44:37 +00:00
nvmf freebsd: return negated error from getaddrinfo() 2023-03-10 16:44:37 +00:00
rdma so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
reduce deprecation: Remove support for PMDK 2023-01-26 15:16:19 +00:00
rocksdb rocksdb: remove spdk_thread 2022-11-23 08:22:04 +00:00
rpc so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
scsi so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
sock sock: Allow flushing even if the socket is in a poll group 2023-01-24 18:18:33 +00:00
thread thread: Add spdk_thread_get_interrupt_fd_group that returns spdk_fd_group 2023-02-28 08:52:27 +00:00
trace so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
trace_parser so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
ublk ublk: update func ublk_try_close_dev 2023-02-08 15:26:00 +00:00
ut_mock so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
util util: fix misaligned load for uint64_t type 2023-03-01 08:56:01 +00:00
vfio_user so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
vfu_tgt so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
vhost vhost_rpc:add sessions information for vhost_get_controllers 2023-03-13 07:59:08 +00:00
virtio lib/virtio_vfio_user: use VIRTIO_PCI_VRING_ALIGN aligned vring address 2023-02-09 11:31:39 +00:00
vmd so_ver: increase all major versions 2023-01-24 08:37:21 +00:00
Makefile ublk: add configure and event/subsystem 2023-01-20 07:48:25 +00:00