Bug 509398 - ethtool should support GRO options
ethtool should support GRO options
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: ethtool (Show other bugs)
5.4
All Linux
low Severity medium
: rc
: ---
Assigned To: Jay Fenlason
BaseOS QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-07-02 11:36 EDT by Mark Wagner
Modified: 2014-08-31 19:29 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-02 08:04:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Mark Wagner 2009-07-02 11:36:29 EDT
Description of problem:
GRO was added to the networking stack for RHEL5.4.  Controlling this setting is managed by ethtool upstream.  ethtool in RHEL5.4 should be modified to so as well.

Version-Release number of selected component (if applicable):


How reproducible:

missing functionality, so, um, everytime.

Steps to Reproduce:
1.
2.
3.
  
Actual results:

can't control GRO directly

Expected results:
ability to turn GRO on and off

Additional info:
commit 5c368cd47d390555f17d9dfb0b04ef48d0a42a21
Author: Jeff Garzik <jeff@garzik.org>
Date:   Fri Mar 6 05:58:15 2009 -0500

    Get/set GRO settings.
    
    Signed-off-by: Jeff Garzik <jgarzik@redhat.com>

diff --git a/ethtool-copy.h b/ethtool-copy.h
index eadba25..3ca4e2c 100644
--- a/ethtool-copy.h
+++ b/ethtool-copy.h
@@ -336,6 +336,8 @@ struct ethtool_rxnfc {
 
 #define	ETHTOOL_GRXFH		0x00000029 /* Get RX flow hash configuration */
 #define	ETHTOOL_SRXFH		0x0000002a /* Set RX flow hash configuration */
+#define ETHTOOL_GGRO		0x0000002b /* Get GRO enable (ethtool_value) */
+#define ETHTOOL_SGRO		0x0000002c /* Set GRO enable (ethtool_value) */
 
 /* compatibility with older code */
 #define SPARC_ETH_GSET		ETHTOOL_GSET
diff --git a/ethtool.8 b/ethtool.8
index 1beb387..fea6074 100644
--- a/ethtool.8
+++ b/ethtool.8
@@ -166,6 +166,8 @@ ethtool \- Display or change ethernet card settings
 .B2 tso on off
 .B2 ufo on off
 .B2 gso on off
+.B2 gro on off
+.B2 lro on off
 
 .B ethtool \-p|\-\-blink
 .I ethX
diff --git a/ethtool.c b/ethtool.c
index a7c02d0..7669180 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -160,7 +160,8 @@ static struct option {
 	        "		[ tso on|off ]\n"
 	        "		[ ufo on|off ]\n"
 		"		[ gso on|off ]\n"
-		"               [ lro on|off ]\n"
+		"		[ gro on|off ]\n"
+		"		[ lro on|off ]\n"
     },
     { "-i", "--driver", MODE_GDRV, "Show driver information" },
     { "-d", "--register-dump", MODE_GREGS, "Do a register dump",
@@ -219,6 +220,7 @@ static int off_tso_wanted = -1;
 static int off_ufo_wanted = -1;
 static int off_gso_wanted = -1;
 static int off_lro_wanted = -1;
+static int off_gro_wanted = -1;
 
 static struct ethtool_pauseparam epause;
 static int gpause_changed = 0;
@@ -334,6 +336,7 @@ static struct cmdline_info cmdline_offload[] = {
 	{ "ufo", CMDL_BOOL, &off_ufo_wanted, NULL },
 	{ "gso", CMDL_BOOL, &off_gso_wanted, NULL },
 	{ "lro", CMDL_BOOL, &off_lro_wanted, NULL },
+	{ "gro", CMDL_BOOL, &off_gro_wanted, NULL },
 };
 
 static struct cmdline_info cmdline_pause[] = {
@@ -1387,22 +1390,25 @@ static int dump_coalesce(void)
 	return 0;
 }
 
-static int dump_offload(int rx, int tx, int sg, int tso, int ufo, int gso, int lro)
+static int dump_offload(int rx, int tx, int sg, int tso, int ufo, int gso,
+			int gro, int lro)
 {
 	fprintf(stdout,
 		"rx-checksumming: %s\n"
 		"tx-checksumming: %s\n"
 		"scatter-gather: %s\n"
-		"tcp segmentation offload: %s\n"
-		"udp fragmentation offload: %s\n"
-		"generic segmentation offload: %s\n"
-		"large receive offload: %s\n",
+		"tcp-segmentation-offload: %s\n"
+		"udp-fragmentation-offload: %s\n"
+		"generic-segmentation-offload: %s\n"
+		"generic-receive-offload: %s\n"
+		"large-receive-offload: %s\n",
 		rx ? "on" : "off",
 		tx ? "on" : "off",
 		sg ? "on" : "off",
 		tso ? "on" : "off",
 		ufo ? "on" : "off",
 		gso ? "on" : "off",
+		gro ? "on" : "off",
 		lro ? "on" : "off");
 
 	return 0;
@@ -1714,7 +1720,7 @@ static int do_goffload(int fd, struct ifreq *ifr)
 {
 	struct ethtool_value eval;
 	int err, allfail = 1, rx = 0, tx = 0, sg = 0;
-	int tso = 0, ufo = 0, gso = 0, lro = 0;
+	int tso = 0, ufo = 0, gso = 0, gro = 0, lro = 0;
 
 	fprintf(stdout, "Offload parameters for %s:\n", devname);
 
@@ -1788,12 +1794,22 @@ static int do_goffload(int fd, struct ifreq *ifr)
 		allfail = 0;
 	}
 
+	eval.cmd = ETHTOOL_GGRO;
+	ifr->ifr_data = (caddr_t)&eval;
+	err = ioctl(fd, SIOCETHTOOL, ifr);
+	if (err)
+		perror("Cannot get device GRO settings");
+	else {
+		gro = eval.data;
+		allfail = 0;
+	}
+
 	if (allfail) {
 		fprintf(stdout, "no offload info available\n");
 		return 83;
 	}
 
-	return dump_offload(rx, tx, sg, tso, ufo, gso, lro);
+	return dump_offload(rx, tx, sg, tso, ufo, gso, gro, lro);
 }
 
 static int do_soffload(int fd, struct ifreq *ifr)
@@ -1893,6 +1909,17 @@ static int do_soffload(int fd, struct ifreq *ifr)
 			return 92;
 		}
 	}
