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

Function esp_inb_pkt_prepare

dpdk/lib/ipsec/esp_inb.c:363–401  ·  view source on GitHub ↗

* setup/update packets and crypto ops for ESP inbound case. */

Source from the content-addressed store, hash-verified

361 * setup/update packets and crypto ops for ESP inbound case.
362 */
363uint16_t
364esp_inb_pkt_prepare(const struct rte_ipsec_session *ss, struct rte_mbuf *mb[],
365 struct rte_crypto_op *cop[], uint16_t num)
366{
367 int32_t rc;
368 uint32_t i, k, hl;
369 struct rte_ipsec_sa *sa;
370 struct rte_cryptodev_sym_session *cs;
371 struct replay_sqn *rsn;
372 union sym_op_data icv;
373 uint32_t dr[num];
374
375 sa = ss->sa;
376 cs = ss->crypto.ses;
377 rsn = rsn_acquire(sa);
378
379 k = 0;
380 for (i = 0; i != num; i++) {
381
382 hl = mb[i]->l2_len + mb[i]->l3_len;
383 rc = inb_pkt_prepare(sa, rsn, mb[i], hl, &icv);
384 if (rc >= 0) {
385 lksd_none_cop_prepare(cop[k], cs, mb[i]);
386 inb_cop_prepare(cop[k], sa, mb[i], &icv, hl, rc);
387 k++;
388 } else {
389 dr[i - k] = i;
390 rte_errno = -rc;
391 }
392 }
393
394 rsn_release(sa, rsn);
395
396 /* copy not prepared mbufs beyond good ones */
397 if (k != num && k != 0)
398 move_bad_mbufs(mb, dr, num, num - k);
399
400 return k;
401}
402
403/*
404 * Start with processing inbound packet.

Callers

nothing calls this directly

Calls 6

rsn_acquireFunction · 0.85
inb_pkt_prepareFunction · 0.85
lksd_none_cop_prepareFunction · 0.85
inb_cop_prepareFunction · 0.85
rsn_releaseFunction · 0.85
move_bad_mbufsFunction · 0.85

Tested by

no test coverage detected