DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ruifeng Wang <ruifeng.wang@arm.com>
To: akhil.goyal@nxp.com, gavin.hu@arm.com
Cc: dev@dpdk.org, jerinj@marvell.com, honnappa.nagarahalli@arm.com,
	nd@arm.com, Ruifeng Wang <ruifeng.wang@arm.com>,
	stable@dpdk.org
Subject: [dpdk-dev] [PATCH v2 3/3] crypto/armv8: fix clang build
Date: Sun, 19 Jan 2020 15:40:04 +0800	[thread overview]
Message-ID: <20200119074004.213861-4-ruifeng.wang@arm.com> (raw)
In-Reply-To: <20200119074004.213861-1-ruifeng.wang@arm.com>

1. Clang requires braces around initialization of subobject.
2. Clang complains implicit conversion of enumeration type.

Trapped issue with Clang version 8.0 and CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO
was set.
Error messages:
rte_armv8_pmd.c:144:2: error: suggest braces around initialization of
 subobject [-Werror,-Wmissing-braces]
        NULL
        ^~~~
        {   }
/usr/lib/llvm-8/lib/clang/8.0.0/include/stddef.h:105:16: note: expanded
 from macro 'NULL'
               ^~~~~~~~~~
rte_armv8_pmd.c:429:21: error: implicit conversion from enumeration
 type 'enum rte_crypto_cipher_operation' to different enumeration type
      'enum armv8_crypto_cipher_operation' [-Werror,-Wenum-conversion]
        cop = sess->cipher.direction;
            ~ ~~~~~~~~~~~~~^~~~~~~~~

Fixes: 169ca3db550c ("crypto/armv8: add PMD optimized for ARMv8 processors")
Cc: stable@dpdk.org

Signed-off-by: Ruifeng Wang <ruifeng.wang@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Reviewed-by: Gavin Hu <gavin.hu@arm.com>
---
 drivers/crypto/armv8/rte_armv8_pmd.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/crypto/armv8/rte_armv8_pmd.c b/drivers/crypto/armv8/rte_armv8_pmd.c
index fd8140896..d2b7ab5e0 100644
--- a/drivers/crypto/armv8/rte_armv8_pmd.c
+++ b/drivers/crypto/armv8/rte_armv8_pmd.c
@@ -86,12 +86,12 @@ crypto_op_ca_encrypt = {
 
 static const crypto_func_tbl_t
 crypto_op_ca_decrypt = {
-	NULL
+	{ {NULL} }
 };
 
 static const crypto_func_tbl_t
 crypto_op_ac_encrypt = {
-	NULL
+	{ {NULL} }
 };
 
 static const crypto_func_tbl_t
@@ -377,7 +377,16 @@ armv8_crypto_set_session_chained_parameters(struct armv8_crypto_session *sess,
 	/* Select cipher key */
 	sess->cipher.key.length = cipher_xform->cipher.key.length;
 	/* Set cipher direction */
-	cop = sess->cipher.direction;
+	switch (sess->cipher.direction) {
+	case RTE_CRYPTO_CIPHER_OP_ENCRYPT:
+		cop = ARMV8_CRYPTO_CIPHER_OP_ENCRYPT;
+		break;
+	case RTE_CRYPTO_CIPHER_OP_DECRYPT:
+		cop = ARMV8_CRYPTO_CIPHER_OP_DECRYPT;
+		break;
+	default:
+		return -ENOTSUP;
+	}
 	/* Set cipher algorithm */
 	calg = cipher_xform->cipher.algo;
 
-- 
2.17.1


  parent reply	other threads:[~2020-01-19  7:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-10  8:28 [dpdk-dev] [RFC PATCH 0/3] armv8 crypto PMD update Ruifeng Wang
2019-12-10  8:28 ` [dpdk-dev] [RFC PATCH 1/3] crypto/armv8: link PMD to crypto library hosted by Arm Ruifeng Wang
2019-12-10  8:28 ` [dpdk-dev] [RFC PATCH 2/3] doc: update link to the crypto library for armv8 PMD Ruifeng Wang
2019-12-10 10:07   ` Jerin Jacob
2019-12-10  8:28 ` [dpdk-dev] [RFC PATCH 3/3] crypto/armv8: fix clang build Ruifeng Wang
2020-01-17 12:11 ` [dpdk-dev] [RFC PATCH 0/3] armv8 crypto PMD update Akhil Goyal
2020-01-17 14:28   ` Ruifeng Wang
2020-01-19  7:40 ` [dpdk-dev] [PATCH v2 " Ruifeng Wang
2020-01-19  7:40   ` [dpdk-dev] [PATCH v2 1/3] crypto/armv8: link PMD to crypto library hosted by Arm Ruifeng Wang
2020-01-19  7:40   ` [dpdk-dev] [PATCH v2 2/3] doc: update link to the crypto library for armv8 PMD Ruifeng Wang
2020-01-19  7:40   ` Ruifeng Wang [this message]
2020-01-21  7:09   ` [dpdk-dev] [PATCH v2 0/3] armv8 crypto PMD update Akhil Goyal
2020-01-21  9:49     ` Ruifeng Wang
2020-01-23  3:45 ` [dpdk-dev] [PATCH v3 0/5] " Ruifeng Wang
2020-01-23  3:45   ` [dpdk-dev] [PATCH v3 1/5] crypto/armv8: link PMD to crypto library hosted by Arm Ruifeng Wang
2020-01-23  3:45   ` [dpdk-dev] [PATCH v3 2/5] crypto/armv8: enable meson build Ruifeng Wang
2020-01-23  3:45   ` [dpdk-dev] [PATCH v3 3/5] doc: update link to the crypto library for armv8 PMD Ruifeng Wang
2020-01-23  3:45   ` [dpdk-dev] [PATCH v3 4/5] doc: update release notes for armv8 crypto PMD Ruifeng Wang
2020-01-23  3:45   ` [dpdk-dev] [PATCH v3 5/5] crypto/armv8: fix clang build Ruifeng Wang
2020-01-23 13:38   ` [dpdk-dev] [PATCH v3 0/5] armv8 crypto PMD update Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200119074004.213861-4-ruifeng.wang@arm.com \
    --to=ruifeng.wang@arm.com \
    --cc=akhil.goyal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=gavin.hu@arm.com \
    --cc=honnappa.nagarahalli@arm.com \
    --cc=jerinj@marvell.com \
    --cc=nd@arm.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).