[4/4] security: add reserved bitfields

Message ID 20210731181327.660296-5-gakhil@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series cryptodev and security ABI improvements |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/github-robot fail github build: failed
ci/iol-intel-Functional success Functional Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/iol-abi-testing warning Testing issues

Commit Message

Akhil Goyal July 31, 2021, 6:13 p.m. UTC
  In struct rte_security_ipsec_sa_options, for every new option
added, there is an ABI breakage, to avoid, a reserved_opts
bitfield is added to for the remaining bits available in the
structure.
Now for every new sa option, these reserved_opts can be reduced
and new option can be added. A corresponding exception is also
added in devtools/libabigail.abignore

Signed-off-by: Akhil Goyal <gakhil@marvell.com>
---
 devtools/libabigail.abignore | 4 ++++
 lib/security/rte_security.h  | 6 ++++++
 2 files changed, 10 insertions(+)
  

Comments

Ananyev, Konstantin Sept. 15, 2021, 3:55 p.m. UTC | #1
> In struct rte_security_ipsec_sa_options, for every new option
> added, there is an ABI breakage, to avoid, a reserved_opts
> bitfield is added to for the remaining bits available in the
> structure.
> Now for every new sa option, these reserved_opts can be reduced
> and new option can be added. A corresponding exception is also
> added in devtools/libabigail.abignore
> 
> Signed-off-by: Akhil Goyal <gakhil@marvell.com>
> ---
>  devtools/libabigail.abignore | 4 ++++
>  lib/security/rte_security.h  | 6 ++++++
>  2 files changed, 10 insertions(+)
> 
> diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
> index 93158405e0..5d8da28e55 100644
> --- a/devtools/libabigail.abignore
> +++ b/devtools/libabigail.abignore
> @@ -52,3 +52,7 @@
>  ; https://sourceware.org/bugzilla/show_bug.cgi?id=28060
>  [suppress_type]
>  	name = rte_eth_dev_data
> +
> +; Ignore changes in reserved_opts bitfield of rte_security_ipsec_sa_options
> +[suppress_variable]
> +	name = reserved_opts
> diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
> index 88d31de0a6..4606425e8d 100644
> --- a/lib/security/rte_security.h
> +++ b/lib/security/rte_security.h
> @@ -181,6 +181,12 @@ struct rte_security_ipsec_sa_options {
>  	 * * 0: Disable per session security statistics collection for this SA.
>  	 */
>  	uint32_t stats : 1;
> +
> +	/** Reserved bit fields for future extension
> +	 *
> +	 * Note: reduce number of bits in reserved_opts for every new option
> +	 */
> +	uint32_t reserved_opts : 24;
>  };
> 
>  /** IPSec security association direction */
> --

Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

> 2.25.1
  
Stephen Hemminger Sept. 15, 2021, 4:43 p.m. UTC | #2
On Sat, 31 Jul 2021 23:43:27 +0530
Akhil Goyal <gakhil@marvell.com> wrote:

> diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
> index 88d31de0a6..4606425e8d 100644
> --- a/lib/security/rte_security.h
> +++ b/lib/security/rte_security.h
> @@ -181,6 +181,12 @@ struct rte_security_ipsec_sa_options {
>  	 * * 0: Disable per session security statistics collection for this SA.
>  	 */
>  	uint32_t stats : 1;
> +
> +	/** Reserved bit fields for future extension
> +	 *
> +	 * Note: reduce number of bits in reserved_opts for every new option
> +	 */
> +	uint32_t reserved_opts : 24;
>  };
>  
>  /** IPSec security association direction */


You must add a check that these are 0 otherwise they are useless as being
reserved later. You can't assume the old application will leave these bits
as zero.
  

Patch

diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore
index 93158405e0..5d8da28e55 100644
--- a/devtools/libabigail.abignore
+++ b/devtools/libabigail.abignore
@@ -52,3 +52,7 @@ 
 ; https://sourceware.org/bugzilla/show_bug.cgi?id=28060
 [suppress_type]
 	name = rte_eth_dev_data
+
+; Ignore changes in reserved_opts bitfield of rte_security_ipsec_sa_options
+[suppress_variable]
+	name = reserved_opts
diff --git a/lib/security/rte_security.h b/lib/security/rte_security.h
index 88d31de0a6..4606425e8d 100644
--- a/lib/security/rte_security.h
+++ b/lib/security/rte_security.h
@@ -181,6 +181,12 @@  struct rte_security_ipsec_sa_options {
 	 * * 0: Disable per session security statistics collection for this SA.
 	 */
 	uint32_t stats : 1;
+
+	/** Reserved bit fields for future extension
+	 *
+	 * Note: reduce number of bits in reserved_opts for every new option
+	 */
+	uint32_t reserved_opts : 24;
 };
 
 /** IPSec security association direction */