net/iavf: add GTPU in default hash
[dpdk.git] / lib / librte_ipsec / rte_ipsec.h
index 93e4df1..de05f4e 100644 (file)
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2018 Intel Corporation
+ * Copyright(c) 2018-2020 Intel Corporation
  */
 
 #ifndef _RTE_IPSEC_H_
@@ -7,9 +7,13 @@
 
 /**
  * @file rte_ipsec.h
- * @b EXPERIMENTAL: this API may change without prior notice
  *
  * RTE IPsec support.
+ *
+ * @warning
+ * @b EXPERIMENTAL:
+ * All functions in this file may be changed or removed without prior notice.
+ *
  * librte_ipsec provides a framework for data-path IPsec protocol
  * processing (ESP/AH).
  */
@@ -33,10 +37,15 @@ struct rte_ipsec_session;
  *   (see rte_ipsec_pkt_process for more details).
  */
 struct rte_ipsec_sa_pkt_func {
-       uint16_t (*prepare)(const struct rte_ipsec_session *ss,
+       union {
+               uint16_t (*async)(const struct rte_ipsec_session *ss,
                                struct rte_mbuf *mb[],
                                struct rte_crypto_op *cop[],
                                uint16_t num);
+               uint16_t (*sync)(const struct rte_ipsec_session *ss,
+                               struct rte_mbuf *mb[],
+                               uint16_t num);
+       } prepare;
        uint16_t (*process)(const struct rte_ipsec_session *ss,
                                struct rte_mbuf *mb[],
                                uint16_t num);
@@ -62,6 +71,7 @@ struct rte_ipsec_session {
        union {
                struct {
                        struct rte_cryptodev_sym_session *ses;
+                       uint8_t dev_id;
                } crypto;
                struct {
                        struct rte_security_session *ses;
@@ -84,7 +94,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,11 +119,20 @@ 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)
 {
-       return ss->pkt_func.prepare(ss, mb, cop, num);
+       return ss->pkt_func.prepare.async(ss, mb, cop, num);
+}
+
+__rte_experimental
+static inline uint16_t
+rte_ipsec_pkt_cpu_prepare(const struct rte_ipsec_session *ss,
+       struct rte_mbuf *mb[], uint16_t num)
+{
+       return ss->pkt_func.prepare.sync(ss, mb, num);
 }
 
 /**
@@ -138,13 +158,16 @@ 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)
 {
        return ss->pkt_func.process(ss, mb, num);
 }
 
+#include <rte_ipsec_group.h>
+
 #ifdef __cplusplus
 }
 #endif