[dpdk-dev,2/5] examples/kni: add optional parameter to enable LRO

Message ID 1511555745-13793-3-git-send-email-rasesh.mody@cavium.com (mailing list archive)
State Changes Requested, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

Mody, Rasesh Nov. 24, 2017, 8:35 p.m. UTC
  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(-)
  

Comments

Ferruh Yigit Dec. 4, 2017, 11:25 p.m. UTC | #1
On 11/24/2017 12:35 PM, Rasesh Mody wrote:
> 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>

Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

I think this patch has no dependency for rest of the patchset and can be
separately applied.
  
Shahaf Shuler Dec. 5, 2017, 6:05 a.m. UTC | #2
Tuesday, December 5, 2017 1:25 AM, Ferruh Yigit:
> On 11/24/2017 12:35 PM, Rasesh Mody wrote:

> > 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>

> 

> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

> 

> I think this patch has no dependency for rest of the patchset and can be

> separately applied.


Snipped from the patch [1]

Please use the new ethdev offloads API. there is already a series to convert the examples including kni[2], I think it is better to work on top of it. 

[1]
@@ -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;
+

[2] http://dpdk.org/dev/patchwork/patch/31558/
  
Patil, Harish Dec. 5, 2017, 7:42 p.m. UTC | #3
-----Original Message-----
From: Ferruh Yigit <ferruh.yigit@intel.com>

Date: Monday, December 4, 2017 at 3:25 PM
To: "Mody, Rasesh" <Rasesh.Mody@cavium.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: Harish Patil <Harish.Patil@cavium.com>, Dept-Eng DPDK Dev
<Dept-EngDPDKDev@cavium.com>
Subject: Re: [dpdk-dev] [PATCH 2/5] examples/kni: add optional parameter
to enable LRO

>On 11/24/2017 12:35 PM, Rasesh Mody wrote:

>> 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>

>

>Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

>

>I think this patch has no dependency for rest of the patchset and can be

>separately applied.


That’s right, thanks.
>
  
Patil, Harish Dec. 5, 2017, 7:43 p.m. UTC | #4
-----Original Message-----
From: Shahaf Shuler <shahafs@mellanox.com>

Date: Monday, December 4, 2017 at 10:05 PM
To: Ferruh Yigit <ferruh.yigit@intel.com>, "Mody, Rasesh"
<Rasesh.Mody@cavium.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: Harish Patil <Harish.Patil@cavium.com>, Dept-Eng DPDK Dev
<Dept-EngDPDKDev@cavium.com>
Subject: RE: [dpdk-dev] [PATCH 2/5] examples/kni: add optional parameter
to enable LRO

>Tuesday, December 5, 2017 1:25 AM, Ferruh Yigit:

>> On 11/24/2017 12:35 PM, Rasesh Mody wrote:

>> > 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>

>> 

>> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

>> 

>> I think this patch has no dependency for rest of the patchset and can be

>> separately applied.

>

>Snipped from the patch [1]

>

>Please use the new ethdev offloads API. there is already a series to

>convert the examples including kni[2], I think it is better to work on

>top of it. 

>

>[1]

>@@ -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;

>+

>

>[2] http://dpdk.org/dev/patchwork/patch/31558/

>

Okay, I will take a look at it.

Thanks,
Harish


>
  

Patch

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",