]> git.droids-corp.org - dpdk.git/commit
dma/idxd: fix burst capacity calculation
authorBruce Richardson <bruce.richardson@intel.com>
Tue, 11 Jan 2022 13:41:02 +0000 (13:41 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 20 Jan 2022 12:40:20 +0000 (13:40 +0100)
commita2b43447e923a54a4d8293fae960fbe2dc3f641e
tree8160a419f8f1c3221686e7bae1c4a5c60d4dd01b
parent62c21c38a26e654bba09be147ea2d61c2e699a13
dma/idxd: fix burst capacity calculation

When the maximum burst size supported by HW is less than the available
ring space, incorrect capacity was returned when there was already some
jobs queued up for submission. This was because the capacity calculation
failed to subtract the number of already-enqueued jobs from the max
burst size. After subtraction is done, ensure that any negative values
(which should never occur if the user respects the reported limits), are
clamped to zero.

Fixes: 9459de4edc99 ("dma/idxd: add burst capacity")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Kevin Laatz <kevin.laatz@intel.com>
Tested-by: Jiayu Hu <jiayu.hu@intel.com>
drivers/dma/idxd/idxd_common.c