[PATCH v5 0/6] crypto/security session framework rework

2022-10-02 Thread Akhil Goyal
This patchset reworks the symmetric crypto and security session
data structure to use a single virtual/physical contiguous buffer
for symmetric crypto/security session and driver private data.
In addition the session data structure is now private.
The session is represented as an opaque pointer in the application.

With the change the session is no longer supported to be accessed
by multiple device drivers. For the same reason
rte_cryptodev_sym_session_init/clear APIs are deprecated as
rte_cryptodev_sym_session_create/free will initialize and
clear the driver specific data field.

The change was also submitted last year during DPDK 21.11
timeframe also[1], but was not applied due to lack of feedback from
community. Please help in getting this cleanup merged in this cycle.

Now the similar work was already done for asymmetric crypto.
This patchset is rebased over current tree and fixes all
the issues reported so far.

Changes in v5:
- rebased over latest dpdk-next-crypto tree

Changes in v4:
- squashed armv8_crypto fixes.
http://patches.dpdk.org/project/dpdk/cover/20220926100120.3980185-1-ruifeng.w...@arm.com/

Changes in v3:
- Updated release notes
- fixed checkpatch issues
- renamed macro to get sess priv data to align with crypto macro
- added acked-by/tested-by

Changes in v2:
This patchset is a v2 for the patch that was sent by Fan Zhang(Intel)
with a few changes
- Added security session rework also.
- fixed issues in [2] reported on mailing list.
- few other fixes.

Please review and provide feedback as soon as possible
as this is intended to be merged in DPDK 22.11 RC1.

Currently the cnxk platform is tested with this change.
Request everyone to review and test on their platform.

Special note to ixgbe and txgbe maintainers.
There is a wrong implementation for flow creation. Please check.
A hack is added to bypass it. Please fix it separately.

[1] 
https://patches.dpdk.org/project/dpdk/cover/20211018213452.2734720-1-gak...@marvell.com/
[2] 
https://patches.dpdk.org/project/dpdk/cover/20220829160645.378406-1-roy.fan.zh...@intel.com/



Akhil Goyal (5):
  cryptodev: rework session framework
  cryptodev: hide sym session structure
  security: remove priv mempool usage
  drivers/crypto: support security session get size op
  security: hide session structure

Fan Zhang (1):
  crypto/scheduler: use unified session

 app/test-crypto-perf/cperf.h  |   1 -
 app/test-crypto-perf/cperf_ops.c  |  64 ++--
 app/test-crypto-perf/cperf_ops.h  |   6 +-
 app/test-crypto-perf/cperf_test_latency.c |  11 +-
 app/test-crypto-perf/cperf_test_latency.h |   1 -
 .../cperf_test_pmd_cyclecount.c   |  12 +-
 .../cperf_test_pmd_cyclecount.h   |   1 -
 app/test-crypto-perf/cperf_test_throughput.c  |  13 +-
 app/test-crypto-perf/cperf_test_throughput.h  |   1 -
 app/test-crypto-perf/cperf_test_verify.c  |  11 +-
 app/test-crypto-perf/cperf_test_verify.h  |   1 -
 app/test-crypto-perf/main.c   |  30 +-
 app/test-eventdev/test_perf_common.c  |  43 +--
 app/test-eventdev/test_perf_common.h  |   1 -
 app/test/test_cryptodev.c | 354 +-
 app/test/test_cryptodev_blockcipher.c |  18 +-
 app/test/test_cryptodev_security_ipsec.c  |   2 +-
 app/test/test_cryptodev_security_ipsec.h  |   2 +-
 app/test/test_event_crypto_adapter.c  |  39 +-
 app/test/test_ipsec.c |  49 +--
 app/test/test_ipsec_perf.c|   4 +-
 app/test/test_security.c  | 178 ++---
 app/test/test_security_inline_proto.c |  26 +-
 doc/guides/prog_guide/cryptodev_lib.rst   |  16 +-
 doc/guides/rel_notes/deprecation.rst  |   9 -
 doc/guides/rel_notes/release_22_11.rst|  14 +
 drivers/crypto/armv8/armv8_pmd_private.h  |   2 -
 drivers/crypto/armv8/rte_armv8_pmd.c  |  21 +-
 drivers/crypto/armv8/rte_armv8_pmd_ops.c  |  35 +-
 drivers/crypto/bcmfs/bcmfs_sym_session.c  |  39 +-
 drivers/crypto/bcmfs/bcmfs_sym_session.h  |   3 +-
 drivers/crypto/caam_jr/caam_jr.c  |  69 +---
 drivers/crypto/ccp/ccp_crypto.c   |  56 +--
 drivers/crypto/ccp/ccp_pmd_ops.c  |  32 +-
 drivers/crypto/ccp/ccp_pmd_private.h  |   2 -
 drivers/crypto/ccp/rte_ccp_pmd.c  |  29 +-
 drivers/crypto/cnxk/cn10k_cryptodev_ops.c |  41 +-
 drivers/crypto/cnxk/cn10k_ipsec.c |  45 +--
 drivers/crypto/cnxk/cn9k_cryptodev_ops.c  |  38 +-
 drivers/crypto/cnxk/cn9k_ipsec.c  |  50 +--
 drivers/crypto/cnxk/cnxk_cryptodev_ops.c  |  55 +--
 drivers/crypto/cnxk/cnxk_cryptodev_ops.h  |  16 +-
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c   |  70 ++--
 drivers/crypto/dpaa2_sec/dpaa2_sec_raw_dp.c   |   6 +-
 drivers/crypto/dpaa_sec/dpaa_sec.c|  69 +---
 drivers/crypto/dpaa_sec/dpaa_sec_raw_dp.c |   7 +-
 drivers/crypto/ipsec_mb/ipsec_mb_ops.

[PATCH v5 2/6] crypto/scheduler: use unified session

2022-10-02 Thread Akhil Goyal
From: Fan Zhang 

This patch updates the scheduler PMD to use unified session
data structure. Previously thanks to the private session
array in cryptodev sym session there are no necessary
change needed for scheduler PMD other than the way ops
are enqueued/dequeued. The patch inherits the same design
in the original session data structure to the scheduler PMD
so the cryptodev sym session can be as a linear buffer for
both session header and driver private data.

With the change there are inevitable extra cost on both memory
(64 bytes per session per driver type) and cycle count (set
the correct session for each cop based on the worker before
enqueue, and retrieve the original session after dequeue).

Signed-off-by: Fan Zhang 
Signed-off-by: Akhil Goyal 
Acked-by: Kai Ji 
Tested-by: Gagandeep Singh 
Tested-by: David Coyle 
Tested-by: Kevin O'Sullivan 
---
 drivers/crypto/scheduler/scheduler_failover.c |  19 ++-
 .../crypto/scheduler/scheduler_multicore.c|  17 +++
 .../scheduler/scheduler_pkt_size_distr.c  |  84 +---
 drivers/crypto/scheduler/scheduler_pmd_ops.c  | 107 +++-
 .../crypto/scheduler/scheduler_pmd_private.h  | 120 +-
 .../crypto/scheduler/scheduler_roundrobin.c   |  11 +-
 6 files changed, 318 insertions(+), 40 deletions(-)

