Code Review
/
samplevnf.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix source mac address when applying imix
[samplevnf.git]
/
VNFs
/
UDP_Replay
/
main.c
diff --git
a/VNFs/UDP_Replay/main.c
b/VNFs/UDP_Replay/main.c
index
587057f
..
6537032
100644
(file)
--- a/
VNFs/UDP_Replay/main.c
+++ b/
VNFs/UDP_Replay/main.c
@@
-83,11
+83,10
@@
performance of the solution should be sufficient for testing the UDP NAT perform
#include <rte_errno.h>
#include <rte_cfgfile.h>
#include <rte_errno.h>
#include <rte_cfgfile.h>
-#include "parse_obj_list.h"
-
#include <lib_arp.h>
#include "l2_proto.h"
#include "interface.h"
#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"
#include "l3fwd_common.h"
#include "l3fwd_lpm4.h"
#include "l3fwd_lpm6.h"
@@
-1993,6
+1992,7
@@
main_loop(__attribute__((unused)) void *dummy)
#endif /* ENABLE_MULTI_BUFFER_OPTIMIZE */
}
}
#endif /* ENABLE_MULTI_BUFFER_OPTIMIZE */
}
}
+ return 0;
}
/* display usage */
}
/* display usage */
@@
-2120,6
+2120,7
@@
print_usage(const char *prgname)
" [--enable-jumbo [--max-pkt-len PKTLEN]]\n"
" -p PORTMASK: hexadecimal bitmask of ports to configure\n"
" -P : enable promiscuous mode\n"
" [--enable-jumbo [--max-pkt-len PKTLEN]]\n"
" -p PORTMASK: hexadecimal bitmask of ports to configure\n"
" -P : enable promiscuous mode\n"
+ " --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"
" --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"
@@
-2293,6
+2294,7
@@
parse_eth_dest(const char *optarg)
#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_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 */
#define CMD_LINE_OPT_HASH_ENTRY_NUM "hash-entry-num"
/* Parse the argument given in the command line of the application */
@@
-2301,7
+2303,7
@@
parse_args(int argc, char **argv)
{
int opt, ret;
char **argvopt;
{
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},
char *prgname = argv[0];
static struct option lgopts[] = {
{CMD_LINE_OPT_CONFIG, 1, 0, 0},
@@
-2310,6
+2312,7
@@
parse_args(int argc, char **argv)
{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_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}
};
{CMD_LINE_OPT_HASH_ENTRY_NUM, 1, 0, 0},
{NULL, 0, 0, 0}
};
@@
-2377,6
+2380,15
@@
parse_args(int argc, char **argv)
}
#endif
}
#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};
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};
@@
-2744,6
+2756,7
@@
main(int argc, char **argv)
uint32_t size;
struct pipeline_params *params;
uint32_t size;
struct pipeline_params *params;
+ /* parse application arguments (after the EAL ones) */
/* init EAL */
ret = rte_eal_init(argc, argv);
if (ret < 0)
/* init EAL */
ret = rte_eal_init(argc, argv);
if (ret < 0)
@@
-2751,7
+2764,7
@@
main(int argc, char **argv)
argc -= ret;
argv += ret;
timer_lcore = rte_lcore_id();
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");
ret = parse_args(argc, argv);
if (ret < 0)
rte_exit(EXIT_FAILURE, "Invalid UDP_Replay parameters\n");