Skip to content

Commit

Permalink
tc: translate mirror/stolen to mirred
Browse files Browse the repository at this point in the history
Currently jumping over a output-to-port action is translated to tc
mirror action and stolen control action.
However, the tc control action is not propagated to the hw offload action,
thus the hardware action will mirror the packet and continue to the next
action.

Transalte mirror/stolen to "mirred egress redirect" action which terminates
the action list.

Fixes: e4daf88 ("netdev-offload-tc: Handle check_pkt_len datapath action.")
Signed-off-by: Oz Shlomo <ozsh@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
  • Loading branch information
Oz Shlomo authored and Simon Horman committed Mar 14, 2023
1 parent 5177813 commit 1949c63
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/tc.c
Expand Up @@ -3341,13 +3341,16 @@ nl_msg_put_flower_acts(struct ofpbuf *request, struct tc_flower *flower)
}
action->jump_action = JUMP_ACTION_STOP;
} else {
if (ingress) {
nl_msg_put_act_mirred(request, ifindex, action_pc,
TCA_INGRESS_MIRROR);
int out_action;

if (action_pc == TC_ACT_STOLEN) {
out_action = TCA_EGRESS_REDIR;
} else {
nl_msg_put_act_mirred(request, ifindex, action_pc,
TCA_EGRESS_MIRROR);
out_action = TCA_EGRESS_MIRROR;
}

nl_msg_put_act_mirred(request, ifindex, action_pc,
out_action);
}
nl_msg_put_act_cookie(request, &flower->act_cookie);
nl_msg_put_act_flags(request);
Expand Down

0 comments on commit 1949c63

Please sign in to comment.