# [solved] dhcpcd: eno1: if_up: Cannot allocate memory

## MasterDragon

New Gentoo install on my server, but I can't seem to get ethernet working. The controller is a Broadcom Netxtreme II.

It works on the liveCD, which calls it eno1. I've compiled the kernel with bnx2 built in.

Now, when I run dhcpcd eno1 (or /etc/init.d/net.eno1 start) it gives me:

```

* Bringing up interface eno1

*     dhcp . . .

*         Running dhcpcd . . . 

dhcpcd[pid]: version 6.4.7 starting

dhcpcd[pid]: eno1: if_up: Cannot allocate memory

dhcpcd[pid]: eno1: waiting for carrier

dhcpcd[pid]: timed out

dhcpcd[pid]: allowing 8 seconds for IPv4LL timeout

dhcpcd[pid]: timed out

dhcpcd[pid]: exited

* ERROR: net.eno1 failed to start
```

(Also, dmesg seems to call it eth0, but dhcpcd says that eh0 doesn't exist)

Anybody know what's going on?Last edited by MasterDragon on Wed Oct 29, 2014 9:47 pm; edited 1 time in total

----------

## DONAHUE

the kernel will name a one and only ethernet interface eth0. When udev runs it will change the name unless you have taken action to prevent it. dmesg should tell the new name. Running ifconfig -a will tell the interface name even if it is not up; if the kernel was able to recognize the hardware and assign a driver to it. Running ifconfig will show the interface name if it is up.

----------

## UberLord

 *MasterDragon wrote:*   

> 
> 
> ```
> 
> dhcpcd[pid]: version 6.4.7 starting
> ...

 

That is a serious error, which I've not seen before.

It's odd as the if_up function itself does not allocate memory - it just uses the puts small variables onto the stack and if the stack is running out at this point there is a serious issue.

Can you report which version is on the live CD and test dhcpcd-6.5.1 which is in portage to see if that resolves the issue?

I'll monitor this thread so I can respond sharply.

----------

## RazielFMX

What might be interesting to is to run an strace on dhcpcd for extra debugging information.

----------

## MasterDragon

The install cd I used was "install-amd64-minimal-20141023"

My installed version of dhcpcd is 6.4.7. I'll see if I can get 6.5.1 installed somehow.

Update: Installing 6.5.1 doesn't solve the problem.Last edited by MasterDragon on Tue Oct 28, 2014 9:01 pm; edited 1 time in total

----------

## UberLord

That tells me nothing  :Smile: 

Boot the install CD and run

```
dhcpcd --version
```

To find out.

Or you could just mount the cd and do

```
/mnt/cdrom/sbin/dhcpcd --version
```

Assuming /mnt/cdrom is where you mounted it.

----------

## MasterDragon

The version installed on the install disk is 6.4.7.

Installing 6.5.1 does not solve the problem.

----------

## DONAHUE

@UberLord: 

the OP has said: *Quote:*   

> It works on the liveCD, which calls it eno1[/

 The version used by the livecd may be less relevant than the version installed on the hard drive which may be less relevant than what interface name is used in the installed gentoo system.

Suggest MasterDragon boot the installed gentoo and run 

```
dhcpcd --version

ifconfig -a
```

 and post the dhcpcd version returned by the first command and the interface name(s) returned by the second command. ifconfig -a instead of ifconfig as ifconfig only shows "up" interfaces.

----------

## UberLord

OK, so might as well downgrade to 6.4.7 then.

So we're left with booting from the CD, dhcpcd-6.4.7 works but it doesn't work from the installed host?

At this point it's almost certain not to be a dhcpcd issue, but something else.

From both systems can you post the output of either `ip a` or `ifconfig` please?

----------

## MasterDragon

on the CD, ifconfig -a

```
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500

        inet 192.168.1.100  netmask 255.255.255.0  broadcast 192.168.1.255

        inet6 fe80::21e:4fff:fe1e:799b  prefixlen 64  scopeid 0x20<link>

        inet6 fe80::44d7:5639:63c8:726f  prefixlen 64  scopeid 0x20<link>

        ether 00:1e:4f:1e:79:9b  txqueuelen 1000  (Ethernet)

        RX packets 539  bytes 109691 (107.1 KiB)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 17  bytes 2047 (1.9 KiB)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eno2: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500

        inet6 fe80::6c77:d2e4:db0e:eaa2  prefixlen 64  scopeid 0x20<link>

        ether 00:1e:4f:1e:79:9d  txqueuelen 1000  (Ethernet)

        RX packets 0  bytes 0 (0.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 0  bytes 0 (0.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp11s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500

        inet6 fe80::4754:702f:84c3:ffa5  prefixlen 64  scopeid 0x20<link>

        ether 00:10:18:28:b6:44  txqueuelen 1000  (Ethernet)

        RX packets 0  bytes 0 (0.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 0  bytes 0 (0.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp13s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500

        inet 169.254.85.181  netmask 255.255.0.0  broadcast 169.254.255.255

        inet6 fe80::9ae:8dee:4e3f:b0d5  prefixlen 64  scopeid 0x20<link>

        ether 00:10:18:28:b6:36  txqueuelen 1000  (Ethernet)

        RX packets 0  bytes 0 (0.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 0  bytes 0 (0.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536

        inet 127.0.0.1  netmask 255.0.0.0

        inet6 ::1  prefixlen 128  scopeid 0x10<host>

        loop  txqueuelen 0  (Local Loopback)

        RX packets 2  bytes 140 (140.0 B)

        RX errors 0  dropped 0  overruns 0  frame 0

        TX packets 2  bytes 140 (140.0 B)

        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

```

----------

## DONAHUE

what is ifconfig -a result from the installed system? Not from the chroot.

----------

## MasterDragon

```

eno1: flags=4098<BROADCAST,MULTICAST> mtu 1500

           ether 00:1e:4f:1e:79:9b  txqueuelen 1000 (Ethernet)

           RX packets 0 bytes 0 (0.0 B)

           RX errors 0 ......and so on with zeroes for everything (I'm copying this by hand since no connection)

eno2: (basically the same)

...

enp11s0: (basically the same)

....

enp13s0: (basically the same)

...

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536

          inet 127.0.0.1  netmask 255.0.0.0

....

```

----------

## DONAHUE

so udev did in fact rename eth0 and eth1 

run 

```
ifconfig
```

 are eno1 eno2 enp11s0 enp13s0 all listed (if so they are up)

run *Quote:*   

> rc-status

  are net.lo net.eno1 net.eno2 net.enp11s0 net.enp13s0 and dhcpcd shown as running?

 edit to o vice 0

----------

## MasterDragon

running ifconfig (without -a) just gives:

lo: ...

----------

## DONAHUE

so eno1 eno2 enp11s0 enp13s0  are not up

run *Quote:*   

> rc-update show

  are net.lo net.eno1 net.eno2 net.enp11s0 net.enp13s0 dhcpcd shown in run levels? net.lo in boot, net.en*'s in default, dhcpcd in no run level for gentoo net scripts

UberLord's sig leads to https://forums.gentoo.org/viewtopic-t-965190.html how to use dhcpcd instead of gentoo net scripts

run 

```
zgrep -i bnx2 /proc/.config.gz
```

 to verify CONFIG_BNX2=m (or y) and CONFIG_BNX2X=m (or y) are in the running kernel (if your kernel has config support)

if not or if no config support: 

run

```
grep -i bnx2 /usr/src/linux/.config
```

 to verify CONFIG_BNX2=m (or y) and CONFIG_BNX2X=m (or y) are in the .config

edit 0 to o

----------

## UberLord

Does just running this work on your host?

```

pkill dhcpcd

sleep 5

dhcpcd -d

```

If not, can you post the output of the last command please?

----------

## MasterDragon

net.lo wasn't in boot for some reason, but fixing that didn't sole the problem

----------

## DONAHUE

So net.eno1  net.eno1, enp11s0, enp13s0 are in default, dhcpcd is in no run level for gentoo net scripts?

UberLord's sig leads to https://forums.gentoo.org/viewtopic-t-965190.html how to use dhcpcd instead of gentoo net scripts

run 

```
zgrep -i bnx2 /proc/.config.gz
```

 to verify CONFIG_BNX2=m (or y) and CONFIG_BNX2X=m (or y) are in the running kernel (if your kernel has config support)

if not or if no config support: 

run

```
grep -i bnx2 /usr/src/linux/.config
```

 to verify CONFIG_BNX2=m (or y) and CONFIG_BNX2X=m (or y) are in the .config

run 

```
ls -l /etc/init.d/net*
```

 verify that net.lo and symlinks  net.eno1,  net.eno2, enp11s0, enp13s0 exist; e.g.,  /etc/init.d/net.eno1 -> net.lo

edit 0 to o

----------

## MasterDragon

I've only got eno1 in default, I don't use the other three ethernet ports, but the link for eno1 is set.

bnx2 is set to y, bnx2x is not.

----------

## DONAHUE

```
bnx2x is not
```

. that is your problem, happy kernel recompiling   :Very Happy:   .

[*]   Broadcom devices #bnx2

< >     Broadcom 440x/47xx ethernet support

< >     QLogic NetXtremeII support

< >     QLogic CNIC support

< >     Broadcom Tigon3 support

<M>     Broadcom NetXtremeII 10Gb support #bnx2x

----------

## MasterDragon

I recompliled the kernel with bnx2x as well and I'm afraid that didn't solve the problem (I'm pretty sure I only have the gigabit controller anyway).

----------

## DONAHUE

from the broadcom site: "Broadcom no longer provides drivers and documentation for NetXtreme II. They can be obtained from QLogic." Guessing the kernel follows same pattern.

from menuconfig help dialog:  *Quote:*   

> CONFIG_NET_VENDOR_BROADCOM: 
> 
> If you have a network (Ethernet) chipset belonging to this class,  say Y.
> 
> Note that the answer to this question does not directly affect 
> ...

  need to pick the right broadcom driver

try: [*]   Broadcom devices

< >     Broadcom 440x/47xx ethernet support

<M>     QLogic NetXtremeII support 

<M>     QLogic CNIC support

< >     Broadcom Tigon3 support

< >     Broadcom NetXtremeII 10Gb support

If still trouble: run lspci -k and lsmod from the livecd and check the drivers and modules in use, post the result for the ethernet NIC's 

enter the chroot 

emerge pciutils

reboot to the installed system

run lspci -k and lsmod from the livecd and check the drivers and modules in use against the list from the livecd

----------

## MasterDragon

Hmm... I don't even have the QLogic option when I configure my kernel.

I don't think it matters though... Both the install CD and the installed system say the NIC is using bnx2.

----------

## MasterDragon

 *UberLord wrote:*   

> Does just running this work on your host?
> 
> ```
> 
> pkill dhcpcd
> ...

 

Abbreviated with (...) since I'm copying this by hand.

```

dhcpcd[3346]: version 6.5.1 starting

... udev: starting

... dev: loaded udev

... eno1: executing '/lib/dhcpcd/dhcpcd-run-hooks' PREINIT

... eno1: execuintg '/lib/dhcpcd/dhcpcd-run-hooks' NOCARRIER

... eno2 ...

... eno2 ...

... enp11s0 ...

... enp11s0 ...

... enp13s0 ...

... enp13s0 ...

... no interfaces have a carrier

... forking to background

... forked to background, child pid 3396
```

----------

## DONAHUE

An ethernet nic that needs a firmware blob!!! Saints preserve us.

```
ls /lib/firmware/bnx2
```

if nothing shows up try 

```
emerge linux-firmware
```

 from the chroot and recheck

If bnx2 and cnic are modules: 

run

```
modprobe -r bnx2

modprobe bnx2
```

reboot the installed system.

```
 ifconfig eno1 up
```

does running 

```
 ifconfig
```

 now show eno1?

what kernel version are you using? I'm 3.17.1-r1 a difference may account for missing qlogic.

what prompt in menuconfig under [*]   Broadcom devices gives you CONFIG_BNX2:  in its help dialog?

Does the next entry contain cnic with CONFIG_CNIC: in its help dialog?

or asking another way, I have:

 [*] Broadcom devices 

< > Broadcom 440x/47xx ethernet support 

<M> QLogic NetXtremeII support # shows CONFIG_BNX2 as symbol in help here

<M> QLogic CNIC support # shows CONFIG_CNIC as symbol in help here

< > Broadcom Tigon3 support 

< > Broadcom NetXtremeII 10Gb support 

if you have an entry that would produce CONFIG_CNIC as symbol that is not currently enabled; suggest you enable it and recompile.

to save typing: command | tee /foo will show you the output of command and save it in a file named /foo; a reboot to the livemedia and mounting the gentoo partitions would then facilitate copy/paste of /mnt/gentoo/foo contents here or wgetpaste /mnt/gentoo/foo and posting the url here

----------

## MasterDragon

emerging linux-firmware fixed it, thanks for the help.

My installed system had stuff in /lib/firmware/bnx2, just not as much as the CD did...

----------

