All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: Leon Romanovsky <leon@kernel.org>, <netdev@vger.kernel.org>,
	<davem@davemloft.net>, <edumazet@google.com>, <pabeni@redhat.com>
Subject: Re: [PATCH net v2 1/2] net: apple: mace: don't call dev_kfree_skb() under spin_lock_irqsave()
Date: Thu, 8 Dec 2022 08:33:55 -0800	[thread overview]
Message-ID: <20221208083355.7ca2a99a@kernel.org> (raw)
In-Reply-To: <0d01feea-973a-0331-e669-bc362ba93f56@huawei.com>

On Thu, 8 Dec 2022 16:39:03 +0800 Yang Yingliang wrote:
> >> @@ -846,7 +846,7 @@ static void mace_tx_timeout(struct timer_list *t)
> >>       if (mp->tx_bad_runt) {
> >>   	mp->tx_bad_runt = 0;
> >>       } else if (i != mp->tx_fill) {
> >> -	dev_kfree_skb(mp->tx_bufs[i]);
> >> +	dev_consume_skb_irq(mp->tx_bufs[i]);  
> > Same question, why did you chose dev_consume_skb_irq and not dev_kfree_skb_irq?  
> I chose dev_consume_skb_irq(), because dev_kfree_skb() is consume_skb().

kfree_skb() should be used on error paths, when packet is dropped.
consume_skb() on normal paths, when packet left the system successfully.

dev_kfree* helpers probably default to consume_skb() to avoid spamming
drop monitor, but switching to dev_consume explicitly is not right.

      reply	other threads:[~2022-12-08 16:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-07  1:29 [PATCH net v2 1/2] net: apple: mace: don't call dev_kfree_skb() under spin_lock_irqsave() Yang Yingliang
2022-12-07  1:29 ` [PATCH net v2 2/2] net: apple: bmac: " Yang Yingliang
2022-12-08  7:58 ` [PATCH net v2 1/2] net: apple: mace: " Leon Romanovsky
2022-12-08  8:39   ` Yang Yingliang
2022-12-08 16:33     ` Jakub Kicinski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221208083355.7ca2a99a@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=leon@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=yangyingliang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.