summaryrefslogtreecommitdiff
path: root/lib/librte_ipsec
diff options
context:
space:
mode:
authorDavid Marchand <david.marchand@redhat.com>2019-06-29 13:58:53 +0200
committerThomas Monjalon <thomas@monjalon.net>2019-06-29 19:04:48 +0200
commit18218713bf4248c4c6b97a12231e7d59b8a86865 (patch)
tree380e87a089b57686fc4c8f99043a1ea4da4d5b8f /lib/librte_ipsec
parentcfe3aeb170b2f6277e6f96173599da51eab0654f (diff)
downloaddpdk-18218713bf4248c4c6b97a12231e7d59b8a86865.zip
dpdk-18218713bf4248c4c6b97a12231e7d59b8a86865.tar.gz
dpdk-18218713bf4248c4c6b97a12231e7d59b8a86865.tar.xz
enforce experimental tag at beginning of declarations
Putting a '__attribute__((deprecated))' in the middle of a function prototype does not result in the expected result with gcc (while clang is fine with this syntax). $ cat deprecated.c void * __attribute__((deprecated)) incorrect() { return 0; } __attribute__((deprecated)) void *correct(void) { return 0; } int main(int argc, char *argv[]) { incorrect(); correct(); return 0; } $ gcc -o deprecated.o -c deprecated.c deprecated.c: In function ‘main’: deprecated.c:3:1: warning: ‘correct’ is deprecated (declared at deprecated.c:2) [-Wdeprecated-declarations] int main(int argc, char *argv[]) { incorrect(); correct(); return 0; } ^ Move the tag on a separate line and make it the first thing of function prototypes. This is not perfect but we will trust reviewers to catch the other not so easy to detect patterns. sed -i \ -e '/^\([^#].*\)\?__rte_experimental */{' \ -e 's//\1/; s/ *$//; i\' \ -e __rte_experimental \ -e '/^$/d}' \ $(git grep -l __rte_experimental -- '*.h') Special mention for rte_mbuf_data_addr_default(): There is either a bug or a (not yet understood) issue with gcc. gcc won't drop this inline when unused and rte_mbuf_data_addr_default() calls rte_mbuf_buf_addr() which itself is experimental. This results in a build warning when not accepting experimental apis from sources just including rte_mbuf.h. For this specific case, we hide the call to rte_mbuf_buf_addr() under the ALLOW_EXPERIMENTAL_API flag. Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com> Signed-off-by: David Marchand <david.marchand@redhat.com>
Diffstat (limited to 'lib/librte_ipsec')
-rw-r--r--lib/librte_ipsec/rte_ipsec.h9
-rw-r--r--lib/librte_ipsec/rte_ipsec_group.h6
-rw-r--r--lib/librte_ipsec/rte_ipsec_sa.h12
3 files changed, 18 insertions, 9 deletions
diff --git a/lib/librte_ipsec/rte_ipsec.h b/lib/librte_ipsec/rte_ipsec.h
index ff1ec80..f3b1f93 100644
--- a/lib/librte_ipsec/rte_ipsec.h
+++ b/lib/librte_ipsec/rte_ipsec.h
@@ -84,7 +84,8 @@ struct rte_ipsec_session {
* - Zero if operation completed successfully.
* - -EINVAL if the parameters are invalid.
*/
-int __rte_experimental
+__rte_experimental
+int
rte_ipsec_session_prepare(struct rte_ipsec_session *ss);
/**
@@ -108,7 +109,8 @@ rte_ipsec_session_prepare(struct rte_ipsec_session *ss);
* @return
* Number of successfully processed packets, with error code set in rte_errno.
*/
-static inline uint16_t __rte_experimental
+__rte_experimental
+static inline uint16_t
rte_ipsec_pkt_crypto_prepare(const struct rte_ipsec_session *ss,
struct rte_mbuf *mb[], struct rte_crypto_op *cop[], uint16_t num)
{
@@ -138,7 +140,8 @@ rte_ipsec_pkt_crypto_prepare(const struct rte_ipsec_session *ss,
* @return
* Number of successfully processed packets, with error code set in rte_errno.
*/
-static inline uint16_t __rte_experimental
+__rte_experimental
+static inline uint16_t
rte_ipsec_pkt_process(const struct rte_ipsec_session *ss, struct rte_mbuf *mb[],
uint16_t num)
{
diff --git a/lib/librte_ipsec/rte_ipsec_group.h b/lib/librte_ipsec/rte_ipsec_group.h
index 740fa7c..47b33ca 100644
--- a/lib/librte_ipsec/rte_ipsec_group.h
+++ b/lib/librte_ipsec/rte_ipsec_group.h
@@ -42,7 +42,8 @@ struct rte_ipsec_group {
* @return
* The pointer to the related *rte_ipsec_session* structure.
*/
-static inline __rte_experimental struct rte_ipsec_session *
+__rte_experimental
+static inline struct rte_ipsec_session *
rte_ipsec_ses_from_crypto(const struct rte_crypto_op *cop)
{
const struct rte_security_session *ss;
@@ -78,7 +79,8 @@ rte_ipsec_ses_from_crypto(const struct rte_crypto_op *cop)
* @return
* Number of filled elements in *grp* array.
*/
-static inline uint16_t __rte_experimental
+__rte_experimental
+static inline uint16_t
rte_ipsec_pkt_crypto_group(const struct rte_crypto_op *cop[],
struct rte_mbuf *mb[], struct rte_ipsec_group grp[], uint16_t num)
{
diff --git a/lib/librte_ipsec/rte_ipsec_sa.h b/lib/librte_ipsec/rte_ipsec_sa.h
index fd9b3ed..b3f9b10 100644
--- a/lib/librte_ipsec/rte_ipsec_sa.h
+++ b/lib/librte_ipsec/rte_ipsec_sa.h
@@ -128,7 +128,8 @@ enum {
* @return
* SA type value.
*/
-uint64_t __rte_experimental
+__rte_experimental
+uint64_t
rte_ipsec_sa_type(const struct rte_ipsec_sa *sa);
/**
@@ -139,7 +140,8 @@ rte_ipsec_sa_type(const struct rte_ipsec_sa *sa);
* - Actual size required for SA with given parameters.
* - -EINVAL if the parameters are invalid.
*/
-int __rte_experimental
+__rte_experimental
+int
rte_ipsec_sa_size(const struct rte_ipsec_sa_prm *prm);
/**
@@ -155,7 +157,8 @@ rte_ipsec_sa_size(const struct rte_ipsec_sa_prm *prm);
* - -EINVAL if the parameters are invalid.
* - -ENOSPC if the size of the provided buffer is not big enough.
*/
-int __rte_experimental
+__rte_experimental
+int
rte_ipsec_sa_init(struct rte_ipsec_sa *sa, const struct rte_ipsec_sa_prm *prm,
uint32_t size);
@@ -164,7 +167,8 @@ rte_ipsec_sa_init(struct rte_ipsec_sa *sa, const struct rte_ipsec_sa_prm *prm,
* @param sa
* Pointer to SA object to de-initialize.
*/
-void __rte_experimental
+__rte_experimental
+void
rte_ipsec_sa_fini(struct rte_ipsec_sa *sa);
#ifdef __cplusplus