From: Tonghao Zhang <xiangxia.m....@gmail.com>

Allow default ip_proto to offload, so icmp, tcp, and udp
will match the flow as show below, otherwise we must type the
ip_proto for icmp, tcp and udp respectively.

$ tc filter add dev netdev01_rep parent ffff: protocol ip prio 1 \
        flower skip_sw dst_ip 3.3.3.3 \
        action pedit ex munge ip dst set 192.168.1.100 pipe \
        action csum ip pipe \
        action mirred egress redirect dev netdev02_rep

Signed-off-by: Tonghao Zhang <xiangxia.m....@gmail.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c 
b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 2ee377a..2a29428 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -2219,7 +2219,7 @@ static bool modify_header_match_supported(struct 
mlx5_flow_spec *spec,
        }
 
        ip_proto = MLX5_GET(fte_match_set_lyr_2_4, headers_v, ip_protocol);
-       if (modify_ip_header && ip_proto != IPPROTO_TCP &&
+       if (modify_ip_header && ip_proto != 0 && ip_proto != IPPROTO_TCP &&
            ip_proto != IPPROTO_UDP && ip_proto != IPPROTO_ICMP) {
                NL_SET_ERR_MSG_MOD(extack,
                                   "can't offload re-write of non TCP/UDP");
-- 
1.8.3.1

Reply via email to