Link Status before sending packet

Sub forums for various specialist XMOS applications. e.g. USB audio, motor control and robotics.
User avatar
gerrykurz
XCore Addict
Posts: 204
Joined: Sun Jun 01, 2014 10:25 pm

Link Status before sending packet

Post by gerrykurz »

Do I have to make sure the link is up before I try and send packets to the ethernet port?

Or does the ethernet server handle this?

In other words, what would happen if I try and transmit a packet on a port where the link is down?

If I do need to know the link status, is the only way to get that is from the smi interface?


srinie
XCore Addict
Posts: 158
Joined: Thu Mar 20, 2014 8:04 am

Post by srinie »

gerrykurz wrote:Do I have to make sure the link is up before I try and send packets to the ethernet port?

Or does the ethernet server handle this?
Ethernet server does not do the link status checks;
gerrykurz wrote: If I do need to know the link status, is the only way to get that is from the smi interface?
Yes - thru 'smi_get_link_state()'
User avatar
gerrykurz
XCore Addict
Posts: 204
Joined: Sun Jun 01, 2014 10:25 pm

Post by gerrykurz »

So what happens if I send packets to a link that is down?
srinie
XCore Addict
Posts: 158
Joined: Thu Mar 20, 2014 8:04 am

Post by srinie »

My observation is that send always go through (remove the link cable on a continuous tx application and print/LED toggle for sends)

On the other hand, if the receive side is a XMOS device: checks for the link status in this path.
User avatar
gerrykurz
XCore Addict
Posts: 204
Joined: Sun Jun 01, 2014 10:25 pm

Post by gerrykurz »

Yes it seems that the server sends the packet and returns a timestamp whether the link is up or not.

This is fine as my concern was that the call would block and not return.
srinie
XCore Addict
Posts: 158
Joined: Thu Mar 20, 2014 8:04 am

Post by srinie »

Good to note your feedback as well. Yes, its a non-blocking call.

Can you please update the similar question in the QnA section with your feedback and learning, for the benefit of other users?
User avatar
gerrykurz
XCore Addict
Posts: 204
Joined: Sun Jun 01, 2014 10:25 pm

Post by gerrykurz »

Done.