All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
To: Michael Chan <michael.chan@broadcom.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
	kuba@kernel.org, pabeni@redhat.com,
	andrew.gospodarek@broadcom.com, pavan.chebbi@broadcom.com
Subject: Re: [PATCH net-next 02/13] bnxt_en: Add ethtool -N support for ether filters.
Date: Tue, 6 Feb 2024 14:45:41 +0100	[thread overview]
Message-ID: <ZcI4BdL6dHOeZiQJ@mev-dev> (raw)
In-Reply-To: <CACKFLi=cwJzA+igWnKNsGdVqY9OvBPao4aheKF_j7PWc1xF3vw@mail.gmail.com>

On Tue, Feb 06, 2024 at 12:10:32AM -0800, Michael Chan wrote:
> On Mon, Feb 5, 2024 at 11:04 PM Michal Swiatkowski
> <michal.swiatkowski@linux.intel.com> wrote:
> >
> > On Mon, Feb 05, 2024 at 02:31:51PM -0800, Michael Chan wrote:
> > > +     spin_lock_bh(&bp->ntp_fltr_lock);
> > > +     fltr = __bnxt_lookup_l2_filter(bp, key, idx);
> > > +     if (fltr) {
> > > +             fltr = ERR_PTR(-EEXIST);
> > > +             goto l2_filter_exit;
> > > +     }
> > > +     fltr = kzalloc(sizeof(*fltr), GFP_ATOMIC);
> > > +     if (!fltr) {
> > > +             fltr = ERR_PTR(-ENOMEM);
> > > +             goto l2_filter_exit;
> > > +     }
> > > +     fltr->base.flags = flags;
> > > +     rc = bnxt_init_l2_filter(bp, fltr, key, idx);
> > > +     if (rc) {
> > > +             spin_unlock_bh(&bp->ntp_fltr_lock);
> > Why filter needs to be deleted without lock? If you can change the order
> > it looks more natural:
> >
> > +if (rc) {
> > +       fltr = ERR_PTR(rc);
> > +       goto l2_filter_del;
> > +}
> 
> Thanks for the review.  bnxt_del_l2_filter() will take the same lock
> inside the function if it goes ahead to delete the filter.  That's why
> the lock needs to be released first.

Got it, thanks.

  reply	other threads:[~2024-02-06 13:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-05 22:31 [PATCH net-next 00/13] bnxt_en: Ntuple and RSS updates Michael Chan
2024-02-05 22:31 ` [PATCH net-next 01/13] bnxt_en: Use firmware provided maximum filter counts Michael Chan
2024-02-06  6:55   ` Michal Swiatkowski
2024-02-05 22:31 ` [PATCH net-next 02/13] bnxt_en: Add ethtool -N support for ether filters Michael Chan
2024-02-06  7:04   ` Michal Swiatkowski
2024-02-06  8:10     ` Michael Chan
2024-02-06 13:45       ` Michal Swiatkowski [this message]
2024-02-05 22:31 ` [PATCH net-next 03/13] bnxt_en: Support ethtool -n to display " Michael Chan
2024-02-06  7:15   ` Michal Swiatkowski
2024-02-05 22:31 ` [PATCH net-next 04/13] bnxt_en: implement fully specified 5-tuple masks Michael Chan
2024-02-06  7:47   ` Michal Swiatkowski
2024-02-05 22:31 ` [PATCH net-next 05/13] bnxt_en: Enhance ethtool ntuple support for ip flows besides TCP/UDP Michael Chan
2024-02-05 22:31 ` [PATCH net-next 06/13] bnxt_en: Add drop action support for ntuple Michael Chan
2024-02-05 22:31 ` [PATCH net-next 07/13] bnxt_en: Add separate function to delete the filter structure Michael Chan
2024-02-05 22:31 ` [PATCH net-next 08/13] bnxt_en: Save user configured filters in a lookup list Michael Chan
2024-02-05 22:31 ` [PATCH net-next 09/13] bnxt_en: Retain user configured filters when closing Michael Chan
2024-02-05 22:31 ` [PATCH net-next 10/13] bnxt_en: Restore all the user created L2 and ntuple filters Michael Chan
2024-02-05 22:32 ` [PATCH net-next 11/13] bnxt_en: Add support for user configured RSS key Michael Chan
2024-02-05 22:32 ` [PATCH net-next 12/13] bnxt_en: Invalidate user filters when needed Michael Chan
2024-02-05 22:32 ` [PATCH net-next 13/13] bnxt_en: Add RSS support for IPSEC headers Michael Chan
2024-02-09 20:50 ` [PATCH net-next 00/13] bnxt_en: Ntuple and RSS updates patchwork-bot+netdevbpf

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=ZcI4BdL6dHOeZiQJ@mev-dev \
    --to=michal.swiatkowski@linux.intel.com \
    --cc=andrew.gospodarek@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pavan.chebbi@broadcom.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.