diff --git a/drivers/crypto/scheduler/scheduler_failover.c 
b/drivers/crypto/scheduler/scheduler_failover.c
index 2a0e29fa72..7fadcf66d0 100644
--- a/drivers/crypto/scheduler/scheduler_failover.c
+++ b/drivers/crypto/scheduler/scheduler_failover.c
@@ -16,18 +16,19 @@
 struct fo_scheduler_qp_ctx {
struct scheduler_worker primary_worker;
struct scheduler_worker secondary_worker;
+   uint8_t primary_worker_index;
+   uint8_t secondary_worker_index;
 
uint8_t deq_idx;
 };
 
 static __rte_always_inline uint16_t
 failover_worker_enqueue(struct scheduler_worker *worker,
-   struct rte_crypto_op **ops, uint16_t nb_ops)
+   struct rte_crypto_op **ops, uint16_t nb_ops, uint8_t index)
 {
-   uint16_t i, processed_ops;
+   uint16_t processed_ops;
 
-   for (i = 0; i < nb_ops && i < 4; i++)
-   rte_prefetch0(ops[i]->sym->session);
+   scheduler_set_worker_session(ops, nb_ops, index);
 
processed_ops = rte_cryptodev_enqueue_burst(worker->dev_id,
worker->qp_id, ops, nb_ops);
@@ -47,13 +48,14 @@ schedule_enqueue(void *qp, struct rte_crypto_op **ops, 
uint16_t nb_ops)
return 0;
 
enqueued_ops = failover_worker_enqueue(&qp_ctx->primary_worker,
-   ops, nb_ops);
+   ops, nb_ops, PRIMARY_WORKER_IDX);
 
if (enqueued_ops < nb_ops)
enqueued_ops += failover_worker_enqueue(
&qp_ctx->secondary_worker,
&ops[enqueued_ops],
-   nb_ops - enqueued_ops);
+   nb_ops - enqueued_ops,
+   SECONDARY_WORKER_IDX);
 
return enqueued_ops;
 }
@@ -94,7 +96,7 @@ schedule_dequeue(void *qp, struct rte_crypto_op **ops, 
uint16_t nb_ops)
qp_ctx->deq_idx = (~qp_ctx->deq_idx) & WORKER_SWITCH_MASK;
 
if (nb_deq_ops == nb_ops)
-   return nb_deq_ops;
+   goto retrieve_session;
 
worker = workers[qp_ctx->deq_idx];
 
@@ -104,6 +106,9 @@ schedule_dequeue(void *qp, struct rte_crypto_op **ops, 
uint16_t nb_ops)
worker->nb_inflight_cops -= nb_deq_ops2;
}
 
+retrieve_session:
+   scheduler_retrieve_session(ops, nb_deq_ops + nb_deq_ops2);
+
return nb_deq_ops + nb_deq_ops2;
 }
 
diff --git a/drivers/crypto/scheduler/scheduler_multicore.c 
b/drivers/crypto/scheduler/scheduler_multicore.c
index 900ab4049d..3dea850661 100644
--- a/drivers/crypto/scheduler/scheduler_multicore.c
+++ b/drivers/crypto/scheduler/scheduler_multicore.c
@@ -183,11 +183,19 @@ mc_scheduler_worker(struct rte_cryptodev *dev)
 
