Writing ndo_start_xmit() NIC driver function assume that after data transmission I must call dev_kfree_skb() of consumed struct sk_buff and return NETDEV_TX_OK.
What should I expect if consumed struct skb will not be freed up during module lifetime?
Can Linux kernel free struct sk_buff after some timeout or in another way?
Are there difference of behavior between various versions of Linux kernel?
Linux kernel Documentation mentioned in the topic:
An ndo_start_xmit method must not modify the shared parts of a cloned SKB.
Do not forget that once you return NETDEV_TX_OK from your ndo_start_xmit method, it is your driver’s responsibility to free up the SKB and in some finite amount of time.
For example, this means that it is not allowed for your TX mitigation scheme to let TX packets “hang out” in the TX ring unreclaimed forever if no new TX packets are sent. This error can deadlock sockets waiting for send buffer room to be freed up.
If you return NETDEV_TX_BUSY from the ndo_start_xmit method, you must not keep any reference to that SKB and you must not attempt to free it up.