开发者

Linux kernel network driver. How do I deal with transmit errors after hard_start_xmit() has returned success?

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 whe开发者_StackOverflowther 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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