* [PATCH 2/4] test/crypto: remove redundant cast
2023-09-08 5:40 [PATCH 1/4] security: remove redundant cast Anoob Joseph
@ 2023-09-08 5:40 ` Anoob Joseph
2023-09-08 5:40 ` [PATCH 3/4] app/crypto-perf: " Anoob Joseph
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Anoob Joseph @ 2023-09-08 5:40 UTC (permalink / raw)
To: Akhil Goyal, Ciara Power; +Cc: Jerin Jacob, dev
The API 'rte_cryptodev_get_sec_ctx' returns void *. Type cast is not
required.
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
app/test/test_cryptodev.c | 29 ++++++++++++-----------------
1 file changed, 12 insertions(+), 17 deletions(-)
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index fb2af40b99..589b9860ce 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -8920,15 +8920,12 @@ security_proto_supported(enum rte_security_session_action_type action,
enum rte_security_session_protocol proto)
{
struct crypto_testsuite_params *ts_params = &testsuite_params;
-
const struct rte_security_capability *capabilities;
const struct rte_security_capability *capability;
+ struct rte_security_ctx *ctx;
uint16_t i = 0;
- struct rte_security_ctx *ctx = (struct rte_security_ctx *)
- rte_cryptodev_get_sec_ctx(
- ts_params->valid_devs[0]);
-
+ ctx = rte_cryptodev_get_sec_ctx(ts_params->valid_devs[0]);
capabilities = rte_security_capabilities_get(ctx);
@@ -8967,12 +8964,12 @@ static int test_pdcp_proto(int i, int oop, enum rte_crypto_cipher_operation opc,
struct crypto_unittest_params *ut_params = &unittest_params;
uint8_t *plaintext;
int ret = TEST_SUCCESS;
- struct rte_security_ctx *ctx = (struct rte_security_ctx *)
- rte_cryptodev_get_sec_ctx(
- ts_params->valid_devs[0]);
struct rte_cryptodev_info dev_info;
+ struct rte_security_ctx *ctx;
uint64_t feat_flags;
+ ctx = rte_cryptodev_get_sec_ctx(ts_params->valid_devs[0]);
+
rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
feat_flags = dev_info.feature_flags;
@@ -9174,11 +9171,11 @@ test_pdcp_proto_SGL(int i, int oop,
unsigned int trn_data = 0;
struct rte_cryptodev_info dev_info;
uint64_t feat_flags;
- struct rte_security_ctx *ctx = (struct rte_security_ctx *)
- rte_cryptodev_get_sec_ctx(
- ts_params->valid_devs[0]);
+ struct rte_security_ctx *ctx;
struct rte_mbuf *temp_mbuf;
+ ctx = rte_cryptodev_get_sec_ctx(ts_params->valid_devs[0]);
+
rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
feat_flags = dev_info.feature_flags;
@@ -10898,6 +10895,7 @@ test_docsis_proto_uplink(const void *data)
const struct docsis_test_data *d_td = data;
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
+ struct rte_security_ctx *ctx;
uint8_t *plaintext = NULL;
uint8_t *ciphertext = NULL;
uint8_t *iv_ptr;
@@ -10905,9 +10903,7 @@ test_docsis_proto_uplink(const void *data)
uint32_t crc_data_len;
int ret = TEST_SUCCESS;
- struct rte_security_ctx *ctx = (struct rte_security_ctx *)
- rte_cryptodev_get_sec_ctx(
- ts_params->valid_devs[0]);
+ ctx = rte_cryptodev_get_sec_ctx(ts_params->valid_devs[0]);
/* Verify the capabilities */
struct rte_security_capability_idx sec_cap_idx;
@@ -11083,15 +11079,14 @@ test_docsis_proto_downlink(const void *data)
const struct docsis_test_data *d_td = data;
struct crypto_testsuite_params *ts_params = &testsuite_params;
struct crypto_unittest_params *ut_params = &unittest_params;
+ struct rte_security_ctx *ctx;
uint8_t *plaintext = NULL;
uint8_t *ciphertext = NULL;
uint8_t *iv_ptr;
int32_t cipher_len, crc_len;
int ret = TEST_SUCCESS;
- struct rte_security_ctx *ctx = (struct rte_security_ctx *)
- rte_cryptodev_get_sec_ctx(
- ts_params->valid_devs[0]);
+ ctx = rte_cryptodev_get_sec_ctx(ts_params->valid_devs[0]);
/* Verify the capabilities */
struct rte_security_capability_idx sec_cap_idx;
--
2.25.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 3/4] app/crypto-perf: remove redundant cast
2023-09-08 5:40 [PATCH 1/4] security: remove redundant cast Anoob Joseph
2023-09-08 5:40 ` [PATCH 2/4] test/crypto: " Anoob Joseph
@ 2023-09-08 5:40 ` Anoob Joseph
2023-09-08 5:40 ` [PATCH 4/4] examples/ipsec-secgw: " Anoob Joseph
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Anoob Joseph @ 2023-09-08 5:40 UTC (permalink / raw)
To: Akhil Goyal, Ciara Power; +Cc: Jerin Jacob, dev
The API 'rte_cryptodev_get_sec_ctx' returns void *. Type cast is not
required.
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
app/test-crypto-perf/cperf_ops.c | 12 ++++++------
app/test-crypto-perf/cperf_test_pmd_cyclecount.c | 4 +---
app/test-crypto-perf/cperf_test_throughput.c | 4 +---
3 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index 93b9bfb240..5bb2ce954a 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -647,6 +647,7 @@ create_ipsec_session(struct rte_mempool *sess_mp,
struct rte_crypto_sym_xform auth_xform = {0};
struct rte_crypto_sym_xform *crypto_xform;
struct rte_crypto_sym_xform xform = {0};
+ struct rte_security_ctx *ctx;
if (options->aead_algo != 0) {
/* Setup AEAD Parameters */
@@ -749,8 +750,7 @@ create_ipsec_session(struct rte_mempool *sess_mp,
else
sess_conf.ipsec.direction = RTE_SECURITY_IPSEC_SA_DIR_INGRESS;
- struct rte_security_ctx *ctx = (struct rte_security_ctx *)
- rte_cryptodev_get_sec_ctx(dev_id);
+ ctx = rte_cryptodev_get_sec_ctx(dev_id);
/* Create security session */
return (void *)rte_security_session_create(ctx, &sess_conf, sess_mp);
@@ -766,6 +766,7 @@ cperf_create_session(struct rte_mempool *sess_mp,
struct rte_crypto_sym_xform cipher_xform;
struct rte_crypto_sym_xform auth_xform;
struct rte_crypto_sym_xform aead_xform;
+ struct rte_security_ctx *ctx;
void *sess = NULL;
void *asym_sess = NULL;
struct rte_crypto_asym_xform xform = {0};
@@ -853,8 +854,7 @@ cperf_create_session(struct rte_mempool *sess_mp,
.crypto_xform = &cipher_xform
};
- struct rte_security_ctx *ctx = (struct rte_security_ctx *)
- rte_cryptodev_get_sec_ctx(dev_id);
+ ctx = rte_cryptodev_get_sec_ctx(dev_id);
/* Create security session */
return (void *)rte_security_session_create(ctx, &sess_conf, sess_mp);
@@ -901,8 +901,8 @@ cperf_create_session(struct rte_mempool *sess_mp,
} },
.crypto_xform = &cipher_xform
};
- struct rte_security_ctx *ctx = (struct rte_security_ctx *)
- rte_cryptodev_get_sec_ctx(dev_id);
+
+ ctx = rte_cryptodev_get_sec_ctx(dev_id);
/* Create security session */
return (void *)rte_security_session_create(ctx, &sess_conf, sess_mp);
diff --git a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
index 0307e82996..d6d4130195 100644
--- a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
+++ b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
@@ -67,9 +67,7 @@ cperf_pmd_cyclecount_test_free(struct cperf_pmd_cyclecount_ctx *ctx)
#ifdef RTE_LIB_SECURITY
if (ctx->options->op_type == CPERF_PDCP ||
ctx->options->op_type == CPERF_DOCSIS) {
- struct rte_security_ctx *sec_ctx =
- (struct rte_security_ctx *)
- rte_cryptodev_get_sec_ctx(ctx->dev_id);
+ struct rte_security_ctx *sec_ctx = rte_cryptodev_get_sec_ctx(ctx->dev_id);
rte_security_session_destroy(sec_ctx,
(void *)ctx->sess);
} else
diff --git a/app/test-crypto-perf/cperf_test_throughput.c b/app/test-crypto-perf/cperf_test_throughput.c
index e892a70699..21738e8425 100644
--- a/app/test-crypto-perf/cperf_test_throughput.c
+++ b/app/test-crypto-perf/cperf_test_throughput.c
@@ -44,9 +44,7 @@ cperf_throughput_test_free(struct cperf_throughput_ctx *ctx)
else if (ctx->options->op_type == CPERF_PDCP ||
ctx->options->op_type == CPERF_DOCSIS ||
ctx->options->op_type == CPERF_IPSEC) {
- struct rte_security_ctx *sec_ctx =
- (struct rte_security_ctx *)
- rte_cryptodev_get_sec_ctx(ctx->dev_id);
+ struct rte_security_ctx *sec_ctx = rte_cryptodev_get_sec_ctx(ctx->dev_id);
rte_security_session_destroy(
sec_ctx,
(void *)ctx->sess);
--
2.25.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 4/4] examples/ipsec-secgw: remove redundant cast
2023-09-08 5:40 [PATCH 1/4] security: remove redundant cast Anoob Joseph
2023-09-08 5:40 ` [PATCH 2/4] test/crypto: " Anoob Joseph
2023-09-08 5:40 ` [PATCH 3/4] app/crypto-perf: " Anoob Joseph
@ 2023-09-08 5:40 ` Anoob Joseph
2023-09-08 10:36 ` [PATCH 1/4] security: " Power, Ciara
2023-09-20 11:18 ` Akhil Goyal
4 siblings, 0 replies; 6+ messages in thread
From: Anoob Joseph @ 2023-09-08 5:40 UTC (permalink / raw)
To: Akhil Goyal, Ciara Power; +Cc: Jerin Jacob, dev
The API 'rte_cryptodev_get_sec_ctx' returns void *. Type cast is not
required.
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
examples/ipsec-secgw/ipsec.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/examples/ipsec-secgw/ipsec.c b/examples/ipsec-secgw/ipsec.c
index a5706bed24..984fb7a2ec 100644
--- a/examples/ipsec-secgw/ipsec.c
+++ b/examples/ipsec-secgw/ipsec.c
@@ -327,9 +327,7 @@ create_lookaside_session(struct ipsec_ctx *ipsec_ctx_lcore[],
};
if (ips->type == RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL) {
- struct rte_security_ctx *ctx = (struct rte_security_ctx *)
- rte_cryptodev_get_sec_ctx(
- cdev_id);
+ struct rte_security_ctx *ctx = rte_cryptodev_get_sec_ctx(cdev_id);
/* Set IPsec parameters in conf */
set_ipsec_conf(sa, &(sess_conf.ipsec));
--
2.25.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH 1/4] security: remove redundant cast
2023-09-08 5:40 [PATCH 1/4] security: remove redundant cast Anoob Joseph
` (2 preceding siblings ...)
2023-09-08 5:40 ` [PATCH 4/4] examples/ipsec-secgw: " Anoob Joseph
@ 2023-09-08 10:36 ` Power, Ciara
2023-09-20 11:18 ` Akhil Goyal
4 siblings, 0 replies; 6+ messages in thread
From: Power, Ciara @ 2023-09-08 10:36 UTC (permalink / raw)
To: Anoob Joseph, Akhil Goyal; +Cc: Jerin Jacob, dev
> -----Original Message-----
> From: Anoob Joseph <anoobj@marvell.com>
> Sent: Friday, September 8, 2023 6:40 AM
> To: Akhil Goyal <gakhil@marvell.com>; Power, Ciara <ciara.power@intel.com>
> Cc: Jerin Jacob <jerinj@marvell.com>; dev@dpdk.org
> Subject: [PATCH 1/4] security: remove redundant cast
>
> The API 'rte_cryptodev_get_sec_ctx' returns void *. Type cast is not required.
>
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> ---
> lib/security/rte_security.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Hi Anoob,
Series-Acked-by: Ciara Power <ciara.power@intel.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH 1/4] security: remove redundant cast
2023-09-08 5:40 [PATCH 1/4] security: remove redundant cast Anoob Joseph
` (3 preceding siblings ...)
2023-09-08 10:36 ` [PATCH 1/4] security: " Power, Ciara
@ 2023-09-20 11:18 ` Akhil Goyal
4 siblings, 0 replies; 6+ messages in thread
From: Akhil Goyal @ 2023-09-20 11:18 UTC (permalink / raw)
To: Anoob Joseph, Ciara Power; +Cc: Jerin Jacob Kollanukkaran, dev
> Subject: [PATCH 1/4] security: remove redundant cast
>
> The API 'rte_cryptodev_get_sec_ctx' returns void *. Type cast is not
> required.
>
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
> ---
The changes in the series are part of
https://patches.dpdk.org/project/dpdk/patch/20230920104000.2868230-1-gakhil@marvell.com/
Hence dropping this series.
^ permalink raw reply [flat|nested] 6+ messages in thread