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->replay_win_sz = app_sa_prm.window_size;
53 ipsec->options.esn = app_sa_prm.enable_esn;
54 ipsec->options.udp_encap = sa->udp_encap;
58 create_lookaside_session(struct ipsec_ctx *ipsec_ctx, struct ipsec_sa *sa,
59 struct rte_ipsec_session *ips)
61 struct rte_cryptodev_info cdev_info;
62 unsigned long cdev_id_qp = 0;
64 struct cdev_key key = { 0 };
66 key.lcore_id = (uint8_t)rte_lcore_id();
68 key.cipher_algo = (uint8_t)sa->cipher_algo;
69 key.auth_algo = (uint8_t)sa->auth_algo;
70 key.aead_algo = (uint8_t)sa->aead_algo;
72 ret = rte_hash_lookup_data(ipsec_ctx->cdev_map, &key,
73 (void **)&cdev_id_qp);
76 "No cryptodev: core %u, cipher_algo %u, "
77 "auth_algo %u, aead_algo %u\n",
85 RTE_LOG_DP(DEBUG, IPSEC, "Create session for SA spi %u on cryptodev "
86 "%u qp %u\n", sa->spi,
87 ipsec_ctx->tbl[cdev_id_qp].id,
88 ipsec_ctx->tbl[cdev_id_qp].qp);
90 if (ips->type != RTE_SECURITY_ACTION_TYPE_NONE &&
91 ips->type != RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO) {
92 struct rte_security_session_conf sess_conf = {
93 .action_type = ips->type,
94 .protocol = RTE_SECURITY_PROTOCOL_IPSEC,
100 .direction = sa->direction,
101 .proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP,
102 .mode = (IS_TUNNEL(sa->flags)) ?
103 RTE_SECURITY_IPSEC_SA_MODE_TUNNEL :
104 RTE_SECURITY_IPSEC_SA_MODE_TRANSPORT,
106 .crypto_xform = sa->xforms,
111 if (ips->type == RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL) {
112 struct rte_security_ctx *ctx = (struct rte_security_ctx *)
113 rte_cryptodev_get_sec_ctx(
114 ipsec_ctx->tbl[cdev_id_qp].id);
116 /* Set IPsec parameters in conf */
117 set_ipsec_conf(sa, &(sess_conf.ipsec));
119 ips->security.ses = rte_security_session_create(ctx,
120 &sess_conf, ipsec_ctx->session_pool,
121 ipsec_ctx->session_priv_pool);
122 if (ips->security.ses == NULL) {
124 "SEC Session init failed: err: %d\n", ret);
128 RTE_LOG(ERR, IPSEC, "Inline not supported\n");
132 if (ips->type == RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO) {
133 struct rte_cryptodev_info info;
136 cdev_id = ipsec_ctx->tbl[cdev_id_qp].id;
137 rte_cryptodev_info_get(cdev_id, &info);
138 if (!(info.feature_flags &
139 RTE_CRYPTODEV_FF_SYM_CPU_CRYPTO))
142 ips->crypto.dev_id = cdev_id;
144 ips->crypto.ses = rte_cryptodev_sym_session_create(
145 ipsec_ctx->session_pool);
146 rte_cryptodev_sym_session_init(ipsec_ctx->tbl[cdev_id_qp].id,
147 ips->crypto.ses, sa->xforms,
148 ipsec_ctx->session_priv_pool);
150 rte_cryptodev_info_get(ipsec_ctx->tbl[cdev_id_qp].id,
154 sa->cdev_id_qp = cdev_id_qp;
160 create_inline_session(struct socket_ctx *skt_ctx, struct ipsec_sa *sa,
161 struct rte_ipsec_session *ips)
164 struct rte_security_ctx *sec_ctx;
165 struct rte_security_session_conf sess_conf = {
166 .action_type = ips->type,
167 .protocol = RTE_SECURITY_PROTOCOL_IPSEC,
173 .direction = sa->direction,
174 .proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP,
175 .mode = (sa->flags == IP4_TUNNEL ||
176 sa->flags == IP6_TUNNEL) ?
177 RTE_SECURITY_IPSEC_SA_MODE_TUNNEL :
178 RTE_SECURITY_IPSEC_SA_MODE_TRANSPORT,
180 .crypto_xform = sa->xforms,
184 RTE_LOG_DP(DEBUG, IPSEC, "Create session for SA spi %u on port %u\n",
185 sa->spi, sa->portid);
187 if (ips->type == RTE_SECURITY_ACTION_TYPE_INLINE_CRYPTO) {
188 struct rte_flow_error err;
189 const struct rte_security_capability *sec_cap;
192 sec_ctx = (struct rte_security_ctx *)
193 rte_eth_dev_get_sec_ctx(
195 if (sec_ctx == NULL) {
197 " rte_eth_dev_get_sec_ctx failed\n");
201 ips->security.ses = rte_security_session_create(sec_ctx,
202 &sess_conf, skt_ctx->session_pool,
203 skt_ctx->session_priv_pool);
204 if (ips->security.ses == NULL) {
206 "SEC Session init failed: err: %d\n", ret);
210 sec_cap = rte_security_capabilities_get(sec_ctx);
212 /* iterate until ESP tunnel*/
213 while (sec_cap->action != RTE_SECURITY_ACTION_TYPE_NONE) {
214 if (sec_cap->action == ips->type &&
216 RTE_SECURITY_PROTOCOL_IPSEC &&
217 sec_cap->ipsec.mode ==
218 RTE_SECURITY_IPSEC_SA_MODE_TUNNEL &&
219 sec_cap->ipsec.direction == sa->direction)
224 if (sec_cap->action == RTE_SECURITY_ACTION_TYPE_NONE) {
226 "No suitable security capability found\n");
230 ips->security.ol_flags = sec_cap->ol_flags;
231 ips->security.ctx = sec_ctx;
232 sa->pattern[0].type = RTE_FLOW_ITEM_TYPE_ETH;
234 if (IS_IP6(sa->flags)) {
235 sa->pattern[1].mask = &rte_flow_item_ipv6_mask;
236 sa->pattern[1].type = RTE_FLOW_ITEM_TYPE_IPV6;
237 sa->pattern[1].spec = &sa->ipv6_spec;
239 memcpy(sa->ipv6_spec.hdr.dst_addr,
240 sa->dst.ip.ip6.ip6_b, 16);
241 memcpy(sa->ipv6_spec.hdr.src_addr,
242 sa->src.ip.ip6.ip6_b, 16);
243 } else if (IS_IP4(sa->flags)) {
244 sa->pattern[1].mask = &rte_flow_item_ipv4_mask;
245 sa->pattern[1].type = RTE_FLOW_ITEM_TYPE_IPV4;
246 sa->pattern[1].spec = &sa->ipv4_spec;
248 sa->ipv4_spec.hdr.dst_addr = sa->dst.ip.ip4;
249 sa->ipv4_spec.hdr.src_addr = sa->src.ip.ip4;
252 sa->pattern[2].type = RTE_FLOW_ITEM_TYPE_ESP;
253 sa->pattern[2].spec = &sa->esp_spec;
254 sa->pattern[2].mask = &rte_flow_item_esp_mask;
255 sa->esp_spec.hdr.spi = rte_cpu_to_be_32(sa->spi);
257 sa->pattern[3].type = RTE_FLOW_ITEM_TYPE_END;
259 sa->action[0].type = RTE_FLOW_ACTION_TYPE_SECURITY;
260 sa->action[0].conf = ips->security.ses;
262 sa->action[1].type = RTE_FLOW_ACTION_TYPE_END;
264 sa->attr.egress = (sa->direction ==
265 RTE_SECURITY_IPSEC_SA_DIR_EGRESS);
266 sa->attr.ingress = (sa->direction ==
267 RTE_SECURITY_IPSEC_SA_DIR_INGRESS);
268 if (sa->attr.ingress) {
270 struct rte_eth_rss_conf rss_conf = {
274 struct rte_eth_dev_info dev_info;
275 uint16_t queue[RTE_MAX_QUEUES_PER_PORT];
276 struct rte_flow_action_rss action_rss;
280 /* Don't create flow if default flow is created */
281 if (flow_info_tbl[sa->portid].rx_def_flow)
284 ret = rte_eth_dev_info_get(sa->portid, &dev_info);
287 "Error during getting device (port %u) info: %s\n",
288 sa->portid, strerror(-ret));
292 sa->action[2].type = RTE_FLOW_ACTION_TYPE_END;
294 sa->action[1].type = RTE_FLOW_ACTION_TYPE_RSS;
295 sa->action[1].conf = &action_rss;
296 ret = rte_eth_dev_rss_hash_conf_get(sa->portid,
300 "rte_eth_dev_rss_hash_conf_get:ret=%d\n",
304 for (i = 0, j = 0; i < dev_info.nb_rx_queues; ++i)
307 action_rss = (struct rte_flow_action_rss){
308 .types = rss_conf.rss_hf,
309 .key_len = rss_conf.rss_key_len,
314 ret = rte_flow_validate(sa->portid, &sa->attr,
315 sa->pattern, sa->action,
320 sa->action[1].type = RTE_FLOW_ACTION_TYPE_QUEUE;
322 &(struct rte_flow_action_queue){
325 ret = rte_flow_validate(sa->portid, &sa->attr,
326 sa->pattern, sa->action,
329 sa->action[1].type = RTE_FLOW_ACTION_TYPE_END;
330 sa->action[1].conf = NULL;
331 ret = rte_flow_validate(sa->portid, &sa->attr,
332 sa->pattern, sa->action,
335 goto flow_create_failure;
336 } else if (sa->attr.egress &&
337 (ips->security.ol_flags &
338 RTE_SECURITY_TX_HW_TRAILER_OFFLOAD)) {
340 RTE_FLOW_ACTION_TYPE_PASSTHRU;
342 RTE_FLOW_ACTION_TYPE_END;
345 sa->flow = rte_flow_create(sa->portid,
346 &sa->attr, sa->pattern, sa->action, &err);
347 if (sa->flow == NULL) {
350 "Failed to create ipsec flow msg: %s\n",
354 } else if (ips->type == RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL) {
355 const struct rte_security_capability *sec_cap;
357 sec_ctx = (struct rte_security_ctx *)
358 rte_eth_dev_get_sec_ctx(sa->portid);
360 if (sec_ctx == NULL) {
362 "Ethernet device doesn't have security features registered\n");
366 /* Set IPsec parameters in conf */
367 set_ipsec_conf(sa, &(sess_conf.ipsec));
369 /* Save SA as userdata for the security session. When
370 * the packet is received, this userdata will be
371 * retrieved using the metadata from the packet.
373 * The PMD is expected to set similar metadata for other
374 * operations, like rte_eth_event, which are tied to
375 * security session. In such cases, the userdata could
376 * be obtained to uniquely identify the security
377 * parameters denoted.
380 sess_conf.userdata = (void *) sa;
382 ips->security.ses = rte_security_session_create(sec_ctx,
383 &sess_conf, skt_ctx->session_pool,
384 skt_ctx->session_priv_pool);
385 if (ips->security.ses == NULL) {
387 "SEC Session init failed: err: %d\n", ret);
391 sec_cap = rte_security_capabilities_get(sec_ctx);
392 if (sec_cap == NULL) {
394 "No capabilities registered\n");
398 /* iterate until ESP tunnel*/
399 while (sec_cap->action !=
400 RTE_SECURITY_ACTION_TYPE_NONE) {
401 if (sec_cap->action == ips->type &&
403 RTE_SECURITY_PROTOCOL_IPSEC &&
404 sec_cap->ipsec.mode ==
405 sess_conf.ipsec.mode &&
406 sec_cap->ipsec.direction == sa->direction)
411 if (sec_cap->action == RTE_SECURITY_ACTION_TYPE_NONE) {
413 "No suitable security capability found\n");
417 ips->security.ol_flags = sec_cap->ol_flags;
418 ips->security.ctx = sec_ctx;
425 create_ipsec_esp_flow(struct ipsec_sa *sa)
428 struct rte_flow_error err;
429 if (sa->direction == RTE_SECURITY_IPSEC_SA_DIR_EGRESS) {
431 "No Flow director rule for Egress traffic\n");
434 if (sa->flags == TRANSPORT) {
436 "No Flow director rule for transport mode\n");
439 sa->action[0].type = RTE_FLOW_ACTION_TYPE_QUEUE;
440 sa->pattern[0].type = RTE_FLOW_ITEM_TYPE_ETH;
441 sa->action[0].conf = &(struct rte_flow_action_queue) {
442 .index = sa->fdir_qid,
445 sa->attr.ingress = 1;
446 if (IS_IP6(sa->flags)) {
447 sa->pattern[1].mask = &rte_flow_item_ipv6_mask;
448 sa->pattern[1].type = RTE_FLOW_ITEM_TYPE_IPV6;
449 sa->pattern[1].spec = &sa->ipv6_spec;
450 memcpy(sa->ipv6_spec.hdr.dst_addr,
451 sa->dst.ip.ip6.ip6_b, sizeof(sa->dst.ip.ip6.ip6_b));
452 memcpy(sa->ipv6_spec.hdr.src_addr,
453 sa->src.ip.ip6.ip6_b, sizeof(sa->src.ip.ip6.ip6_b));
454 sa->pattern[2].type = RTE_FLOW_ITEM_TYPE_ESP;
455 sa->pattern[2].spec = &sa->esp_spec;
456 sa->pattern[2].mask = &rte_flow_item_esp_mask;
457 sa->esp_spec.hdr.spi = rte_cpu_to_be_32(sa->spi);
458 sa->pattern[3].type = RTE_FLOW_ITEM_TYPE_END;
459 } else if (IS_IP4(sa->flags)) {
460 sa->pattern[1].mask = &rte_flow_item_ipv4_mask;
461 sa->pattern[1].type = RTE_FLOW_ITEM_TYPE_IPV4;
462 sa->pattern[1].spec = &sa->ipv4_spec;
463 sa->ipv4_spec.hdr.dst_addr = sa->dst.ip.ip4;
464 sa->ipv4_spec.hdr.src_addr = sa->src.ip.ip4;
465 sa->pattern[2].type = RTE_FLOW_ITEM_TYPE_ESP;
466 sa->pattern[2].spec = &sa->esp_spec;
467 sa->pattern[2].mask = &rte_flow_item_esp_mask;
468 sa->esp_spec.hdr.spi = rte_cpu_to_be_32(sa->spi);
469 sa->pattern[3].type = RTE_FLOW_ITEM_TYPE_END;
471 sa->action[1].type = RTE_FLOW_ACTION_TYPE_END;
473 ret = rte_flow_validate(sa->portid, &sa->attr, sa->pattern, sa->action,
476 RTE_LOG(ERR, IPSEC, "Flow validation failed %s\n", err.message);
480 sa->flow = rte_flow_create(sa->portid, &sa->attr, sa->pattern,
483 RTE_LOG(ERR, IPSEC, "Flow creation failed %s\n", err.message);
491 * queue crypto-ops into PMD queue.
494 enqueue_cop_burst(struct cdev_qp *cqp)
496 uint32_t i, len, ret;
499 ret = rte_cryptodev_enqueue_burst(cqp->id, cqp->qp, cqp->buf, len);
501 RTE_LOG_DP(DEBUG, IPSEC, "Cryptodev %u queue %u:"
502 " enqueued %u crypto ops out of %u\n",
503 cqp->id, cqp->qp, ret, len);
504 /* drop packets that we fail to enqueue */
505 for (i = ret; i < len; i++)
506 free_pkts(&cqp->buf[i]->sym->m_src, 1);
508 cqp->in_flight += ret;
513 enqueue_cop(struct cdev_qp *cqp, struct rte_crypto_op *cop)
515 cqp->buf[cqp->len++] = cop;
517 if (cqp->len == MAX_PKT_BURST)
518 enqueue_cop_burst(cqp);
522 ipsec_enqueue(ipsec_xform_fn xform_func, struct ipsec_ctx *ipsec_ctx,
523 struct rte_mbuf *pkts[], void *sas[],
527 struct ipsec_mbuf_metadata *priv;
528 struct rte_crypto_sym_op *sym_cop;
530 struct rte_ipsec_session *ips;
532 for (i = 0; i < nb_pkts; i++) {
533 if (unlikely(sas[i] == NULL)) {
534 free_pkts(&pkts[i], 1);
538 rte_prefetch0(sas[i]);
539 rte_prefetch0(pkts[i]);
541 priv = get_priv(pkts[i]);
542 sa = ipsec_mask_saptr(sas[i]);
544 ips = ipsec_get_primary_session(sa);
547 case RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL:
548 priv->cop.type = RTE_CRYPTO_OP_TYPE_SYMMETRIC;
549 priv->cop.status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
551 rte_prefetch0(&priv->sym_cop);
553 if ((unlikely(ips->security.ses == NULL)) &&
554 create_lookaside_session(ipsec_ctx, sa, ips)) {
555 free_pkts(&pkts[i], 1);
559 if (unlikely((pkts[i]->packet_type &
560 (RTE_PTYPE_TUNNEL_MASK |
561 RTE_PTYPE_L4_MASK)) ==
562 MBUF_PTYPE_TUNNEL_ESP_IN_UDP &&
563 sa->udp_encap != 1)) {
564 free_pkts(&pkts[i], 1);
568 sym_cop = get_sym_cop(&priv->cop);
569 sym_cop->m_src = pkts[i];
571 rte_security_attach_session(&priv->cop,
575 case RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO:
576 RTE_LOG(ERR, IPSEC, "CPU crypto is not supported by the"
578 free_pkts(&pkts[i], 1);
581 case RTE_SECURITY_ACTION_TYPE_NONE:
583 priv->cop.type = RTE_CRYPTO_OP_TYPE_SYMMETRIC;
584 priv->cop.status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
586 rte_prefetch0(&priv->sym_cop);
588 if ((unlikely(ips->crypto.ses == NULL)) &&
589 create_lookaside_session(ipsec_ctx, sa, ips)) {
590 free_pkts(&pkts[i], 1);
594 rte_crypto_op_attach_sym_session(&priv->cop,
597 ret = xform_func(pkts[i], sa, &priv->cop);
599 free_pkts(&pkts[i], 1);
603 case RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL:
604 RTE_ASSERT(ips->security.ses != NULL);
605 ipsec_ctx->ol_pkts[ipsec_ctx->ol_pkts_cnt++] = pkts[i];
606 if (ips->security.ol_flags &
607 RTE_SECURITY_TX_OLOAD_NEED_MDATA)
608 rte_security_set_pkt_metadata(
609 ips->security.ctx, ips->security.ses,
612 case RTE_SECURITY_ACTION_TYPE_INLINE_CRYPTO:
613 RTE_ASSERT(ips->security.ses != NULL);
614 priv->cop.type = RTE_CRYPTO_OP_TYPE_SYMMETRIC;
615 priv->cop.status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
617 rte_prefetch0(&priv->sym_cop);
618 rte_security_attach_session(&priv->cop,
621 ret = xform_func(pkts[i], sa, &priv->cop);
623 free_pkts(&pkts[i], 1);
627 ipsec_ctx->ol_pkts[ipsec_ctx->ol_pkts_cnt++] = pkts[i];
628 if (ips->security.ol_flags &
629 RTE_SECURITY_TX_OLOAD_NEED_MDATA)
630 rte_security_set_pkt_metadata(
631 ips->security.ctx, ips->security.ses,
636 RTE_ASSERT(sa->cdev_id_qp < ipsec_ctx->nb_qps);
637 enqueue_cop(&ipsec_ctx->tbl[sa->cdev_id_qp], &priv->cop);
641 static inline int32_t
642 ipsec_inline_dequeue(ipsec_xform_fn xform_func, struct ipsec_ctx *ipsec_ctx,
643 struct rte_mbuf *pkts[], uint16_t max_pkts)
645 int32_t nb_pkts, ret;
646 struct ipsec_mbuf_metadata *priv;
648 struct rte_mbuf *pkt;
651 while (ipsec_ctx->ol_pkts_cnt > 0 && nb_pkts < max_pkts) {
652 pkt = ipsec_ctx->ol_pkts[--ipsec_ctx->ol_pkts_cnt];
654 priv = get_priv(pkt);
656 ret = xform_func(pkt, sa, &priv->cop);
661 pkts[nb_pkts++] = pkt;
668 ipsec_dequeue(ipsec_xform_fn xform_func, struct ipsec_ctx *ipsec_ctx,
669 struct rte_mbuf *pkts[], uint16_t max_pkts)
671 int32_t nb_pkts = 0, ret = 0, i, j, nb_cops;
672 struct ipsec_mbuf_metadata *priv;
673 struct rte_crypto_op *cops[max_pkts];
675 struct rte_mbuf *pkt;
677 for (i = 0; i < ipsec_ctx->nb_qps && nb_pkts < max_pkts; i++) {
680 cqp = &ipsec_ctx->tbl[ipsec_ctx->last_qp++];
681 if (ipsec_ctx->last_qp == ipsec_ctx->nb_qps)
682 ipsec_ctx->last_qp %= ipsec_ctx->nb_qps;
684 if (cqp->in_flight == 0)
687 nb_cops = rte_cryptodev_dequeue_burst(cqp->id, cqp->qp,
688 cops, max_pkts - nb_pkts);
690 cqp->in_flight -= nb_cops;
692 for (j = 0; j < nb_cops; j++) {
693 pkt = cops[j]->sym->m_src;
696 priv = get_priv(pkt);
699 RTE_ASSERT(sa != NULL);
701 if (ipsec_get_action_type(sa) ==
702 RTE_SECURITY_ACTION_TYPE_NONE) {
703 ret = xform_func(pkt, sa, cops[j]);
708 } else if (ipsec_get_action_type(sa) ==
709 RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL) {
710 if (cops[j]->status) {
715 pkts[nb_pkts++] = pkt;
724 ipsec_inbound(struct ipsec_ctx *ctx, struct rte_mbuf *pkts[],
725 uint16_t nb_pkts, uint16_t len)
729 inbound_sa_lookup(ctx->sa_ctx, pkts, sas, nb_pkts);
731 ipsec_enqueue(esp_inbound, ctx, pkts, sas, nb_pkts);
733 return ipsec_inline_dequeue(esp_inbound_post, ctx, pkts, len);
737 ipsec_inbound_cqp_dequeue(struct ipsec_ctx *ctx, struct rte_mbuf *pkts[],
740 return ipsec_dequeue(esp_inbound_post, ctx, pkts, len);
744 ipsec_outbound(struct ipsec_ctx *ctx, struct rte_mbuf *pkts[],
745 uint32_t sa_idx[], uint16_t nb_pkts, uint16_t len)
749 outbound_sa_lookup(ctx->sa_ctx, sa_idx, sas, nb_pkts);
751 ipsec_enqueue(esp_outbound, ctx, pkts, sas, nb_pkts);
753 return ipsec_inline_dequeue(esp_outbound_post, ctx, pkts, len);
757 ipsec_outbound_cqp_dequeue(struct ipsec_ctx *ctx, struct rte_mbuf *pkts[],
760 return ipsec_dequeue(esp_outbound_post, ctx, pkts, len);