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

Function esp_inb_pkt_process

dpdk/lib/ipsec/esp_inb.c:722–748  ·  view source on GitHub ↗

* process group of ESP inbound packets. */

Source from the content-addressed store, hash-verified

720 * process group of ESP inbound packets.
721 */
722static inline uint16_t
723esp_inb_pkt_process(struct rte_ipsec_sa *sa, struct rte_mbuf *mb[],
724 uint16_t num, uint8_t sqh_len, esp_inb_process_t process)
725{
726 uint32_t k, n;
727 uint32_t sqn[num];
728 uint32_t dr[num];
729
730 /* process packets, extract seq numbers */
731 k = process(sa, mb, sqn, dr, num, sqh_len);
732
733 /* handle unprocessed mbufs */
734 if (k != num && k != 0)
735 move_bad_mbufs(mb, dr, num, num - k);
736
737 /* update SQN and replay window */
738 n = esp_inb_rsn_update(sa, sqn, dr, k);
739
740 /* handle mbufs with wrong SQN */
741 if (n != k && n != 0)
742 move_bad_mbufs(mb, dr, k, k - n);
743
744 if (n != num)
745 rte_errno = EBADMSG;
746
747 return n;
748}
749
750/*
751 * Prepare (plus actual crypto/auth) routine for inbound CPU-CRYPTO

Callers 4

esp_inb_tun_pkt_processFunction · 0.85
esp_inb_trs_pkt_processFunction · 0.85

Calls 3

move_bad_mbufsFunction · 0.85
esp_inb_rsn_updateFunction · 0.85
processFunction · 0.50

Tested by

no test coverage detected