All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Florian Fainelli <florian.fainelli@broadcom.com>
Cc: Wang Hai <wanghai38@huawei.com>,
	bcm-kernel-feedback-list@broadcom.com, davem@davemloft.net,
	edumazet@google.com, pabeni@redhat.com, zhangxiaoxu5@huawei.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] net: systemport: fix potential memory leak in bcm_sysport_xmit()
Date: Tue, 15 Oct 2024 11:01:54 -0700	[thread overview]
Message-ID: <20241015110154.55c7442f@kernel.org> (raw)
In-Reply-To: <0c21ac6a-fda4-4924-9ad1-db1b549be418@broadcom.com>

On Mon, 14 Oct 2024 09:59:27 -0700 Florian Fainelli wrote:
> > diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
> > index c9faa8540859..0a68b526e4a8 100644
> > --- a/drivers/net/ethernet/broadcom/bcmsysport.c
> > +++ b/drivers/net/ethernet/broadcom/bcmsysport.c
> > @@ -1359,6 +1359,7 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb,
> >   		netif_err(priv, tx_err, dev, "DMA map failed at %p (len=%d)\n",
> >   			  skb->data, skb_len);
> >   		ret = NETDEV_TX_OK;
> > +		dev_kfree_skb_any(skb);  
> 
> Since we already have a private counter tracking DMA mapping errors, I 
> would follow what the driver does elsewhere in the transmit path, 
> especially what bcm_sysport_insert_tsb() does, and just use 
> dev_consume_skb_any() here.

Are you saying that if the packet drop is accounted is some statistics
we should not inform drop monitor about it? 🤔️ 
That wasn't my understanding of kfree_skb vs consume_skb..

  parent reply	other threads:[~2024-10-15 18:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14 14:51 [PATCH net] net: systemport: fix potential memory leak in bcm_sysport_xmit() Wang Hai
2024-10-14 16:59 ` Florian Fainelli
2024-10-15 14:54   ` Wang Hai
2024-10-15 18:01   ` Jakub Kicinski [this message]
2024-10-15 18:07     ` Florian Fainelli
2024-10-15 19:54       ` Jakub Kicinski
2024-10-15 23:55         ` Florian Fainelli
2024-10-16  0:00           ` Jakub Kicinski
2024-10-15 23:53 ` Florian Fainelli

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=20241015110154.55c7442f@kernel.org \
    --to=kuba@kernel.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=wanghai38@huawei.com \
    --cc=zhangxiaoxu5@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.