* [PATCH] crypto: qat - ring returning retry even though ring has BW
@ 2015-12-09 19:59 Tadeusz Struk
2015-12-12 5:43 ` Herbert Xu
0 siblings, 1 reply; 2+ messages in thread
From: Tadeusz Struk @ 2015-12-09 19:59 UTC (permalink / raw)
To: herbert; +Cc: harvijayx.saini, linux-crypto, tadeusz.struk
From: Harvijay Saini <harvijayx.saini@intel.com>
When many threads submit multiple requests they get blocked until all
responses are processed, which prevents them from submitting more requests
even though there is space on the rings.
To fix this we need to decrement the inflight counter early to in the callback.
Signed-off-by: Harvijay Saini <harvijayx.saini@intel.com>
Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
---
drivers/crypto/qat/qat_common/adf_transport.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/crypto/qat/qat_common/adf_transport.c b/drivers/crypto/qat/qat_common/adf_transport.c
index eff00cd..a6f3766 100644
--- a/drivers/crypto/qat/qat_common/adf_transport.c
+++ b/drivers/crypto/qat/qat_common/adf_transport.c
@@ -141,6 +141,7 @@ static int adf_handle_response(struct adf_etr_ring_data *ring)
while (*msg != ADF_RING_EMPTY_SIG) {
ring->callback((uint32_t *)msg);
+ atomic_dec(ring->inflights);
*msg = ADF_RING_EMPTY_SIG;
ring->head = adf_modulo(ring->head +
ADF_MSG_SIZE_TO_BYTES(ring->msg_size),
@@ -148,12 +149,10 @@ static int adf_handle_response(struct adf_etr_ring_data *ring)
msg_counter++;
msg = (uint32_t *)((uintptr_t)ring->base_addr + ring->head);
}
- if (msg_counter > 0) {
+ if (msg_counter > 0)
WRITE_CSR_RING_HEAD(ring->bank->csr_addr,
ring->bank->bank_number,
ring->ring_number, ring->head);
- atomic_sub(msg_counter, ring->inflights);
- }
return 0;
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] crypto: qat - ring returning retry even though ring has BW
2015-12-09 19:59 [PATCH] crypto: qat - ring returning retry even though ring has BW Tadeusz Struk
@ 2015-12-12 5:43 ` Herbert Xu
0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2015-12-12 5:43 UTC (permalink / raw)
To: Tadeusz Struk; +Cc: harvijayx.saini, linux-crypto
On Wed, Dec 09, 2015 at 11:59:45AM -0800, Tadeusz Struk wrote:
> From: Harvijay Saini <harvijayx.saini@intel.com>
>
> When many threads submit multiple requests they get blocked until all
> responses are processed, which prevents them from submitting more requests
> even though there is space on the rings.
> To fix this we need to decrement the inflight counter early to in the callback.
>
> Signed-off-by: Harvijay Saini <harvijayx.saini@intel.com>
> Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com>
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-12-12 5:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-09 19:59 [PATCH] crypto: qat - ring returning retry even though ring has BW Tadeusz Struk
2015-12-12 5:43 ` Herbert Xu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.