Skip to contentSkip to conversation

Question: Virtual device error return is mangled

DISCUSSION Mark Huth 1 participant 1 message Jun 15, 2006

Subsystems (2)
lore
Share & tools
lore

Mark Huth

author
#0 lore raw

Why does net/core/dev.c: dev_queue_transmit not pass back the actual status from hard_start_xmit in the case of a virtual device, and why is an error return considered a critical kernel error?

ie why:

         if (!dev->hard_start_xmit(skb, dev)) {
            ...
   rc = -ENETDOWN;
            ...

return rc;

instead of :

         if (!rc = dev->hard_start_xmit(skb, dev)) {
            ...

            ...

return rc;

In the case of a real device, a qdisc error gets returned up the stack, while in the case of say a bonding device enslaving the real device and encountering the same error, success gets returned up the stack. The various virtual devices seem to return success whatever happens, but it seems like this behavior is chosen due to the fact that the real status cannot be passed back, even if the virtural device manages the skb ref count correctly, as dev_queue_transmit will turn it into -ENETDOWN.

Thanks,
Mark Huth