net/ngbe: fix debug logs
[dpdk.git] / examples / l2fwd-crypto / main.c
index f128e64..bbdb263 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;
@@ -216,12 +215,11 @@ struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE];
 
 static struct rte_eth_conf port_conf = {
        .rxmode = {
-               .mq_mode = ETH_MQ_RX_NONE,
-               .max_rx_pkt_len = RTE_ETHER_MAX_LEN,
+               .mq_mode = RTE_ETH_MQ_RX_NONE,
                .split_hdr_size = 0,
        },
        .txmode = {
-               .mq_mode = ETH_MQ_TX_NONE,
+               .mq_mode = RTE_ETH_MQ_TX_NONE,
        },
 };
 
@@ -617,11 +615,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 +1267,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;
@@ -1809,7 +1807,7 @@ check_all_ports_link_status(uint32_t port_mask)
                                continue;
                        }
                        /* clear all_ports_up flag if any link down */
-                       if (link.link_status == ETH_LINK_DOWN) {
+                       if (link.link_status == RTE_ETH_LINK_DOWN) {
                                all_ports_up = 0;
                                break;
                        }
@@ -2220,6 +2218,11 @@ check_capabilities(struct l2fwd_crypto_options *options, uint8_t cdev_id)
                                                RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_4096_BYTES))
                                                ret = -1;
                                        break;
+                               case 1048576:
+                                       if (!(cap->sym.cipher.dataunit_set &
+                                               RTE_CRYPTO_CIPHER_DATA_UNIT_LEN_1_MEGABYTES))
+                                               ret = -1;
+                                       break;
                                default:
                                        ret = -1;
                                }
@@ -2633,9 +2636,9 @@ initialize_ports(struct l2fwd_crypto_options *options)
                        return retval;
                }
 
-               if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
+               if (dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE)
                        local_port_conf.txmode.offloads |=
-                               DEV_TX_OFFLOAD_MBUF_FAST_FREE;
+                               RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE;
                retval = rte_eth_dev_configure(portid, 1, 1, &local_port_conf);
                if (retval < 0) {
                        printf("Cannot configure device: err=%d, port=%u\n",
@@ -2702,13 +2705,8 @@ initialize_ports(struct l2fwd_crypto_options *options)
                }
 
                printf("Port %u, MAC address: " RTE_ETHER_ADDR_PRT_FMT "\n\n",
-                               portid,
-                               l2fwd_ports_eth_addr[portid].addr_bytes[0],
-                               l2fwd_ports_eth_addr[portid].addr_bytes[1],
-                               l2fwd_ports_eth_addr[portid].addr_bytes[2],
-                               l2fwd_ports_eth_addr[portid].addr_bytes[3],
-                               l2fwd_ports_eth_addr[portid].addr_bytes[4],
-                               l2fwd_ports_eth_addr[portid].addr_bytes[5]);
+                       portid,
+                       RTE_ETHER_ADDR_BYTES(&l2fwd_ports_eth_addr[portid]));
 
                /* initialize port stats */
                memset(&port_statistics, 0, sizeof(port_statistics));
@@ -2721,7 +2719,7 @@ initialize_ports(struct l2fwd_crypto_options *options)
                        last_portid = portid;
                }
 
-               l2fwd_enabled_port_mask |= (1 << portid);
+               l2fwd_enabled_port_mask |= (1ULL << portid);
                enabled_portcount++;
        }