* for group of ESP inbound packets perform SQN check and update. */
| 692 | * for group of ESP inbound packets perform SQN check and update. |
| 693 | */ |
| 694 | static inline uint16_t |
| 695 | esp_inb_rsn_update(struct rte_ipsec_sa *sa, const uint32_t sqn[], |
| 696 | uint32_t dr[], uint16_t num) |
| 697 | { |
| 698 | uint32_t i, k; |
| 699 | struct replay_sqn *rsn; |
| 700 | |
| 701 | /* replay not enabled */ |
| 702 | if (sa->replay.win_sz == 0) |
| 703 | return num; |
| 704 | |
| 705 | rsn = rsn_update_start(sa); |
| 706 | |
| 707 | k = 0; |
| 708 | for (i = 0; i != num; i++) { |
| 709 | if (esn_inb_update_sqn(rsn, sa, rte_be_to_cpu_32(sqn[i])) == 0) |
| 710 | k++; |
| 711 | else |
| 712 | dr[i - k] = i; |
| 713 | } |
| 714 | |
| 715 | rsn_update_finish(sa, rsn); |
| 716 | return k; |
| 717 | } |
| 718 | |
| 719 | /* |
| 720 | * process group of ESP inbound packets. |
no test coverage detected