Netdev Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH net] net: sonic: replace dev_kfree_skb in sonic_send_packet
@ 2019-09-10  8:58 Mao Wenan
  2019-09-10 10:23 ` Sergei Shtylyov
  0 siblings, 1 reply; 4+ messages in thread
From: Mao Wenan @ 2019-09-10  8:58 UTC (permalink / raw)
  To: tsbogend, davem; +Cc: netdev, linux-kernel, kernel-janitors, Mao Wenan

sonic_send_packet will be processed in irq or none
irq context, so it would better use dev_kfree_skb_any
instead of dev_kfree_skb.

Fixes: d9fb9f384292 ("*sonic/natsemi/ns83829: Move the National Semi-conductor drivers")
Signed-off-by: Mao Wenan <maowenan@huawei.com>
---
 drivers/net/ethernet/natsemi/sonic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/natsemi/sonic.c b/drivers/net/ethernet/natsemi/sonic.c
index 18fd62fbfb64..b339125b2f09 100644
--- a/drivers/net/ethernet/natsemi/sonic.c
+++ b/drivers/net/ethernet/natsemi/sonic.c
@@ -233,7 +233,7 @@ static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev)
 	laddr = dma_map_single(lp->device, skb->data, length, DMA_TO_DEVICE);
 	if (!laddr) {
 		pr_err_ratelimited("%s: failed to map tx DMA buffer.\n", dev->name);
-		dev_kfree_skb(skb);
+		dev_kfree_skb_any(skb);
 		return NETDEV_TX_OK;
 	}
 
-- 
2.20.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] net: sonic: replace dev_kfree_skb in sonic_send_packet
  2019-09-10  8:58 [PATCH net] net: sonic: replace dev_kfree_skb in sonic_send_packet Mao Wenan
@ 2019-09-10 10:23 ` Sergei Shtylyov
  2019-09-11  1:36   ` [PATCH v2 " Mao Wenan
  0 siblings, 1 reply; 4+ messages in thread
From: Sergei Shtylyov @ 2019-09-10 10:23 UTC (permalink / raw)
  To: Mao Wenan, tsbogend, davem; +Cc: netdev, linux-kernel, kernel-janitors

Hello!

On 10.09.2019 11:58, Mao Wenan wrote:

> sonic_send_packet will be processed in irq or none

    s/none irq/non-irq/?

> irq context, so it would better use dev_kfree_skb_any
> instead of dev_kfree_skb.
> 
> Fixes: d9fb9f384292 ("*sonic/natsemi/ns83829: Move the National Semi-conductor drivers")
> Signed-off-by: Mao Wenan <maowenan@huawei.com>
[...]

MBR, Sergei

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 net] net: sonic: replace dev_kfree_skb in sonic_send_packet
  2019-09-10 10:23 ` Sergei Shtylyov
@ 2019-09-11  1:36   ` " Mao Wenan
  2019-09-11  8:14     ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Mao Wenan @ 2019-09-11  1:36 UTC (permalink / raw)
  To: tsbogend, davem; +Cc: netdev, linux-kernel, kernel-janitors, Mao Wenan

sonic_send_packet will be processed in irq or non-irq 
context, so it would better use dev_kfree_skb_any
instead of dev_kfree_skb.

Fixes: d9fb9f384292 ("*sonic/natsemi/ns83829: Move the National Semi-conductor drivers")
Signed-off-by: Mao Wenan <maowenan@huawei.com>
---
 v2: change 'none irq' to 'non-irq'.
 drivers/net/ethernet/natsemi/sonic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/natsemi/sonic.c b/drivers/net/ethernet/natsemi/sonic.c
index 18fd62fbfb64..b339125b2f09 100644
--- a/drivers/net/ethernet/natsemi/sonic.c
+++ b/drivers/net/ethernet/natsemi/sonic.c
@@ -233,7 +233,7 @@ static int sonic_send_packet(struct sk_buff *skb, struct net_device *dev)
 	laddr = dma_map_single(lp->device, skb->data, length, DMA_TO_DEVICE);
 	if (!laddr) {
 		pr_err_ratelimited("%s: failed to map tx DMA buffer.\n", dev->name);
-		dev_kfree_skb(skb);
+		dev_kfree_skb_any(skb);
 		return NETDEV_TX_OK;
 	}
 
-- 
2.20.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 net] net: sonic: replace dev_kfree_skb in sonic_send_packet
  2019-09-11  1:36   ` [PATCH v2 " Mao Wenan
@ 2019-09-11  8:14     ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-09-11  8:14 UTC (permalink / raw)
  To: maowenan; +Cc: tsbogend, netdev, linux-kernel, kernel-janitors

From: Mao Wenan <maowenan@huawei.com>
Date: Wed, 11 Sep 2019 09:36:23 +0800

> sonic_send_packet will be processed in irq or non-irq 
> context, so it would better use dev_kfree_skb_any
> instead of dev_kfree_skb.
> 
> Fixes: d9fb9f384292 ("*sonic/natsemi/ns83829: Move the National Semi-conductor drivers")
> Signed-off-by: Mao Wenan <maowenan@huawei.com>

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-10  8:58 [PATCH net] net: sonic: replace dev_kfree_skb in sonic_send_packet Mao Wenan
2019-09-10 10:23 ` Sergei Shtylyov
2019-09-11  1:36   ` [PATCH v2 " Mao Wenan
2019-09-11  8:14     ` David Miller

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org netdev@archiver.kernel.org
	public-inbox-index netdev


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox