diff options
| author | Akhil Goyal <[email protected]> | 2022-10-04 23:07:09 +0530 |
|---|---|---|
| committer | Akhil Goyal <[email protected]> | 2022-10-04 22:37:54 +0200 |
| commit | 2973dbf93b44981377540e89ca489d6ee1de0f74 (patch) | |
| tree | d13493003dbef3b6d8416e229d295b02d5c8ed3b /lib/ipsec | |
| parent | 66837861d37539aad5676698b44ad6bcba629440 (diff) | |
security: hide session structure
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 <[email protected]>
Tested-by: Gagandeep Singh <[email protected]>
Tested-by: David Coyle <[email protected]>
Tested-by: Kevin O'Sullivan <[email protected]>
Diffstat (limited to 'lib/ipsec')
| -rw-r--r-- | lib/ipsec/rte_ipsec_group.h | 12 | ||||
| -rw-r--r-- | lib/ipsec/ses.c | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/ipsec/rte_ipsec_group.h b/lib/ipsec/rte_ipsec_group.h index a4e0e128f8..c6458ef81e 100644 --- a/lib/ipsec/rte_ipsec_group.h +++ b/lib/ipsec/rte_ipsec_group.h @@ -44,16 +44,16 @@ struct rte_ipsec_group { static inline struct rte_ipsec_session * rte_ipsec_ses_from_crypto(const struct rte_crypto_op *cop) { - const struct rte_security_session *ss; - void *cs; + void *ses; if (cop->sess_type == RTE_CRYPTO_OP_SECURITY_SESSION) { - ss = cop->sym[0].sec_session; - return (struct rte_ipsec_session *)(uintptr_t)ss->opaque_data; + ses = cop->sym[0].session; + return (struct rte_ipsec_session *)(uintptr_t) + rte_security_session_opaque_data_get(ses); } else if (cop->sess_type == RTE_CRYPTO_OP_WITH_SESSION) { - cs = cop->sym[0].session; + ses = cop->sym[0].session; return (struct rte_ipsec_session *)(uintptr_t) - rte_cryptodev_sym_session_opaque_data_get(cs); + rte_cryptodev_sym_session_opaque_data_get(ses); } return NULL; } diff --git a/lib/ipsec/ses.c b/lib/ipsec/ses.c index 0d3c932302..d9ab1e6d2b 100644 --- a/lib/ipsec/ses.c +++ b/lib/ipsec/ses.c @@ -48,7 +48,7 @@ rte_ipsec_session_prepare(struct rte_ipsec_session *ss) rte_cryptodev_sym_session_opaque_data_set(ss->crypto.ses, (uintptr_t)ss); else - ss->security.ses->opaque_data = (uintptr_t)ss; + rte_security_session_opaque_data_set(ss->security.ses, (uintptr_t)ss); return 0; } |
