mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* Activating network during start
@ 2014-11-20 20:50 Holger Freyther
  2014-11-21  7:11 ` Sascha Hauer
  0 siblings, 1 reply; 5+ messages in thread
From: Holger Freyther @ 2014-11-20 20:50 UTC (permalink / raw)
  To: barebox

Good Evening,

I wrote a small command to send a LLDP frame over the network. Then I
tried to integrate this command into the start script but I noticed that
while a message is printed on the console no actual packet is being
sent on the wire.

I am using a Phytec AM335X SoM and I am not on the latest version of
barebox either so this might be something that is already fixed.

My assumption is that when I use eth_get_current/eth_send the network
is being activated. I had a quick look at the return code of eth_send
to see if I could see that my packet has been dropped but in both
success/failure the method returns 0. Is this to be expected? My
interim solution is to add a sleep after the first command invocation
and then do it again?

Any ideas on how to properly address it?

holger


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Activating network during start
  2014-11-20 20:50 Activating network during start Holger Freyther
@ 2014-11-21  7:11 ` Sascha Hauer
  2014-11-21  8:40   ` Holger Hans Peter Freyther
  0 siblings, 1 reply; 5+ messages in thread
From: Sascha Hauer @ 2014-11-21  7:11 UTC (permalink / raw)
  To: Holger Freyther; +Cc: barebox

Hi Holger,

On Thu, Nov 20, 2014 at 08:50:17PM +0000, Holger Freyther wrote:
> Good Evening,
> 
> I wrote a small command to send a LLDP frame over the network. Then I
> tried to integrate this command into the start script but I noticed that
> while a message is printed on the console no actual packet is being
> sent on the wire.
> 
> I am using a Phytec AM335X SoM and I am not on the latest version of
> barebox either so this might be something that is already fixed.
> 
> My assumption is that when I use eth_get_current/eth_send the network
> is being activated. I had a quick look at the return code of eth_send
> to see if I could see that my packet has been dropped but in both
> success/failure the method returns 0. Is this to be expected? My
> interim solution is to add a sleep after the first command invocation
> and then do it again?

I don't understand what the exact problem is. So your command generally
works, only when it's called from the start script it doesn't work. Did
I get that correctly? Also a second invocation of the command then
works, right?
This sounds like the phy is not yet ready. I often get the impression
that the very first packet sent to the network is lost, even though the
phy registers tell us the phy is ready. I never found out what the
problem is here.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Activating network during start
  2014-11-21  7:11 ` Sascha Hauer
@ 2014-11-21  8:40   ` Holger Hans Peter Freyther
  2014-11-21  9:18     ` Sascha Hauer
  2014-11-21  9:20     ` Sascha Hauer
  0 siblings, 2 replies; 5+ messages in thread
From: Holger Hans Peter Freyther @ 2014-11-21  8:40 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On Fri, Nov 21, 2014 at 08:11:16AM +0100, Sascha Hauer wrote:

Good Morning,

> I don't understand what the exact problem is. So your command generally
> works, only when it's called from the start script it doesn't work. Did
> I get that correctly? Also a second invocation of the command then
> works, right?
> This sounds like the phy is not yet ready. I often get the impression
> that the very first packet sent to the network is lost, even though the
> phy registers tell us the phy is ready. I never found out what the
> problem is here.

 lldp
 sleep 2s
 lldp

With the first "lldp" invocation the network is activated and then I
need to sleep a bit (I don't know if 1s or less is working but with
no wait it certainly doesn't work).

With checking the phy you refer to the call of eth_carrier_check that
is used by eth_send?

kind regards
	holger

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Activating network during start
  2014-11-21  8:40   ` Holger Hans Peter Freyther
@ 2014-11-21  9:18     ` Sascha Hauer
  2014-11-21  9:20     ` Sascha Hauer
  1 sibling, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2014-11-21  9:18 UTC (permalink / raw)
  To: Holger Hans Peter Freyther, h; +Cc: barebox

On Fri, Nov 21, 2014 at 09:40:01AM +0100, Holger Hans Peter Freyther wrote:
> On Fri, Nov 21, 2014 at 08:11:16AM +0100, Sascha Hauer wrote:
> 
> Good Morning,
> 
> > I don't understand what the exact problem is. So your command generally
> > works, only when it's called from the start script it doesn't work. Did
> > I get that correctly? Also a second invocation of the command then
> > works, right?
> > This sounds like the phy is not yet ready. I often get the impression
> > that the very first packet sent to the network is lost, even though the
> > phy registers tell us the phy is ready. I never found out what the
> > problem is here.
> 
>  lldp
>  sleep 2s
>  lldp
> 
> With the first "lldp" invocation the network is activated and then I
> need to sleep a bit (I don't know if 1s or less is working but with
> no wait it certainly doesn't work).
> 
> With checking the phy you refer to the call of eth_carrier_check that
> is used by eth_send?

Yes.

You could try if one of the other network commands like 'ping' work
right after startup.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Activating network during start
  2014-11-21  8:40   ` Holger Hans Peter Freyther
  2014-11-21  9:18     ` Sascha Hauer
@ 2014-11-21  9:20     ` Sascha Hauer
  1 sibling, 0 replies; 5+ messages in thread
From: Sascha Hauer @ 2014-11-21  9:20 UTC (permalink / raw)
  To: Holger Hans Peter Freyther; +Cc: barebox

On Fri, Nov 21, 2014 at 09:40:01AM +0100, Holger Hans Peter Freyther wrote:
> On Fri, Nov 21, 2014 at 08:11:16AM +0100, Sascha Hauer wrote:
> 
> Good Morning,
> 
> > I don't understand what the exact problem is. So your command generally
> > works, only when it's called from the start script it doesn't work. Did
> > I get that correctly? Also a second invocation of the command then
> > works, right?
> > This sounds like the phy is not yet ready. I often get the impression
> > that the very first packet sent to the network is lost, even though the
> > phy registers tell us the phy is ready. I never found out what the
> > problem is here.
> 
>  lldp
>  sleep 2s
>  lldp
> 
> With the first "lldp" invocation the network is activated and then I
> need to sleep a bit (I don't know if 1s or less is working but with
> no wait it certainly doesn't work).
> 
> With checking the phy you refer to the call of eth_carrier_check that
> is used by eth_send?

Yes.

You could try if one of the other network commands like 'ping' work
right after startup.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-11-21  9:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-20 20:50 Activating network during start Holger Freyther
2014-11-21  7:11 ` Sascha Hauer
2014-11-21  8:40   ` Holger Hans Peter Freyther
2014-11-21  9:18     ` Sascha Hauer
2014-11-21  9:20     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox