[PATCH] python-ethtool : Add a check in set_offload
by sumanth
From: Sumanth K <sumantk2(a)linux.vnet.ibm.com>
Add a check in set_offload, set_ringparam and set_coalesce - pethtool.py
In one of our lpar ppc64 , we get the following using ethtool .
#ethtool -K eth0 tso off.
Cannot change tcp-segmentation-offload
Could not change any device features
But pethtool doesnt return any error and the exit code is 0. Make the user know
that tso offload cannot be set and return 1 just like ethtool.
Couldnt get how to do git clone for fedora packages . So doing the diff using tarball
Any inputs welcome.
Signed-off-by: Sumanth K <sumantk2(a)linux.vnet.ibm.com>
---
--- python-ethtool-0.11/pethtool.py.org 2014-07-02 15:10:59.622971063 +0530
+++ python-ethtool-0.11/pethtool.py 2014-07-02 15:14:43.875683364 +0530
@@ -169,7 +169,11 @@ def set_coalesce(interface, args):
if not changed:
return
- ethtool.set_coalesce(interface, coal)
+ try:
+ ethtool.set_coalesce(interface, coal)
+ except:
+ printtab("Cannot set coalesce options")
+ sys.exit(1)
def show_offload(interface, args = None):
try:
@@ -205,7 +209,9 @@ def set_offload(interface, args):
try:
ethtool.set_tso(interface, value)
except:
- pass
+ printtab("Cannot change tcp-segmentation-offload")
+ printtab("Could not change any device features")
+ sys.exit(1)
ethtool_ringparam_msgs = (
( "Pre-set maximums", ),
@@ -273,8 +279,11 @@ def set_ringparam(interface, args):
if not changed:
return
-
- ethtool.set_ringparam(interface, ring)
+ try:
+ ethtool.set_ringparam(interface, ring)
+ except:
+ printtab("Cannot set RX/TX ring parameters")
+ sys.exit(1)
def show_driver(interface, args = None):
try:
9 years, 10 months