OSDN Git Service

net/mlx5e: Return -EOPNOTSUPP when attempting to offload an unsupported action
authorTonghao Zhang <xiangxia.m.yue@gmail.com>
Wed, 27 Feb 2019 15:31:19 +0000 (07:31 -0800)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 5 Apr 2019 21:10:33 +0000 (14:10 -0700)
commit2cc1cb1d17352aaf6400774793353720be221945
treec71612029a9b50a80c2dbb18c5073d3e1866cbe0
parent20bb4a813e139947c03d612ae9a562ad30d2314d
net/mlx5e: Return -EOPNOTSUPP when attempting to offload an unsupported action

* Now the encapsulation is not supported for mlx5 VFs. When we try to
offload that action, the -EINVAL is returned, but not -EOPNOTSUPP.
This patch changes the returned value and ignore to confuse user.
The command is shown as below [1].

* When max modify header action is zero, we return -EOPNOTSUPP
directly. In this way, we can ignore wrong message info (e.g.
"mlx5: parsed 0 pedit actions, can't do more"). This happens when
offloading pedit actions on mlx(cx4) VFs. The command is shown as below [2].

For example: (p2p1_0 is VF net device)
[1]
$ tc filter add dev p2p1_0 protocol ip  parent ffff: prio 1 flower skip_sw \
    src_mac e4:11:22:33:44:01    \
    action tunnel_key set        \
    src_ip 1.1.1.100        \
    dst_ip 1.1.1.200        \
    dst_port 4789 id 100        \
    action mirred egress redirect dev vxlan0

[2]
$ tc filter add dev p2p1_0 parent ffff: protocol ip prio 1 \
    flower skip_sw dst_mac 00:10:56:fb:64:e8 \
    dst_ip 1.1.1.100 src_ip 1.1.1.200 \
    action pedit ex munge eth src set 00:10:56:b4:5d:20

Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c