Commit 1073b6b1 authored by Michal Berger's avatar Michal Berger Committed by Konrad Sztyber
Browse files

pkgdep/git: Patch QAT driver to address issues reported by gcc



Change-Id: I0904a3ad64b3bd75bbef6aa158398ef3ce2bf8f7
Signed-off-by: default avatarMichal Berger <michal.berger@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/24547


Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarKonrad Sztyber <konrad.sztyber@intel.com>
parent 82c8059a
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -29,6 +29,11 @@ function install_qat() {

	tar -C "$GIT_REPOS/QAT" -xzof - < <(wget -O- "$DRIVER_LOCATION_QAT")

	patch --dir="$GIT_REPOS/QAT" -p1 \
		< "$rootdir/test/common/config/pkgdep/patches/qat/0001-old-style-declaration.patch"
	patch --dir="$GIT_REPOS/QAT" -p1 \
		< "$rootdir/test/common/config/pkgdep/patches/qat/0001-empty-body.patch"

	(cd "$GIT_REPOS/QAT" && sudo ./configure --enable-icp-sriov=host && sudo make install)

	if ! sudo service qat_service start; then
+25 −0
Original line number Diff line number Diff line
gcc complains about the following:

error: suggest braces around empty body in an ‘if’ statement [-Werror=empty-body]

---
 .../lookaside/access_layer/src/common/ctrl/sal_compression.c    | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/quickassist/lookaside/access_layer/src/common/ctrl/sal_compression.c b/quickassist/lookaside/access_layer/src/common/ctrl/sal_compression.c
index f30fad0..d36c59e 100644
--- a/quickassist/lookaside/access_layer/src/common/ctrl/sal_compression.c
+++ b/quickassist/lookaside/access_layer/src/common/ctrl/sal_compression.c
@@ -844,8 +844,10 @@ cleanup:
 
     /* destroy the initialized lock*/
     if (CPA_STATUS_SUCCESS == lockStatus)
+    {
         LAC_SPINLOCK_DESTROY(
             &pCompressionService->generic_service_info.instanceLock);
+    }
     SalCtrl_DcDebugShutdown(device, service);
 
 #ifndef ICP_DC_ONLY
-- 
+101 −0
Original line number Diff line number Diff line
gcc complains about the following:

error: ‘static’ is not at beginning of declaration [-Werror=old-style-declaration]
error: ‘inline’ is not at beginning of declaration [-Werror=old-style-declaration]
---
 .../access_layer/include/icp_sal_versions.h    |  2 +-
 .../src/common/crypto/sym/key/lac_sym_key.c    | 18 +++++++++---------
 .../src/common/qat_comms/sal_qat_cmn_msg.c     |  2 +-
 .../crypto/cpa_sample_code_sm2_perf.h          |  4 ++--
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/quickassist/lookaside/access_layer/include/icp_sal_versions.h b/quickassist/lookaside/access_layer/include/icp_sal_versions.h
index ae89f66..1f95a31 100644
--- a/quickassist/lookaside/access_layer/include/icp_sal_versions.h
+++ b/quickassist/lookaside/access_layer/include/icp_sal_versions.h
@@ -100,7 +100,7 @@ extern "C" {
 
 #define QAT_SW_VERSION(s1, s2, s3, s4) s1 s2 s3 s4
 
-const static char *__attribute__((used)) qat_sw_version =
+static const char *__attribute__((used)) qat_sw_version =
     QAT_SW_VERSION(VERSION_CONCAT(QAT_SOFTWARE_VERSION, =),
                    VERSION_CONCAT(SAL_INFO2_DRIVER_SW_VERSION_MAJ_NUMBER, .),
                    VERSION_CONCAT(SAL_INFO2_DRIVER_SW_VERSION_MIN_NUMBER, .),
diff --git a/quickassist/lookaside/access_layer/src/common/crypto/sym/key/lac_sym_key.c b/quickassist/lookaside/access_layer/src/common/crypto/sym/key/lac_sym_key.c
index dc0831c..25140fd 100644
--- a/quickassist/lookaside/access_layer/src/common/crypto/sym/key/lac_sym_key.c
+++ b/quickassist/lookaside/access_layer/src/common/crypto/sym/key/lac_sym_key.c
@@ -165,29 +165,29 @@
 /**< macro to check whether the HKDF algorithm can be supported on the device */
 
 /* Sublabel for HKDF TLS Key Generation, as defined in RFC8446. */
-const static Cpa8U key256[] =
+static const Cpa8U key256[] =
     {0, 16, 9, 't', 'l', 's', '1', '3', ' ', 'k', 'e', 'y', 0};
-const static Cpa8U key384[] =
+static const Cpa8U key384[] =
     {0, 32, 9, 't', 'l', 's', '1', '3', ' ', 'k', 'e', 'y', 0};
-const static Cpa8U keyChaChaPoly[] =
+static const Cpa8U keyChaChaPoly[] =
     {0, 32, 9, 't', 'l', 's', '1', '3', ' ', 'k', 'e', 'y', 0};
 /* Sublabel for HKDF TLS IV key Generation, as defined in RFC8446. */
-const static Cpa8U iv256[] =
+static const Cpa8U iv256[] =
     {0, 12, 8, 't', 'l', 's', '1', '3', ' ', 'i', 'v', 0};
-const static Cpa8U iv384[] =
+static const Cpa8U iv384[] =
     {0, 12, 8, 't', 'l', 's', '1', '3', ' ', 'i', 'v', 0};
 /* Sublabel for HKDF TLS RESUMPTION key Generation, as defined in RFC8446. */
-const static Cpa8U resumption256[] = {0,   32,  16,  't', 'l', 's', '1',
+static const Cpa8U resumption256[] = {0,   32,  16,  't', 'l', 's', '1',
                                       '3', ' ', 'r', 'e', 's', 'u', 'm',
                                       'p', 't', 'i', 'o', 'n', 0};
-const static Cpa8U resumption384[] = {0,   48,  16,  't', 'l', 's', '1',
+static const Cpa8U resumption384[] = {0,   48,  16,  't', 'l', 's', '1',
                                       '3', ' ', 'r', 'e', 's', 'u', 'm',
                                       'p', 't', 'i', 'o', 'n', 0};
 /* Sublabel for HKDF TLS FINISHED key Generation, as defined in RFC8446. */
-const static Cpa8U finished256[] = { 0, 32, 14, 't', 'l', 's', '1',
+static const Cpa8U finished256[] = { 0, 32, 14, 't', 'l', 's', '1',
                                     '3', ' ', 'f', 'i', 'n', 'i', 's',
                                     'h', 'e', 'd', 0};
-const static Cpa8U finished384[] = { 0, 48, 14, 't', 'l', 's', '1',
+static const Cpa8U finished384[] = { 0, 48, 14, 't', 'l', 's', '1',
                                     '3', ' ', 'f', 'i', 'n', 'i', 's',
                                     'h', 'e', 'd', 0};
 
diff --git a/quickassist/lookaside/access_layer/src/common/qat_comms/sal_qat_cmn_msg.c b/quickassist/lookaside/access_layer/src/common/qat_comms/sal_qat_cmn_msg.c
index 531da87..591f7f2 100644
--- a/quickassist/lookaside/access_layer/src/common/qat_comms/sal_qat_cmn_msg.c
+++ b/quickassist/lookaside/access_layer/src/common/qat_comms/sal_qat_cmn_msg.c
@@ -162,7 +162,7 @@ void SalQatMsg_CmnHdrWrite(icp_qat_fw_comn_req_t *pMsg,
  *      None
  *
  *****************************************/
-void inline SalQatMsg_CmnMidWrite(icp_qat_fw_la_bulk_req_t *pReq,
+inline void SalQatMsg_CmnMidWrite(icp_qat_fw_la_bulk_req_t *pReq,
                                   const void *pOpaqueData,
                                   Cpa8U bufferFormat,
                                   Cpa64U srcBuffer,
diff --git a/quickassist/lookaside/access_layer/src/sample_code/performance/crypto/cpa_sample_code_sm2_perf.h b/quickassist/lookaside/access_layer/src/sample_code/performance/crypto/cpa_sample_code_sm2_perf.h
index 94f034f..a14dfb0 100644
--- a/quickassist/lookaside/access_layer/src/sample_code/performance/crypto/cpa_sample_code_sm2_perf.h
+++ b/quickassist/lookaside/access_layer/src/sample_code/performance/crypto/cpa_sample_code_sm2_perf.h
@@ -118,12 +118,12 @@ extern CpaStatus kdf(CpaFlatBuffer *inbuf, CpaFlatBuffer *outbuf);
     (SM3_HASH_SIZE_IN_BYTE + GFP_SM2_POINT_SIZE_IN_BYTE + MESSAGE_LEN)
 
 /* ID of A for key exchange ,arbitrary data*/
-const static Cpa8U ZA[] = {0xE4, 0xD1, 0xD0, 0xC3, 0xCA, 0x4C, 0x7F, 0x11,
+static const Cpa8U ZA[] = {0xE4, 0xD1, 0xD0, 0xC3, 0xCA, 0x4C, 0x7F, 0x11,
                            0xBC, 0x8F, 0xF8, 0xCB, 0x3F, 0x4C, 0x02, 0xA7,
                            0x8F, 0x10, 0x8F, 0xA0, 0x98, 0xE5, 0x1A, 0x66,
                            0x84, 0x87, 0x24, 0x0F, 0x75, 0xE2, 0x0F, 0x31};
 /* ID of B for key exchange, arbitrary data*/
-const static Cpa8U ZB[] = {0x6B, 0x4B, 0x6D, 0x0E, 0x27, 0x66, 0x91, 0xBD,
+static const Cpa8U ZB[] = {0x6B, 0x4B, 0x6D, 0x0E, 0x27, 0x66, 0x91, 0xBD,
                            0x4A, 0x11, 0xBF, 0x72, 0xF4, 0xFB, 0x50, 0x1A,
                            0xE3, 0x09, 0xFD, 0xAC, 0xB7, 0x2F, 0xA6, 0xCC,
                            0x33, 0x6E, 0x66, 0x56, 0x11, 0x9A, 0xBD, 0x67};
--