xgmac: Call dev_kfree/consume_skb_any instead of dev_kfree_skb.
Replace dev_kfree_skb with dev_consume_skb_any in xgmac_tx_complete that can be called in hard irq and other contexts. Replace dev_kfree_skb with dev_kfree_skb_any in xgmac_xmit that can be called in hard irq and other contexts. dev_consume_skb_any is used in xgamc_tx_complete as skbs that reach there have been successfully transmitted, dev_kfree_skby_any is used in xgmac_xmit as skbs that are freed there are being dropped. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
This commit is contained in:
Родитель
c88b5b6a68
Коммит
f5cf76ba62
|
@ -897,7 +897,7 @@ static void xgmac_tx_complete(struct xgmac_priv *priv)
|
||||||
/* Check tx error on the last segment */
|
/* Check tx error on the last segment */
|
||||||
if (desc_get_tx_ls(p)) {
|
if (desc_get_tx_ls(p)) {
|
||||||
desc_get_tx_status(priv, p);
|
desc_get_tx_status(priv, p);
|
||||||
dev_kfree_skb(skb);
|
dev_consume_skb_any(skb);
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->tx_skbuff[entry] = NULL;
|
priv->tx_skbuff[entry] = NULL;
|
||||||
|
@ -1105,7 +1105,7 @@ static netdev_tx_t xgmac_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||||
len = skb_headlen(skb);
|
len = skb_headlen(skb);
|
||||||
paddr = dma_map_single(priv->device, skb->data, len, DMA_TO_DEVICE);
|
paddr = dma_map_single(priv->device, skb->data, len, DMA_TO_DEVICE);
|
||||||
if (dma_mapping_error(priv->device, paddr)) {
|
if (dma_mapping_error(priv->device, paddr)) {
|
||||||
dev_kfree_skb(skb);
|
dev_kfree_skb_any(skb);
|
||||||
return NETDEV_TX_OK;
|
return NETDEV_TX_OK;
|
||||||
}
|
}
|
||||||
priv->tx_skbuff[entry] = skb;
|
priv->tx_skbuff[entry] = skb;
|
||||||
|
@ -1169,7 +1169,7 @@ dma_err:
|
||||||
desc = first;
|
desc = first;
|
||||||
dma_unmap_single(priv->device, desc_get_buf_addr(desc),
|
dma_unmap_single(priv->device, desc_get_buf_addr(desc),
|
||||||
desc_get_buf_len(desc), DMA_TO_DEVICE);
|
desc_get_buf_len(desc), DMA_TO_DEVICE);
|
||||||
dev_kfree_skb(skb);
|
dev_kfree_skb_any(skb);
|
||||||
return NETDEV_TX_OK;
|
return NETDEV_TX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче