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

Function l2fwd_simple_forward

dpdk/examples/l2fwd-crypto/main.c:625–651  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

623}
624
625static void
626l2fwd_simple_forward(struct rte_mbuf *m, uint16_t portid,
627 struct l2fwd_crypto_options *options)
628{
629 uint16_t dst_port;
630 uint32_t pad_len;
631 struct rte_ipv4_hdr *ip_hdr;
632 uint32_t ipdata_offset = sizeof(struct rte_ether_hdr);
633
634 ip_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(m, char *) +
635 ipdata_offset);
636 dst_port = l2fwd_dst_ports[portid];
637
638 if (options->mac_updating)
639 l2fwd_mac_updating(m, dst_port);
640
641 if (options->auth_xform.auth.op == RTE_CRYPTO_AUTH_OP_VERIFY)
642 rte_pktmbuf_trim(m, options->auth_xform.auth.digest_length);
643
644 if (options->cipher_xform.cipher.op == RTE_CRYPTO_CIPHER_OP_DECRYPT) {
645 pad_len = m->pkt_len - rte_be_to_cpu_16(ip_hdr->total_length) -
646 ipdata_offset;
647 rte_pktmbuf_trim(m, pad_len);
648 }
649
650 l2fwd_send_packet(m, dst_port);
651}
652
653/** Generate random key */
654static void

Callers 1

l2fwd_main_loopFunction · 0.70

Calls 3

rte_pktmbuf_trimFunction · 0.85
l2fwd_send_packetFunction · 0.85
l2fwd_mac_updatingFunction · 0.70

Tested by

no test coverage detected