aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorKonstantin Ananyev <konstantin.ananyev@intel.com>2017-07-27 12:00:57 +0100
committerKonstantin Ananyev <konstantin.ananyev@intel.com>2017-07-27 20:24:53 +0100
commit7e18fa1bf263822c46d7431a911b41d6377d5f69 (patch)
treeddf5ce05545419d6d77bb9d8b3c48fc90d221a7a /examples
parente151ee29d02d7802fab9e32b50ced54fd8d64160 (diff)
- Introduce tle_tcp_stream_readv() and tle_tcp_stream_writev().
- Introduce flags for tle_ctx_param. - Introduce TLE_CTX_FLAG_ST - indicates that given ctx will be used by single thread only. - Introduce new parameters for tcp context: timewait - allows user to configure max timeout in TCP_TIMEWAIT state. icw - allows user to specify desired initial congestion window for new connections. -Few optimisations: cache tx.ol_flags inside tle destination. calcualte and cache inside ctx cycles_to_ms shift value. reorder restoring SYN opts and filling TCB a bit. Change-Id: Ie05087783b3b7f1e4ce99d3555bc5bd098f83fe0 Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Signed-off-by: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/l4fwd/main.c3
-rw-r--r--examples/l4fwd/parse.c42
2 files changed, 39 insertions, 6 deletions
diff --git a/examples/l4fwd/main.c b/examples/l4fwd/main.c
index 7613a95..c43b8d7 100644
--- a/examples/l4fwd/main.c
+++ b/examples/l4fwd/main.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016 Intel Corporation.
+ * Copyright (c) 2016-2017 Intel Corporation.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
@@ -209,6 +209,7 @@ main(int argc, char *argv[])
__func__, rc);
memset(&ctx_prm, 0, sizeof(ctx_prm));
+ ctx_prm.timewait = TLE_TCP_TIMEWAIT_DEFAULT;
signal(SIGINT, sig_handle);
diff --git a/examples/l4fwd/parse.c b/examples/l4fwd/parse.c
index 158b2cb..97cf20d 100644
--- a/examples/l4fwd/parse.c
+++ b/examples/l4fwd/parse.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2016 Intel Corporation.
+ * Copyright (c) 2016-2017 Intel Corporation.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
@@ -38,6 +38,9 @@ static const struct {
#define OPT_SHORT_SBULK 'B'
#define OPT_LONG_SBULK "sburst"
+#define OPT_SHORT_CTXFLAGS 'C'
+#define OPT_LONG_CTXFLAGS "ctxflags"
+
#define OPT_SHORT_PROMISC 'P'
#define OPT_LONG_PROMISC "promisc"
@@ -74,9 +77,16 @@ static const struct {
#define OPT_SHORT_VERBOSE 'v'
#define OPT_LONG_VERBOSE "verbose"
+#define OPT_SHORT_WINDOW 'w'
+#define OPT_LONG_WINDOW "initial-window"
+
+#define OPT_SHORT_TIMEWAIT 'W'
+#define OPT_LONG_TIMEWAIT "timewait"
+
static const struct option long_opt[] = {
{OPT_LONG_ARP, 1, 0, OPT_SHORT_ARP},
{OPT_LONG_SBULK, 1, 0, OPT_SHORT_SBULK},
+ {OPT_LONG_CTXFLAGS, 1, 0, OPT_SHORT_CTXFLAGS},
{OPT_LONG_PROMISC, 0, 0, OPT_SHORT_PROMISC},
{OPT_LONG_RBUFS, 1, 0, OPT_SHORT_RBUFS},
{OPT_LONG_SBUFS, 1, 0, OPT_SHORT_SBUFS},
@@ -89,6 +99,8 @@ static const struct option long_opt[] = {
{OPT_LONG_SEC_KEY, 1, 0, OPT_SHORT_SEC_KEY},
{OPT_LONG_LISTEN, 0, 0, OPT_SHORT_LISTEN},
{OPT_LONG_VERBOSE, 1, 0, OPT_SHORT_VERBOSE},
+ {OPT_LONG_WINDOW, 1, 0, OPT_SHORT_WINDOW},
+ {OPT_LONG_TIMEWAIT, 1, 0, OPT_SHORT_TIMEWAIT},
{NULL, 0, 0, 0}
};
@@ -760,7 +772,7 @@ parse_app_options(int argc, char **argv, struct netbe_cfg *cfg,
optind = 0;
optarg = NULL;
- while ((opt = getopt_long(argc, argv, "aB:LPR:S:TUb:f:s:v:H:K:",
+ while ((opt = getopt_long(argc, argv, "aB:C:LPR:S:TUb:f:s:v:H:K:W:w:",
long_opt, &opt_idx)) != EOF) {
if (opt == OPT_SHORT_ARP) {
cfg->arp = 1;
@@ -771,6 +783,14 @@ parse_app_options(int argc, char **argv, struct netbe_cfg *cfg,
"for option: \'%c\'\n",
__func__, optarg, opt);
ctx_prm->send_bulk_size = v;
+ } else if (opt == OPT_SHORT_CTXFLAGS) {
+ rc = parse_uint_val(NULL, optarg, &v);
+ if (rc < 0)
+ rte_exit(EXIT_FAILURE, "%s: invalid value: %s "
+ "for option: \'%c\'\n",
+ __func__, optarg, opt);
+ ctx_prm->flags = v;
+ } else if (opt == OPT_SHORT_PROMISC) {
} else if (opt == OPT_SHORT_PROMISC) {
cfg->promisc = 1;
} else if (opt == OPT_SHORT_RBUFS) {
@@ -835,9 +855,21 @@ parse_app_options(int argc, char **argv, struct netbe_cfg *cfg,
}
memcpy(&ctx_prm->secret_key, optarg,
sizeof(ctx_prm->secret_key));
- }
-
- else {
+ } else if (opt == OPT_SHORT_WINDOW) {
+ rc = parse_uint_val(NULL, optarg, &v);
+ if (rc < 0)
+ rte_exit(EXIT_FAILURE, "%s: invalid value: %s "
+ "for option: \'%c\'\n",
+ __func__, optarg, opt);
+ ctx_prm->icw = v;
+ } else if (opt == OPT_SHORT_TIMEWAIT) {
+ rc = parse_uint_val(NULL, optarg, &v);
+ if (rc < 0)
+ rte_exit(EXIT_FAILURE, "%s: invalid value: %s "
+ "for option: \'%c\'\n",
+ __func__, optarg, opt);
+ ctx_prm->timewait = v;
+ } else {
rte_exit(EXIT_FAILURE,
"%s: unknown option: \'%c\'\n",
__func__, opt);