while (!mc_ctx->stop_signal) {
if (pending_enq_ops) {
+   scheduler_set_worker_session(
+   &enq_ops[pending_enq_ops_idx], pending_enq_ops,
+   worker_idx);
processed_ops =
rte_cryptodev_enqueue_burst(worker->dev_id,
worker->qp_id,
&enq_ops[pending_enq_ops_idx],
pending_enq_ops);
+   if (processed_ops < pending_deq_ops)
+   scheduler_retrieve_session(
+   &enq_ops[pending_enq_ops_idx +
+   processed_ops],
+   pending_deq_ops - processed_ops);
pending_enq_ops -= processed_ops;
pending_enq_

[PATCH v5 3/6] cryptodev: hide sym session structure

2022-10-02 Thread Akhil Goyal
Structure rte_cryptodev_sym_session is moved to internal
headers which are not visible to applications.
The only field which should be used by app is opaque_data.
This field can now be accessed via set/get APIs added in this
patch.
Subsequent changes in app and lib are made to compile the code.

Signed-off-by: Akhil Goyal 
Signed-off-by: Fan Zhang 
Acked-by: Kai Ji 
Tested-by: Gagandeep Singh 
Tested-by: David Coyle 
Tested-by: Kevin O'Sullivan 
---
 app/test-crypto-perf/cperf_ops.c  | 24 
 app/test-crypto-perf/cperf_ops.h  |  6 +-
 app/test-crypto-perf/cperf_test_latency.c |  2 +-
 .../cperf_test_pmd_cyclecount.c   |  2 +-
 app/test-crypto-perf/cperf_test_throughput.c  |  2 +-
 app/test-crypto-perf/cperf_test_verify.c  |  2 +-
 app/test-eventdev/test_perf_common.c  |  8 +--
 app/test/test_cryptodev.c | 17 +++---
 app/test/test_cryptodev_blockcipher.c |  2 +-
 app/test/test_event_crypto_adapter.c  |  4 +-
 app/test/test_ipsec.c |  2 +-
 app/test/test_ipsec_perf.c|  4 +-
 doc/guides/prog_guide/cryptodev_lib.rst   | 16 ++
 doc/guides/rel_notes/deprecation.rst  |  5 --
 doc/guides/rel_notes/release_22_11.rst|  9 +++
 drivers/crypto/bcmfs/bcmfs_sym_session.c  |  5 +-
 drivers/crypto/caam_jr/caam_jr.c  | 10 ++--
 drivers/crypto/ccp/ccp_crypto.c   | 30 +-
 drivers/crypto/ccp/ccp_pmd_ops.c  |  2 +-
 drivers/crypto/ccp/rte_ccp_pmd.c  |  4 +-
 drivers/crypto/cnxk/cn10k_cryptodev_ops.c |  8 +--
 drivers/crypto/cnxk/cn9k_cryptodev_ops.c  | 10 ++--
 drivers/crypto/cnxk/cnxk_cryptodev_ops.c  |  4 +-
 drivers/crypto/cnxk/cnxk_cryptodev_ops.h  |  2 +-
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c   | 11 ++--
 drivers/crypto/dpaa2_sec/dpaa2_sec_raw_dp.c   |  2 +-
 drivers/crypto/dpaa_sec/dpaa_sec.c|  9 ++-
 drivers/crypto/dpaa_sec/dpaa_sec_raw_dp.c |  2 +-
 drivers/crypto/ipsec_mb/ipsec_mb_ops.c|  2 +-
 drivers/crypto/ipsec_mb/ipsec_mb_private.h|  4 +-
 drivers/crypto/ipsec_mb/pmd_aesni_gcm.c   |  6 +-
 drivers/crypto/ipsec_mb/pmd_aesni_mb.c|  4 +-
 drivers/crypto/ipsec_mb/pmd_kasumi.c  |  2 +-
 drivers/crypto/ipsec_mb/pmd_snow3g.c  |  2 +-
 drivers/crypto/mlx5/mlx5_crypto.c |  7 +--
 drivers/crypto/nitrox/nitrox_sym.c|  6 +-
 drivers/crypto/null/null_crypto_pmd.c |  3 +-
 drivers/crypto/null/null_crypto_pmd_ops.c |  2 +-
 drivers/crypto/octeontx/otx_cryptodev_ops.c   | 10 ++--
 drivers/crypto/openssl/rte_openssl_pmd.c  |  4 +-
 drivers/crypto/openssl/rte_openssl_pmd_ops.c  |  4 +-
 drivers/crypto/qat/qat_sym.c  |  4 +-
 drivers/crypto/qat/qat_sym.h  |  3 +-
 drivers/crypto/qat/qat_sym_session.c  |  6 +-
 .../scheduler/scheduler_pkt_size_distr.c  | 13 ++---
 drivers/crypto/scheduler/scheduler_pmd_ops.c  |  4 +-
 .../crypto/scheduler/scheduler_pmd_private.h  | 30 +-
 drivers/crypto/virtio/virtio_cryptodev.c  |  4 +-
 drivers/crypto/virtio/virtio_rxtx.c   |  2 +-
 examples/fips_validation/fips_dev_self_test.c | 10 ++--
 examples/fips_validation/main.c   |  2 +-
 examples/l2fwd-crypto/main.c  |  6 +-
 lib/cryptodev/cryptodev_pmd.h | 32 +++
 lib/cryptodev/cryptodev_trace_points.c|  3 -
 lib/cryptodev/rte_crypto.h|  3 +-
 lib/cryptodev/rte_crypto_sym.h|  7 +--
 lib/cryptodev/rte_cryptodev.c | 15 +++--
 lib/cryptodev/rte_cryptodev.h | 56 +--
 lib/cryptodev/rte_cryptodev_trace.h   | 14 +
 lib/cryptodev/version.map |  1 -
 lib/ipsec/rte_ipsec_group.h   |  5 +-
 lib/ipsec/ses.c   |  3 +-
 62 files changed, 239 insertions(+), 244 deletions(-)

diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index c6f5735bb0..5acd495794 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -13,7 +13,7 @@ static void
 cperf_set_ops_asym(struct rte_crypto_op **ops,
   uint32_t src_buf_offset __rte_unused,
   uint32_t dst_buf_offset __rte_unused, uint16_t nb_ops,
-  struct rte_cryptodev_sym_session *sess,
+  void *sess,
   const struct cperf_options *options,
   const struct cperf_test_vector *test_vector __rte_unused,
   uint16_t iv_offset __rte_unused,
@@ -55,7 +55,7 @@ static void
 cperf_set_ops_security(struct rte_crypto_op **ops,
uint32_t src_buf_offset __rte_unused,
uint32_t dst_buf_offset __rte_unused,
-   uint16_t nb_ops, struct rte_cryptodev_sym_session *sess,
+   uint16_t nb_ops, void *sess,
 

[PATCH v5 4/6] security: remove priv mempool usage

2022-10-02 Thread Akhil Goyal
As per current design, rte_security_session_create()
unnecessarily use 2 mempool objects for a single session.

To address this, the API will now take only 1 mempool
object instead of 2. With this change, the library layer
will get the object from mempool and session priv data is
stored contiguously in the same mempool object.

User need to ensure that the mempool created in application
is big enough for session private data as well. This can be
ensured if the pool is created after getting size of session
priv data using API rte_security_session_get_size().

Since set and get pkt metadata for security sessions are now
made inline for Inline crypto/proto mode, a new member fast_mdata
is added to the rte_security_session.
To access opaque data and fast_mdata will be accessed via inline
APIs which can do pointer manipulations inside library from
session_private_data pointer coming from application.

Signed-off-by: Akhil Goyal 
Tested-by: Gagandeep Singh 
Tested-by: David Coyle 
Tested-by: Kevin O'Sullivan 
---
 app/test-crypto-perf/cperf.h  |   1 -
 app/test-crypto-perf/cperf_ops.c  |  13 +-
 app/test-crypto-perf/cperf_test_latency.c |   3 +-
 app/test-crypto-perf/cperf_test_latency.h |   1 -
 .../cperf_test_pmd_cyclecount.c   |   3 +-
 .../cperf_test_pmd_cyclecount.h   |   1 -
 app/test-crypto-perf/cperf_test_throughput.c  |   3 +-
 app/test-crypto-perf/cperf_test_throughput.h  |   1 -
 app/test-crypto-perf/cperf_test_verify.c  |   3 +-
 app/test-crypto-perf/cperf_test_verify.h  |   1 -
 app/test-crypto-perf/main.c   |   3 -
 app/test/test_cryptodev.c |  44 +-
 app/test/test_ipsec.c |   7 +-
 app/test/test_security.c  | 146 ++
 app/test/test_security_inline_proto.c |  16 +-
 drivers/crypto/caam_jr/caam_jr.c  |  31 +---
 drivers/crypto/cnxk/cn10k_cryptodev_ops.c |   7 +-
 drivers/crypto/cnxk/cn10k_ipsec.c |  45 ++
 drivers/crypto/cnxk/cn9k_cryptodev_ops.c  |   9 +-
 drivers/crypto/cnxk/cn9k_ipsec.c  |  50 ++
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c   |  29 +---
 drivers/crypto/dpaa2_sec/dpaa2_sec_raw_dp.c   |   3 +-
 drivers/crypto/dpaa_sec/dpaa_sec.c|  25 +--
 drivers/crypto/dpaa_sec/dpaa_sec_raw_dp.c |   3 +-
 drivers/crypto/ipsec_mb/pmd_aesni_mb.c|  26 +---
 drivers/crypto/mvsam/rte_mrvl_pmd.c   |   3 +-
 drivers/crypto/mvsam/rte_mrvl_pmd_ops.c   |  21 +--
 drivers/crypto/qat/qat_sym.c  |   3 +-
 drivers/crypto/qat/qat_sym.h  |  11 +-
 drivers/crypto/qat/qat_sym_session.c  |  27 +---
 drivers/crypto/qat/qat_sym_session.h  |   2 +-
 drivers/net/cnxk/cn10k_ethdev_sec.c   |  38 ++---
 drivers/net/cnxk/cn9k_ethdev_sec.c|  41 ++---
 drivers/net/iavf/iavf_ipsec_crypto.c  |  23 +--
 drivers/net/ixgbe/ixgbe_ipsec.c   |  31 ++--
 drivers/net/txgbe/txgbe_ipsec.c   |  32 ++--
 examples/ipsec-secgw/ipsec-secgw.c|  34 
 examples/ipsec-secgw/ipsec.c  |   9 +-
 examples/ipsec-secgw/ipsec.h  |   1 -
 lib/cryptodev/rte_cryptodev.h |   2 +-
 lib/security/rte_security.c   |  20 ++-
 lib/security/rte_security.h   |  30 ++--
 lib/security/rte_security_driver.h|  13 +-
 43 files changed, 193 insertions(+), 622 deletions(-)

diff --git a/app/test-crypto-perf/cperf.h b/app/test-crypto-perf/cperf.h
index 2b0aad095c..db58228dce 100644
--- a/app/test-crypto-perf/cperf.h
+++ b/app/test-crypto-perf/cperf.h
@@ -15,7 +15,6 @@ struct cperf_op_fns;
 
 typedef void  *(*cperf_constructor_t)(
struct rte_mempool *sess_mp,
-   struct rte_mempool *sess_priv_mp,
uint8_t dev_id,
uint16_t qp_id,
const struct cperf_options *options,
diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index 5acd495794..727eee6599 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -642,7 +642,6 @@ cperf_set_ops_aead(struct rte_crypto_op **ops,
 
 static void *
 create_ipsec_session(struct rte_mempool *sess_mp,
-   struct rte_mempool *priv_mp,
uint8_t dev_id,
const struct cperf_options *options,
const struct cperf_test_vector *test_vector,
@@ -753,13 +752,11 @@ create_ipsec_session(struct rte_mempool *sess_mp,
rte_cryptodev_get_sec_ctx(dev_id);
 
/* Create security session */
-   return (void *)rte_security_session_create(ctx,
-   &sess_conf, sess_mp, priv_mp);
+   return (void *)rte_security_session_create(ctx, &sess_conf, sess_mp);
 }
 
 static void *
 cperf_create_session(struct rte_mempool *sess_mp,
-   struct rte_mempoo

[PATCH v5 5/6] drivers/crypto: support security session get size op

2022-10-02 Thread Akhil Goyal
Added the support for rte_security_op.session_get_size()
in all the PMDs which support rte_security sessions and the
op was not supported.

Signed-off-by: Akhil Goyal 
Acked-by: Kai Ji 
Tested-by: Gagandeep Singh 
Tested-by: David Coyle 
Tested-by: Kevin O'Sullivan 
---
 drivers/crypto/caam_jr/caam_jr.c| 6 ++
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 7 +++
 drivers/crypto/dpaa_sec/dpaa_sec.c  | 8 
 drivers/crypto/ipsec_mb/pmd_aesni_mb.c  | 7 +++
 drivers/crypto/mvsam/rte_mrvl_pmd_ops.c | 7 +++
 drivers/crypto/qat/dev/qat_sym_pmd_gen1.c   | 1 +
 drivers/crypto/qat/qat_sym_session.c| 6 ++
 drivers/crypto/qat/qat_sym_session.h| 2 ++
 8 files changed, 44 insertions(+)

diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c
index bbf2c0bdb1..67d9bb89e5 100644
--- a/drivers/crypto/caam_jr/caam_jr.c
+++ b/drivers/crypto/caam_jr/caam_jr.c
@@ -1937,6 +1937,11 @@ caam_jr_security_session_destroy(void *dev __rte_unused,
return 0;
 }
 
+static unsigned int
+caam_jr_security_session_get_size(void *device __rte_unused)
+{
+   return sizeof(struct caam_jr_session);
+}
 
 static int
 caam_jr_dev_configure(struct rte_cryptodev *dev,
@@ -2031,6 +2036,7 @@ static struct rte_cryptodev_ops caam_jr_ops = {
 static struct rte_security_ops caam_jr_security_ops = {
.session_create = caam_jr_security_session_create,
.session_update = NULL,
+   .session_get_size = caam_jr_security_session_get_size,
.session_stats_get = NULL,
.session_destroy = caam_jr_security_session_destroy,
.set_pkt_metadata = NULL,
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c 
b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index 28a868da53..49f08f69f0 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -3733,6 +3733,12 @@ dpaa2_sec_security_session_destroy(void *dev 
__rte_unused,
}
return 0;
 }
+
+static unsigned int
+dpaa2_sec_security_session_get_size(void *device __rte_unused)
+{
+   return sizeof(dpaa2_sec_session);
+}
 #endif
 static int
 dpaa2_sec_sym_session_configure(struct rte_cryptodev *dev __rte_unused,
@@ -4184,6 +4190,7 @@ dpaa2_sec_capabilities_get(void *device __rte_unused)
 static const struct rte_security_ops dpaa2_sec_security_ops = {
.session_create = dpaa2_sec_security_session_create,
.session_update = NULL,
+   .session_get_size = dpaa2_sec_security_session_get_size,
.session_stats_get = NULL,
.session_destroy = dpaa2_sec_security_session_destroy,
.set_pkt_metadata = NULL,
diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c 
b/drivers/crypto/dpaa_sec/dpaa_sec.c
index b1529bd1f6..0df63aaf3f 100644
--- a/drivers/crypto/dpaa_sec/dpaa_sec.c
+++ b/drivers/crypto/dpaa_sec/dpaa_sec.c
@@ -3289,6 +3289,13 @@ dpaa_sec_security_session_destroy(void *dev __rte_unused,
}
return 0;
 }
+
+static unsigned int
+dpaa_sec_security_session_get_size(void *device __rte_unused)
+{
+   return sizeof(dpaa_sec_session);
+}
+
 #endif
 static int
 dpaa_sec_dev_configure(struct rte_cryptodev *dev __rte_unused,
@@ -3547,6 +3554,7 @@ dpaa_sec_capabilities_get(void *device __rte_unused)
 static const struct rte_security_ops dpaa_sec_security_ops = {
.session_create = dpaa_sec_security_session_create,
.session_update = NULL,
+   .session_get_size = dpaa_sec_security_session_get_size,
.session_stats_get = NULL,
.session_destroy = dpaa_sec_security_session_destroy,
.set_pkt_metadata = NULL,
diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c 
b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
index 76cb1c543a..fc9ee01124 100644
--- a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c
@@ -2130,6 +2130,12 @@ aesni_mb_pmd_sec_sess_destroy(void *dev __rte_unused,
return 0;
 }
 
+static unsigned int
+aesni_mb_pmd_sec_sess_get_size(void *device __rte_unused)
+{
+   return sizeof(struct aesni_mb_session);
+}
+
 /** Get security capabilities for aesni multi-buffer */
 static const struct rte_security_capability *
 aesni_mb_pmd_sec_capa_get(void *device __rte_unused)
@@ -2140,6 +2146,7 @@ aesni_mb_pmd_sec_capa_get(void *device __rte_unused)
 static struct rte_security_ops aesni_mb_pmd_sec_ops = {
.session_create = aesni_mb_pmd_sec_sess_create,
.session_update = NULL,
+   .session_get_size = aesni_mb_pmd_sec_sess_get_size,
.session_stats_get = NULL,
.session_destroy = aesni_mb_pmd_sec_sess_destroy,
.set_pkt_metadata = NULL,
diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c 
b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
index 1aa8e935f1..6ac0407c36 100644
--- a/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
+++ b/drivers/crypto/mvsam/rte_mrvl_pmd_ops.c
@@ -907,6 +907,12 @@ mrvl_crypto_pmd_security_session_destroy(void *dev 

[PATCH v5 6/6] security: hide session structure

2022-10-02 Thread Akhil Goyal
Structure rte_security_session is moved to internal
headers which are not visible to applications.
The only field which should be used by app is opaque_data.
This field can now be accessed via set/get APIs added in this
patch.
Subsequent changes in app and lib are made to compile the code.

Signed-off-by: Akhil Goyal 
Tested-by: Gagandeep Singh 
Tested-by: David Coyle 
Tested-by: Kevin O'Sullivan 
---
 app/test-crypto-perf/cperf_ops.c  |  6 +-
 .../cperf_test_pmd_cyclecount.c   |  2 +-
 app/test-crypto-perf/cperf_test_throughput.c  |  2 +-
 app/test/test_cryptodev.c |  2 +-
 app/test/test_cryptodev_security_ipsec.c  |  2 +-
 app/test/test_cryptodev_security_ipsec.h  |  2 +-
 app/test/test_security.c  | 32 
 app/test/test_security_inline_proto.c | 10 +--
 doc/guides/rel_notes/deprecation.rst  |  4 -
 doc/guides/rel_notes/release_22_11.rst|  5 ++
 drivers/crypto/caam_jr/caam_jr.c  |  2 +-
 drivers/crypto/cnxk/cn10k_cryptodev_ops.c |  4 +-
 drivers/crypto/cnxk/cn9k_cryptodev_ops.c  |  6 +-
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c   |  6 +-
 drivers/crypto/dpaa_sec/dpaa_sec.c|  4 +-
 drivers/crypto/ipsec_mb/pmd_aesni_mb.c|  4 +-
 drivers/crypto/qat/qat_sym.c  |  4 +-
 drivers/crypto/qat/qat_sym.h  |  4 +-
 drivers/net/iavf/iavf_ipsec_crypto.h  |  2 +-
 examples/ipsec-secgw/ipsec_worker.c   |  2 +-
 lib/cryptodev/rte_crypto_sym.h|  4 +-
 lib/ipsec/rte_ipsec_group.h   | 12 +--
 lib/ipsec/ses.c   |  2 +-
 lib/security/rte_security.c   | 13 ++-
 lib/security/rte_security.h   | 80 ---
 lib/security/rte_security_driver.h| 18 +
 26 files changed, 137 insertions(+), 97 deletions(-)

diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c
index 727eee6599..61a3967697 100644
--- a/app/test-crypto-perf/cperf_ops.c
+++ b/app/test-crypto-perf/cperf_ops.c
@@ -65,8 +65,7 @@ cperf_set_ops_security(struct rte_crypto_op **ops,
 
for (i = 0; i < nb_ops; i++) {
struct rte_crypto_sym_op *sym_op = ops[i]->sym;
-   struct rte_security_session *sec_sess =
-   (struct rte_security_session *)sess;
+   void *sec_sess = (void *)sess;
uint32_t buf_sz;
 
uint32_t *per_pkt_hfn = rte_crypto_op_ctod_offset(ops[i],
@@ -131,8 +130,7 @@ cperf_set_ops_security_ipsec(struct rte_crypto_op **ops,
uint16_t iv_offset __rte_unused, uint32_t *imix_idx,
uint64_t *tsc_start)
 {
-   struct rte_security_session *sec_sess =
-   (struct rte_security_session *)sess;
+   void *sec_sess = sess;
const uint32_t test_buffer_size = options->test_buffer_size;
const uint32_t headroom_sz = options->headroom_sz;
const uint32_t segment_sz = options->segment_sz;
diff --git a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c 
b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
index aa2654250f..0307e82996 100644
--- a/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
+++ b/app/test-crypto-perf/cperf_test_pmd_cyclecount.c
@@ -71,7 +71,7 @@ cperf_pmd_cyclecount_test_free(struct 
cperf_pmd_cyclecount_ctx *ctx)
(struct rte_security_ctx *)
rte_cryptodev_get_sec_ctx(ctx->dev_id);
rte_security_session_destroy(sec_ctx,
-   (struct rte_security_session *)ctx->sess);
+   (void *)ctx->sess);
} else
 #endif
rte_cryptodev_sym_session_free(ctx->dev_id, ctx->sess);
diff --git a/app/test-crypto-perf/cperf_test_throughput.c 
b/app/test-crypto-perf/cperf_test_throughput.c
index db89b7ddff..e892a70699 100644
--- a/app/test-crypto-perf/cperf_test_throughput.c
+++ b/app/test-crypto-perf/cperf_test_throughput.c
@@ -49,7 +49,7 @@ cperf_throughput_test_free(struct cperf_throughput_ctx *ctx)
rte_cryptodev_get_sec_ctx(ctx->dev_id);
rte_security_session_destroy(
sec_ctx,
-   (struct rte_security_session *)ctx->sess);
+   (void *)ctx->sess);
}
 #endif
else
diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c
index 9708fc87d2..c6d47a035e 100644
--- a/app/test/test_cryptodev.c
+++ b/app/test/test_cryptodev.c
@@ -84,7 +84,7 @@ struct crypto_unittest_params {
union {
void *sess;
 #ifdef RTE_LIB_SECURITY
-   struct rte_security_session *sec_session;
+   void *sec_session;
 #endif
};
 #ifdef RTE_LIB_SECURITY
diff --git a/app/test/test_cryptodev_security_ipsec.c

RE: [EXT] [dpdk-dev v2] lib/cryptodev: multi-process IPC request handler

2022-10-02 Thread Akhil Goyal


> This patch add a function to support queue-pair configuration
> request to allow the primary or secondary process to setup/free the
> queue-pair via IPC handler.
> 
> Signed-off-by: Kai Ji 
I hope this patch is for next release now. It is too late for it to get merged 
in RC1


[PATCH] doc: remove deprecation for inline IPsec events

2022-10-02 Thread Akhil Goyal
The IPsec SA expiry events were added as per below patch,
but the deprecation notice was not removed. This patch removed it.

Fixes: d1ce79d14ba1 ("ethdev: add IPsec SA expiry event subtypes")

Signed-off-by: Akhil Goyal 
---
 doc/guides/rel_notes/deprecation.rst | 5 -
 1 file changed, 5 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst 
b/doc/guides/rel_notes/deprecation.rst
index 80ec8ba01d..26ff2eedac 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -119,11 +119,6 @@ Deprecation Notices
   alternative is implemented.
   The legacy actions should be removed in DPDK 22.11.
 
-* ethdev: The enum ``rte_eth_event_ipsec_subtype`` will be extended to add
-  new subtype values ``RTE_ETH_EVENT_IPSEC_SA_PKT_EXPIRY``,
-  ``RTE_ETH_EVENT_IPSEC_SA_BYTE_HARD_EXPIRY`` and
-  ``RTE_ETH_EVENT_IPSEC_SA_PKT_HARD_EXPIRY`` in DPDK 22.11.
-
 * cryptodev: The function ``rte_cryptodev_cb_fn`` will be updated
   to have another parameter ``qp_id`` to return the queue pair ID
   which got error interrupt to the application,
-- 
2.25.1



[dpdk-dev v3 1/1] lib/cryptodev: multi-process IPC request handler

2022-10-02 Thread Kai Ji
This patch add a function to support queue-pair configuration
request to allow the primary or secondary process to setup/free the
queue-pair via IPC handler. Add in queue pair in-used by process id
array in rte_cryptodev_data for pid tracking.

Signed-off-by: Kai Ji 
---
v3:
- addin missing free function for qp_in_use_by_pid

v2:
- code rework
---
 lib/cryptodev/cryptodev_pmd.h |  3 +-
 lib/cryptodev/rte_cryptodev.c | 92 +++
 lib/cryptodev/rte_cryptodev.h | 37 ++
 lib/cryptodev/version.map |  2 +
 4 files changed, 133 insertions(+), 1 deletion(-)

diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h
index 09ba952455..f404604963 100644
--- a/lib/cryptodev/cryptodev_pmd.h
+++ b/lib/cryptodev/cryptodev_pmd.h
@@ -78,7 +78,8 @@ struct rte_cryptodev_data {
void **queue_pairs;
/** Number of device queue pairs. */
uint16_t nb_queue_pairs;
-
+   /** Array of process id used for queue pairs **/
+   uint16_t *qp_in_use_by_pid;
/** PMD-specific private data */
void *dev_private;
 } __rte_cache_aligned;
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 9e76a1c72d..dab6a37bff 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -49,6 +49,9 @@ struct rte_crypto_fp_ops 
rte_crypto_fp_ops[RTE_CRYPTO_MAX_DEVS];
 /* spinlock for crypto device callbacks */
 static rte_spinlock_t rte_cryptodev_cb_lock = RTE_SPINLOCK_INITIALIZER;
 
+/* crypto queue pair config */
+#define CRYPTODEV_MP_REQ "cryptodev_mp_request"
+
 /**
  * The user application callback description.
  *
@@ -1050,6 +1053,9 @@ rte_cryptodev_pmd_release_device(struct rte_cryptodev 
*cryptodev)
return ret;
}
 
+   if (cryptodev->data->qp_in_use_by_pid)
+   rte_free(cryptodev->data->qp_in_use_by_pid);
+
ret = rte_cryptodev_data_free(dev_id, &cryptodev_globals.data[dev_id]);
if (ret < 0)
return ret;
@@ -1138,6 +1144,21 @@ rte_cryptodev_queue_pairs_config(struct rte_cryptodev 
*dev, uint16_t nb_qpairs,
 
}
dev->data->nb_queue_pairs = nb_qpairs;
+
+   if (dev->data->qp_in_use_by_pid == NULL) {
+   dev->data->qp_in_use_by_pid = rte_zmalloc_socket(
+   "cryptodev->qp_in_use_by_pid",
+   sizeof(dev->data->qp_in_use_by_pid[0]) *
+   dev_info.max_nb_queue_pairs,
+   RTE_CACHE_LINE_SIZE, socket_id);
+   if (dev->data->qp_in_use_by_pid == NULL) {
+   CDEV_LOG_ERR("failed to get memory for qp meta data, "
+   "nb_queues %u",
+   nb_qpairs);
+   return -(ENOMEM);
+   }
+   }
+
return 0;
 }
 
@@ -1400,6 +1421,77 @@ rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t 
queue_pair_id,
socket_id);
 }
 
+static int
+rte_cryptodev_ipc_request(const struct rte_mp_msg *mp_msg, const void *peer)
+{
+   struct rte_mp_msg mp_res;
+   struct rte_cryptodev_mp_param *res =
+   (struct rte_cryptodev_mp_param *)mp_res.param;
+   const struct rte_cryptodev_mp_param *param =
+   (const struct rte_cryptodev_mp_param *)mp_msg->param;
+
+   int ret;
+   struct rte_cryptodev *dev;
+   uint16_t *qps_in_used_by_pid;
+   int dev_id = param->dev_id;
+   int qp_id = param->qp_id;
+   struct rte_cryptodev_qp_conf *queue_conf = param->queue_conf;
+
+   res->result = -EINVAL;
+   if (!rte_cryptodev_is_valid_dev(dev_id)) {
+   CDEV_LOG_ERR("Invalid dev_id=%" PRIu8, dev_id);
+   goto out;
+   }
+
+   if (!rte_cryptodev_get_qp_status(dev_id, qp_id))
+   goto out;
+
+   dev = &rte_crypto_devices[dev_id];
+   qps_in_used_by_pid = dev->data->qp_in_use_by_pid;
+
+   switch (param->type) {
+   case RTE_CRYPTODEV_MP_REQ_QP_SET:
+   ret = rte_cryptodev_queue_pair_setup(dev_id, qp_id,
+   queue_conf, param->socket_id);
+   if (!ret)
+   qps_in_used_by_pid[qp_id] = param->process_id;
+   res->result = ret;
+   break;
+   case RTE_CRYPTODEV_MP_REQ_QP_FREE:
+   if ((rte_eal_process_type() == RTE_PROC_SECONDARY) &&
+   (qps_in_used_by_pid[qp_id] != param->process_id)) {
+   CDEV_LOG_ERR("Unable to release qp_id=%" PRIu8, qp_id);
+   goto out;
+   }
+
+   ret = (*dev->dev_ops->queue_pair_release)(dev, qp_id);
+   if (!ret)
+   qps_in_used_by_pid[qp_id] = 0;
+
+   res->result = ret;
+   break;
+   default:
+   CDEV_LOG_ERR("invalid mp reque

[PATCH] doc: remove DPAA2 cmdif raw driver deprecation notice

2022-10-02 Thread Gagandeep Singh
In commit [1], It was announced to remove the DPAA2 cmdif
raw driver as there was no active user known at that time.
But now, one of the DPAA2 user has objected this driver
removal so in this patch, removing the deprecation notice
for the driver.

[1] commit 10f0e51554b4 ("doc: announce removal of DPAA2 cmdif raw driver")

Signed-off-by: Gagandeep Singh 
---
 doc/guides/rel_notes/deprecation.rst | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst 
b/doc/guides/rel_notes/deprecation.rst
index e83bc648fc..cb5336c351 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -178,9 +178,6 @@ Deprecation Notices
 * metrics: The function ``rte_metrics_init`` will have a non-void return
   in order to notify errors instead of calling ``rte_exit``.
 
-* raw/dpaa2_cmdif: The ``dpaa2_cmdif`` rawdev driver will be deprecated
-  in DPDK 22.11, as it is no longer in use, no active user known.
-
 * raw/ioat: The ``ioat`` rawdev driver has been deprecated, since it's
   functionality is provided through the new ``dmadev`` infrastructure.
   To continue to use hardware previously supported by the ``ioat`` rawdev 
driver,
-- 
2.25.1



RE: [PATCH v3] ethdev: queue rate parameter changed from 16b to 32b

2022-10-02 Thread Satha Koteswara Rao Kottidi
Ping

-Original Message-
From: Satha Koteswara Rao Kottidi  
Sent: Friday, September 30, 2022 3:27 PM
To: Satha Koteswara Rao Kottidi ; Aman Singh 
; Yuying Zhang ; Ray 
Kinsella ; Ajit Khaparde ; Somnath 
Kotur ; Nithin Kumar Dabilpuram 
; Kiran Kumar Kokkilagadda ; 
Sunil Kumar Kori ; Qiming Yang ; 
Wenjun Wu ; Jiawen Wu ; Jian 
Wang ; Thomas Monjalon ; Ferruh 
Yigit ; Andrew Rybchenko 

Cc: dev@dpdk.org; ferruh.yi...@amd.com; bruce.richard...@intel.com; 
konstantin.v.anan...@yandex.ru; Jerin Jacob Kollanukkaran 
Subject: RE: [PATCH v3] ethdev: queue rate parameter changed from 16b to 32b

Hi All,

Could you please review and provide suggestions if any.

Thanks,
Satha.

-Original Message-
From: skotesh...@marvell.com 
Sent: Wednesday, September 28, 2022 11:22 AM
To: Aman Singh ; Yuying Zhang 
; Ray Kinsella ; Ajit Khaparde 
; Somnath Kotur ; 
Nithin Kumar Dabilpuram ; Kiran Kumar Kokkilagadda 
; Sunil Kumar Kori ; Satha 
Koteswara Rao Kottidi ; Qiming Yang 
; Wenjun Wu ; Jiawen Wu 
; Jian Wang ; Thomas Monjalon 
; Ferruh Yigit ; Andrew Rybchenko 

Cc: dev@dpdk.org; ferruh.yi...@amd.com; bruce.richard...@intel.com; 
konstantin.v.anan...@yandex.ru; Jerin Jacob Kollanukkaran 
Subject: [PATCH v3] ethdev: queue rate parameter changed from 16b to 32b

From: Satha Rao 

The rate parameter modified to uint32_t, so that it can work for more than 64 
Gbps.

Signed-off-by: Satha Rao 
---

v2: Fixed checkpatch warnings

v3: updated release notes, cleanup deprecation, addressed review comments

 app/test-pmd/cmdline.c | 8 
 app/test-pmd/config.c  | 4 ++--
 app/test-pmd/testpmd.h | 4 ++--
 doc/guides/rel_notes/deprecation.rst   | 5 -
 doc/guides/rel_notes/release_22_11.rst | 3 +++
 drivers/net/bnxt/rte_pmd_bnxt.c| 4 ++--
 drivers/net/bnxt/rte_pmd_bnxt.h| 2 +-
 drivers/net/cnxk/cnxk_ethdev.h | 2 +-
 drivers/net/cnxk/cnxk_tm.c | 2 +-
 drivers/net/ixgbe/ixgbe_ethdev.c   | 4 ++--
 drivers/net/ixgbe/ixgbe_ethdev.h   | 4 ++--
 drivers/net/ixgbe/rte_pmd_ixgbe.c  | 2 +-
 drivers/net/ixgbe/rte_pmd_ixgbe.h  | 2 +-
 drivers/net/txgbe/txgbe_ethdev.c   | 2 +-
 drivers/net/txgbe/txgbe_ethdev.h   | 2 +-
 lib/ethdev/ethdev_driver.h | 2 +-
 lib/ethdev/rte_ethdev.c| 2 +-
 lib/ethdev/rte_ethdev.h| 2 +-
 18 files changed, 27 insertions(+), 29 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 
51321de..adfdc1d 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -8106,7 +8106,7 @@ struct cmd_queue_rate_limit_result {
cmdline_fixed_string_t queue;
uint8_t queue_num;
cmdline_fixed_string_t rate;
-   uint16_t rate_num;
+   uint32_t rate_num;
 };
 
 static void cmd_queue_rate_limit_parsed(void *parsed_result, @@ -8147,7 
+8147,7 @@ static void cmd_queue_rate_limit_parsed(void *parsed_result,
rate, "rate");
 static cmdline_parse_token_num_t cmd_queue_rate_limit_ratenum =
TOKEN_NUM_INITIALIZER(struct cmd_queue_rate_limit_result,
-   rate_num, RTE_UINT16);
+   rate_num, RTE_UINT32);
 
 static cmdline_parse_inst_t cmd_queue_rate_limit = {
.f = cmd_queue_rate_limit_parsed,
@@ -8174,7 +8174,7 @@ struct cmd_vf_rate_limit_result {
cmdline_fixed_string_t vf;
uint8_t vf_num;
cmdline_fixed_string_t rate;
-   uint16_t rate_num;
+   uint32_t rate_num;
cmdline_fixed_string_t q_msk;
uint64_t q_msk_val;
 };
@@ -8218,7 +8218,7 @@ static void cmd_vf_rate_limit_parsed(void *parsed_result,
rate, "rate");
 static cmdline_parse_token_num_t cmd_vf_rate_limit_ratenum =
TOKEN_NUM_INITIALIZER(struct cmd_vf_rate_limit_result,
-   rate_num, RTE_UINT16);
+   rate_num, RTE_UINT32);
 static cmdline_parse_token_string_t cmd_vf_rate_limit_q_msk =
TOKEN_STRING_INITIALIZER(struct cmd_vf_rate_limit_result,
q_msk, "queue_mask");
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 
c90cdfe..6dd543d 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -5914,7 +5914,7 @@ struct igb_ring_desc_16_bytes {  }
 
 int
-set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint16_t rate)
+set_queue_rate_limit(portid_t port_id, uint16_t queue_idx, uint32_t
+rate)
 {
int diag;
struct rte_eth_link link;
@@ -5942,7 +5942,7 @@ struct igb_ring_desc_16_bytes {  }
 
 int
-set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate, uint64_t q_msk)
+set_vf_rate_limit(portid_t port_id, uint16_t vf, uint32_t rate, 
+uint64_t q_msk)
 {
int diag = -ENOTSUP;
 
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 
ddf5e21..0af3aa1 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@

[PATCH] app/testpmd: fix vlan offload of rxq

2022-10-02 Thread Mingjin Ye
After setting "vlan offload" in testpmd, the result does not
update the rxq queues configuration.

Therefore, this patch is to reconfigure rxq queues after
executing the "vlan offload" command.

Fixes: a47aa8b97afe ("app/testpmd: add vlan offload support")
Cc: sta...@dpdk.org

Signed-off-by: Mingjin Ye 
---
 app/test-pmd/cmdline.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index b4fe9dfb17..066a482fb5 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -4076,6 +4076,7 @@ cmd_vlan_offload_parsed(void *parsed_result,
else
vlan_extend_set(port_id, on);
 
+   cmd_reconfig_device_queue(port_id, 1, 1);
return;
 }
 
-- 
2.34.1



Question about VFIO_DEVICE_RESET

2022-10-02 Thread Niket Kandya
Hi Folks,

After running into a reset related issue recently and browsing through
code, I reached at this function *pci_rte_vfio_setup_device*.

I do not understand the rationale of the *VFIO_DEVICE_RESET* at the end of
this function.
Looks like the function sets up interrupts, enables bus mastering and then
resets the device?

See below from the PCIe spec:
*`Note that the controls that enable the Function to initiate requests on
PCI Express are cleared, including Bus Master Enable, MSI Enable, and the
like, effectively causing the Function to become quiescent on the Link.`*

Is the function effectively undoing everything by doing the reset at the
end?


[PATCH] drivers: suggestion on removing empty version.map files

2022-10-02 Thread Abdullah Ömer Yamaç
In this patch, we remove all version.map files which include
only the below part:
`DPDK_23 {
local: *;
};`

Then we modify the meson.build to be able to compile without version.map

Signed-off-by: Abdullah Ömer Yamaç 
Suggested-by: Ferruh Yigit 
---
 drivers/baseband/la12xx/version.map   |  3 --
 drivers/baseband/null/version.map |  3 --
 drivers/baseband/turbo_sw/version.map |  3 --
 drivers/common/qat/version.map|  3 --
 drivers/compress/isal/version.map |  3 --
 drivers/compress/mlx5/version.map |  3 --
 drivers/compress/octeontx/version.map |  3 --
 drivers/compress/zlib/version.map |  3 --
 drivers/crypto/armv8/version.map  |  3 --
 drivers/crypto/bcmfs/version.map  |  3 --
 drivers/crypto/caam_jr/version.map|  3 --
 drivers/crypto/ccp/version.map|  3 --
 drivers/crypto/ipsec_mb/version.map   |  3 --
 drivers/crypto/mlx5/version.map   |  3 --
 drivers/crypto/mvsam/version.map  |  3 --
 drivers/crypto/nitrox/version.map |  3 --
 drivers/crypto/null/version.map   |  3 --
 drivers/crypto/openssl/version.map|  3 --
 drivers/crypto/virtio/version.map |  3 --
 drivers/dma/cnxk/version.map  |  3 --
 drivers/dma/dpaa/version.map  |  3 --
 drivers/dma/hisilicon/version.map |  3 --
 drivers/dma/idxd/version.map  |  3 --
 drivers/dma/ioat/version.map  |  3 --
 drivers/dma/skeleton/version.map  |  3 --
 drivers/event/cnxk/version.map|  3 --
 drivers/event/dpaa/version.map|  3 --
 drivers/event/dpaa2/version.map   |  3 --
 drivers/event/dsw/version.map |  3 --
 drivers/event/octeontx/version.map|  3 --
 drivers/event/opdl/version.map|  3 --
 drivers/event/skeleton/version.map|  3 --
 drivers/event/sw/version.map  |  3 --
 drivers/gpu/cuda/version.map  |  3 --
 drivers/mempool/bucket/version.map|  3 --
 drivers/mempool/cnxk/version.map  |  3 --
 drivers/mempool/octeontx/version.map  |  3 --
 drivers/mempool/ring/version.map  |  3 --
 drivers/mempool/stack/version.map |  3 --
 drivers/meson.build   | 63 +++
 drivers/net/af_packet/version.map |  3 --
 drivers/net/af_xdp/version.map|  3 --
 drivers/net/ark/version.map   |  3 --
 drivers/net/avp/version.map   |  3 --
 drivers/net/axgbe/version.map |  3 --
 drivers/net/bnx2x/version.map |  3 --
 drivers/net/cxgbe/version.map |  3 --
 drivers/net/e1000/version.map |  3 --
 drivers/net/ena/version.map   |  3 --
 drivers/net/enetc/version.map |  3 --
 drivers/net/enetfec/version.map   |  3 --
 drivers/net/enic/version.map  |  3 --
 drivers/net/failsafe/version.map  |  3 --
 drivers/net/fm10k/version.map |  3 --
 drivers/net/hinic/version.map |  3 --
 drivers/net/hns3/version.map  |  3 --
 drivers/net/igc/version.map   |  3 --
 drivers/net/ionic/version.map |  3 --
 drivers/net/kni/version.map   |  3 --
 drivers/net/liquidio/version.map  |  3 --
 drivers/net/memif/version.map |  3 --
 drivers/net/mlx4/version.map  |  3 --
 drivers/net/mvneta/version.map|  3 --
 drivers/net/mvpp2/version.map |  3 --
 drivers/net/netvsc/version.map|  3 --
 drivers/net/nfb/version.map   |  3 --
 drivers/net/nfp/version.map   |  3 --
 drivers/net/ngbe/version.map  |  3 --
 drivers/net/null/version.map  |  3 --
 drivers/net/octeon_ep/version.map |  3 --
 drivers/net/pcap/version.map  |  3 --
 drivers/net/pfe/version.map   |  3 --
 drivers/net/qede/version.map  |  3 --
 drivers/net/sfc/version.map   |  3 --
 drivers/net/tap/version.map   |  3 --
 drivers/net/thunderx/version.map  |  3 --
 drivers/net/txgbe/version.map |  3 --
 drivers/net/vdev_netvsc/version.map   |  3 --
 drivers/net/virtio/version.map|  3 --
 drivers/net/vmxnet3/version.map   |  3 --
 drivers/raw/cnxk_bphy/version.map |  3 --
 drivers/raw/cnxk_gpio/version.map |  3 --
 drivers/raw/dpaa2_cmdif/version.map   |  3 --
 drivers/raw/ntb/version.map   |  3 --
 drivers/raw/skeleton/version.map  |  3 --
 drivers/regex/cn9k/version.map|  3 --
 drivers/regex/mlx5/version.map|  3 --
 drivers/vdpa/ifc/version.map  |  3 --
 drivers/vdpa/mlx5/version.map |  3 --
 drivers/vdpa/sfc/version.map  |  3 --
 90 files changed, 34 insertions(+), 296 deletions(-)
 delete mode 100644 drivers/baseband/la12xx/version.map
 delete mode 100644 drivers/baseband/null/version.map
 delete mode 100644 drivers/baseband/turbo_sw/version.map
 delete mode 100644 drivers/common/qat/version.map
 delete mode 100644 drivers/compress/isal/version.map
 delete mode 100644 drivers/compress/mlx5/version.map
 delete mode 100644 drivers/compress/octeontx/version.map
 delete mode 100644 drivers/compress/zlib/versi