Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Strange networking behaviour
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Fri Nov 15, 2013 9:10 pm    Post subject: [Solved] Strange networking behaviour Reply with quote

Hi.
I just finished installation (the very basic system, kernel+grub) and rebooted. After reboot I found a strange problem with networking.
Or maybe it is a modules problem. Or maybe it is a kernel problem.
The thing is lsmod shows nothing. Module for Ethernet was built (r8169) and installed, but not loaded. ifconfig -a shows net.lo interface only.
After "modprobe r8169" new interface appears in ifconfig output. But it's name is not enp4s0 (as was during system install). It has an old name: eth0 ... I can start it: "/etc/init.d/net.eth0 start" and and get internet connection. On next boot I have to do all the steps again: modprobe + eth0 start. Though I tried to add eth0 to default runlevel.

My .config: http://pastebin.com/M88z3rGA
What's wrong here?


Last edited by creaker on Sun Nov 17, 2013 8:57 am; edited 1 time in total
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21607

PostPosted: Fri Nov 15, 2013 9:22 pm    Post subject: Reply with quote

Why did you make your network driver a module? That seems like a feature you would want to have builtin to the kernel.

If the module is not automatically loaded, then you cannot have the interface automatically start at boot, since the interface will not exist. I suggest making the network driver builtin, then investigating whether other problems remain.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54220
Location: 56N 3W

PostPosted: Fri Nov 15, 2013 9:38 pm    Post subject: Reply with quote

creaker,

udev is renaming eth0 for you. Its a feature.

If you want to use eth0, tell udev not to use the new name, otherwise use enp4s0 everywhere you would use eth0
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Fri Nov 15, 2013 9:39 pm    Post subject: Reply with quote

I always had r8169 as module (CONFIG_R8169=m) and it worked.
I'll try to build it into kernel...
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Fri Nov 15, 2013 9:48 pm    Post subject: Reply with quote

I built r8169 into kernel. Networking starts, but it takes a lot: about 50 seconds(!) to bring it up. As well as if I starting networking manually.

I checked messages but nothing helpful.
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Fri Nov 15, 2013 10:06 pm    Post subject: Reply with quote

another one problem: with built-in r8169 system hangs on halt/reboot
It seems I have to do a thorough audit of kernel config. Probably I removed too much options.
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2665
Location: Slovenia

PostPosted: Fri Nov 15, 2013 10:41 pm    Post subject: Reply with quote

creaker wrote:
I built r8169 into kernel. Networking starts, but it takes a lot: about 50 seconds(!) to bring it up. As well as if I starting networking manually.

You're missing firmware. The kernel fails to load it, so it asks udev to do it. Udev will then try to load the firmware until a timeout (60 sec) expires and only then bring up the interface. Networking will still work because this firmware is optional.

You have two choices:
a) Check dmesg to see which firmware file failed to load and include it in the kernel. This way the kernel will be able to load it. You'll find it in the linux-firmware package.
b) Disable the the userspace firmware helper in the kernel. That way, when the kernel fails to load firmware, it will not ask udev to do it, so no waiting for a timeout.
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Sat Nov 16, 2013 6:34 am    Post subject: Reply with quote

NeddySeagoon
I know about interface renaming. I expected it will be renamed to enp4s0 and I configured conf.d/net accordingly. But for unknown reason interface was not renamed and I got an old name: eth0.

Gusar

I checked dmesg for firmware - nothing.
Userspace firmware helper hard enabled (marked as -*-), I can't to disable it.
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Sat Nov 16, 2013 7:32 am    Post subject: Reply with quote

Seems it is not .config issue. I copied .config from another gentoo box (that works fine) and rebuilt kernel - the same problem:
1. No r8169 module loaded at boot
2. On "modprobe r8169" I get old-fashioned named (eth0) interface
3. When trying to start eth0 I have to wait for 50 seconds to get networking ready

As well it is not a hardware problem: I tested it by booting arch usb stick: arch boots in 8 seconds and I have internet connected immediately after booting.

May be it is a kernel ? This machine runs 3.10.17 kernel. Machine where I copied .config runs 3.10.7 kernel. Is it worth to try to install older kernel (3.10.7)?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54220
Location: 56N 3W

PostPosted: Sat Nov 16, 2013 11:49 am    Post subject: Reply with quote

creaker,

The wait is the firmware loading timeout.
dmesg will tell the firmware file name.

If r8169 is built into the kernel, the firmware must be too.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Gusar
Advocate
Advocate


Joined: 09 Apr 2005
Posts: 2665
Location: Slovenia

PostPosted: Sat Nov 16, 2013 12:19 pm    Post subject: Reply with quote

