Skip to content

Commit 739d7c5

Browse files
jahurleydavem330
authored andcommitted
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: 4d12ba4 ("nfp: flower: allow offloading of matches on 'internal' ports") Signed-off-by: John Hurley <[email protected]> Reviewed-by: Jakub Kicinski <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 80a6a5d commit 739d7c5

File tree

1 file changed

+4
-3
lines changed
  • drivers/net/ethernet/netronome/nfp/flower

1 file changed

+4
-3
lines changed

drivers/net/ethernet/netronome/nfp/flower/offload.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,9 +1409,10 @@ nfp_flower_setup_indr_tc_block(struct net_device *netdev, struct nfp_app *app,
14091409
struct nfp_flower_priv *priv = app->priv;
14101410
struct flow_block_cb *block_cb;
14111411

1412-
if (f->binder_type != FLOW_BLOCK_BINDER_TYPE_CLSACT_INGRESS &&
1413-
!(f->binder_type == FLOW_BLOCK_BINDER_TYPE_CLSACT_EGRESS &&
1414-
nfp_flower_internal_port_can_offload(app, netdev)))
1412+
if ((f->binder_type != FLOW_BLOCK_BINDER_TYPE_CLSACT_INGRESS &&
1413+
!nfp_flower_internal_port_can_offload(app, netdev)) ||
1414+
(f->binder_type != FLOW_BLOCK_BINDER_TYPE_CLSACT_EGRESS &&
1415+
nfp_flower_internal_port_can_offload(app, netdev)))
14151416
return -EOPNOTSUPP;
14161417

14171418
switch (f->command) {

0 commit comments

Comments
 (0)