summaryrefslogtreecommitdiffstats
path: root/drivers/crypto
diff options
context:
space:
mode:
authorStruk, Tadeusz <tadeusz.struk@intel.com>2014-11-21 12:25:57 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2014-11-25 09:50:42 -0500
commitb1c9952afeae3e7da798ca08cab0e97caaba0706 (patch)
treecec662144ff851a1ce8b9c321518340dd63b7e95 /drivers/crypto
parent79e886599e6416d0de26e8562e4464577d081c3d (diff)
crytpo: qat - Fix 64 bytes requests
Fix invalid inflights calculation for 64 bytes requests. Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/qat/qat_common/adf_transport_access_macros.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/crypto/qat/qat_common/adf_transport_access_macros.h b/drivers/crypto/qat/qat_common/adf_transport_access_macros.h
index 91d88d676580..160c9a36c919 100644
--- a/drivers/crypto/qat/qat_common/adf_transport_access_macros.h
+++ b/drivers/crypto/qat/qat_common/adf_transport_access_macros.h
@@ -83,14 +83,14 @@
83#define ADF_MAX_RING_SIZE ADF_RING_SIZE_4M 83#define ADF_MAX_RING_SIZE ADF_RING_SIZE_4M
84#define ADF_DEFAULT_RING_SIZE ADF_RING_SIZE_16K 84#define ADF_DEFAULT_RING_SIZE ADF_RING_SIZE_16K
85 85
86/* Valid internal msg size values internal */ 86/* Valid internal msg size values */
87#define ADF_MSG_SIZE_32 0x01 87#define ADF_MSG_SIZE_32 0x01
88#define ADF_MSG_SIZE_64 0x02 88#define ADF_MSG_SIZE_64 0x02
89#define ADF_MSG_SIZE_128 0x04 89#define ADF_MSG_SIZE_128 0x04
90#define ADF_MIN_MSG_SIZE ADF_MSG_SIZE_32 90#define ADF_MIN_MSG_SIZE ADF_MSG_SIZE_32
91#define ADF_MAX_MSG_SIZE ADF_MSG_SIZE_128 91#define ADF_MAX_MSG_SIZE ADF_MSG_SIZE_128
92 92
93/* Size to bytes conversion macros for ring and msg values */ 93/* Size to bytes conversion macros for ring and msg size values */
94#define ADF_MSG_SIZE_TO_BYTES(SIZE) (SIZE << 5) 94#define ADF_MSG_SIZE_TO_BYTES(SIZE) (SIZE << 5)
95#define ADF_BYTES_TO_MSG_SIZE(SIZE) (SIZE >> 5) 95#define ADF_BYTES_TO_MSG_SIZE(SIZE) (SIZE >> 5)
96#define ADF_SIZE_TO_RING_SIZE_IN_BYTES(SIZE) ((1 << (SIZE - 1)) << 7) 96#define ADF_SIZE_TO_RING_SIZE_IN_BYTES(SIZE) ((1 << (SIZE - 1)) << 7)
@@ -100,8 +100,11 @@
100#define ADF_RING_SIZE_BYTES_MIN(SIZE) ((SIZE < ADF_RING_SIZE_4K) ? \ 100#define ADF_RING_SIZE_BYTES_MIN(SIZE) ((SIZE < ADF_RING_SIZE_4K) ? \
101 ADF_RING_SIZE_4K : SIZE) 101 ADF_RING_SIZE_4K : SIZE)
102#define ADF_RING_SIZE_MODULO(SIZE) (SIZE + 0x6) 102#define ADF_RING_SIZE_MODULO(SIZE) (SIZE + 0x6)
103#define ADF_SIZE_TO_POW(SIZE) ((((SIZE & 0x4) >> 1) | ((SIZE & 0x4) >> 2) | \
104 SIZE) & ~0x4)
105/* Max outstanding requests */
103#define ADF_MAX_INFLIGHTS(RING_SIZE, MSG_SIZE) \ 106#define ADF_MAX_INFLIGHTS(RING_SIZE, MSG_SIZE) \
104 ((((1 << (RING_SIZE - 1)) << 4) >> MSG_SIZE) - 1) 107 ((((1 << (RING_SIZE - 1)) << 3) >> ADF_SIZE_TO_POW(MSG_SIZE)) - 1)
105#define BUILD_RING_CONFIG(size) \ 108#define BUILD_RING_CONFIG(size) \
106 ((ADF_RING_NEAR_WATERMARK_0 << ADF_RING_CONFIG_NEAR_FULL_WM) \ 109 ((ADF_RING_NEAR_WATERMARK_0 << ADF_RING_CONFIG_NEAR_FULL_WM) \
107 | (ADF_RING_NEAR_WATERMARK_0 << ADF_RING_CONFIG_NEAR_EMPTY_WM) \ 110 | (ADF_RING_NEAR_WATERMARK_0 << ADF_RING_CONFIG_NEAR_EMPTY_WM) \