]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.10.7/net-mlx5e-use-the-proper-uapi-values-when-offloading-tc-vlan-actions.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.10.7 / net-mlx5e-use-the-proper-uapi-values-when-offloading-tc-vlan-actions.patch
CommitLineData
ad3041a8
GKH
1From foo@baz Mon Mar 27 18:18:08 CEST 2017
2From: Or Gerlitz <ogerlitz@mellanox.com>
3Date: Tue, 21 Mar 2017 15:59:15 +0200
4Subject: net/mlx5e: Use the proper UAPI values when offloading TC vlan actions
5
6From: Or Gerlitz <ogerlitz@mellanox.com>
7
8
9[ Upstream commit 09c91ddf2cd33489c2c14edfef43ae38d412888e ]
10
11Currently we use the non UAPI values and we miss erring on
12the modify action which is not supported, fix that.
13
14Fixes: 8b32580df1cb ('net/mlx5e: Add TC vlan action for SRIOV offloads')
15Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
16Reported-by: Petr Machata <petrm@mellanox.com>
17Reviewed-by: Jiri Pirko <jiri@mellanox.com>
18Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
19Signed-off-by: David S. Miller <davem@davemloft.net>
20Signed-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 }