Bug 458450

Summary: s2io doesn't support ethtool "sg on" on pci-x card
Product: Red Hat Enterprise Linux 5 Reporter: Andrew Hecox <ahecox>
Component: kernelAssignee: Michal Schmidt <mschmidt>
Status: CLOSED NOTABUG QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: low Docs Contact:
Priority: low    
Version: 5.4CC: herbert.xu, jon.mason, jtluka, nhorman, peterm
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-15 10:29:59 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andrew Hecox 2008-08-08 14:24:04 UTC
The s2io driver supports turning SG off; but not on

# ethtool -k eth1
...
scatter-gather: on
...
# ethtool -K eth1 sg off
# sudo ethtool -k eth1
...
scatter-gather: off
...
# sudo ethtool -K eth1 sg on
Cannot set device scatter-gather settings: Invalid argument
# sudo ethtool -k eth1
...
scatter-gather: off
...

stracing, I see: 

ioctl(3, SIOCETHTOOL, 0x7fffe899c270)   = -1 EINVAL (Invalid argument)

running on a pci-e version of the card, the operation works and I see:

ioctl(3, SIOCETHTOOL, 0x7fff0b649f10)   = 0

Testing on  2.6.18-92.1.1.el5 #1 SMP Thu May 22 09:01:47 EDT 2008 x86_64 x86_64 x86_64 GNU/Linux

Comment 1 Andrew Hecox 2008-08-08 15:31:55 UTC
after further experimentation, it looks like you cannot enable sg offloading when tx checksumming is off. Maybe this is expected? 

# for i in on off ; do for j in on off ; do for k in on off ; do echo "--- tx $i + sg $j + gso $k ---" ; ethtool -K eth1 tx $i + sg $j + gso $k ; done ; done ; done
--- tx on + sg on + gso on ---
--- tx on + sg on + gso off ---
--- tx on + sg off + gso on ---
--- tx on + sg off + gso off ---
--- tx off + sg on + gso on ---
Cannot set device scatter-gather settings: Invalid argument
--- tx off + sg on + gso off ---
Cannot set device scatter-gather settings: Invalid argument
--- tx off + sg off + gso on ---
--- tx off + sg off + gso off ---

Comment 2 Jan Tluka 2009-11-11 13:55:18 UTC
Andrew, if you think this is really a bug, please raise these flags: 
rhel‑5.5.0 ?
pm_ack ?
devel_ack ?
qa_ack +

Thanks.

Comment 3 Andrew Hecox 2010-01-06 11:54:21 UTC
set (I can't set qa_ack+)

Comment 5 Michal Schmidt 2011-03-15 10:29:59 UTC
(In reply to comment #1)
> after further experimentation, it looks like you cannot enable sg offloading
> when tx checksumming is off. Maybe this is expected? 

Yes, checksumming is needed for SG. This is enforced by net/core/ethtool.c:ethtool_set_sg()
...
if (edata.data &&
            !(dev->features & NETIF_F_ALL_CSUM))
                return -EINVAL;
...