nfp: flower: support offloading multiple rules with same cookie
authorJohn Hurley <john.hurley@netronome.com>
Wed, 25 Apr 2018 04:17:03 +0000 (21:17 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 25 Apr 2018 18:07:04 +0000 (14:07 -0400)
commit54a4a03439305f701834cef1e4bd108548388d83
tree39f5b30426c3d85926512bd88f3b240f80f75a3a
parentdd92a7d1afef6229812a8980e89a22cfc9ddca94
nfp: flower: support offloading multiple rules with same cookie

When multiple netdevs are attached to a tc offload block and register for
callbacks, a rule added to the block will be propogated to all netdevs.
Previously these were detected as duplicates (based on cookie) and
rejected. Modify the rule nfp lookup function to optionally include an
ingress netdev and a host context along with the cookie value when
searching for a rule. When a new rule is passed to the driver, the netdev
the rule is to be attached to is considered when searching for dublicates.
When a stats update is received from HW, the host context is used
alongside the cookie to map to the correct host rule.

Signed-off-by: John Hurley <john.hurley@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/flower/main.h
drivers/net/ethernet/netronome/nfp/flower/metadata.c
drivers/net/ethernet/netronome/nfp/flower/offload.c