* process group of ESP inbound packets. */
| 720 | * process group of ESP inbound packets. |
| 721 | */ |
| 722 | static inline uint16_t |
| 723 | esp_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 |
no test coverage detected