+	if (off_gro_wanted >= 0) {
+		changed = 1;
+		eval.cmd = ETHTOOL_SGRO;
+		eval.data = (off_gro_wanted == 1);
+		ifr->ifr_data = (caddr_t)&eval;
+		err = ioctl(fd, SIOCETHTOOL, ifr);
+		if (err) {
+			perror("Cannot set device GRO settings");
+			return 93;
+		}
+	}
 
 	if (!changed) {
 		fprintf(stdout, "no offload settings changed\n");
Comment 1 RHEL Product and Program Management 2009-07-07 12:22:09 EDT
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".
Comment 4 Jay Fenlason 2009-07-09 14:36:06 EDT
I had to update the patch a bit, because the ethtool in 5.4 does not have LRO support, and it is outside the scope of this bug.  Also, the man page hunk is incomplete--it adds gro support in one area, but not in the actual description.
Comment 9 Mark Wagner 2009-07-13 13:30:06 EDT
Test results below from ixgbe based card.  I was able to test with it on, turn it off and see drop in throughput. Finally turned it back on and saw throughput return to the higher value.

[root@perf22 ~]# ethtool -k eth0
Offload parameters for eth0:
Cannot get device udp large send offload settings: Operation not supported
rx-checksumming: on
tx-checksumming: on
scatter-gather: on
tcp segmentation offload: on
udp fragmentation offload: off
generic segmentation offload: off
generic-receive-offload: on

GRO is on, run a netperf, get results

[root@perf15 np2.4]# ./netperf -l 20 -H 172.17.10.22
TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 172.17.10.22 (172.17.10.22) port 0 AF_INET : spin interval : demo
Recv   Send    Send                          
Socket Socket  Message  Elapsed              
Size   Size    Size     Time     Throughput  
bytes  bytes   bytes    secs.    10^6bits/sec  
 87380  16384  16384    20.00    9408.64   


Turn off GRO, repeat netperf, should see drop in throughput
ethtool -K eth0 gro off

[root@perf15 np2.4]# ./netperf -l 20 -H 172.17.10.22
TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 172.17.10.22 (172.17.10.22) port 0 AF_INET : spin interval : demo
Recv   Send    Send                          
Socket Socket  Message  Elapsed              
Size   Size    Size     Time     Throughput  
bytes  bytes   bytes    secs.    10^6bits/sec  
 87380  16384  16384    20.00    6156.92   


Finally, verify that we can turn GRO on, should see throughput return to level around that of the first test. 

[root@perf15 np2.4]# ./netperf -l 20 -H 172.17.10.22
TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 172.17.10.22 (172.17.10.22) port 0 AF_INET : spin interval : demo
Recv   Send    Send                          
Socket Socket  Message  Elapsed              
Size   Size    Size     Time     Throughput  
bytes  bytes   bytes    secs.    10^6bits/sec  
 87380  16384  16384    20.00    9410.15   


Seems to work, marking as VERIFIED
Comment 11 errata-xmlrpc 2009-09-02 08:04:19 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1408.html

Note You need to log in before you can comment on or make changes to this bug.