Bug 170884

Summary: MTU of ethernet card can't be set before interface is up
Product: [Fedora] Fedora Reporter: Sven Neuhaus <sven-redhat>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED WONTFIX QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: denis, jgarzik, linville, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-08-07 18:24:46 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:
Bug Depends On:    
Bug Blocks: 124226    
Attachments:
Description Flags
moves the MTU section further back none

Description Sven Neuhaus 2005-10-14 22:32:42 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-DE; rv:1.7.12) Gecko/20050922 Fedora/1.0.7-1.1.fc4 Firefox/1.0.7

Description of problem:
In /etc/sysconfig/network-scripts/ifup-eth
if the MTU parameter is configured in
/etc/sysconfig/network-scripts/ifcfg-eth0
it will try to set the MTU with "ip link set dev ${DEVICE} mtu ${MTU}"
before the interface is up.
This fails with my Marvell GigE card (sk98lin driver, kernel 2.6.13-1.1526_FC4).


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

How reproducible:
Always

Steps to Reproduce:
1. Add non-standard MTU to /etc/sysconfig/network-scripts/ifcfg-eth0
2. make sure eth0 currently has the standard MTU:
   ifconfig eth0 mtu 1500
3. cd /etc/sysconfig/network-scripts; ./ifdown eth0; echo down; ./ifup eth0; echo up; ifconfig eth0 | grep MTU
  

Actual Results:  I see this output:
down
SIOCSIFMTU: Invalid argument
up
          UP BROADCAST MULTICAST  MTU:1500  Metric:1


Expected Results:  This should have been the output if the MTU had been set without a problem:
down
up
          UP BROADCAST MULTICAST  MTU:9000  Metric:1


Additional info:

The fix (for me) is to move the section that sets the MTU behind the lines that set the interface to status "up".

Comment 1 Sven Neuhaus 2005-10-14 22:34:43 UTC
Created attachment 120007 [details]
moves the MTU section further back

this patch moves the "ip link set dev ${DEVICE} mtu ${MTU}"
behind the "ip link set dev ${REALDEVICE} up"
which fixes the problem for me.

Comment 2 Sven Neuhaus 2005-10-14 22:42:01 UTC
This bug would have been detected much sooner if the feature from bug 124226
(RFE: set MTU from system-config-network) had been implemented.

Comment 4 Sven Neuhaus 2005-11-03 10:23:41 UTC
Do you see any problems with my patch?

Comment 5 Bill Nottingham 2005-11-03 17:15:54 UTC
Theoretically, it might need a second stanza to handle DHCP, although I'd hope
that nothing needs MTU set to actually *get* a IP address.

I'm still curious is the 'inability to set MTU unless link is set up' is
something that's specific to a particular driver, or is defined behavior -
John/Jeff?

Comment 6 John W. Linville 2005-11-03 18:33:33 UTC
I don't see anything to suggest that this is a generic problem.  The sk98lin 
driver looks like it might be enforcing such a requirement, but I don't know 
why. 
 
Since this is FC4, I would suggest using the skge driver instead of sk98lin if 
at all possible. 

Comment 7 Denis Ovsienko 2005-11-04 07:30:14 UTC
In most cases I have met MTU can be changed while interface is down.

Comment 8 Bill Nottingham 2006-08-07 18:24:46 UTC
Closing this - this is best solved by fixing the driver to allow setting the MTU
in all cases.