Skip to contentSkip to conversation

support enqueue & dequeue callbacks on cryptodev

PATCH Superseded Abhinandan Gujjar 3 participants 15 messages Oct 30, 2020 – Nov 3, 2020 Arm/Amlogic Meson SoC support

v6 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v6 cover support enqueue & dequeue callbacks on cryptodev

In an eventdev world, multiple workers (with ordered queue) will be working on IPsec ESP processing. The ESP header's sequence number is unique and has to be sequentially incremented in an orderly manner. This rises a need for incrementing sequence number in crypto stage especially in event crypto adapter. By adding a user callback to cryptodev at enqueue burst, the user callback will get executed in the context of event crypto adapter. This helps the application to increment the ESP sequence number atomically and orderly manner. The user callback at the dequeue burst helps IPsec application to take care of ARW processing.

v5->v6:
-Removed error code in remove callback APIs & cb init -Updated release notes & documentation

v4->v5:
-Added dequeue callback APIs
-Updated documentation
-Updated errno and return values
-Updated cleanup function

v3->v4:
-Move callback init and cleanup under dev_configure -Update with memory ordering
-Removed extra level of indirection
-Add documentation

v2->v3:
-Moved RCU under the cryptodev APIs
-RCU is maintained per queue-pair
-Changed name of few variables
-Updated callback test with negative cases
-Updated with required changes for meson

v1->v2:
-Moved callback related members to the end of cryptodev struct -Added support for RCU

Abhinandan Gujjar (2):
cryptodev: support enqueue & dequeue callback functions
test: add testcase for crypto enqueue callback

 app/test/test_cryptodev.c               | 135 ++++++++++-
 config/rte_config.h                     |   1 +
 doc/guides/prog_guide/cryptodev_lib.rst |  47 ++++
 doc/guides/rel_notes/release_20_11.rst  |   9 +
 lib/librte_cryptodev/meson.build        |   2 +-
 lib/librte_cryptodev/rte_cryptodev.c    | 404 +++++++++++++++++++++++++++++++-
 lib/librte_cryptodev/rte_cryptodev.h    | 260 +++++++++++++++++++-
 lib/librte_cryptodev/version.map        |   4 +
 8 files changed, 857 insertions(+), 5 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH v6 1/2 cryptodev: support enqueue & dequeue callback functions

This patch adds APIs to add/remove callback functions on crypto enqueue/dequeue burst. The callback function will be called for each burst of crypto ops received/sent on a given crypto device queue pair.

---
 config/rte_config.h                     |   1 +
 doc/guides/prog_guide/cryptodev_lib.rst |  47 ++++
 doc/guides/rel_notes/release_20_11.rst  |   9 +
 lib/librte_cryptodev/meson.build        |   2 +-
 lib/librte_cryptodev/rte_cryptodev.c    | 404 +++++++++++++++++++++++++++++++-
 lib/librte_cryptodev/rte_cryptodev.h    | 260 +++++++++++++++++++-
 lib/librte_cryptodev/version.map        |   4 +
 7 files changed, 724 insertions(+), 3 deletions(-)
config/rte_config.h +1 -0
index 8aa46a1..0e3ddbb 100644
@@ -62,6 +62,7 @@
 /* cryptodev defines */
 #define RTE_CRYPTO_MAX_DEVS 64
 #define RTE_CRYPTODEV_NAME_LEN 64
+#define RTE_CRYPTO_CALLBACKS 1
 
 /* compressdev defines */
 #define RTE_COMPRESS_MAX_DEVS 64
doc/guides/prog_guide/cryptodev_lib.rst +47 -0

53 lines not on this page · raw message

doc/guides/rel_notes/release_20_11.rst +9 -0
index bae39b2..33e190a 100644
@@ -235,6 +235,12 @@ New Features
   enqueue/dequeue operations but does not necessarily depends on
   mbufs and cryptodev operation mempools.
 
+* **Added enqueue & dequeue callback APIs for cryptodev library.**
+
+  Cryptodev library is added with enqueue & dequeue callback APIs to
+  enable applications to add/remove user callbacks which gets called
+  for every enqueue/dequeue operation.
+
 * **Updated the aesni_mb crypto PMD.**
 
   * Added support for AES-ECB 128, 192 and 256.
@@ -492,6 +498,9 @@ API Changes
   ``RTE_CRYPTO_AUTH_LIST_END`` from ``enum rte_crypto_auth_algorithm``
   are removed to avoid future ABI breakage while adding new algorithms.
 
+* cryptodev: The structure ``rte_cryptodev`` has been updated with pointers
+  for adding enqueue and dequeue callbacks.
+
 * scheduler: Renamed functions ``rte_cryptodev_scheduler_slave_attach``,
   ``rte_cryptodev_scheduler_slave_detach`` and
   ``rte_cryptodev_scheduler_slaves_get`` to
lib/librte_cryptodev/meson.build +1 -1
index c4c6b3b..8c5493f 100644
@@ -9,4 +9,4 @@ headers = files('rte_cryptodev.h',
 	'rte_crypto.h',
 	'rte_crypto_sym.h',
 	'rte_crypto_asym.h')
-deps += ['kvargs', 'mbuf']
+deps += ['kvargs', 'mbuf', 'rcu']
lib/librte_cryptodev/rte_cryptodev.c +403 -1

432 lines not on this page · raw message

lib/librte_cryptodev/rte_cryptodev.h +259 -1

308 lines not on this page · raw message

