MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pkt_flag_process

Function pkt_flag_process

dpdk/lib/ipsec/sa.c:653–684  ·  view source on GitHub ↗

* simplest pkt process routine: * all actual processing is already done by HW/PMD, * just check mbuf ol_flags. * used for: * - inbound for RTE_SECURITY_ACTION_TYPE_INLINE_PROTOCOL * - inbound/outbound for RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL * - outbound for RTE_SECURITY_ACTION_TYPE_NONE when ESN is disabled */

Source from the content-addressed store, hash-verified

651 * - outbound for RTE_SECURITY_ACTION_TYPE_NONE when ESN is disabled
652 */
653uint16_t
654pkt_flag_process(const struct rte_ipsec_session *ss,
655 struct rte_mbuf *mb[], uint16_t num)
656{
657 uint32_t i, k, bytes;
658 uint32_t dr[num];
659
660 RTE_SET_USED(ss);
661
662 k = 0;
663 bytes = 0;
664 for (i = 0; i != num; i++) {
665 if ((mb[i]->ol_flags & RTE_MBUF_F_RX_SEC_OFFLOAD_FAILED) == 0) {
666 k++;
667 bytes += mb[i]->pkt_len;
668 }
669 else
670 dr[i - k] = i;
671 }
672
673 ss->sa->statistics.count += k;
674 ss->sa->statistics.bytes += bytes;
675
676 /* handle unprocessed mbufs */
677 if (k != num) {
678 rte_errno = EBADMSG;
679 if (k != 0)
680 move_bad_mbufs(mb, dr, num, num - k);
681 }
682
683 return k;
684}
685
686/*
687 * Select packet processing function for session on LOOKASIDE_NONE

Callers

nothing calls this directly

Calls 1

move_bad_mbufsFunction · 0.85

Tested by

no test coverage detected