Skip to content

Commit 8c6ec36

Browse files
dcarattidavem330
authored andcommitted
bnxt_en: don't try to offload VLAN 'modify' action
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 <dcaratti@redhat.com> Acked-by: Sathya Perla <sathya.perla@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 56ce3c5 commit 8c6ec36

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,23 @@ static int bnxt_tc_parse_redir(struct bnxt *bp,
7575
return 0;
7676
}
7777

78-
static void bnxt_tc_parse_vlan(struct bnxt *bp,
79-
struct bnxt_tc_actions *actions,
80-
const struct tc_action *tc_act)
78+
static int bnxt_tc_parse_vlan(struct bnxt *bp,
79+
struct bnxt_tc_actions *actions,
80+
const struct tc_action *tc_act)
8181
{
82-
if (tcf_vlan_action(tc_act) == TCA_VLAN_ACT_POP) {
82+
switch (tcf_vlan_action(tc_act)) {
83+
case TCA_VLAN_ACT_POP:
8384
actions->flags |= BNXT_TC_ACTION_FLAG_POP_VLAN;
84-
} else if (tcf_vlan_action(tc_act) == TCA_VLAN_ACT_PUSH) {
85+
break;
86+
case TCA_VLAN_ACT_PUSH:
8587
actions->flags |= BNXT_TC_ACTION_FLAG_PUSH_VLAN;
8688
actions->push_vlan_tci = htons(tcf_vlan_push_vid(tc_act));
8789
actions->push_vlan_tpid = tcf_vlan_push_proto(tc_act);
90+
break;
91+
default:
92+
return -EOPNOTSUPP;
8893
}
94+
return 0;
8995
}
9096

9197
static int bnxt_tc_parse_tunnel_set(struct bnxt *bp,
@@ -134,7 +140,9 @@ static int bnxt_tc_parse_actions(struct bnxt *bp,
134140

135141
/* Push/pop VLAN */
136142
if (is_tcf_vlan(tc_act)) {
137-
bnxt_tc_parse_vlan(bp, actions, tc_act);
143+
rc = bnxt_tc_parse_vlan(bp, actions, tc_act);
144+
if (rc)
145+
return rc;
138146
continue;
139147
}
140148

0 commit comments

Comments
 (0)