Did you check dmesg after those 50 sec? That's when the message about failing to load firmware will appear. It's there for sure, it'll be something like rtl_nic/rtl8168e-3.fw (that's the file I need, there are several files in the rtl_nic directory of the linux-firmware package). Did you install the linux-firmware package yet? It seems not, because that should actually get rid of the delay already.

@NeddySeagoon: Nowadays firmware does not need to be in the kernel anymore if the driver is. That's because it will not be loaded when the driver starts, but when you want to bring the interface up. There might be devices where it's still needed (I have no idea about radeon for example), but for network cards firmware can be in userspace if the kernel has the userspace helper activated.
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Sat Nov 16, 2013 12:52 pm    Post subject: Reply with quote

I tried to get networking with older kernel (3.10.7) but fails with the same result. Kernel 3.10.7 + OpenRC 0.11.8 + r8169 works just fine at one machine and refuses to work at another similar box.
I decided to reinstall the system and totally stuck after unpacking stage tarball: can't even emerge gentoo-sources due to sys-devel/bc versions mismatch.
Emerge requires bc-1.06.95.tar.bz2 but fails after checking a lot of mirrors: no such file... I checked some of the mirrors - it is really does not exists. All messed up. What's going on?
:roll:

may be I have had to try linux-firmware, but I never used it before, so why I have to use it now?
Anyway right now I can't to fetch gentoo-sources. Looks like portage tree was updated before mirrors was populated with required packages.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54220
Location: 56N 3W

PostPosted: Sat Nov 16, 2013 1:52 pm    Post subject: Reply with quote

Gusar,

My experience with network card firmware, also for a r1869 card, is limited to diskless systems.
With root over NFS, choices are limited. :)

creaker,

linux-firmware is a huge collection of firmware files. You can configure what you install. Firmware files are also available separately.
Which cards need firmware seems to vary and all the r8169 cards operate without it but if the driver tries to load it and fails, the timeout is 60 sec.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Sat Nov 16, 2013 3:46 pm    Post subject: Reply with quote

It seems that the gods turned their backs on me :D
They won't I'll install gentoo.
I found bc-1.06.95.tar.bz2 on the net, downloaded it and put it under distfiles. But still can't emerge gentoo-sources:
Code:
>>>> Downloading 'http://distfiles.gentoo.org/distfiles/linux-3.10.tar.xz'
--2013-11-16 18:19:57-- http://distfiles.gentoo.org/distfiles/linux-3.10.tar.xz
Resolving distfiles.gentoo.org... failed: Name or service not known.
wget: unable to resolve host address 'distfiles.gentoo.org'


at the same time:
Code:
ping distfiles.gentoo.org
PING distfiles.gentoo.org (140.211.166.134) 56(84) bytes of data.
64 bytes from ftp-osl.osuosl.org (140.211.166.134): icmp_seq=1 ttl=44 time=258ms
64 bytes from ftp-osl.osuosl.org (140.211.166.134): icmp_seq=2 ttl=44 time=258ms


Code:
cat /etc/resolv.conf
nameserver 8.8.8.8


but I can download these packages if I out of chroot (directly from live media).
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21607

PostPosted: Sat Nov 16, 2013 4:31 pm    Post subject: Reply with quote

What is the output of ls -l on your in-chroot /etc/resolv.conf?
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Sat Nov 16, 2013 5:23 pm    Post subject: Reply with quote

Hu
Yeah, it is: wrong permissions:
Code:
ls -l /etc/resolv.conf
-rw------- 1 root root 19 Nov 16 16:14

I recreated resolv.conf and got
Code:
-rw-r--r--

I be able to emerge gentoo-sources and can continue to deal with kernel, modules and firmwares.
Lets see if module problem will appear again
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Sat Nov 16, 2013 6:53 pm    Post subject: Reply with quote

So, I've reinstalled the system. Still have no r8169 loaded at boot.
I had to add it to /etc/conf.d/modules and emerge linux-firmware. It helped. But is it a new way to go now?
And why old eth0 name came back?
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Sat Nov 16, 2013 7:15 pm    Post subject: Reply with quote

And still can't to halt the system: after killing remaining processes and remounting / read only machine just hangs. Is it related to linux-firmware or module r8169?
Reboot works fine.
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Sun Nov 17, 2013 8:56 am    Post subject: Reply with quote

Halt issue fixed as well by enabling kernel APM (advanced power management) option.
Just out of curiosity: why I had to use stuffs that I never used before - linux-firmware and APM?
I would understood it if it was some new features, but it is not...

Thanks for helping, guys!
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21607

PostPosted: Sun Nov 17, 2013 4:41 pm    Post subject: Reply with quote

APM is very old and is superseded by ACPI. You should use ACPI if possible.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum