net/qede/base: support to initiate PF FLR
[dpdk.git] / examples / l3fwd / main.c
index e10dab9..7223e77 100644 (file)
@@ -66,7 +66,6 @@
 #include <rte_debug.h>
 #include <rte_ether.h>
 #include <rte_ethdev.h>
-#include <rte_ring.h>
 #include <rte_mempool.h>
 #include <rte_mbuf.h>
 #include <rte_ip.h>
@@ -311,20 +310,32 @@ init_lcore_rx_queues(void)
 static void
 print_usage(const char *prgname)
 {
-       printf ("%s [EAL options] -- -p PORTMASK -P"
-               "  [--config (port,queue,lcore)[,(port,queue,lcore]]"
-               "  [--enable-jumbo [--max-pkt-len PKTLEN]]\n"
-               "  -p PORTMASK: hexadecimal bitmask of ports to configure\n"
-               "  -P : enable promiscuous mode\n"
-               "  -E : enable exact match\n"
-               "  -L : enable longest prefix match\n"
-               "  --config (port,queue,lcore): rx queues configuration\n"
-               "  --eth-dest=X,MM:MM:MM:MM:MM:MM: optional, ethernet destination for port X\n"
-               "  --no-numa: optional, disable numa awareness\n"
-               "  --ipv6: optional, specify it if running ipv6 packets\n"
-               "  --enable-jumbo: enable jumbo frame"
-               " which max packet len is PKTLEN in decimal (64-9600)\n"
-               "  --hash-entry-num: specify the hash entry number in hexadecimal to be setup\n",
+       printf("%s [EAL options] --"
+               " -p PORTMASK"
+               " [-P]"
+               " [-E]"
+               " [-L]"
+               " --config (port,queue,lcore)[,(port,queue,lcore)]"
+               " [--eth-dest=X,MM:MM:MM:MM:MM:MM]"
+               " [--enable-jumbo [--max-pkt-len PKTLEN]]"
+               " [--no-numa]"
+               " [--hash-entry-num]"
+               " [--ipv6]"
+               " [--parse-ptype]\n\n"
+
+               "  -p PORTMASK: Hexadecimal bitmask of ports to configure\n"
+               "  -P : Enable promiscuous mode\n"
+               "  -E : Enable exact match\n"
+               "  -L : Enable longest prefix match (default)\n"
+               "  --config (port,queue,lcore): Rx queue configuration\n"
+               "  --eth-dest=X,MM:MM:MM:MM:MM:MM: Ethernet destination for port X\n"
+               "  --enable-jumbo: Enable jumbo frames\n"
+               "  --max-pkt-len: Under the premise of enabling jumbo,\n"
+               "                 maximum packet length in decimal (64-9600)\n"
+               "  --no-numa: Disable numa awareness\n"
+               "  --hash-entry-num: Specify the hash entry number in hexadecimal to be setup\n"
+               "  --ipv6: Set if running ipv6 packets\n"
+               "  --parse-ptype: Set to use software to analyze packet type\n\n",
                prgname);
 }
 
@@ -769,7 +780,7 @@ check_all_ports_link_status(uint8_t port_num, uint32_t port_mask)
                                continue;
                        }
                        /* clear all_ports_up flag if any link down */
-                       if (link.link_status == 0) {
+                       if (link.link_status == ETH_LINK_DOWN) {
                                all_ports_up = 0;
                                break;
                        }
@@ -836,7 +847,6 @@ main(int argc, char **argv)
        unsigned lcore_id;
        uint32_t n_tx_queue, nb_lcores;
        uint8_t portid, nb_rx_queue, queue, socketid;
-       uint8_t nb_tx_port;
 
        /* init EAL */
        ret = rte_eal_init(argc, argv);
@@ -869,14 +879,11 @@ main(int argc, char **argv)
                rte_exit(EXIT_FAILURE, "init_lcore_rx_queues failed\n");
 
        nb_ports = rte_eth_dev_count();
-       if (nb_ports > RTE_MAX_ETHPORTS)
-               nb_ports = RTE_MAX_ETHPORTS;
 
        if (check_port_config(nb_ports) < 0)
                rte_exit(EXIT_FAILURE, "check_port_config failed\n");
 
        nb_lcores = rte_lcore_count();
-       nb_tx_port = 0;
 
        /* Setup function pointers for lookup method. */
        setup_l3fwd_lookup_tables();
@@ -954,12 +961,10 @@ main(int argc, char **argv)
                        qconf->tx_queue_id[portid] = queueid;
                        queueid++;
 
-                       qconf->n_tx_port = nb_tx_port;
                        qconf->tx_port_id[qconf->n_tx_port] = portid;
+                       qconf->n_tx_port++;
                }
                printf("\n");
-
-               nb_tx_port++;
        }
 
        for (lcore_id = 0; lcore_id < RTE_MAX_LCORE; lcore_id++) {