Skip to contentSkip to conversation

dev_kfree_skb[_irq,_any] usage rules

DISCUSSION Denis Vlasenko 1 participant 1 message Jun 29, 2005

lore
Share & tools
lore
#0 lore raw

Hi,

I have this hard_start_xmit code (simplified):

int start_xmit(struct sk_buff *skb, netdevice_t * dev)

{
        struct mydevice *priv = acx_netdev_priv(dev);

        if (!skb) goto end;
        if (!priv) goto end;

        /* there is no one to talk to */
        if (priv->status != ACX_STATUS_4_ASSOCIATED) {
                printk("start_xmit() called but not associated yet\n");
                /* silently drop the packet, since we're not connected yet */
                dev_kfree_skb(skb);
                priv->stats.tx_errors++;
                goto end;
        }
	...
}

Should I use dev_kfree_skb(skb) here or dev_kfree_skb_irq(skb)? (IIRC hard_start_xmit is in atomic context, no?)

There is also a dev_kfree_skb_any(skb). What are the rules? --
vda