app/crypto-perf: support lookaside IPsec
[dpdk.git] / examples / l2fwd-crypto / main.c
index 66d1491..256a29b 100644 (file)
@@ -20,7 +20,6 @@
 #include <unistd.h>
 
 #include <rte_string_fns.h>
-#include <rte_atomic.h>
 #include <rte_branch_prediction.h>
 #include <rte_common.h>
 #include <rte_cryptodev.h>
@@ -182,7 +181,7 @@ struct l2fwd_crypto_params {
        unsigned digest_length;
        unsigned block_size;
 
-       uint16_t cipher_dataunit_len;
+       uint32_t cipher_dataunit_len;
 
        struct l2fwd_iv cipher_iv;
        struct l2fwd_iv auth_iv;
@@ -617,11 +616,11 @@ l2fwd_mac_updating(struct rte_mbuf *m, uint16_t dest_portid)
        eth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
 
        /* 02:00:00:00:00:xx */
-       tmp = &eth->d_addr.addr_bytes[0];
+       tmp = &eth->dst_addr.addr_bytes[0];
        *((uint64_t *)tmp) = 0x000000000002 + ((uint64_t)dest_portid << 40);
 
        /* src addr */
-       rte_ether_addr_copy(&l2fwd_ports_eth_addr[dest_portid], &eth->s_addr);
+       rte_ether_addr_copy(&l2fwd_ports_eth_addr[dest_portid], &eth->src_addr);
 }
 
 static void
@@ -1269,9 +1268,9 @@ l2fwd_crypto_parse_args_long_options(struct l2fwd_crypto_options *options,
 
        else if (strcmp(lgopts[option_index].name, "cipher_dataunit_len") == 0) {
                retval = parse_size(&val, optarg);
-               if (retval == 0 && val >= 0 && val <= UINT16_MAX) {
+               if (retval == 0 && val >= 0) {
                        options->cipher_xform.cipher.dataunit_len =
-                                                               (uint16_t)val;
+                                                               (uint32_t)val;
                        return 0;
                } else
                        return -1;