OSDN Git Service

nfp: flower: prevent ingress block binds on internal ports
authorJohn Hurley <john.hurley@netronome.com>
Wed, 28 Aug 2019 05:56:29 +0000 (22:56 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 28 Aug 2019 23:06:49 +0000 (16:06 -0700)
commit739d7c5752b255e89ddbb1b0474f3b88ef5cd343
tree9a2f51687e74a3402d6c34577c123ec3828c42fd
parent80a6a5d62da9ec1a4a949c0f95baa80d7efbfef5
nfp: flower: prevent ingress block binds on internal ports

Internal port TC offload is implemented through user-space applications
(such as OvS) by adding filters at egress via TC clsact qdiscs. Indirect
block offload support in the NFP driver accepts both ingress qdisc binds
and egress binds if the device is an internal port. However, clsact sends
bind notification for both ingress and egress block binds which can lead
to the driver registering multiple callbacks and receiving multiple
notifications of new filters.

Fix this by rejecting ingress block bind callbacks when the port is
internal and only adding filter callbacks for egress binds.

Fixes: 4d12ba42787b ("nfp: flower: allow offloading of matches on 'internal' ports")
Signed-off-by: John Hurley <john.hurley@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/flower/offload.c