DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rasesh Mody <rasesh.mody@cavium.com>
To: dev@dpdk.org
Cc: Harish Patil <harish.patil@cavium.com>, Dept-EngDPDKDev@cavium.com
Subject: [dpdk-dev] [PATCH 2/5] examples/kni: add optional parameter to enable LRO
Date: Fri, 24 Nov 2017 12:35:42 -0800	[thread overview]
Message-ID: <1511555745-13793-3-git-send-email-rasesh.mody@cavium.com> (raw)
In-Reply-To: <1511555745-13793-1-git-send-email-rasesh.mody@cavium.com>

From: Harish Patil <harish.patil@cavium.com>

Add an optional cmdline parameter to enable LRO. This is useful to test
LRO feature by being able to run linux utils like iperf over KNI interface
which generates consistent packet aggregations.

Signed-off-by: Harish Patil <harish.patil@cavium.com>
---
 examples/kni/main.c |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/examples/kni/main.c b/examples/kni/main.c
index 3f17385..1cedaff 100644
--- a/examples/kni/main.c
+++ b/examples/kni/main.c
@@ -143,6 +143,9 @@ struct kni_port_params {
 /* Ports set in promiscuous mode off by default. */
 static int promiscuous_on = 0;
 
+/* Enable LRO offload, off by default. */
+static int enable_lro = 0;
+
 /* Structure type for recording kni interface specific stats */
 struct kni_interface_stats {
 	/* number of pkts received from NIC, and sent to KNI */
@@ -360,11 +363,12 @@ struct kni_interface_stats {
 static void
 print_usage(const char *prgname)
 {
-	RTE_LOG(INFO, APP, "\nUsage: %s [EAL options] -- -p PORTMASK -P "
+	RTE_LOG(INFO, APP, "\nUsage: %s [EAL options] -- -p PORTMASK -P -l "
 		   "[--config (port,lcore_rx,lcore_tx,lcore_kthread...)"
 		   "[,(port,lcore_rx,lcore_tx,lcore_kthread...)]]\n"
 		   "    -p PORTMASK: hex bitmask of ports to use\n"
 		   "    -P : enable promiscuous mode\n"
+		   "    -l : enable LRO\n"
 		   "    --config (port,lcore_rx,lcore_tx,lcore_kthread...): "
 		   "port and lcore configurations\n",
 	           prgname);
@@ -545,7 +549,7 @@ struct kni_interface_stats {
 	opterr = 0;
 
 	/* Parse command line */
-	while ((opt = getopt_long(argc, argv, "p:P", longopts,
+	while ((opt = getopt_long(argc, argv, "p:Pl", longopts,
 						&longindex)) != EOF) {
 		switch (opt) {
 		case 'p':
@@ -554,6 +558,9 @@ struct kni_interface_stats {
 		case 'P':
 			promiscuous_on = 1;
 			break;
+		case 'l':
+			enable_lro = 1;
+			break;
 		case 0:
 			if (!strncmp(longopts[longindex].name,
 				     CMDLINE_OPT_CONFIG,
@@ -611,6 +618,10 @@ struct kni_interface_stats {
 	/* Initialise device and RX/TX queues */
 	RTE_LOG(INFO, APP, "Initialising port %u ...\n", (unsigned)port);
 	fflush(stdout);
+
+	if (enable_lro)
+		port_conf.rxmode.enable_lro = 1;
+
 	ret = rte_eth_dev_configure(port, 1, 1, &port_conf);
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "Could not configure port%u (%d)\n",
-- 
1.7.10.3

  parent reply	other threads:[~2017-11-24 20:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-24 20:35 [dpdk-dev] [PATCH 0/5] net/qede: add enhancements and fixes Rasesh Mody
2017-11-24 20:35 ` [dpdk-dev] [PATCH 1/5] net/qede: fix to enable LRO over tunnels Rasesh Mody
2017-11-24 20:35 ` Rasesh Mody [this message]
2017-12-04 23:25   ` [dpdk-dev] [PATCH 2/5] examples/kni: add optional parameter to enable LRO Ferruh Yigit
2017-12-05  6:05     ` Shahaf Shuler
2017-12-05 19:43       ` Patil, Harish
2017-12-05 19:42     ` Patil, Harish
2017-11-24 20:35 ` [dpdk-dev] [PATCH 3/5] net/qede: fix to reject config with no Rx queue Rasesh Mody
2017-11-24 20:35 ` [dpdk-dev] [PATCH 4/5] app/testpmd: add configuration for udp port tunnel type Rasesh Mody
2017-12-07  0:38   ` Ferruh Yigit
2017-12-07 18:18     ` Shaikh, Shahed
2017-11-24 20:35 ` [dpdk-dev] [PATCH 5/5] net/qede: add support for GENEVE tunneling offload Rasesh Mody
2017-12-14  6:36 ` [dpdk-dev] [PATCH v2 0/3] net/qede: add enhancements and fixes Rasesh Mody
2017-12-15 21:05   ` Ferruh Yigit
2017-12-14  6:36 ` [dpdk-dev] [PATCH v2 1/3] net/qede: fix to enable LRO over tunnels Rasesh Mody
2017-12-14  6:36 ` [dpdk-dev] [PATCH v2 2/3] net/qede: fix to reject config with no Rx queue Rasesh Mody
2017-12-14  6:36 ` [dpdk-dev] [PATCH v2 3/3] net/qede: add support for GENEVE tunneling offload Rasesh Mody
2017-12-15 21:01   ` Ferruh Yigit
2017-12-15 21:12     ` Mody, Rasesh
2017-12-16  0:19       ` Ferruh Yigit
2017-12-16  0:42         ` Mody, Rasesh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1511555745-13793-3-git-send-email-rasesh.mody@cavium.com \
    --to=rasesh.mody@cavium.com \
    --cc=Dept-EngDPDKDev@cavium.com \
    --cc=dev@dpdk.org \
    --cc=harish.patil@cavium.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).