提交 080b3c19 编写于 作者: E Eric W. Biederman 提交者: David S. Miller

netpoll: Remove strong unnecessary assumptions about skbs

Remove the assumption that the skbs that make it to
netpoll_send_skb_on_dev are allocated with find_skb, such that
skb->users == 1 and nothing is attached that would prevent the skbs from
being freed from hard irq context.

Remove this assumption by replacing __kfree_skb on error paths with
dev_kfree_skb_irq (in hard irq context) and kfree_skb (in process
context).
Signed-off-by: N"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 66b5552f
...@@ -112,7 +112,7 @@ static void queue_process(struct work_struct *work) ...@@ -112,7 +112,7 @@ static void queue_process(struct work_struct *work)
struct netdev_queue *txq; struct netdev_queue *txq;
if (!netif_device_present(dev) || !netif_running(dev)) { if (!netif_device_present(dev) || !netif_running(dev)) {
__kfree_skb(skb); kfree_skb(skb);
continue; continue;
} }
...@@ -332,7 +332,7 @@ void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb, ...@@ -332,7 +332,7 @@ void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb,
npinfo = rcu_dereference_bh(np->dev->npinfo); npinfo = rcu_dereference_bh(np->dev->npinfo);
if (!npinfo || !netif_running(dev) || !netif_device_present(dev)) { if (!npinfo || !netif_running(dev) || !netif_device_present(dev)) {
__kfree_skb(skb); dev_kfree_skb_irq(skb);
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册