]> git.droids-corp.org - dpdk.git/commit
dma/idxd: fix wrap-around in burst capacity calculation
authorBruce Richardson <bruce.richardson@intel.com>
Tue, 11 Jan 2022 13:41:04 +0000 (13:41 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 20 Jan 2022 13:05:14 +0000 (14:05 +0100)
commit63990aeb08f45f0acd435f67fd52a3736a493563
tree8726a16586f76beb2b0df874fe67ea90a38a6340
parent3277676319f61dbc14a38e5c9c79d97c59889855
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 <sunil.pai.g@intel.com>
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Tested-by: Sunil Pai G <sunil.pai.g@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
drivers/dma/idxd/idxd_common.c