lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Repeated DHCP requests.


From: Rogier Wolff
Subject: Re: [lwip-users] Repeated DHCP requests.
Date: Mon, 9 Oct 2023 17:20:55 +0200

On Mon, Oct 09, 2023 at 04:53:55PM +0200, Rogier Wolff wrote:
> On Mon, Oct 09, 2023 at 02:53:31PM +0200, Rogier Wolff wrote:
> > Ok... Just added a debug message to netif_set_link_up in
> > src/core/netif.c and... Nope: dhcp_network_changed is NOT called from
> > there, at least I'm not seeing the debug message, and I don't see any
> > other place where it gets called.
> 
> Tip to self. Make sure you upload the new modified version before
> testing.
> 
> Sorry I forgot to upload the modified version with those debug
> statements. So now the question becomes: Why is netif_set_link_up
> called more than expected. I found a bare call in my own source. That
> should only be called once during init, and the low-level-driver for
> the phy has a call. I'll check which one gets called.

Update: My phy is occasionally, reporting "link down" on one poll and
then "link up" on the next.

331929: status 0 changed: 7829
is link up changed: 0 
331930: status 0 changed: 782d
is link up changed: 1 
netif_set_link_up 87.767868
setlinkup: calling dhcp

7829 is the 16 bit status word that has "link down" in bit2. 

331929 is the number of the poll, with the real-time being about 87
seconds, teh poll is being called over 3700 times per second.

As you can see, less than 300 microseconds later, it reports "link up"
again.

It does not look as if there is a communications error. If say the
chip would miss a clock cycle, the whole word would be shifted. It is
not. 

I'm now implementing a workaround: link state is considered UP if
either THIS poll or the PREVIOUS poll says it was/is up.

        Roger.

-- 
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a is going up.  -- Chris Hadfield about flying up the space shuttle.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]