* helper function, init SA replay structure. */
| 510 | * helper function, init SA replay structure. |
| 511 | */ |
| 512 | static void |
| 513 | fill_sa_replay(struct rte_ipsec_sa *sa, uint32_t wnd_sz, uint32_t nb_bucket, |
| 514 | uint64_t sqn) |
| 515 | { |
| 516 | sa->replay.win_sz = wnd_sz; |
| 517 | sa->replay.nb_bucket = nb_bucket; |
| 518 | sa->replay.bucket_index_mask = nb_bucket - 1; |
| 519 | sa->sqn.inb.rsn[0] = (struct replay_sqn *)(sa + 1); |
| 520 | sa->sqn.inb.rsn[0]->sqn = sqn; |
| 521 | if ((sa->type & RTE_IPSEC_SATP_SQN_MASK) == RTE_IPSEC_SATP_SQN_ATOM) { |
| 522 | sa->sqn.inb.rsn[1] = (struct replay_sqn *) |
| 523 | ((uintptr_t)sa->sqn.inb.rsn[0] + rsn_size(nb_bucket)); |
| 524 | sa->sqn.inb.rsn[1]->sqn = sqn; |
| 525 | } |
| 526 | } |
| 527 | |
| 528 | int |
| 529 | rte_ipsec_sa_size(const struct rte_ipsec_sa_prm *prm) |
no test coverage detected