dma/idxd: fix wrap-around in burst capacity calculation
dma/idxd: fix wrap-around in burst capacity calculation

The burst capacity calculation code assumes that the write and read
(i.e. ids_returned) values both wrap at the ring-size, but the read
value instead wraps as UINT16_MAX. Therefore, instead of just adding
ring-size to the write value in case the read is greater, we need to
just always mask the result to ensure a correct, in-range, value.

Fixes: 9459de4edc99 ("dma/idxd: add burst capacity")
Cc: stable@dpdk.org

Reported-by: Sunil Pai G <e26356fc23eea30f59c058c1a959129748a9e165@intel.com>
Signed-off-by: Bruce Richardson <66b9e8e8fbd5e9f41f91b0af050876182ce9d0e4@intel.com>
Tested-by: Sunil Pai G <e26356fc23eea30f59c058c1a959129748a9e165@intel.com>
Acked-by: Kevin Laatz <961b59698dfa2327ef66e48c81ae3315f5733fd1@intel.com>

john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk