• Tonghao Zhang's avatar
    net/mlx5e: Don't overwrite pedit action when multiple pedit used · 218d05ce
    Tonghao Zhang authored
    In some case, we may use multiple pedit actions to modify packets.
    The command shown as below: the last pedit action is effective.
    
    $ tc filter add dev netdev_rep parent ffff: protocol ip prio 1    \
    	flower skip_sw ip_proto icmp dst_ip 3.3.3.3        \
    	action pedit ex munge ip dst set 192.168.1.100 pipe    \
    	action pedit ex munge eth src set 00:00:00:00:00:01 pipe    \
    	action pedit ex munge eth dst set 00:00:00:00:00:02 pipe    \
    	action csum ip pipe    \
    	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
    
    To fix it, we add max_mod_hdr_actions to mlx5e_tc_flow_parse_attr struction,
    max_mod_hdr_actions will store the max pedit action number we support and
    num_mod_hdr_actions indicates how many pedit action we used, and store all
    pedit action to mod_hdr_actions.
    
    Fixes: d79b6df6 ("net/mlx5e: Add parsing of TC pedit actions to HW format")
    Cc: Or Gerlitz <ogerlitz@mellanox.com>
    Signed-off-by: 's avatarTonghao Zhang <xiangxia.m.yue@gmail.com>
    Reviewed-by: 's avatarOr Gerlitz <ogerlitz@mellanox.com>
    Acked-by: 's avatarSaeed Mahameed <saeedm@mellanox.com>
    Signed-off-by: 's avatarDavid S. Miller <davem@davemloft.net>
    218d05ce
Name
Last commit
Last update
Documentation Loading commit data...
LICENSES Loading commit data...
arch Loading commit data...
block Loading commit data...
certs Loading commit data...
crypto Loading commit data...
drivers Loading commit data...
firmware Loading commit data...
fs Loading commit data...
include Loading commit data...
init Loading commit data...
ipc Loading commit data...
kernel Loading commit data...
lib Loading commit data...
mm Loading commit data...
net Loading commit data...
samples Loading commit data...
scripts Loading commit data...
security Loading commit data...
sound Loading commit data...
tools Loading commit data...
usr Loading commit data...
virt Loading commit data...
.clang-format Loading commit data...
.cocciconfig Loading commit data...
.get_maintainer.ignore Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
Kbuild Loading commit data...
Kconfig Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README Loading commit data...