bnc#616263
OBS-URL: https://build.opensuse.org/package/show/network:utilities/ethtool?expand=0&rev=7
This commit is contained in:
parent
b18e534bde
commit
62fc6ee457
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Jul 12 08:01:51 UTC 2010 - puzel@novell.com
|
||||
|
||||
- add get-set-gro-settings.patch (bnc#616263)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 8 22:19:41 CET 2010 - jengelh@medozas.de
|
||||
|
||||
|
@ -34,6 +34,8 @@ Patch1: ethtool-LRO_support.patch
|
||||
Patch2: ethtool-cmd-speed-display-all.patch
|
||||
#PATCH-FIX-UPSTREAM fix parse of 10Gbe option (bnc#557016)
|
||||
Patch3: ethtool-speed-parse.patch
|
||||
#PATCH-FIX-UPSTREAM support gro (bnc#616263)
|
||||
Patch4: get-set-gro-settings.patch
|
||||
|
||||
%description
|
||||
Ethtool is a small utility for examining and tuning ethernet-based
|
||||
@ -54,6 +56,7 @@ Authors:
|
||||
%patch1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
|
||||
%build
|
||||
%{suse_update_config -f}
|
||||
|
140
get-set-gro-settings.patch
Normal file
140
get-set-gro-settings.patch
Normal file
@ -0,0 +1,140 @@
|
||||
From 5c368cd47d390555f17d9dfb0b04ef48d0a42a21 Mon Sep 17 00:00:00 2001
|
||||
From: Jeff Garzik <jeff@garzik.org>
|
||||
Date: Fri, 6 Mar 2009 05:58:15 -0500
|
||||
Subject: [PATCH] Get/set GRO settings.
|
||||
|
||||
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
|
||||
---
|
||||
ethtool-copy.h | 2 ++
|
||||
ethtool.8 | 2 ++
|
||||
ethtool.c | 43 +++++++++++++++++++++++++++++++++++--------
|
||||
3 files changed, 39 insertions(+), 8 deletions(-)
|
||||
|
||||
Index: ethtool-6/ethtool-copy.h
|
||||
===================================================================
|
||||
--- ethtool-6.orig/ethtool-copy.h 2010-07-12 09:23:33.000000000 +0200
|
||||
+++ ethtool-6/ethtool-copy.h 2010-07-12 09:24:08.000000000 +0200
|
||||
@@ -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
|
||||
Index: ethtool-6/ethtool.8
|
||||
===================================================================
|
||||
--- ethtool-6.orig/ethtool.8 2007-07-26 19:33:37.000000000 +0200
|
||||
+++ ethtool-6/ethtool.8 2010-07-12 09:24:08.000000000 +0200
|
||||
@@ -158,6 +158,8 @@ ethtool \- Display or change ethernet ca
|
||||
.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
|
||||
Index: ethtool-6/ethtool.c
|
||||
===================================================================
|
||||
--- ethtool-6.orig/ethtool.c 2010-07-12 09:23:33.000000000 +0200
|
||||
+++ ethtool-6/ethtool.c 2010-07-12 09:25:19.000000000 +0200
|
||||
@@ -203,6 +203,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;
|
||||
@@ -314,6 +315,7 @@ static struct cmdline_info cmdline_offlo
|
||||
{ "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[] = {
|
||||
@@ -1211,22 +1213,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;
|
||||
@@ -1492,7 +1497,7 @@ static int do_goffload(int fd, struct if
|
||||
{
|
||||
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);
|
||||
|
||||
@@ -1566,12 +1571,22 @@ static int do_goffload(int fd, struct if
|
||||
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)
|
||||
@@ -1675,6 +1690,17 @@ static int do_soffload(int fd, struct if
|
||||
if (!changed) {
|
||||
fprintf(stdout, "no offload settings changed\n");
|
||||
}
|
||||
+ 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;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user