DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] doc: fix code blocks in security guide
@ 2023-08-18  9:29 Anoob Joseph
  2023-08-18  9:29 ` [PATCH 2/2] doc: update " Anoob Joseph
  2023-09-19  8:43 ` [PATCH 1/2] doc: fix code blocks in " Akhil Goyal
  0 siblings, 2 replies; 4+ messages in thread
From: Anoob Joseph @ 2023-08-18  9:29 UTC (permalink / raw)
  To: Thomas Monjalon, Akhil Goyal, Jerin Jacob; +Cc: Bruce Richardson, dev

Add literal includes to copy code block while compiling. Having a copy
may lead to mismatch if code is updated without updating the doc.

Fixes: 40ff8c99ea99 ("doc: add details of security library")

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 doc/guides/prog_guide/rte_security.rst | 65 +++++---------------------
 lib/security/rte_security.h            |  6 +++
 2 files changed, 18 insertions(+), 53 deletions(-)

diff --git a/doc/guides/prog_guide/rte_security.rst b/doc/guides/prog_guide/rte_security.rst
index 7418e35c1b..ae8b0aaef3 100644
--- a/doc/guides/prog_guide/rte_security.rst
+++ b/doc/guides/prog_guide/rte_security.rst
@@ -671,68 +671,27 @@ Security session configuration
 
 Security Session configuration structure is defined as ``rte_security_session_conf``
 
-.. code-block:: c
-
-    struct rte_security_session_conf {
-        enum rte_security_session_action_type action_type;
-        /**< Type of action to be performed on the session */
-        enum rte_security_session_protocol protocol;
-        /**< Security protocol to be configured */
-        union {
-                struct rte_security_ipsec_xform ipsec;
-                struct rte_security_macsec_xform macsec;
-                struct rte_security_pdcp_xform pdcp;
-                struct rte_security_docsis_xform docsis;
-        };
-        /**< Configuration parameters for security session */
-        struct rte_crypto_sym_xform *crypto_xform;
-        /**< Security Session Crypto Transformations */
-        void *userdata;
-        /**< Application specific userdata to be saved with session */
-    };
+.. literalinclude:: ../../../lib/security/rte_security.h
+   :language: c
+   :start-after: Structure rte_security_session_conf 8<
+   :end-before: >8 End of structure rte_security_session_conf.
 
 The configuration structure reuses the ``rte_crypto_sym_xform`` struct for crypto related
 configuration. The ``rte_security_session_action_type`` struct is used to specify whether the
 session is configured for Lookaside Protocol offload or Inline Crypto or Inline Protocol
 Offload.
 
-.. code-block:: c
-
-    enum rte_security_session_action_type {
-        RTE_SECURITY_ACTION_TYPE_NONE,
-        /**< No security actions */
-        RTE_SECURITY_ACTION_TYPE_INLINE_CRYPTO,
-        /**< Crypto processing for security protocol is processed inline
-         * during transmission
-         */
-        RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL,
-        /**< All security protocol processing is performed inline during
-         * transmission
-         */
-        RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL,
-        /**< All security protocol processing including crypto is performed
-         * on a lookaside accelerator
-         */
-        RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO
-        /**< Similar to ACTION_TYPE_NONE but crypto processing for security
-         * protocol is processed synchronously by a CPU.
-         */
-    };
+.. literalinclude:: ../../../lib/security/rte_security.h
+   :language: c
+   :start-after: Enumeration of rte_security_session_action_type 8<
+   :end-before: >8 End enumeration of rte_security_session_action_type.
 
 The ``rte_security_session_protocol`` is defined as
 
-.. code-block:: c
-
-    enum rte_security_session_protocol {
-        RTE_SECURITY_PROTOCOL_IPSEC = 1,
-        /**< IPsec Protocol */
-        RTE_SECURITY_PROTOCOL_MACSEC,
-        /**< MACSec Protocol */
-        RTE_SECURITY_PROTOCOL_PDCP,
-        /**< PDCP Protocol */
-        RTE_SECURITY_PROTOCOL_DOCSIS,
-        /**< DOCSIS Protocol */
-    };
+.. literalinclude:: ../../../lib/security/rte_security.h
+   :language: c
+   :start-after: Enumeration of rte_security_session_protocol 8<
+   :end-before: >8 End enumeration of rte_security_session_protocol.
 
 Currently the library defines configuration parameters for IPsec and PDCP only.
 For other protocols like MACSec, structures and enums are defined as place holders
diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
index 35ddf208a7..c908c428ad 100644
--- a/lib/security/rte_security.h
+++ b/lib/security/rte_security.h
@@ -634,6 +634,7 @@ struct rte_security_docsis_xform {
 /**
  * Security session action type.
  */
+/* Enumeration of rte_security_session_action_type 8<*/
 enum rte_security_session_action_type {
 	RTE_SECURITY_ACTION_TYPE_NONE,
 	/**< No security actions */
@@ -654,8 +655,10 @@ enum rte_security_session_action_type {
 	 * protocol is processed synchronously by a CPU.
 	 */
 };
+/* >8 End enumeration of rte_security_session_action_type. */
 
 /** Security session protocol definition */
+/* Enumeration of rte_security_session_protocol 8<*/
 enum rte_security_session_protocol {
 	RTE_SECURITY_PROTOCOL_IPSEC = 1,
 	/**< IPsec Protocol */
@@ -666,10 +669,12 @@ enum rte_security_session_protocol {
 	RTE_SECURITY_PROTOCOL_DOCSIS,
 	/**< DOCSIS Protocol */
 };
+/* >8 End enumeration of rte_security_session_protocol. */
 
 /**
  * Security session configuration
  */
+/* Structure rte_security_session_conf 8< */
 struct rte_security_session_conf {
 	enum rte_security_session_action_type action_type;
 	/**< Type of action to be performed on the session */
@@ -688,6 +693,7 @@ struct rte_security_session_conf {
 	void *userdata;
 	/**< Application specific userdata to be saved with session */
 };
+/* >8 End of structure rte_security_session_conf. */
 
 /**
  * Create security session as specified by the session configuration
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] doc: update security guide
  2023-08-18  9:29 [PATCH 1/2] doc: fix code blocks in security guide Anoob Joseph
@ 2023-08-18  9:29 ` Anoob Joseph
  2023-09-19  8:43   ` Akhil Goyal
  2023-09-19  8:43 ` [PATCH 1/2] doc: fix code blocks in " Akhil Goyal
  1 sibling, 1 reply; 4+ messages in thread
From: Anoob Joseph @ 2023-08-18  9:29 UTC (permalink / raw)
  To: Thomas Monjalon, Akhil Goyal, Jerin Jacob; +Cc: Bruce Richardson, dev

Security library has definitions for configuration parameters of DOCSIS
and MACsec. Remove obsolete comments.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 doc/guides/prog_guide/rte_security.rst | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/doc/guides/prog_guide/rte_security.rst b/doc/guides/prog_guide/rte_security.rst
index ae8b0aaef3..b4db4a7bfd 100644
--- a/doc/guides/prog_guide/rte_security.rst
+++ b/doc/guides/prog_guide/rte_security.rst
@@ -693,10 +693,6 @@ The ``rte_security_session_protocol`` is defined as
    :start-after: Enumeration of rte_security_session_protocol 8<
    :end-before: >8 End enumeration of rte_security_session_protocol.
 
-Currently the library defines configuration parameters for IPsec and PDCP only.
-For other protocols like MACSec, structures and enums are defined as place holders
-which will be updated in the future.
-
 IPsec related configuration parameters are defined in ``rte_security_ipsec_xform``
 
 MACsec related configuration parameters are defined in ``rte_security_macsec_xform``
-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH 1/2] doc: fix code blocks in security guide
  2023-08-18  9:29 [PATCH 1/2] doc: fix code blocks in security guide Anoob Joseph
  2023-08-18  9:29 ` [PATCH 2/2] doc: update " Anoob Joseph
@ 2023-09-19  8:43 ` Akhil Goyal
  1 sibling, 0 replies; 4+ messages in thread
From: Akhil Goyal @ 2023-09-19  8:43 UTC (permalink / raw)
  To: Anoob Joseph, Thomas Monjalon, Jerin Jacob Kollanukkaran
  Cc: Bruce Richardson, dev

> Subject: [PATCH 1/2] doc: fix code blocks in security guide
> 
> Add literal includes to copy code block while compiling. Having a copy
> may lead to mismatch if code is updated without updating the doc.
> 
> Fixes: 40ff8c99ea99 ("doc: add details of security library")
> 
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Cc: stable@dpdk.org

Acked-by: Akhil Goyal <gakhil@marvell.com>

Applied to dpdk-next-crypto
Thanks.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH 2/2] doc: update security guide
  2023-08-18  9:29 ` [PATCH 2/2] doc: update " Anoob Joseph
@ 2023-09-19  8:43   ` Akhil Goyal
  0 siblings, 0 replies; 4+ messages in thread
From: Akhil Goyal @ 2023-09-19  8:43 UTC (permalink / raw)
  To: Anoob Joseph, Thomas Monjalon, Jerin Jacob Kollanukkaran
  Cc: Bruce Richardson, dev

> Subject: [PATCH 2/2] doc: update security guide
> 
> Security library has definitions for configuration parameters of DOCSIS
> and MACsec. Remove obsolete comments.
> 
> Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>

Applied to dpdk-next-crypto


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-09-19  8:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-18  9:29 [PATCH 1/2] doc: fix code blocks in security guide Anoob Joseph
2023-08-18  9:29 ` [PATCH 2/2] doc: update " Anoob Joseph
2023-09-19  8:43   ` Akhil Goyal
2023-09-19  8:43 ` [PATCH 1/2] doc: fix code blocks in " Akhil Goyal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).