# interface 'flipping' @ boot



## mururoa (Aug 18, 2022)

Hi there,
I have a strange network interface init behaviour.
In the end the interface is up and running ... most of the time.
Configuration is DHCP.
The computer is a Dell laptop I use for work.
Here is the behaviour :

```
dmesg | grep em0
ahciem0: <AHCI enclosure management bridge> on ahci0
em0: <Intel(R) I219-LM SPT(5)> mem 0xef200000-0xef21ffff irq 16 at device 31.6 on pci0
em0: EEPROM V0.1-4
em0: Using 1024 TX descriptors and 1024 RX descriptors
em0: Using an MSI interrupt
em0: Ethernet address: a4:4c:c8:36:19:82
em0: netmap queues/slots: TX 1/1024, RX 1/1024
ses0 at ahciem0 bus 0 scbus2 target 0 lun 0
em0: link state changed to UP
em0: link state changed to DOWN
em0: link state changed to UP
em0: link state changed to DOWN
em0: link state changed to UP
em0: link state changed to DOWN
em0: link state changed to UP
em0: link state changed to DOWN
em0: link state changed to UP
em0: link state changed to DOWN
em0: link state changed to UP
em0: link state changed to DOWN
em0: link state changed to UP
em0: link state changed to DOWN
em0: link state changed to UP
em0: link state changed to DOWN
em0: link state changed to UP
em0: link state changed to DOWN
em0: link state changed to UP
em0: link state changed to DOWN
em0: link state changed to UP
em0: link state changed to DOWN
em0: link state changed to UP
em0: link state changed to DOWN
em0: link state changed to UP
em0: link state changed to DOWN
em0: link state changed to UP
em0: link state changed to DOWN
em0: promiscuous mode enabled
em0: link state changed to UP
em0: link state changed to DOWN
em0: link state changed to UP
em0: link state changed to DOWN
em0: link state changed to UP
em0: link state changed to DOWN
em0: link state changed to UP
em0: link state changed to DOWN
em0: link state changed to UP
em0: link state changed to DOWN
em0: link state changed to UP
```
Somebody already have seen this or may know where it comes from ?


----------



## mer (Aug 18, 2022)

Is this happening after a warm reset or a cold boot?
Have you tried a different cable?
What's on the other end of the cable?  If a switch, does it have another port you could move the cable to?


----------



## SirDice (Aug 18, 2022)

mer said:


> Have you tried a different cable?


Yeah, that would be my first guess too. Easy enough to test, just swap out the cable. A dodgy cable could certainly cause this.


----------



## mer (Aug 18, 2022)

SirDice said:


> Yeah, that would be my first guess too. Easy enough to test, just swap out the cable. A dodgy cable could certainly cause this.


It amazes me how a cable can be good for a while and then go bad.  I learned that keeping extra quality cables on hand is never a bad thing.


----------



## SirDice (Aug 18, 2022)

mer said:


> It amazes me how a cable can be good for a while and then go bad.


Cables get snagged, run over, bent, pulled, and whatnot. All it takes is one of the 8 strands breaking and the cable becomes dodgy. 


mer said:


> I learned that keeping extra quality cables on hand is never a bad thing.


I have a whole drawer full of cat5 cables. Some new, some old, different lengths, etc. They're cheap enough to have a couple of spares on hand.


----------



## mururoa (Aug 18, 2022)

So,
it happen after a cold boot; never tried to suspend so far.
On the other end there is a switch/router with other ports yes. I'll try another port and if it's the same thing, another cable.
This particular cable is comming from the router, dont lay on ground, and was used for other devices and other OS on this laptop with any problem so far.
After the last UP nothing happen any more. All up/down are during the boot or soon after it.
I'll tell you more when the tests will have been made.
I wanna just know if it's a kind of already known thing before exploring more.


----------



## mer (Aug 18, 2022)

From a software POV, it may happen as things initialize at the device driver for the em0 device.  I have that same device in a system (I think it's an Intel device of some sort) and I don't see those messages.  If it's happening after a cold boot perhaps something with  power to the devices.  It would be interesting to see if there is any difference if you do "shutdown -r now"  after it's been up and stable for a while, basically warm boot so power to everything should be good.


----------



## mururoa (Aug 19, 2022)

I changed the cable and port. I know I had to change ONE thing at a time. I'll put back the new cable on the original port later.
Now I have :

```
em0: link state changed to UP
em0: link state changed to DOWN
em0: promiscuous mode enabled
em0: link state changed to UP
em0: link state changed to DOWN
em0: link state changed to UP
```
Maybe it's normal ?

Edit : I looked @ other servers and maybe one more UP/DOWN here; not a big deal.


----------



## SirDice (Aug 19, 2022)

It could be a driver/software issue of course. Some variation of the chipset that needs some specific workarounds, that's not uncommon. Still a good idea to rule out any other potential causes.


----------



## mer (Aug 19, 2022)

I agree with SirDice.  A few could be normal or reasonable, but "how many is too many", I don't know.  Drivers hitting hardware registers that cause autonegotiation to restart would cause a down/up and the other end could also cause a restart.  If after changing cable and port cold boot is giving only a couple of downs I would say that's more normal.  What you originally posted, to me indicated something not quite right.  Maybe not a problem, but a future problem.


----------

