From: David Miller <davem@davemloft.net>
To: vladbu@mellanox.com
Cc: netdev@vger.kernel.org, jhs@mojatatu.com,
xiyou.wangcong@gmail.com, jiri@resnulli.us,
john.hurley@netronome.com
Subject: Re: [PATCH net-next] net: sched: flower: insert filter to ht before offloading it to hw
Date: Sun, 07 Apr 2019 19:34:46 -0700 (PDT) [thread overview]
Message-ID: <20190407.193446.222511969891972229.davem@davemloft.net> (raw)
In-Reply-To: <20190405175626.4123-1-vladbu@mellanox.com>
From: Vlad Buslov <vladbu@mellanox.com>
Date: Fri, 5 Apr 2019 20:56:26 +0300
> John reports:
>
> Recent refactoring of fl_change aims to use the classifier spinlock to
> avoid the need for rtnl lock. In doing so, the fl_hw_replace_filer()
> function was moved to before the lock is taken. This can create problems
> for drivers if duplicate filters are created (commmon in ovs tc offload
> due to filters being triggered by user-space matches).
>
> Drivers registered for such filters will now receive multiple copies of
> the same rule, each with a different cookie value. This means that the
> drivers would need to do a full match field lookup to determine
> duplicates, repeating work that will happen in flower __fl_lookup().
> Currently, drivers do not expect to receive duplicate filters.
>
> To fix this, verify that filter with same key is not present in flower
> classifier hash table and insert the new filter to the flower hash table
> before offloading it to hardware. Implement helper function
> fl_ht_insert_unique() to atomically verify/insert a filter.
>
> This change makes filter visible to fast path at the beginning of
> fl_change() function, which means it can no longer be freed directly in
> case of error. Refactor fl_change() error handling code to deallocate the
> filter with rcu timeout.
>
> Fixes: 620da4860827 ("net: sched: flower: refactor fl_change")
> Reported-by: John Hurley <john.hurley@netronome.com>
> Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
Applied, thanks Vlad.
next prev parent reply other threads:[~2019-04-08 2:34 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-05 17:56 [PATCH net-next] net: sched: flower: insert filter to ht before offloading it to hw Vlad Buslov
2019-04-06 5:59 ` Jiri Pirko
2019-04-08 2:34 ` David Miller [this message]
2019-04-08 22:26 ` Jakub Kicinski
2019-04-09 8:23 ` Vlad Buslov
2019-04-09 17:10 ` Jakub Kicinski
2019-04-10 14:53 ` Vlad Buslov
2019-04-10 15:48 ` Jakub Kicinski
2019-04-10 16:02 ` Vlad Buslov
2019-04-10 16:09 ` Jakub Kicinski
2019-04-10 16:26 ` Vlad Buslov
2019-04-10 17:00 ` Jakub Kicinski
2019-04-16 14:20 ` [RFC PATCH net-next] net: sched: flower: refactor reoffload for concurrent access Vlad Buslov
2019-04-16 21:49 ` Jakub Kicinski
2019-04-17 7:29 ` Vlad Buslov
2019-04-17 16:34 ` Jakub Kicinski
2019-04-17 17:01 ` Vlad Buslov
2019-04-18 16:33 ` Vlad Buslov
2019-04-18 17:46 ` Jakub Kicinski
2019-04-18 17:58 ` Vlad Buslov
2019-04-18 18:02 ` Jakub Kicinski
2019-04-18 18:13 ` Vlad Buslov
2019-04-18 18:15 ` Jakub Kicinski
2019-04-11 11:13 ` [PATCH net-next] net: sched: flower: insert filter to ht before offloading it to hw Ido Schimmel
2019-04-11 11:28 ` Vlad Buslov
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=20190407.193446.222511969891972229.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=john.hurley@netronome.com \
--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).