LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-20-2009, 05:38 PM   #1
GriFF3n
Member
 
Registered: Aug 2009
Posts: 31

Rep: Reputation: 16
Gigabit speed lost after Resuming from Suspend


Everytime I wake the server from sleep it changes my gigabit speeds to 100 Mb. I am able to get the gigabit speed back up but have to run this command:


Code:
sudo ethtool -s eth0 speed 1000
This is vary annoying as I have to do it every time I wake my server. Is there a way to run this command on wake? Server is running Ubuntu Server 9.10 and the nic is an r8169. Computer is an MSI Wind Nettop. This is listed as a bug on Launchpad (https://bugs.launchpad.net/ubuntu/+s...ux/+bug/371159) but their fix doesnt work for me. Any help would be appreciated. Thanks,

GriFF
 
Old 12-21-2009, 10:20 AM   #2
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
When your computer goes "suspend" Ethernet card interface goes DOWN. When you wake it up, interface goes up, but the config file doesn't have information about the speed.
"ifcfg-eth<N>" - it the file with config settings, you can add there additional option ETHTOOL_OPTIONS = 'speed 1000 duplex full ...'
 
Old 12-21-2009, 11:14 AM   #3
GriFF3n
Member
 
Registered: Aug 2009
Posts: 31

Original Poster
Rep: Reputation: 16
Talking

Quote:
Originally Posted by nimnull22 View Post
When your computer goes "suspend" Ethernet card interface goes DOWN. When you wake it up, interface goes up, but the config file doesn't have information about the speed.
"ifcfg-eth<N>" - it the file with config settings, you can add there additional option ETHTOOL_OPTIONS = 'speed 1000 duplex full ...'
Thanks minnull22, I'll give that a try when I get home tonight. I'll report back if it works or not. Thanks for the suggestion!

GriFF
 
Old 12-21-2009, 08:08 PM   #4
GriFF3n
Member
 
Registered: Aug 2009
Posts: 31

Original Poster
Rep: Reputation: 16
For Ubuntu there is no ifcfg. Looks like thats just for RedHat Linux. There is "interfaces" and "ifup/ifdown". Looking at the man pages for that now to see if I can run the "ETHTOOL_OPTIONS" as you suggested.

GriFF
 
Old 12-21-2009, 08:25 PM   #5
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
Just an example:

Under OpenSuSE™ 10.2, I placed the following in /etc/sysconfig/network/ifcfg-eth-id-00:16:3e:b1:d7:90 (the config file for eth0):
ETHTOOL_OPTIONS='............'

Under other distributions, the technique will vary. For example, under Debian™ or Ubuntu™, you can just add a 'post-up' entry to /etc/network/interfaces as shown here:
iface eth0 inet static
address 206.124.146.177
netmask 255.255.255.0
post-up ethtool ..............


Check this.

Last edited by nimnull22; 12-21-2009 at 08:26 PM.
 
Old 12-21-2009, 08:40 PM   #6
GriFF3n
Member
 
Registered: Aug 2009
Posts: 31

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by nimnull22 View Post
Just an example:

Under OpenSuSE™ 10.2, I placed the following in /etc/sysconfig/network/ifcfg-eth-id-00:16:3e:b1:d7:90 (the config file for eth0):
ETHTOOL_OPTIONS='............'

Under other distributions, the technique will vary. For example, under Debian™ or Ubuntu™, you can just add a 'post-up' entry to /etc/network/interfaces as shown here:
iface eth0 inet static
address 206.124.146.177
netmask 255.255.255.0
post-up ethtool ..............


Check this.
Read the MAN pages and "post-up" is the command I'm using. It works, but I have to manually restart the network ("sudo /etc/init.d/networking restart") for the command to take effect. I know it works after that, but when I suspend the server, then bring it back up, the network doesnt seam to restart and is brought back to 100 Mbit. What I get from this is that when the server resumes from suspend, its not restarting the network. Any ideas? Again thanks for all the help so far nimnull22!

GriFF
 
Old 12-21-2009, 09:23 PM   #7
GriFF3n
Member
 
Registered: Aug 2009
Posts: 31

Original Poster
Rep: Reputation: 16
I'm a MONSTER!!!! Figured out that "pm-suspend"'s hooks can be altered to run commands during resume/hibernate/suspend/thaw. Heres the steps I took for anyone else who runs into this problem.

1. Create a file in "/etc/pm/sleep.d/" named "speed"

speed contains;

Code:
#!/bin/bash
case $1 in
    resume)
        ethtool -s eth0 speed 1000
        ;;
    *)  echo ""
        ;;
esac
2.
Code:
sudo chmod +x /etc/pm/sleep.d/speed
3. You're Done!!!!

I put an echo "whatever" in the script first to see if it would show on resume and it didnt on the main prompt. I had to look at "var/log/pm-suspend.log" to see it was working. Hope this helps other people. Thanks again for all your help nimnull22. Much appreciated!

GriFF
 
1 members found this post helpful.
Old 12-21-2009, 09:48 PM   #8
nimnull22
Senior Member
 
Registered: Jul 2009
Distribution: OpenSuse 11.1, Fedora 14, Ubuntu 12.04/12.10, FreeBSD 9.0
Posts: 1,571

Rep: Reputation: 92
Good, glad to hear that.

But it should be a script which brings interface up. May be in the network manager, I would help but I use OpenSuse and it is a lot different.

Any way, glad that you're happy.

Last edited by nimnull22; 12-21-2009 at 09:54 PM.
 
Old 06-30-2010, 09:06 PM   #9
jumon
LQ Newbie
 
Registered: Jun 2010
Posts: 2

Rep: Reputation: 0
Still happens on Ubuntu 10.04 too. Work-around above fixed it for now.

Linux linux 2.6.32-22-generic #36-Ubuntu SMP Thu Jun 3 19:31:57 UTC 2010 x86_64 GNU/Linux


04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 01)


root@linux:/etc/pm/sleep.d# mii-tool -vv eth0
Using SIOCGMIIPHY=0x8947
eth0: negotiated 1000baseT-FD flow-control, link ok
registers for MII PHY 32:
1000 796d 001c c912 0de1 c5e1 000f 2001
4f12 0300 3800 0000 1007 f880 0000 3000
0060 acc0 0000 6c42 1060 0000 c10c 2108
2740 8c00 0040 0106 097c 8000 0123 0000
product info: vendor 00:07:32, model 17 rev 2
basic mode: autonegotiation enabled
basic status: autonegotiation complete, link ok
capabilities: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
advertising: 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
link partner: 1000baseT-HD 1000baseT-FD 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control

Last edited by jumon; 06-30-2010 at 09:07 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems after resuming from suspend to ram chessonly Linux - General 1 08-10-2012 07:55 AM
[SOLVED] Internet is very slow after resuming from suspend jsteel Linux - Networking 9 06-18-2009 03:16 AM
System hangs when resuming from Suspend. theboomboomcars Linux - Laptop and Netbook 4 08-15-2008 08:14 AM
monitor does not turn on after resuming from suspend nappaji Puppy 2 08-24-2006 08:19 PM
Software Suspend - freezes while resuming TazG Linux - Software 2 08-11-2004 10:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration