Skip to content

Commit

Permalink
bnxt_en: don't try to offload VLAN 'modify' action
Browse files Browse the repository at this point in the history
bnxt offload code currently supports only 'push' and 'pop' operation: let
.ndo_setup_tc() return -EOPNOTSUPP if VLAN 'modify' action is configured.

Fixes: 2ae7408 ("bnxt_en: bnxt: add TC flower filter offload support")
Signed-off-by: Davide Caratti <[email protected]>
Acked-by: Sathya Perla <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
dcaratti authored and davem330 committed Sep 20, 2018
1 parent 56ce3c5 commit 8c6ec36
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,23 @@ static int bnxt_tc_parse_redir(struct bnxt *bp,
return 0;
}

static void bnxt_tc_parse_vlan(struct bnxt *bp,
struct bnxt_tc_actions *actions,
const struct tc_action *tc_act)
static int bnxt_tc_parse_vlan(struct bnxt *bp,
struct bnxt_tc_actions *actions,
const struct tc_action *tc_act)
{
if (tcf_vlan_action(tc_act) == TCA_VLAN_ACT_POP) {
switch (tcf_vlan_action(tc_act)) {
case TCA_VLAN_ACT_POP:
actions->flags |= BNXT_TC_ACTION_FLAG_POP_VLAN;
} else if (tcf_vlan_action(tc_act) == TCA_VLAN_ACT_PUSH) {
break;
case TCA_VLAN_ACT_PUSH:
actions->flags |= BNXT_TC_ACTION_FLAG_PUSH_VLAN;
actions->push_vlan_tci = htons(tcf_vlan_push_vid(tc_act));
actions->push_vlan_tpid = tcf_vlan_push_proto(tc_act);
break;
default:
return -EOPNOTSUPP;
}
return 0;
}

static int bnxt_tc_parse_tunnel_set(struct bnxt *bp,
Expand Down Expand Up @@ -134,7 +140,9 @@ static int bnxt_tc_parse_actions(struct bnxt *bp,

/* Push/pop VLAN */
if (is_tcf_vlan(tc_act)) {
bnxt_tc_parse_vlan(bp, actions, tc_act);
rc = bnxt_tc_parse_vlan(bp, actions, tc_act);
if (rc)
return rc;
continue;
}

Expand Down

0 comments on commit 8c6ec36

Please sign in to comment.