Take the 2-minute tour ×

In a linux network driver, I must provide a function, hard_start_xmit(), that actually sends packets on the wire. I understand that if it can't send the packet, hard_start_xmit() should return an error, which will cause the packet to be retried later. However, since hard_start_xmit() may be called at with IRQs disabled, it cannot wait very long to determine whether the packet could be sent.

How do I deal with a transmission error that happens after hard_start_xmit() has already returned success? Is it correct to simply drop the packet, free the skb, and count a transmit error?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Yes. Many transmit errors are only detectable after the NIC has actually tried to transmit the frame. Note that there are several different error counters that you can increment, if your device returns sufficient information on the error - see struct net_device_stats.

share|improve this answer
add comment

Your Answer


