1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2016-2020 Intel Corporation
5 #include <netinet/in.h>
6 #include <netinet/ip.h>
8 #include <rte_branch_prediction.h>
10 #include <rte_crypto.h>
11 #include <rte_security.h>
12 #include <rte_cryptodev.h>
13 #include <rte_ipsec.h>
14 #include <rte_ethdev.h>
22 set_ipsec_conf(struct ipsec_sa *sa, struct rte_security_ipsec_xform *ipsec)
24 if (ipsec->mode == RTE_SECURITY_IPSEC_SA_MODE_TUNNEL) {
25 struct rte_security_ipsec_tunnel_param *tunnel =
27 if (IS_IP4_TUNNEL(sa->flags)) {
29 RTE_SECURITY_IPSEC_TUNNEL_IPV4;
30 tunnel->ipv4.ttl = IPDEFTTL;
32 memcpy((uint8_t *)&tunnel->ipv4.src_ip,
33 (uint8_t *)&sa->src.ip.ip4, 4);
35 memcpy((uint8_t *)&tunnel->ipv4.dst_ip,
36 (uint8_t *)&sa->dst.ip.ip4, 4);
37 } else if (IS_IP6_TUNNEL(sa->flags)) {
39 RTE_SECURITY_IPSEC_TUNNEL_IPV6;
40 tunnel->ipv6.hlimit = IPDEFTTL;
41 tunnel->ipv6.dscp = 0;
42 tunnel->ipv6.flabel = 0;
44 memcpy((uint8_t *)&tunnel->ipv6.src_addr,
45 (uint8_t *)&sa->src.ip.ip6.ip6_b, 16);
47 memcpy((uint8_t *)&tunnel->ipv6.dst_addr,
48 (uint8_t *)&sa->dst.ip.ip6.ip6_b, 16);
50 /* TODO support for Transport */
52 ipsec->esn_soft_limit = IPSEC_OFFLOAD_ESN_SOFTLIMIT;
53 ipsec->replay_win_sz = app_sa_prm.window_size;
54 ipsec->options.esn = app_sa_prm.enable_esn;
55 ipsec->options.udp_encap = sa->udp_encap;
59 create_lookaside_session(struct ipsec_ctx *ipsec_ctx, struct ipsec_sa *sa,
60 struct rte_ipsec_session *ips)
62 struct rte_cryptodev_info cdev_info;
63 unsigned long cdev_id_qp = 0;
65 struct cdev_key key = { 0 };
67 key.lcore_id = (uint8_t)rte_lcore_id();
69 key.cipher_algo = (uint8_t)sa->cipher_algo;
70 key.auth_algo = (uint8_t)sa->auth_algo;
71 key.aead_algo = (uint8_t)sa->aead_algo;
73 ret = rte_hash_lookup_data(ipsec_ctx->cdev_map, &key,
74 (void **)&cdev_id_qp);
77 "No cryptodev: core %u, cipher_algo %u, "
78 "auth_algo %u, aead_algo %u\n",
86 RTE_LOG_DP(DEBUG, IPSEC, "Create session for SA spi %u on cryptodev "
87 "%u qp %u\n", sa->spi,
88 ipsec_ctx->tbl[cdev_id_qp].id,
89 ipsec_ctx->tbl[cdev_id_qp].qp);
91 if (ips->type != RTE_SECURITY_ACTION_TYPE_NONE &&
92 ips->type != RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO) {
93 struct rte_security_session_conf sess_conf = {
94 .action_type = ips->type,
95 .protocol = RTE_SECURITY_PROTOCOL_IPSEC,
101 .direction = sa->direction,
102 .proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP,
103 .mode = (IS_TUNNEL(sa->flags)) ?
104 RTE_SECURITY_IPSEC_SA_MODE_TUNNEL :
105 RTE_SECURITY_IPSEC_SA_MODE_TRANSPORT,
107 .crypto_xform = sa->xforms,
112 if (ips->type == RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL) {
113 struct rte_security_ctx *ctx = (struct rte_security_ctx *)
114 rte_cryptodev_get_sec_ctx(
115 ipsec_ctx->tbl[cdev_id_qp].id);
117 /* Set IPsec parameters in conf */
118 set_ipsec_conf(sa, &(sess_conf.ipsec));
120 ips->security.ses = rte_security_session_create(ctx,
121 &sess_conf, ipsec_ctx->session_pool,
122 ipsec_ctx->session_priv_pool);
123 if (ips->security.ses == NULL) {
125 "SEC Session init failed: err: %d\n", ret);
129 RTE_LOG(ERR, IPSEC, "Inline not supported\n");
133 if (ips->type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO) {
134 struct rte_cryptodev_info info;
137 cdev_id = ipsec_ctx->tbl[cdev_id_qp].id;
138 rte_cryptodev_info_get(cdev_id, &info);
139 if (!(info.feature_flags &
140 RTE_CRYPTODEV_FF_SYM_CPU_CRYPTO))
143 ips->crypto.dev_id = cdev_id;
145 ips->crypto.ses = rte_cryptodev_sym_session_create(
146 ipsec_ctx->session_pool);
147 rte_cryptodev_sym_session_init(ipsec_ctx->tbl[cdev_id_qp].id,
148 ips->crypto.ses, sa->xforms,
149 ipsec_ctx->session_priv_pool);
151 rte_cryptodev_info_get(ipsec_ctx->tbl[cdev_id_qp].id,
155 sa->cdev_id_qp = cdev_id_qp;
161 create_inline_session(struct socket_ctx *skt_ctx, struct ipsec_sa *sa,
162 struct rte_ipsec_session *ips)
165 struct rte_security_ctx *sec_ctx;
166 struct rte_security_session_conf sess_conf = {
167 .action_type = ips->type,
168 .protocol = RTE_SECURITY_PROTOCOL_IPSEC,
174 .direction = sa->direction,
175 .proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP,
176 .mode = (sa->flags == IP4_TUNNEL ||
177 sa->flags == IP6_TUNNEL) ?
178 RTE_SECURITY_IPSEC_SA_MODE_TUNNEL :
179 RTE_SECURITY_IPSEC_SA_MODE_TRANSPORT,
181 .crypto_xform = sa->xforms,
185 RTE_LOG_DP(DEBUG, IPSEC, "Create session for SA spi %u on port %u\n",
186 sa->spi, sa->portid);
188 if (ips->type == RTE_SECURITY_ACTION_TYPE_INLINE_CRYPTO) {
189 struct rte_flow_error err;
190 const struct rte_security_capability *sec_cap;
193 sec_ctx = (struct rte_security_ctx *)
194 rte_eth_dev_get_sec_ctx(
196 if (sec_ctx == NULL) {
198 " rte_eth_dev_get_sec_ctx failed\n");
202 ips->security.ses = rte_security_session_create(sec_ctx,
203 &sess_conf, skt_ctx->session_pool,
204 skt_ctx->session_priv_pool);
205 if (ips->security.ses == NULL) {
207 "SEC Session init failed: err: %d\n", ret);
211 sec_cap = rte_security_capabilities_get(sec_ctx);
213 /* iterate until ESP tunnel*/
214 while (sec_cap->action != RTE_SECURITY_ACTION_TYPE_NONE) {
215 if (sec_cap->action == ips->type &&
217 RTE_SECURITY_PROTOCOL_IPSEC &&
218 sec_cap->ipsec.mode ==
219 RTE_SECURITY_IPSEC_SA_MODE_TUNNEL &&
220 sec_cap->ipsec.direction == sa->direction)
225 if (sec_cap->action == RTE_SECURITY_ACTION_TYPE_NONE) {
227 "No suitable security capability found\n");
231 ips->security.ol_flags = sec_cap->ol_flags;
232 ips->security.ctx = sec_ctx;
233 sa->pattern[0].type = RTE_FLOW_ITEM_TYPE_ETH;
235 if (IS_IP6(sa->flags)) {
236 sa->pattern[1].mask = &rte_flow_item_ipv6_mask;
237 sa->pattern[1].type = RTE_FLOW_ITEM_TYPE_IPV6;
238 sa->pattern[1].spec = &sa->ipv6_spec;
240 memcpy(sa->ipv6_spec.hdr.dst_addr,
241 sa->dst.ip.ip6.ip6_b, 16);
242 memcpy(sa->ipv6_spec.hdr.src_addr,
243 sa->src.ip.ip6.ip6_b, 16);
244 } else if (IS_IP4(sa->flags)) {
245 sa->pattern[1].mask = &rte_flow_item_ipv4_mask;
246 sa->pattern[1].type = RTE_FLOW_ITEM_TYPE_IPV4;
247 sa->pattern[1].spec = &sa->ipv4_spec;
249 sa->ipv4_spec.hdr.dst_addr = sa->dst.ip.ip4;
250 sa->ipv4_spec.hdr.src_addr = sa->src.ip.ip4;
253 sa->pattern[2].type = RTE_FLOW_ITEM_TYPE_ESP;
254 sa->pattern[2].spec = &sa->esp_spec;
255 sa->pattern[2].mask = &rte_flow_item_esp_mask;
256 sa->esp_spec.hdr.spi = rte_cpu_to_be_32(sa->spi);
258 sa->pattern[3].type = RTE_FLOW_ITEM_TYPE_END;
260 sa->action[0].type = RTE_FLOW_ACTION_TYPE_SECURITY;
261 sa->action[0].conf = ips->security.ses;
263 sa->action[1].type = RTE_FLOW_ACTION_TYPE_END;
265 sa->attr.egress = (sa->direction ==
266 RTE_SECURITY_IPSEC_SA_DIR_EGRESS);
267 sa->attr.ingress = (sa->direction ==
268 RTE_SECURITY_IPSEC_SA_DIR_INGRESS);
269 if (sa->attr.ingress) {
271 struct rte_eth_rss_conf rss_conf = {
275 struct rte_eth_dev_info dev_info;
276 uint16_t queue[RTE_MAX_QUEUES_PER_PORT];
277 struct rte_flow_action_rss action_rss;
281 /* Don't create flow if default flow is created */
282 if (flow_info_tbl[sa->portid].rx_def_flow)
285 ret = rte_eth_dev_info_get(sa->portid, &dev_info);
288 "Error during getting device (port %u) info: %s\n",
289 sa->portid, strerror(-ret));
293 sa->action[2].type = RTE_FLOW_ACTION_TYPE_END;
295 sa->action[1].type = RTE_FLOW_ACTION_TYPE_RSS;
296 sa->action[1].conf = &action_rss;
297 ret = rte_eth_dev_rss_hash_conf_get(sa->portid,
301 "rte_eth_dev_rss_hash_conf_get:ret=%d\n",
305 for (i = 0, j = 0; i < dev_info.nb_rx_queues; ++i)
308 action_rss = (struct rte_flow_action_rss){
309 .types = rss_conf.rss_hf,
310 .key_len = rss_conf.rss_key_len,
315 ret = rte_flow_validate(sa->portid, &sa->attr,
316 sa->pattern, sa->action,
321 sa->action[1].type = RTE_FLOW_ACTION_TYPE_QUEUE;
323 &(struct rte_flow_action_queue){
326 ret = rte_flow_validate(sa->portid, &sa->attr,
327 sa->pattern, sa->action,
330 sa->action[1].type = RTE_FLOW_ACTION_TYPE_END;
331 sa->action[1].conf = NULL;
332 ret = rte_flow_validate(sa->portid, &sa->attr,
333 sa->pattern, sa->action,
336 goto flow_create_failure;
337 } else if (sa->attr.egress &&
338 (ips->security.ol_flags &
339 RTE_SECURITY_TX_HW_TRAILER_OFFLOAD)) {
341 RTE_FLOW_ACTION_TYPE_PASSTHRU;
343 RTE_FLOW_ACTION_TYPE_END;
346 sa->flow = rte_flow_create(sa->portid,
347 &sa->attr, sa->pattern, sa->action, &err);
348 if (sa->flow == NULL) {
351 "Failed to create ipsec flow msg: %s\n",
355 } else if (ips->type == RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL) {
356 const struct rte_security_capability *sec_cap;
358 sec_ctx = (struct rte_security_ctx *)
359 rte_eth_dev_get_sec_ctx(sa->portid);
361 if (sec_ctx == NULL) {
363 "Ethernet device doesn't have security features registered\n");
367 /* Set IPsec parameters in conf */
368 set_ipsec_conf(sa, &(sess_conf.ipsec));
370 /* Save SA as userdata for the security session. When
371 * the packet is received, this userdata will be
372 * retrieved using the metadata from the packet.
374 * The PMD is expected to set similar metadata for other
375 * operations, like rte_eth_event, which are tied to
376 * security session. In such cases, the userdata could
377 * be obtained to uniquely identify the security
378 * parameters denoted.
381 sess_conf.userdata = (void *) sa;
383 ips->security.ses = rte_security_session_create(sec_ctx,
384 &sess_conf, skt_ctx->session_pool,
385 skt_ctx->session_priv_pool);
386 if (ips->security.ses == NULL) {
388 "SEC Session init failed: err: %d\n", ret);
392 sec_cap = rte_security_capabilities_get(sec_ctx);
393 if (sec_cap == NULL) {
395 "No capabilities registered\n");
399 /* iterate until ESP tunnel*/
400 while (sec_cap->action !=
401 RTE_SECURITY_ACTION_TYPE_NONE) {
402 if (sec_cap->action == ips->type &&
404 RTE_SECURITY_PROTOCOL_IPSEC &&
405 sec_cap->ipsec.mode ==
406 sess_conf.ipsec.mode &&
407 sec_cap->ipsec.direction == sa->direction)
412 if (sec_cap->action == RTE_SECURITY_ACTION_TYPE_NONE) {
414 "No suitable security capability found\n");
418 ips->security.ol_flags = sec_cap->ol_flags;
419 ips->security.ctx = sec_ctx;
426 create_ipsec_esp_flow(struct ipsec_sa *sa)
429 struct rte_flow_error err;
430 if (sa->direction == RTE_SECURITY_IPSEC_SA_DIR_EGRESS) {
432 "No Flow director rule for Egress traffic\n");
435 if (sa->flags == TRANSPORT) {
437 "No Flow director rule for transport mode\n");
440 sa->action[0].type = RTE_FLOW_ACTION_TYPE_QUEUE;
441 sa->pattern[0].type = RTE_FLOW_ITEM_TYPE_ETH;
442 sa->action[0].conf = &(struct rte_flow_action_queue) {
443 .index = sa->fdir_qid,
446 sa->attr.ingress = 1;
447 if (IS_IP6(sa->flags)) {
448 sa->pattern[1].mask = &rte_flow_item_ipv6_mask;
449 sa->pattern[1].type = RTE_FLOW_ITEM_TYPE_IPV6;
450 sa->pattern[1].spec = &sa->ipv6_spec;
451 memcpy(sa->ipv6_spec.hdr.dst_addr,
452 sa->dst.ip.ip6.ip6_b, sizeof(sa->dst.ip.ip6.ip6_b));
453 memcpy(sa->ipv6_spec.hdr.src_addr,
454 sa->src.ip.ip6.ip6_b, sizeof(sa->src.ip.ip6.ip6_b));
455 sa->pattern[2].type = RTE_FLOW_ITEM_TYPE_ESP;
456 sa->pattern[2].spec = &sa->esp_spec;
457 sa->pattern[2].mask = &rte_flow_item_esp_mask;
458 sa->esp_spec.hdr.spi = rte_cpu_to_be_32(sa->spi);
459 sa->pattern[3].type = RTE_FLOW_ITEM_TYPE_END;
460 } else if (IS_IP4(sa->flags)) {
461 sa->pattern[1].mask = &rte_flow_item_ipv4_mask;
462 sa->pattern[1].type = RTE_FLOW_ITEM_TYPE_IPV4;
463 sa->pattern[1].spec = &sa->ipv4_spec;
464 sa->ipv4_spec.hdr.dst_addr = sa->dst.ip.ip4;
465 sa->ipv4_spec.hdr.src_addr = sa->src.ip.ip4;
466 sa->pattern[2].type = RTE_FLOW_ITEM_TYPE_ESP;
467 sa->pattern[2].spec = &sa->esp_spec;
468 sa->pattern[2].mask = &rte_flow_item_esp_mask;
469 sa->esp_spec.hdr.spi = rte_cpu_to_be_32(sa->spi);
470 sa->pattern[3].type = RTE_FLOW_ITEM_TYPE_END;
472 sa->action[1].type = RTE_FLOW_ACTION_TYPE_END;
474 ret = rte_flow_validate(sa->portid, &sa->attr, sa->pattern, sa->action,
477 RTE_LOG(ERR, IPSEC, "Flow validation failed %s\n", err.message);
481 sa->flow = rte_flow_create(sa->portid, &sa->attr, sa->pattern,
484 RTE_LOG(ERR, IPSEC, "Flow creation failed %s\n", err.message);
492 * queue crypto-ops into PMD queue.
495 enqueue_cop_burst(struct cdev_qp *cqp)
497 uint32_t i, len, ret;
500 ret = rte_cryptodev_enqueue_burst(cqp->id, cqp->qp, cqp->buf, len);
502 RTE_LOG_DP(DEBUG, IPSEC, "Cryptodev %u queue %u:"
503 " enqueued %u crypto ops out of %u\n",
504 cqp->id, cqp->qp, ret, len);
505 /* drop packets that we fail to enqueue */
506 for (i = ret; i < len; i++)
507 free_pkts(&cqp->buf[i]->sym->m_src, 1);
509 cqp->in_flight += ret;
514 enqueue_cop(struct cdev_qp *cqp, struct rte_crypto_op *cop)
516 cqp->buf[cqp->len++] = cop;
518 if (cqp->len == MAX_PKT_BURST)
519 enqueue_cop_burst(cqp);
523 ipsec_enqueue(ipsec_xform_fn xform_func, struct ipsec_ctx *ipsec_ctx,
524 struct rte_mbuf *pkts[], void *sas[],
528 struct ipsec_mbuf_metadata *priv;
529 struct rte_crypto_sym_op *sym_cop;
531 struct rte_ipsec_session *ips;
533 for (i = 0; i < nb_pkts; i++) {
534 if (unlikely(sas[i] == NULL)) {
535 free_pkts(&pkts[i], 1);
539 rte_prefetch0(sas[i]);
540 rte_prefetch0(pkts[i]);
542 priv = get_priv(pkts[i]);
543 sa = ipsec_mask_saptr(sas[i]);
545 ips = ipsec_get_primary_session(sa);
548 case RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL:
549 priv->cop.type = RTE_CRYPTO_OP_TYPE_SYMMETRIC;
550 priv->cop.status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
552 rte_prefetch0(&priv->sym_cop);
554 if ((unlikely(ips->security.ses == NULL)) &&
555 create_lookaside_session(ipsec_ctx, sa, ips)) {
556 free_pkts(&pkts[i], 1);
560 if (unlikely((pkts[i]->packet_type &
561 (RTE_PTYPE_TUNNEL_MASK |
562 RTE_PTYPE_L4_MASK)) ==
563 MBUF_PTYPE_TUNNEL_ESP_IN_UDP &&
564 sa->udp_encap != 1)) {
565 free_pkts(&pkts[i], 1);
569 sym_cop = get_sym_cop(&priv->cop);
570 sym_cop->m_src = pkts[i];
572 rte_security_attach_session(&priv->cop,
576 case RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO:
577 RTE_LOG(ERR, IPSEC, "CPU crypto is not supported by the"
579 free_pkts(&pkts[i], 1);
582 case RTE_SECURITY_ACTION_TYPE_NONE:
584 priv->cop.type = RTE_CRYPTO_OP_TYPE_SYMMETRIC;
585 priv->cop.status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
587 rte_prefetch0(&priv->sym_cop);
589 if ((unlikely(ips->crypto.ses == NULL)) &&
590 create_lookaside_session(ipsec_ctx, sa, ips)) {
591 free_pkts(&pkts[i], 1);
595 rte_crypto_op_attach_sym_session(&priv->cop,
598 ret = xform_func(pkts[i], sa, &priv->cop);
600 free_pkts(&pkts[i], 1);
604 case RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL:
605 RTE_ASSERT(ips->security.ses != NULL);
606 ipsec_ctx->ol_pkts[ipsec_ctx->ol_pkts_cnt++] = pkts[i];
607 if (ips->security.ol_flags &
608 RTE_SECURITY_TX_OLOAD_NEED_MDATA)
609 rte_security_set_pkt_metadata(
610 ips->security.ctx, ips->security.ses,
613 case RTE_SECURITY_ACTION_TYPE_INLINE_CRYPTO:
614 RTE_ASSERT(ips->security.ses != NULL);
615 priv->cop.type = RTE_CRYPTO_OP_TYPE_SYMMETRIC;
616 priv->cop.status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
618 rte_prefetch0(&priv->sym_cop);
619 rte_security_attach_session(&priv->cop,
622 ret = xform_func(pkts[i], sa, &priv->cop);
624 free_pkts(&pkts[i], 1);
628 ipsec_ctx->ol_pkts[ipsec_ctx->ol_pkts_cnt++] = pkts[i];
629 if (ips->security.ol_flags &
630 RTE_SECURITY_TX_OLOAD_NEED_MDATA)
631 rte_security_set_pkt_metadata(
632 ips->security.ctx, ips->security.ses,
637 RTE_ASSERT(sa->cdev_id_qp < ipsec_ctx->nb_qps);
638 enqueue_cop(&ipsec_ctx->tbl[sa->cdev_id_qp], &priv->cop);
642 static inline int32_t
643 ipsec_inline_dequeue(ipsec_xform_fn xform_func, struct ipsec_ctx *ipsec_ctx,
644 struct rte_mbuf *pkts[], uint16_t max_pkts)
646 int32_t nb_pkts, ret;
647 struct ipsec_mbuf_metadata *priv;
649 struct rte_mbuf *pkt;
652 while (ipsec_ctx->ol_pkts_cnt > 0 && nb_pkts < max_pkts) {
653 pkt = ipsec_ctx->ol_pkts[--ipsec_ctx->ol_pkts_cnt];
655 priv = get_priv(pkt);
657 ret = xform_func(pkt, sa, &priv->cop);
662 pkts[nb_pkts++] = pkt;
669 ipsec_dequeue(ipsec_xform_fn xform_func, struct ipsec_ctx *ipsec_ctx,
670 struct rte_mbuf *pkts[], uint16_t max_pkts)
672 int32_t nb_pkts = 0, ret = 0, i, j, nb_cops;
673 struct ipsec_mbuf_metadata *priv;
674 struct rte_crypto_op *cops[max_pkts];
676 struct rte_mbuf *pkt;
678 for (i = 0; i < ipsec_ctx->nb_qps && nb_pkts < max_pkts; i++) {
681 cqp = &ipsec_ctx->tbl[ipsec_ctx->last_qp++];
682 if (ipsec_ctx->last_qp == ipsec_ctx->nb_qps)
683 ipsec_ctx->last_qp %= ipsec_ctx->nb_qps;
685 if (cqp->in_flight == 0)
688 nb_cops = rte_cryptodev_dequeue_burst(cqp->id, cqp->qp,
689 cops, max_pkts - nb_pkts);
691 cqp->in_flight -= nb_cops;
693 for (j = 0; j < nb_cops; j++) {
694 pkt = cops[j]->sym->m_src;
697 priv = get_priv(pkt);
700 RTE_ASSERT(sa != NULL);
702 if (ipsec_get_action_type(sa) ==
703 RTE_SECURITY_ACTION_TYPE_NONE) {
704 ret = xform_func(pkt, sa, cops[j]);
709 } else if (ipsec_get_action_type(sa) ==
710 RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL) {
711 if (cops[j]->status) {
716 pkts[nb_pkts++] = pkt;
725 ipsec_inbound(struct ipsec_ctx *ctx, struct rte_mbuf *pkts[],
726 uint16_t nb_pkts, uint16_t len)
730 inbound_sa_lookup(ctx->sa_ctx, pkts, sas, nb_pkts);
732 ipsec_enqueue(esp_inbound, ctx, pkts, sas, nb_pkts);
734 return ipsec_inline_dequeue(esp_inbound_post, ctx, pkts, len);
738 ipsec_inbound_cqp_dequeue(struct ipsec_ctx *ctx, struct rte_mbuf *pkts[],
741 return ipsec_dequeue(esp_inbound_post, ctx, pkts, len);
745 ipsec_outbound(struct ipsec_ctx *ctx, struct rte_mbuf *pkts[],
746 uint32_t sa_idx[], uint16_t nb_pkts, uint16_t len)
750 outbound_sa_lookup(ctx->sa_ctx, sa_idx, sas, nb_pkts);
752 ipsec_enqueue(esp_outbound, ctx, pkts, sas, nb_pkts);
754 return ipsec_inline_dequeue(esp_outbound_post, ctx, pkts, len);
758 ipsec_outbound_cqp_dequeue(struct ipsec_ctx *ctx, struct rte_mbuf *pkts[],
761 return ipsec_dequeue(esp_outbound_post, ctx, pkts, len);