netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Vlad Buslov <vladbu@mellanox.com>
Cc: netdev@vger.kernel.org, jhs@mojatatu.com,
	xiyou.wangcong@gmail.com, davem@davemloft.net,
	jakub.kicinski@netronome.com
Subject: Re: [PATCH net-next v2] net: sched: flower: refactor reoffload for concurrent access
Date: Thu, 25 Apr 2019 10:26:43 +0200	[thread overview]
Message-ID: <20190425082643.GA3951@nanopsycho> (raw)
In-Reply-To: <20190424065331.31046-1-vladbu@mellanox.com>

Wed, Apr 24, 2019 at 08:53:31AM CEST, vladbu@mellanox.com wrote:
>Recent changes that introduced unlocked flower did not properly account for
>case when reoffload is initiated concurrently with filter updates. To fix
>the issue, extend flower with 'hw_filters' list that is used to store
>filters that don't have 'skip_hw' flag set. Filter is added to the list
>when it is inserted to hardware and only removed from it after being
>unoffloaded from all drivers that parent block is attached to. This ensures
>that concurrent reoffload can still access filter that is being deleted and
>prevents race condition when driver callback can be removed when filter is
>no longer accessible trough idr, but is still present in hardware.
>
>Refactor fl_change() to respect new filter reference counter and to release
>filter reference with __fl_put() in case of error, instead of directly
>deallocating filter memory. This allows for concurrent access to filter
>from fl_reoffload() and protects it with reference counting. Refactor
>fl_reoffload() to iterate over hw_filters list instead of idr. Implement
>fl_get_next_hw_filter() helper function that is used to iterate over
>hw_filters list with reference counting and skips filters that are being
>concurrently deleted.
>
>Fixes: 92149190067d ("net: sched: flower: set unlocked flag for flower proto ops")
>Signed-off-by: Vlad Buslov <vladbu@mellanox.com>

Acked-by: Jiri Pirko <jiri@mellanox.com>

      parent reply	other threads:[~2019-04-25  8:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-24  6:53 [PATCH net-next v2] net: sched: flower: refactor reoffload for concurrent access Vlad Buslov
2019-04-24 18:43 ` Saeed Mahameed
2019-04-24 18:53 ` David Miller
2019-04-25  8:26 ` Jiri Pirko [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=20190425082643.GA3951@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=jhs@mojatatu.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).