lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1547646606-16687-1-git-send-email-xiangxia.m.yue@gmail.com>
Date:   Wed, 16 Jan 2019 05:50:06 -0800
From:   xiangxia.m.yue@...il.com
To:     ogerlitz@...lanox.com, saeedm@...lanox.com, leonro@...lanox.com
Cc:     netdev@...r.kernel.org, Tonghao Zhang <xiangxia.m.yue@...il.com>
Subject: [PATCH] net: mlx5: allow default ip_proto to offload

From: Tonghao Zhang <xiangxia.m.yue@...il.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.yue@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