<snip>

>
>
>>
>>> +               struct sk_buff *skb_new;
>>> +
>>> +               skb_new = skb_realloc_headroom(skb, MLXSW_TXHDR_LEN);
>>> +               dev_kfree_skb_any(skb);
>>> +               if (!skb_new) {
>>> +                       this_cpu_inc(mlxsw_sx_port->pcpu_stats->tx_dropped);
>>> +                       return NETDEV_TX_OK;
>>> +               }
>>> +               skb = skb_new;
>>> +       }
>>> +       mlxsw_sx_txhdr_construct(skb, &tx_info);
>>> +       err = mlxsw_core_skb_transmit(mlxsw_sx, skb, &tx_info);
>>> +       if (err == -EAGAIN)
>>> +               return NETDEV_TX_BUSY;
>>
>>I think there is a problem here when returning NETDEV_TX_BUSY when
>>original skb might have been freed above in the headroom check. (ref
>>Documentation/networking/driver.txt).
>
>I have to check this out a bit more. Thanks for pointing that out.

You are right. In case queue is busy we obviously cannot free
the original skb. Will fix that in V2. Thanks!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to