netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleksij Rempel <o.rempel@pengutronix.de>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Qianqiang Liu <qianqiang.liu@163.com>,
	chris.snook@gmail.com, davem@davemloft.net, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: ag71xx: remove dead code path
Date: Wed, 11 Sep 2024 09:53:31 +0200	[thread overview]
Message-ID: <ZuFMe-WoIIwr8E1o@pengutronix.de> (raw)
In-Reply-To: <196dc563-85ec-491d-8e2e-8749f3b07ff4@lunn.ch>

On Tue, Sep 10, 2024 at 05:58:22PM +0200, Andrew Lunn wrote:
> On Tue, Sep 10, 2024 at 11:22:54PM +0800, Qianqiang Liu wrote:
> > The 'err' is always zero, so the following branch can never be executed:
> > if (err) {
> > 	ndev->stats.rx_dropped++;
> > 	kfree_skb(skb);
> > }
> > Therefore, the 'if' statement can be removed.
> 
> This code was added by Oleksij Rempel <o.rempel@pengutronix.de>. It is
> good to Cc: him, he might have useful comments.

Yes, please.

> Your changed does look correct, but maybe ret was actually supposed to
> be set somewhere? Is there an actual bug hiding here somewhere?

Hm, let's see... this issue existed in the openwrt code and I didn't
spotted it by upstreaming.

The only place which may fail in this part is napi_build_skb(), we will
need to count it probably with rx_errors++.

I'm ok with this patch, it can be reworked to use rx_errors++ on
napi_build_skb() instead or this can be done in a separate patch.

If you like to keep this patch as is, here is my:
Reviewed-by: Oleksij Rempel <o.rempel@pengutronix.de>

Thank you!

Regards,
Oleksij
-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

  reply	other threads:[~2024-09-11  7:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-10 15:22 [PATCH] net: ag71xx: remove dead code path Qianqiang Liu
2024-09-10 15:58 ` Andrew Lunn
2024-09-11  7:53   ` Oleksij Rempel [this message]
2024-09-10 18:22 ` Rosen Penev
2024-09-12 15:46 ` Qianqiang Liu
2024-09-13  0:36   ` Jakub Kicinski

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=ZuFMe-WoIIwr8E1o@pengutronix.de \
    --to=o.rempel@pengutronix.de \
    --cc=andrew@lunn.ch \
    --cc=chris.snook@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=qianqiang.liu@163.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).