#include <lib_arp.h>
#include "l2_proto.h"
#include "interface.h"
+#include "version.h"
#include "l3fwd_common.h"
#include "l3fwd_lpm4.h"
#include "l3fwd_lpm6.h"
" [--enable-jumbo [--max-pkt-len PKTLEN]]\n"
" -p PORTMASK: hexadecimal bitmask of ports to configure\n"
" -P : enable promiscuous mode\n"
+ " -v version: display app version\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"
#define CMD_LINE_OPT_NO_HW_CSUM "no-hw-csum"
#define CMD_LINE_OPT_IPV6 "ipv6"
#define CMD_LINE_OPT_ENABLE_JUMBO "enable-jumbo"
+#define CMD_LINE_OPT_VERSION "version"
#define CMD_LINE_OPT_HASH_ENTRY_NUM "hash-entry-num"
/* Parse the argument given in the command line of the application */
{
int opt, ret;
char **argvopt;
- int option_index;
+ int option_index, v_present = 0;
char *prgname = argv[0];
static struct option lgopts[] = {
{CMD_LINE_OPT_CONFIG, 1, 0, 0},
{CMD_LINE_OPT_NO_HW_CSUM, 0, 0, 0},
{CMD_LINE_OPT_IPV6, 0, 0, 0},
{CMD_LINE_OPT_ENABLE_JUMBO, 0, 0, 0},
+ {CMD_LINE_OPT_VERSION, 0, 0, 0},
{CMD_LINE_OPT_HASH_ENTRY_NUM, 1, 0, 0},
{NULL, 0, 0, 0}
};
argvopt = argv;
- while ((opt = getopt_long(argc, argvopt, "s:p:P",
+ while ((opt = getopt_long(argc, argvopt, "v:s:p:P",
lgopts, &option_index)) != EOF) {
switch (opt) {
}
#endif
+ if (!strncmp(lgopts[option_index].name, CMD_LINE_OPT_VERSION,
+ sizeof (CMD_LINE_OPT_VERSION))) {
+ if (v_present)
+ rte_panic("Error: VERSION is provided more than once\n");
+ v_present = 1;
+ printf("Version: %s\n", VERSION_STR);
+ exit(0);
+ }
+
if (!strncmp(lgopts[option_index].name, CMD_LINE_OPT_ENABLE_JUMBO,
sizeof (CMD_LINE_OPT_ENABLE_JUMBO))) {
struct option lenopts = {"max-pkt-len", required_argument, 0, 0};
uint32_t size;
struct pipeline_params *params;
+ /* parse application arguments (after the EAL ones) */
+ ret = parse_args(argc, argv);
+ if (ret < 0)
+ rte_exit(EXIT_FAILURE, "Invalid UDP_Replay parameters\n");
+
/* init EAL */
ret = rte_eal_init(argc, argv);
if (ret < 0)
argc -= ret;
argv += ret;
timer_lcore = rte_lcore_id();
- /* parse application arguments (after the EAL ones) */
- ret = parse_args(argc, argv);
- if (ret < 0)
- rte_exit(EXIT_FAILURE, "Invalid UDP_Replay parameters\n");
if (check_lcore_params() < 0)
rte_exit(EXIT_FAILURE, "check_lcore_params failed\n");