]>
Commit | Line | Data |
---|---|---|
ad3041a8 GKH |
1 | From foo@baz Mon Mar 27 18:18:08 CEST 2017 |
2 | From: Or Gerlitz <ogerlitz@mellanox.com> | |
3 | Date: Tue, 21 Mar 2017 15:59:15 +0200 | |
4 | Subject: net/mlx5e: Use the proper UAPI values when offloading TC vlan actions | |
5 | ||
6 | From: Or Gerlitz <ogerlitz@mellanox.com> | |
7 | ||
8 | ||
9 | [ Upstream commit 09c91ddf2cd33489c2c14edfef43ae38d412888e ] | |
10 | ||
11 | Currently we use the non UAPI values and we miss erring on | |
12 | the modify action which is not supported, fix that. | |
13 | ||
14 | Fixes: 8b32580df1cb ('net/mlx5e: Add TC vlan action for SRIOV offloads') | |
15 | Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> | |
16 | Reported-by: Petr Machata <petrm@mellanox.com> | |
17 | Reviewed-by: Jiri Pirko <jiri@mellanox.com> | |
18 | Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> | |
19 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
20 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
21 | --- | |
22 | drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 6 ++++-- | |
23 | 1 file changed, 4 insertions(+), 2 deletions(-) | |
24 | ||
25 | --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | |
26 | +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | |
27 | @@ -974,14 +974,16 @@ static int parse_tc_fdb_actions(struct m | |
28 | } | |
29 | ||
30 | if (is_tcf_vlan(a)) { | |
31 | - if (tcf_vlan_action(a) == VLAN_F_POP) { | |
32 | + if (tcf_vlan_action(a) == TCA_VLAN_ACT_POP) { | |
33 | attr->action |= MLX5_FLOW_CONTEXT_ACTION_VLAN_POP; | |
34 | - } else if (tcf_vlan_action(a) == VLAN_F_PUSH) { | |
35 | + } else if (tcf_vlan_action(a) == TCA_VLAN_ACT_PUSH) { | |
36 | if (tcf_vlan_push_proto(a) != htons(ETH_P_8021Q)) | |
37 | return -EOPNOTSUPP; | |
38 | ||
39 | attr->action |= MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH; | |
40 | attr->vlan = tcf_vlan_push_vid(a); | |
41 | + } else { /* action is TCA_VLAN_ACT_MODIFY */ | |
42 | + return -EOPNOTSUPP; | |
43 | } | |
44 | continue; | |
45 | } |