| 623 | } |
| 624 | |
| 625 | static void |
| 626 | l2fwd_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 */ |
| 654 | static void |
no test coverage detected