Skip to content

Commit 16e6653

Browse files
Ondřej Hlavatýdavem330
authored andcommitted
ixgbe: fix parsing of TC actions for HW offload
The previous code was optimistic, accepting the offload of whole action chain when there was a single known action (drop/redirect). This results in offloading a rule which should not be offloaded, because its behavior cannot be reproduced in the hardware. For example: $ tc filter add dev eno1 parent ffff: protocol ip \ u32 ht 800: order 1 match tcp src 42 FFFF \ action mirred egress mirror dev enp1s16 pipe \ drop The controller is unable to mirror the packet to a VF, but still offloads the rule by dropping the packet. Change the approach of the function to a pessimistic one, rejecting the chain when an unknown action is found. This is better suited for future extensions. Note that both recognized actions always return TC_ACT_SHOT, therefore it is safe to ignore actions behind them. Signed-off-by: Ondřej Hlavatý <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8005b09 commit 16e6653

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9054,7 +9054,6 @@ static int parse_tc_actions(struct ixgbe_adapter *adapter,
90549054
{
90559055
const struct tc_action *a;
90569056
LIST_HEAD(actions);
9057-
int err;
90589057

90599058
if (!tcf_exts_has_actions(exts))
90609059
return -EINVAL;
@@ -9075,11 +9074,11 @@ static int parse_tc_actions(struct ixgbe_adapter *adapter,
90759074

90769075
if (!dev)
90779076
return -EINVAL;
9078-
err = handle_redirect_action(adapter, dev->ifindex, queue,
9079-
action);
9080-
if (err == 0)
9081-
return err;
9077+
return handle_redirect_action(adapter, dev->ifindex,
9078+
queue, action);
90829079
}
9080+
9081+
return -EINVAL;
90839082
}
90849083

90859084
return -EINVAL;

0 commit comments

Comments
 (0)