public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Jiawen Wu" <jiawenwu@trustnetic•com>
To: "'Simon Horman'" <horms@kernel•org>
Cc: <davem@davemloft•net>, <edumazet@google•com>, <kuba@kernel•org>,
	<pabeni@redhat•com>, <linux@armlinux•org.uk>, <andrew@lunn•ch>,
	<netdev@vger•kernel.org>, <mengyuanlou@net-swift•com>
Subject: RE: [PATCH net-next v2 2/3] net: txgbe: support Flow Director perfect filters
Date: Tue, 18 Jun 2024 17:02:30 +0800	[thread overview]
Message-ID: <00d501dac15e$4034f530$c09edf90$@trustnetic.com> (raw)
In-Reply-To: <20240606204959.GP791188@kernel.org>

> > +	/* only program filters to hardware if the net device is running, as
> > +	 * we store the filters in the Rx buffer which is not allocated when
> > +	 * the device is down
> > +	 */
> > +	if (netif_running(wx->netdev)) {
> > +		err = txgbe_fdir_write_perfect_filter(wx, &input->filter,
> > +						      input->sw_idx, queue);
> > +		if (err)
> > +			goto err_unlock;
> > +	}
> > +
> > +	txgbe_update_ethtool_fdir_entry(txgbe, input, input->sw_idx);
> > +
> > +	spin_unlock(&txgbe->fdir_perfect_lock);
> > +
> > +	return err;
> 
> Hi Jiawen Wu,
> 
> Smatch flags that err may be used uninitialised here.
> I'm unsure if that can occur in practice, but perhaps it
> would be nicer to simply return 0 here.
> 
> > +err_unlock:
> > +	spin_unlock(&txgbe->fdir_perfect_lock);
> > +err_out:
> > +	kfree(input);
> > +	return -EINVAL;
> 
> And conversely, perhaps it would be nicer to return err here - ensuring is
> it always set.  F.e. this would propagate the error code returned by
> txgbe_fdir_write_perfect_filter().

I think it can be changed to initialize err = 0, and return err in these two places.



  reply	other threads:[~2024-06-18  9:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-05  2:08 [PATCH net-next v2 0/3] add flow director for txgbe Jiawen Wu
2024-06-05  2:08 ` [PATCH net-next v2 1/3] net: txgbe: add FDIR ATR support Jiawen Wu
2024-06-05  2:08 ` [PATCH net-next v2 2/3] net: txgbe: support Flow Director perfect filters Jiawen Wu
2024-06-06  8:53   ` Hariprasad Kelam
2024-06-18  8:55     ` Jiawen Wu
2024-06-06 20:49   ` Simon Horman
2024-06-18  9:02     ` Jiawen Wu [this message]
2024-06-18  9:07       ` Jiawen Wu
2024-06-05  2:08 ` [PATCH net-next v2 3/3] net: txgbe: add FDIR info to ethtool ops Jiawen Wu
2024-06-05  7:33   ` Hariprasad Kelam
2024-06-06  0:52     ` Jakub Kicinski
2024-06-06  3:04 ` [PATCH net-next v2 0/3] add flow director for txgbe 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='00d501dac15e$4034f530$c09edf90$@trustnetic.com' \
    --to=jiawenwu@trustnetic$(echo .)com \
    --cc=andrew@lunn$(echo .)ch \
    --cc=davem@davemloft$(echo .)net \
    --cc=edumazet@google$(echo .)com \
    --cc=horms@kernel$(echo .)org \
    --cc=kuba@kernel$(echo .)org \
    --cc=linux@armlinux$(echo .)org.uk \
    --cc=mengyuanlou@net-swift$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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