lib/librte_cryptodev/version.map +4 -0
index 7e4360f..429b03e 100644
@@ -101,6 +101,8 @@ EXPERIMENTAL {
 	rte_cryptodev_get_qp_status;
 
 	# added in 20.11
+	rte_cryptodev_add_deq_callback;
+	rte_cryptodev_add_enq_callback;
 	rte_cryptodev_configure_raw_dp_ctx;
 	rte_cryptodev_get_raw_dp_ctx_size;
 	rte_cryptodev_raw_dequeue;
@@ -109,4 +111,6 @@ EXPERIMENTAL {
 	rte_cryptodev_raw_enqueue;
 	rte_cryptodev_raw_enqueue_burst;
 	rte_cryptodev_raw_enqueue_done;
+	rte_cryptodev_remove_deq_callback;
+	rte_cryptodev_remove_enq_callback;
 };
Signature · 1 line
1.9.1
#2 lore raw

Re: [dpdk-dev] [v6 1/2] cryptodev: support enqueue & dequeue callback functions

Hi Abhinandan,

Quoted 10 lines
lib/librte_cryptodev/rte_cryptodev.h +10 -0
+struct rte_cryptodev_cb {
+	struct rte_cryptodev_cb *next;
+	/** < Pointer to next callback */
+	rte_cryptodev_callback_fn fn;
+	/** < Pointer to callback function */
+	void *arg;
+	/** < Pointer to argument */
+};
+
+/**

lib/librte_cryptodev/rte_cryptodev.h typedef uint16_t (*enqueue_pkt_burst_t)(void *qp, · line 893

Quoted 10 lines
lib/librte_cryptodev/rte_cryptodev.h +10 -0
+ * @internal
+ * Structure used to hold information about the RCU for a queue pair.
+ */
+struct rte_cryptodev_cb_rcu {
+	struct rte_cryptodev_cb *next;
+	/** < Pointer to next callback */
+	struct rte_rcu_qsbr *qsbr;
+	/** < RCU QSBR variable per queue pair */
+};
+#endif

There is an extra space in each of the comments above between * and <. Check other doxygen errors if any.

I believe the timestamp in your system is not correct, as the patchwork show Date of 2 days back while the patches are sent today.
Could you please check? I believe CI server is not picking your patches for auto build. Please correct it so that auto build can happen. None of your version was picked by CI.

#3 lore raw

Re: [dpdk-dev] [v6 1/2] cryptodev: support enqueue & dequeue callback functions

Hi Akhil,

Regarding the date, I am not sure how it can be fixed now. May be the space is missed out as well. Could be please help?

Regards
Abhinandan

Quoted 39 lines

-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Friday, October 30, 2020 11:59 PM
To: Gujjar, Abhinandan S <[email protected]>; [email protected]; Doherty, Declan <[email protected]>; [email protected]; Ananyev, Konstantin <[email protected]>
Cc: Vangati, Narender <[email protected]>; [email protected]
Subject: RE: [v6 1/2] cryptodev: support enqueue & dequeue callback functions

Hi Abhinandan,

Quoted 8 lines
lib/librte_cryptodev/rte_cryptodev.h +8 -0
+struct rte_cryptodev_cb {
+	struct rte_cryptodev_cb *next;
+	/** < Pointer to next callback */
+	rte_cryptodev_callback_fn fn;
+	/** < Pointer to callback function */
+	void *arg;
+	/** < Pointer to argument */
+};

lib/librte_cryptodev/rte_cryptodev.h typedef uint16_t (*enqueue_pkt_burst_t)(void *qp,

Quoted 10 lines
lib/librte_cryptodev/rte_cryptodev.h +10 -0
+
+/**
+ * @internal
+ * Structure used to hold information about the RCU for a queue pair.
+ */
+struct rte_cryptodev_cb_rcu {
+	struct rte_cryptodev_cb *next;
+	/** < Pointer to next callback */
+	struct rte_rcu_qsbr *qsbr;
+	/** < RCU QSBR variable per queue pair */ }; #endif

There is an extra space in each of the comments above between * and <. Check other doxygen errors if any.

I believe the timestamp in your system is not correct, as the patchwork show Date of 2 days back while the patches are sent today.
Could you please check? I believe CI server is not picking your patches for auto build.
Please correct it so that auto build can happen. None of your version was picked by CI.

#4 lore raw

Re: [dpdk-dev] [v6 1/2] cryptodev: support enqueue & dequeue callback functions

Hi Akhil,

What is the status of this patch? Is it pulled into RC2?

Regards
Abhinandan

Quoted 58 lines

-----Original Message-----
From: Gujjar, Abhinandan S
Sent: Saturday, October 31, 2020 12:06 AM
To: 'Akhil Goyal' <[email protected]>; [email protected]; Doherty, Declan <[email protected]>; [email protected]; Ananyev, Konstantin <[email protected]>
Cc: Vangati, Narender <[email protected]>; [email protected]
Subject: RE: [v6 1/2] cryptodev: support enqueue & dequeue callback functions

Hi Akhil,

Regarding the date, I am not sure how it can be fixed now. May be the space is missed out as well. Could be please help?

Regards
Abhinandan

Quoted 40 lines

-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Friday, October 30, 2020 11:59 PM
To: Gujjar, Abhinandan S <[email protected]>; [email protected]; Doherty, Declan <[email protected]>; [email protected]; Ananyev, Konstantin <[email protected]>
Cc: Vangati, Narender <[email protected]>; [email protected]
Subject: RE: [v6 1/2] cryptodev: support enqueue & dequeue callback functions

Hi Abhinandan,

Quoted 8 lines
lib/librte_cryptodev/rte_cryptodev.h +8 -0
+struct rte_cryptodev_cb {
+	struct rte_cryptodev_cb *next;
+	/** < Pointer to next callback */
+	rte_cryptodev_callback_fn fn;
+	/** < Pointer to callback function */
+	void *arg;
+	/** < Pointer to argument */
+};

lib/librte_cryptodev/rte_cryptodev.h typedef uint16_t (*enqueue_pkt_burst_t)(void *qp,

Quoted 10 lines
lib/librte_cryptodev/rte_cryptodev.h +10 -0
+
+/**
+ * @internal
+ * Structure used to hold information about the RCU for a queue pair.
+ */
+struct rte_cryptodev_cb_rcu {
+	struct rte_cryptodev_cb *next;
+	/** < Pointer to next callback */
+	struct rte_rcu_qsbr *qsbr;
+	/** < RCU QSBR variable per queue pair */ }; #endif

There is an extra space in each of the comments above between * and <. Check other doxygen errors if any.

I believe the timestamp in your system is not correct, as the patchwork show Date of 2 days back while the patches are sent today. Could you please check? I believe CI server is not picking your patches for auto build.
Please correct it so that auto build can happen. None of your version was picked by CI.

#5 lore raw

Re: [dpdk-dev] [v6 1/2] cryptodev: support enqueue & dequeue callback functions

Hi Abhinandan,

Quoted 5 lines

Hi Akhil,

What is the status of this patch? Is it pulled into RC2?

As I suggested below, please fix your date and let the CI pick your patches for build. In my local build for documentation, the newly added APIs are not added in the Documentation. Please fix doxygen issues as soon as possible.
Did you try building documentation at your end?

Regards,
Akhil

Quoted 32 lines
Quoted 32 lines

Regarding the date, I am not sure how it can be fixed now. May be the space is missed out as well. Could be please help?

Quoted 28 lines
Quoted 9 lines
lib/librte_cryptodev/rte_cryptodev.h +8 -0
+struct rte_cryptodev_cb {
+	struct rte_cryptodev_cb *next;
+	/** < Pointer to next callback */
+	rte_cryptodev_callback_fn fn;
+	/** < Pointer to callback function */
+	void *arg;
+	/** < Pointer to argument */
+};

lib/librte_cryptodev/rte_cryptodev.h typedef uint16_t (*enqueue_pkt_burst_t)(void *qp,

Quoted 10 lines
lib/librte_cryptodev/rte_cryptodev.h +10 -0
+
+/**
+ * @internal
+ * Structure used to hold information about the RCU for a queue pair.
+ */
+struct rte_cryptodev_cb_rcu {
+	struct rte_cryptodev_cb *next;
+	/** < Pointer to next callback */
+	struct rte_rcu_qsbr *qsbr;
+	/** < RCU QSBR variable per queue pair */ }; #endif

There is an extra space in each of the comments above between * and <. Check other doxygen errors if any.

I believe the timestamp in your system is not correct, as the patchwork show Date of 2 days back while the patches are sent today. Could you please check? I believe CI server is not picking your patches for auto build.
Please correct it so that auto build can happen. None of your version was picked by CI.

#6 lore raw

Re: [dpdk-dev] [v6 1/2] cryptodev: support enqueue & dequeue callback functions

Hi Akhil,

Can you please go through the patch again and check if any more comments?
I understand that we work in same time zone, getting feedback from you in the mid night will not help me/you to pull this patch in. A quick response will enable me to prepare patch set quickly and send it across.

This time, I will prepare the patch along with dequeue test case. Hope you understand the concern. Thanks..

Regards
Abhinandan

Quoted 59 lines

-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Tuesday, November 3, 2020 12:28 AM
To: Gujjar, Abhinandan S <[email protected]>; [email protected]; Doherty, Declan <[email protected]>; [email protected]; Ananyev, Konstantin <[email protected]>; Hemant Agrawal <[email protected]>
Cc: Vangati, Narender <[email protected]>; [email protected]
Subject: RE: [v6 1/2] cryptodev: support enqueue & dequeue callback functions

Hi Abhinandan,

Quoted 5 lines

Hi Akhil,

What is the status of this patch? Is it pulled into RC2?

As I suggested below, please fix your date and let the CI pick your patches for build.
In my local build for documentation, the newly added APIs are not added in the Documentation. Please fix doxygen issues as soon as possible.
Did you try building documentation at your end?

Regards,
Akhil

Quoted 32 lines
Quoted 32 lines

Regarding the date, I am not sure how it can be fixed now. May be the space is missed out as well. Could be please help?

Quoted 28 lines
Quoted 9 lines
lib/librte_cryptodev/rte_cryptodev.h +8 -0
+struct rte_cryptodev_cb {
+	struct rte_cryptodev_cb *next;
+	/** < Pointer to next callback */
+	rte_cryptodev_callback_fn fn;
+	/** < Pointer to callback function */
+	void *arg;
+	/** < Pointer to argument */
+};

lib/librte_cryptodev/rte_cryptodev.h typedef uint16_t (*enqueue_pkt_burst_t)(void *qp,

Quoted 10 lines
lib/librte_cryptodev/rte_cryptodev.h +10 -0
+
+/**
+ * @internal
+ * Structure used to hold information about the RCU for a queue pair.
+ */
+struct rte_cryptodev_cb_rcu {
+	struct rte_cryptodev_cb *next;
+	/** < Pointer to next callback */
+	struct rte_rcu_qsbr *qsbr;
+	/** < RCU QSBR variable per queue pair */ }; #endif

There is an extra space in each of the comments above between * and <. Check other doxygen errors if any.

I believe the timestamp in your system is not correct, as the patchwork show Date of 2 days back while the patches are sent today. Could you please check? I believe CI server is not picking your patches for auto build.
Please correct it so that auto build can happen. None of your version was picked by CI.

#7 lore raw

Re: [dpdk-dev] [v6 1/2] cryptodev: support enqueue & dequeue callback functions

Hi Abhinandan,

Quoted 5 lines

Subject: RE: [v6 1/2] cryptodev: support enqueue & dequeue callback functions

Hi Akhil,

Can you please go through the patch again and check if any more comments?

As I suggested 2 times that there are documentation issues. Haven't seen a version To fix that. Please check it at your end and try fixing the timing of your system so that CI Can pick it for compilation.

Quoted 3 lines

I understand that we work in same time zone, getting feedback from you in the mid night will not help me/you to pull this patch in.
A quick response will enable me to prepare patch set quickly and send it across.

I am not dedicatedly working on your patchset. I will work as per my priorities. Had it been a CI pass for compilation for both documentation and code, it would have been applied last night. I could remove those extra spaces, but there are other issues also as the newly added APIs are not visible in html files generated. Please ensure that there are no issues in doxygen build issues and should be able to see the newly added APIs in html guides.

And please note, do not top post your comments. It becomes difficult to read it in Archives.

Quoted 53 lines

This time, I will prepare the patch along with dequeue test case. Hope you understand the concern. Thanks..

Quoted 49 lines

Hi Abhinandan,

Quoted 5 lines

Hi Akhil,

What is the status of this patch? Is it pulled into RC2?

As I suggested below, please fix your date and let the CI pick your patches for build.
In my local build for documentation, the newly added APIs are not added in the Documentation. Please fix doxygen issues as soon as possible.
Did you try building documentation at your end?

Regards,
Akhil

Quoted 32 lines
Quoted 32 lines

Regarding the date, I am not sure how it can be fixed now. May be the space is missed out as well. Could be please help?

Quoted 28 lines
Quoted 9 lines
lib/librte_cryptodev/rte_cryptodev.h +8 -0
+struct rte_cryptodev_cb {
+	struct rte_cryptodev_cb *next;
+	/** < Pointer to next callback */
+	rte_cryptodev_callback_fn fn;
+	/** < Pointer to callback function */
+	void *arg;
+	/** < Pointer to argument */
+};

lib/librte_cryptodev/rte_cryptodev.h typedef uint16_t (*enqueue_pkt_burst_t)(void *qp,

Quoted 10 lines
lib/librte_cryptodev/rte_cryptodev.h +10 -0
+
+/**
+ * @internal
+ * Structure used to hold information about the RCU for a queue pair.
+ */
+struct rte_cryptodev_cb_rcu {
+	struct rte_cryptodev_cb *next;
+	/** < Pointer to next callback */
+	struct rte_rcu_qsbr *qsbr;
+	/** < RCU QSBR variable per queue pair */ }; #endif

There is an extra space in each of the comments above between * and <. Check other doxygen errors if any.

I believe the timestamp in your system is not correct, as the patchwork show Date of 2 days back while the patches are sent today. Could you please check? I believe CI server is not picking your patches for auto build.
Please correct it so that auto build can happen. None of your version was picked by CI.

#8 lore raw

Re: [dpdk-dev] [v6 1/2] cryptodev: support enqueue & dequeue callback functions

Hi Akhil,

Quoted 15 lines

-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Tuesday, November 3, 2020 11:58 AM
To: Gujjar, Abhinandan S <[email protected]>; [email protected]; Doherty, Declan <[email protected]>; [email protected]; Ananyev, Konstantin <[email protected]>; Hemant Agrawal <[email protected]>
Cc: Vangati, Narender <[email protected]>; [email protected]
Subject: RE: [v6 1/2] cryptodev: support enqueue & dequeue callback functions

Hi Abhinandan,

Quoted 3 lines

Subject: RE: [v6 1/2] cryptodev: support enqueue & dequeue callback functions

Quoted 7 lines
Quoted 3 lines

Hi Akhil,

Can you please go through the patch again and check if any more comments?

As I suggested 2 times that there are documentation issues. Haven't seen a version To fix that. Please check it at your end and try fixing the timing of your system so that CI Can pick it for compilation.

As far as I remember, I have pulled in all the comments from you for the previous patch.

Quoted 7 lines
Quoted 4 lines

I understand that we work in same time zone, getting feedback from you in the mid night will not help me/you to pull this patch in. A quick response will enable me to prepare patch set quickly and send it

across.

I am not dedicatedly working on your patchset. I will work as per my priorities.

It is same for me. End of the day, we have mutually agreed to get this feature in.

Quoted 5 lines

Had it been a CI pass for compilation for both documentation and code, it would have been applied last night. I could remove those extra spaces, but there are other issues also as the newly added APIs are not visible in html files generated. Please ensure that there are no issues in doxygen build issues and should be able to see the newly added APIs in html guides.

This is the kind of information I was looking for, which was not available in your previous patch. If this info had been available quickly, I would have prepared next patchset. Anyway, I will post the next patch set.

Quoted 3 lines

And please note, do not top post your comments. It becomes difficult to read it in Archives.

Ok

Quoted 55 lines
Quoted 27 lines

This time, I will prepare the patch along with dequeue test case. Hope you understand the concern. Thanks..

Quoted 22 lines

Hi Abhinandan,

Quoted 5 lines

Hi Akhil,

What is the status of this patch? Is it pulled into RC2?

As I suggested below, please fix your date and let the CI pick your patches for build.
In my local build for documentation, the newly added APIs are not added in the Documentation. Please fix doxygen issues as soon as possible. Did you try building documentation at your end?

Regards,
Akhil

Quoted 5 lines
Quoted 5 lines

Regarding the date, I am not sure how it can be fixed now. May be the space is missed out as well. Could be please help?

Quoted 1 line
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines

Review

Quoted 11 lines
(quoted diff) +11 -0
+struct rte_cryptodev_cb {
+	struct rte_cryptodev_cb *next;
+	/** < Pointer to next callback */
+	rte_cryptodev_callback_fn fn;
+	/** < Pointer to callback function */
+	void *arg;
+	/** < Pointer to argument */ };
+
+/**
+ * @internal
+ * Structure used to hold information about the RCU for a queue

pair.

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Review

Quoted 6 lines

+ */

(quoted diff) +5 -0
+struct rte_cryptodev_cb_rcu {
+	struct rte_cryptodev_cb *next;
+	/** < Pointer to next callback */
+	struct rte_rcu_qsbr *qsbr;
+	/** < RCU QSBR variable per queue pair */ }; #endif

There is an extra space in each of the comments above between * and

<.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Check other doxygen errors if any.

I believe the timestamp in your system is not correct, as the patchwork show Date of 2 days back while the patches are sent today. Could you please check? I believe CI server is not picking your patches for auto build.
Please correct it so that auto build can happen. None of your version was picked by CI.

#9 lore raw

Re: [dpdk-dev] [v6 1/2] cryptodev: support enqueue & dequeue callback functions

03/11/2020 08:44, Gujjar, Abhinandan S:

Quoted 16 lines

From: Akhil Goyal <[email protected]>

Quoted 3 lines

As I suggested 2 times that there are documentation issues. Haven't seen a version To fix that. Please check it at your end and try fixing the timing of your system so that CI Can pick it for compilation.

As far as I remember, I have pulled in all the comments from you for the previous patch.

Quoted 7 lines
Quoted 4 lines

I understand that we work in same time zone, getting feedback from you in the mid night will not help me/you to pull this patch in. A quick response will enable me to prepare patch set quickly and send it

across.

I am not dedicatedly working on your patchset. I will work as per my priorities.

It is same for me. End of the day, we have mutually agreed to get this feature in.

Quoted 8 lines
Quoted 5 lines

Had it been a CI pass for compilation for both documentation and code, it would have been applied last night. I could remove those extra spaces, but there are other issues also as the newly added APIs are not visible in html files generated. Please ensure that there are no issues in doxygen build issues and should be able to see the newly added APIs in html guides.

This is the kind of information I was looking for, which was not available in your previous patch. If this info had been available quickly, I would have prepared next patchset.

It seems you didn't do all the checks you are required to do. Please be kind with Akhil who is working hard for the community. If you want to accelerate the process, help by reviewing other patches.

Quoted 1 line

Anyway, I will post the next patch set.

This is too late.
We are not supposed to add new API in -rc2,
and for sure not after -rc2 deadline.

Quoted 5 lines
Quoted 3 lines

And please note, do not top post your comments. It becomes difficult to read it in Archives.

Ok

Yes please do not top post, use --in-reply-to to gather all versions in the same thread, and fix the clock of your machine.

#10 lore raw

Re: [dpdk-dev] [v6 1/2] cryptodev: support enqueue & dequeue callback functions

Hi Thomas,

Quoted 42 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, November 3, 2020 9:34 PM
To: Gujjar, Abhinandan S <[email protected]>
Cc: Akhil Goyal <[email protected]>; [email protected]; Doherty, Declan <[email protected]>; [email protected]; Ananyev, Konstantin <[email protected]>; Hemant Agrawal <[email protected]>; Vangati, Narender <[email protected]>; [email protected]; Mcnamara, John <[email protected]>; [email protected]; Yigit, Ferruh <[email protected]>
Subject: Re: [dpdk-dev] [v6 1/2] cryptodev: support enqueue & dequeue callback functions

03/11/2020 08:44, Gujjar, Abhinandan S:

Quoted 6 lines

From: Akhil Goyal <[email protected]>

Quoted 3 lines

As I suggested 2 times that there are documentation issues. Haven't seen a version To fix that. Please check it at your end and try fixing the timing of your system so that CI Can pick it for compilation.

As far as I remember, I have pulled in all the comments from you for the

previous patch.

Quoted 8 lines
Quoted 8 lines
Quoted 5 lines

I understand that we work in same time zone, getting feedback from you in the mid night will not help me/you to pull this patch in. A quick response will enable me to prepare patch set quickly and send it

across.

I am not dedicatedly working on your patchset. I will work as per my

priorities.

Quoted 2 lines

It is same for me. End of the day, we have mutually agreed to get this feature

in.

Quoted 6 lines
Quoted 6 lines

Had it been a CI pass for compilation for both documentation and code, it would have been applied last night. I could remove those extra spaces, but there are other issues also as the newly added APIs are not visible in html files generated. Please ensure that there are no issues in doxygen build issues and should be able to see the

newly added APIs in html guides.

Quoted 1 line
Quoted 8 lines
Quoted 2 lines

This is the kind of information I was looking for, which was not available in your previous patch. If this info had been available quickly, I

would have prepared next patchset.

It seems you didn't do all the checks you are required to do. Please be kind with Akhil who is working hard for the community. If you want to accelerate the process, help by reviewing other patches.

I have done enough follow ups with Akhil and we both agreed to get this into RC2. I did not realize that CI did not pick up the patches because of mismatch with my system time. All I am saying is giving this information would have helped me.

Quoted 7 lines
Quoted 1 line

Anyway, I will post the next patch set.

This is too late.
We are not supposed to add new API in -rc2, and for sure not after -rc2 deadline.

Quoted 1 line
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

And please note, do not top post your comments. It becomes difficult to read it in Archives.

Ok

Yes please do not top post, use --in-reply-to to gather all versions in the same thread, and fix the clock of your machine.

Ok

Quoted 2 lines
#11 lore raw

Re: [dpdk-dev] [v6 1/2] cryptodev: support enqueue & dequeue callback functions

Hi Abhinandan,

Quoted 41 lines

Hi Thomas,

Quoted 10 lines

03/11/2020 08:44, Gujjar, Abhinandan S:

Quoted 6 lines

From: Akhil Goyal <[email protected]>

Quoted 3 lines

As I suggested 2 times that there are documentation issues. Haven't seen a version To fix that. Please check it at your end and try fixing the timing of your system so that CI Can pick it for compilation.

As far as I remember, I have pulled in all the comments from you for the

previous patch.

Quoted 1 line
Quoted 1 line
Quoted 10 lines
Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

I understand that we work in same time zone, getting feedback from you in the mid night will not help me/you to pull this patch in. A quick response will enable me to prepare patch set quickly and send it

across.

I am not dedicatedly working on your patchset. I will work as per my

priorities.

Quoted 2 lines

It is same for me. End of the day, we have mutually agreed to get this

feature

Quoted 9 lines

in.

Quoted 6 lines
Quoted 6 lines

Had it been a CI pass for compilation for both documentation and code, it would have been applied last night. I could remove those extra spaces, but there are other issues also as the newly added APIs are not visible in html files generated. Please ensure that there are no issues in doxygen build issues and should be able to see the

newly added APIs in html guides.

Quoted 1 line
Quoted 8 lines
Quoted 2 lines

This is the kind of information I was looking for, which was not available in your previous patch. If this info had been available quickly, I

would have prepared next patchset.

It seems you didn't do all the checks you are required to do. Please be kind with Akhil who is working hard for the community. If you want to accelerate the process, help by reviewing other patches.

Quoted 5 lines

I have done enough follow ups with Akhil and we both agreed to get this into RC2.
I did not realize that CI did not pick up the patches because of mismatch with my system time.
All I am saying is giving this information would have helped me.

I highlighted the documentation issue and the system timing on Friday itself. When the fix was not there on Monday, I tried to fix on my side which took me late To comment back. Had it been done by CI, it would have been faster.

Quoted 18 lines
Quoted 8 lines
Quoted 2 lines

Anyway, I will post the next patch set.

This is too late.
We are not supposed to add new API in -rc2, and for sure not after -rc2 deadline.

Quoted 1 line
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

And please note, do not top post your comments. It becomes difficult to read it in Archives.

Ok

Yes please do not top post, use --in-reply-to to gather all versions in the same thread, and fix the clock of your machine.

Ok

Quoted 2 lines
#12 lore raw

Re: [dpdk-dev] [v6 1/2] cryptodev: support enqueue & dequeue callback functions

Hi Akhil,

Quoted 69 lines

-----Original Message-----
From: Akhil Goyal <[email protected]>
Sent: Tuesday, November 3, 2020 10:23 PM
To: Gujjar, Abhinandan S <[email protected]>; Thomas Monjalon <[email protected]>
Cc: [email protected]; Doherty, Declan <[email protected]>; [email protected]; Ananyev, Konstantin <[email protected]>; Hemant Agrawal <[email protected]>; Vangati, Narender <[email protected]>; [email protected]; Mcnamara, John <[email protected]>; [email protected]; Yigit, Ferruh <[email protected]>
Subject: RE: [dpdk-dev] [v6 1/2] cryptodev: support enqueue & dequeue callback functions

Hi Abhinandan,

Quoted 9 lines

Hi Thomas,

Quoted 6 lines

03/11/2020 08:44, Gujjar, Abhinandan S:

Quoted 4 lines

From: Akhil Goyal <[email protected]>

Quoted 3 lines

As I suggested 2 times that there are documentation issues. Haven't seen a version To fix that. Please check it at your end and try fixing the timing of your system so that CI Can pick it for

compilation.

Quoted 37 lines
Quoted 9 lines
Quoted 3 lines

As far as I remember, I have pulled in all the comments from you for the

previous patch.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

I understand that we work in same time zone, getting feedback from you in the mid night will not help me/you to pull this patch in. A quick response will enable me to prepare patch set quickly and send it

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines

across.

I am not dedicatedly working on your patchset. I will work as per my

priorities.

Quoted 3 lines

It is same for me. End of the day, we have mutually agreed to get this

feature

Quoted 10 lines

in.

Quoted 7 lines
Quoted 7 lines

Had it been a CI pass for compilation for both documentation and code, it would have been applied last night. I could remove those extra spaces, but there are other issues also as the newly added APIs are not visible in html files generated. Please ensure that there are no issues in doxygen build issues and should be able to see the

newly added APIs in html guides.

Quoted 1 line
Quoted 9 lines
Quoted 3 lines

This is the kind of information I was looking for, which was not available in your previous patch. If this info had been available quickly, I

would have prepared next patchset.

It seems you didn't do all the checks you are required to do. Please be kind with Akhil who is working hard for the community. If you want to accelerate the process, help by reviewing other patches.

Quoted 5 lines

I have done enough follow ups with Akhil and we both agreed to get this into RC2.
I did not realize that CI did not pick up the patches because of mismatch with my system time.
All I am saying is giving this information would have helped me.

Quoted 3 lines

I highlighted the documentation issue and the system timing on Friday itself. When the fix was not there on Monday, I tried to fix on my side which took me late To comment back. Had it been done by CI, it would have been faster.

What is the next step?

Quoted 19 lines
Quoted 19 lines
Quoted 9 lines
Quoted 3 lines

Anyway, I will post the next patch set.

This is too late.
We are not supposed to add new API in -rc2, and for sure not after -rc2 deadline.

Quoted 1 line
Quoted 1 line
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

And please note, do not top post your comments. It becomes difficult to read it in Archives.

Ok

Yes please do not top post, use --in-reply-to to gather all versions in the same thread, and fix the clock of your machine.

Ok

Quoted 2 lines
#13 lore raw

Re: [dpdk-dev] [v6 1/2] cryptodev: support enqueue & dequeue callback functions

Quoted 57 lines

Hi Akhil,

Quoted 54 lines

Hi Abhinandan,

Quoted 9 lines

Hi Thomas,

Quoted 6 lines

03/11/2020 08:44, Gujjar, Abhinandan S:

Quoted 4 lines

From: Akhil Goyal <[email protected]>

Quoted 3 lines

As I suggested 2 times that there are documentation issues. Haven't seen a version To fix that. Please check it at your end and try fixing the timing of your system so that CI Can pick it for

compilation.

Quoted 42 lines
Quoted 9 lines
Quoted 3 lines

As far as I remember, I have pulled in all the comments from you for the

previous patch.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

I understand that we work in same time zone, getting feedback from you in the mid night will not help me/you to pull this patch in. A quick response will enable me to prepare patch set quickly and send it

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines

across.

I am not dedicatedly working on your patchset. I will work as per my

priorities.

Quoted 3 lines

It is same for me. End of the day, we have mutually agreed to get this

feature

Quoted 10 lines

in.

Quoted 7 lines
Quoted 7 lines

Had it been a CI pass for compilation for both documentation and code, it would have been applied last night. I could remove those extra spaces, but there are other issues also as the newly added APIs are not visible in html files generated. Please ensure that there are no issues in doxygen build issues and should be able to see the

newly added APIs in html guides.

Quoted 1 line
Quoted 9 lines
Quoted 3 lines

This is the kind of information I was looking for, which was not available in your previous patch. If this info had been available quickly, I

would have prepared next patchset.

It seems you didn't do all the checks you are required to do. Please be kind with Akhil who is working hard for the community. If you want to accelerate the process, help by reviewing other patches.

I have done enough follow ups with Akhil and we both agreed to get this into RC2.
I did not realize that CI did not pick up the patches because of mismatch with my system time.
All I am saying is giving this information would have helped me.

Quoted 5 lines
Quoted 3 lines

I highlighted the documentation issue and the system timing on Friday itself. When the fix was not there on Monday, I tried to fix on my side which took me late To comment back. Had it been done by CI, it would have been faster.

What is the next step?

I have closed the crypto tree for RC2, and it is upto Thomas to take it directly on main branch.

#14 lore raw

PATCH v6 2/2 test: add testcase for crypto enqueue callback

In reply to Abhinandan Gujjar

This patch adds test case for testing functionality of enqueue callback mechanism.

---
 app/test/test_cryptodev.c | 135 +++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 133 insertions(+), 2 deletions(-)
app/test/test_cryptodev.c +133 -2
index 2128b01..ada7838 100644
@@ -10728,6 +10728,135 @@ struct multi_session_params {
 	return TEST_SUCCESS;
 }
 
+#ifdef RTE_CRYPTO_CALLBACKS
+static uint16_t
+test_enq_callback(uint16_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops,
+		  uint16_t nb_ops, void *user_param)
+{
+	RTE_SET_USED(dev_id);
+	RTE_SET_USED(qp_id);
+	RTE_SET_USED(ops);
+	RTE_SET_USED(user_param);
+
+	printf("crypto enqueue callback called\n");
+	return nb_ops;
+}
+
+/*
+ * Thread using enqueue callback with RCU.
+ */
+static int
+test_enq_callback_rcu_thread(void *arg)
+{
+	RTE_SET_USED(arg);
+	/* DP thread calls rte_cryptodev_enqueue_burst() and
+	 * invokes enqueue callback.
+	 */
+	test_null_burst_operation();
+	return 0;
+}
+
+static int
+test_enq_callback_setup(void)
+{
+	struct crypto_testsuite_params *ts_params = &testsuite_params;
+	struct rte_cryptodev_info dev_info;
+	struct rte_cryptodev_qp_conf qp_conf = {
+		.nb_descriptors = MAX_NUM_OPS_INFLIGHT
+	};
+
+	struct rte_cryptodev_cb *cb;
+	uint16_t qp_id = 0;
+
+	/* Stop the device in case it's started so it can be configured */
+	rte_cryptodev_stop(ts_params->valid_devs[0]);
+
+	rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info);
+
+	TEST_ASSERT_SUCCESS(rte_cryptodev_configure(ts_params->valid_devs[0],
+			&ts_params->conf),
+			"Failed to configure cryptodev %u",
+			ts_params->valid_devs[0]);
+
+	qp_conf.nb_descriptors = MAX_NUM_OPS_INFLIGHT;
+	qp_conf.mp_session = ts_params->session_mpool;
+	qp_conf.mp_session_private = ts_params->session_priv_mpool;
+
+	TEST_ASSERT_SUCCESS(rte_cryptodev_queue_pair_setup(
+			ts_params->valid_devs[0], qp_id, &qp_conf,
+			rte_cryptodev_socket_id(ts_params->valid_devs[0])),
+			"Failed test for "
+			"rte_cryptodev_queue_pair_setup: num_inflights "
+			"%u on qp %u on cryptodev %u",
+			qp_conf.nb_descriptors, qp_id,
+			ts_params->valid_devs[0]);
+
+	/* Test with invalid crypto device */
+	cb = rte_cryptodev_add_enq_callback(RTE_CRYPTO_MAX_DEVS,
+			qp_id, test_enq_callback, NULL);
+	TEST_ASSERT_NULL(cb, "Add callback on qp %u on "
+			"cryptodev %u did not fail",
+			qp_id, RTE_CRYPTO_MAX_DEVS);
+
+	/* Test with invalid queue pair */
+	cb = rte_cryptodev_add_enq_callback(ts_params->valid_devs[0],
+			dev_info.max_nb_queue_pairs + 1,
+			test_enq_callback, NULL);
+	TEST_ASSERT_NULL(cb, "Add callback on qp %u on "
+			"cryptodev %u did not fail",
+			dev_info.max_nb_queue_pairs + 1,
+			ts_params->valid_devs[0]);
+
+	/* Test with NULL callback */
+	cb = rte_cryptodev_add_enq_callback(ts_params->valid_devs[0],
+			qp_id, NULL, NULL);
+	TEST_ASSERT_NULL(cb, "Add callback on qp %u on "
+			"cryptodev %u did not fail",
+			qp_id, ts_params->valid_devs[0]);
+
+	/* Test with valid configuration */
+	cb = rte_cryptodev_add_enq_callback(ts_params->valid_devs[0],
+			qp_id, test_enq_callback, NULL);
+	TEST_ASSERT_NOT_NULL(cb, "Failed test to add callback on "
+			"qp %u on cryptodev %u",
+			qp_id, ts_params->valid_devs[0]);
+
+	rte_cryptodev_start(ts_params->valid_devs[0]);
+
+	/* Launch a thread */
+	rte_eal_remote_launch(test_enq_callback_rcu_thread, NULL,
+				rte_get_next_lcore(-1, 1, 0));
+
+	/* Wait until reader exited. */
+	rte_eal_mp_wait_lcore();
+
+	/* Test with invalid crypto device */
+	TEST_ASSERT_FAIL(rte_cryptodev_remove_enq_callback(
+			RTE_CRYPTO_MAX_DEVS, qp_id, cb),
+			"Expected call to fail as crypto device is invalid");
+
+	/* Test with invalid queue pair */
+	TEST_ASSERT_FAIL(rte_cryptodev_remove_enq_callback(
+			ts_params->valid_devs[0],
+			dev_info.max_nb_queue_pairs + 1, cb),
+			"Expected call to fail as queue pair is invalid");
+
+	/* Test with NULL callback */
+	TEST_ASSERT_FAIL(rte_cryptodev_remove_enq_callback(
+			ts_params->valid_devs[0], qp_id, NULL),
+			"Expected call to fail as callback is NULL");
+
+	/* Test with valid configuration */
+	TEST_ASSERT_SUCCESS(rte_cryptodev_remove_enq_callback(
+			ts_params->valid_devs[0], qp_id, cb),
+			"Failed test to remove callback on "
+			"qp %u on cryptodev %u",
+			qp_id, ts_params->valid_devs[0]);
+
+	return TEST_SUCCESS;
+}
+#endif
+
 static void
 generate_gmac_large_plaintext(uint8_t *data)
 {
@@ -13048,7 +13177,6 @@ struct test_crypto_vector {
 				test_queue_pair_descriptor_setup),
 		TEST_CASE_ST(ut_setup, ut_teardown,
 				test_device_configure_invalid_queue_pair_ids),
-
 		TEST_CASE_ST(ut_setup, ut_teardown,
 				test_multi_session),
 		TEST_CASE_ST(ut_setup, ut_teardown,
@@ -13057,7 +13185,6 @@ struct test_crypto_vector {
 		TEST_CASE_ST(ut_setup, ut_teardown,
 			test_null_invalid_operation),
 		TEST_CASE_ST(ut_setup, ut_teardown, test_null_burst_operation),
-
 		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_chain_all),
 		TEST_CASE_ST(ut_setup, ut_teardown, test_AES_cipheronly_all),
 		TEST_CASE_ST(ut_setup, ut_teardown, test_3DES_chain_all),
@@ -13671,6 +13798,10 @@ struct test_crypto_vector {
 		TEST_CASE_ST(ut_setup_security, ut_teardown,
 			test_DOCSIS_PROTO_all),
 #endif
+
+#ifdef RTE_CRYPTO_CALLBACKS
+		TEST_CASE_ST(ut_setup, ut_teardown, test_enq_callback_setup),
+#endif
 		TEST_CASES_END() /**< NULL terminate unit test array */
 	}
 };
Signature · 1 line
1.9.1