netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@mellanox.com>
To: Vlad Buslov <vladbu@mellanox.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"jhs@mojatatu.com" <jhs@mojatatu.com>,
	"xiyou.wangcong@gmail.com" <xiyou.wangcong@gmail.com>,
	"jiri@resnulli.us" <jiri@resnulli.us>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"idosch@idosch.org" <idosch@idosch.org>
Subject: Re: [PATCH net-next] net: sched: flower: fix filter net reference counting
Date: Fri, 12 Apr 2019 13:28:58 +0000	[thread overview]
Message-ID: <20190412132855.GA21114@splinter> (raw)
In-Reply-To: <20190411215419.5417-1-vladbu@mellanox.com>

On Fri, Apr 12, 2019 at 12:54:19AM +0300, Vlad Buslov wrote:
> Fix net reference counting in fl_change() and remove redundant call to
> tcf_exts_get_net() from __fl_delete(). __fl_put() already tries to get net
> before releasing exts and deallocating a filter, so this code caused flower
> classifier to obtain net twice per filter that is being deleted.
> 
> Implementation of __fl_delete() called tcf_exts_get_net() to pass its
> result as 'async' flag to fl_mask_put(). However, 'async' flag is redundant
> and only complicates fl_mask_put() implementation. This functionality seems
> to be copied from filter cleanup code, where it was added by Cong with
> following explanation:
> 
>     This patchset tries to fix the race between call_rcu() and
>     cleanup_net() again. Without holding the netns refcnt the
>     tc_action_net_exit() in netns workqueue could be called before
>     filter destroy works in tc filter workqueue. This patchset
>     moves the netns refcnt from tc actions to tcf_exts, without
>     breaking per-netns tc actions.
> 
> This doesn't apply to flower mask, which doesn't call any tc action code
> during cleanup. Simplify fl_mask_put() by removing the flag parameter and
> always use tcf_queue_work() to free mask objects.
> 
> Fixes: 061775583e35 ("net: sched: flower: introduce reference counting for filters")
> Fixes: 1f17f7742eeb ("net: sched: flower: insert filter to ht before offloading it to hw")
> Fixes: 05cd271fd61a ("cls_flower: Support multiple masks per priority")
> Reported-by: Ido Schimmel <idosch@mellanox.com>
> Signed-off-by: Vlad Buslov <vladbu@mellanox.com>

I see the patch was already applied, but FWIW:

Tested-by: Ido Schimmel <idosch@mellanox.com>

      reply	other threads:[~2019-04-12 13:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-11 21:54 [PATCH net-next] net: sched: flower: fix filter net reference counting Vlad Buslov
2019-04-12 13:28 ` Ido Schimmel [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=20190412132855.GA21114@splinter \
    --to=idosch@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=idosch@idosch.org \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=vladbu@mellanox.com \
    --cc=xiyou.wangcong@gmail.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).