[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20191105.174909.256611580863902520.davem@davemloft.net>
Date: Tue, 05 Nov 2019 17:49:09 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: john.hurley@...ronome.com
Cc: netdev@...r.kernel.org, vladbu@...lanox.com, jiri@...lanox.com,
simon.horman@...ronome.com, jakub.kicinski@...ronome.com,
louis.peens@...ronome.com, oss-drivers@...ronome.com
Subject: Re: [PATCH net 1/1] net: sched: prevent duplicate flower rules
from tcf_proto destroy race
From: John Hurley <john.hurley@...ronome.com>
Date: Sat, 2 Nov 2019 14:17:47 +0000
> When a new filter is added to cls_api, the function
> tcf_chain_tp_insert_unique() looks up the protocol/priority/chain to
> determine if the tcf_proto is duplicated in the chain's hashtable. It then
> creates a new entry or continues with an existing one. In cls_flower, this
> allows the function fl_ht_insert_unque to determine if a filter is a
> duplicate and reject appropriately, meaning that the duplicate will not be
> passed to drivers via the offload hooks. However, when a tcf_proto is
> destroyed it is removed from its chain before a hardware remove hook is
> hit. This can lead to a race whereby the driver has not received the
> remove message but duplicate flows can be accepted. This, in turn, can
> lead to the offload driver receiving incorrect duplicate flows and out of
> order add/delete messages.
>
> Prevent duplicates by utilising an approach suggested by Vlad Buslov. A
> hash table per block stores each unique chain/protocol/prio being
> destroyed. This entry is only removed when the full destroy (and hardware
> offload) has completed. If a new flow is being added with the same
> identiers as a tc_proto being detroyed, then the add request is replayed
> until the destroy is complete.
>
> Fixes: 8b64678e0af8 ("net: sched: refactor tp insert/delete for concurrent execution")
> Signed-off-by: John Hurley <john.hurley@...ronome.com>
> Signed-off-by: Vlad Buslov <vladbu@...lanox.com>
> Reviewed-by: Simon Horman <simon.horman@...ronome.com>
> Reported-by: Louis Peens <louis.peens@...ronome.com>
Applied and queued up for -stable, thanks John.
Powered by blists - more mailing lists