Skip to contentSkip to conversation

test --transfer-encoding=quoted-printable

PATCH New Yongseok Koh 1 participant 1 message Sep 28, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test --transfer-encoding=quoted-printable

rte_flow has 'group' attribute and 'jump' action in order to support multiple groups. This feature is known as multi-table support ('chain' in linux TC flower) in general because a group means a table of flows. Example commands are:

flow create 0 transfer priority 1 ingress
pattern eth / vlan vid is 100 / end
actions jump group 1 / end

flow create 0 transfer priority 1 ingress
pattern eth / vlan vid is 200 / end
actions jump group 2 / end

flow create 0 transfer group 1 priority 2 ingress
pattern eth / vlan vid is 100 /
ipv4 dst spec 192.168.40.0 dst prefix 24 / end
actions drop / end

flow create 0 transfer group 1 priority 2 ingress
pattern end
actions of_pop_vlan / port_id id 1 / end

flow create 0 transfer group 2 priority 2 ingress
pattern eth / vlan vid is 200 /
ipv4 dst spec 192.168.40.0 dst prefix 24 / end
actions of_pop_vlan / port_id id 2 / end

flow create 0 transfer group 2 priority 2 ingress
pattern end
actions port_id id 2 / end

With theses flows, if a packet having vlan 200 and src_ip as 192.168.40.1, this packet will firstly hit the 1st flow. Then it will hit the 5th flow because of the 'jump' action. As a result, the packet will be forwarded to port 2 (VF representor) with vlan tag being stripped off. If the packet had vlan 100 instead, it would be dropped by the 3rd flow.

---
 drivers/net/mlx5/Makefile        | 10 ++++++
 drivers/net/mlx5/meson.build     |  4 +++
 drivers/net/mlx5/mlx5_flow.h     |  5 +++
 drivers/net/mlx5/mlx5_flow_tcf.c | 78 +++++++++++++++++++++++++++++++++++-----
 4 files changed, 88 insertions(+), 9 deletions(-)
drivers/net/mlx5/Makefile +10 -0
index ca1de9f21..92bae9dfc 100644
@@ -347,6 +347,16 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config-h.sh
 		enum TCA_VLAN_PUSH_VLAN_PRIORITY \
 		$(AUTOCONF_OUTPUT)
 	$Q sh -- '$<' '$@' \
+		HAVE_TCA_CHAIN \
+		linux/rtnetlink.h \
+		enum TCA_CHAIN \
+		$(AUTOCONF_OUTPUT)
+	$Q sh -- '$<' '$@' \
+		HAVE_TC_ACT_GOTO_CHAIN \
+		linux/pkt_cls.h \
+		define TC_ACT_GOTO_CHAIN \
+		$(AUTOCONF_OUTPUT)
+	$Q sh -- '$<' '$@' \
 		HAVE_SUPPORTED_40000baseKR4_Full \
 		/usr/include/linux/ethtool.h \
 		define SUPPORTED_40000baseKR4_Full \
drivers/net/mlx5/meson.build +4 -0
index fd93ac162..696624838 100644
@@ -182,6 +182,10 @@ if build
 		'TCA_FLOWER_KEY_VLAN_ETH_TYPE' ],
 		[ 'HAVE_TC_ACT_VLAN', 'linux/tc_act/tc_vlan.h',
 		'TCA_VLAN_PUSH_VLAN_PRIORITY' ],
+		[ 'HAVE_TCA_CHAIN', 'linux/rtnetlink.h',
+		'TCA_CHAIN' ],
+		[ 'HAVE_TC_ACT_GOTO_CHAIN', 'linux/pkt_cls.h',
+		'TC_ACT_GOTO_CHAIN' ],
 		[ 'HAVE_RDMA_NL_NLDEV', 'rdma/rdma_netlink.h',
 		'RDMA_NL_NLDEV' ],
 		[ 'HAVE_RDMA_NLDEV_CMD_GET', 'rdma/rdma_netlink.h',
drivers/net/mlx5/mlx5_flow.h +5 -0
index 7117f1471..d4253110c 100644
@@ -78,6 +78,7 @@
 #define MLX5_FLOW_ACTION_OF_PUSH_VLAN (1u << 8)
 #define MLX5_FLOW_ACTION_OF_SET_VLAN_VID (1u << 9)
 #define MLX5_FLOW_ACTION_OF_SET_VLAN_PCP (1u << 10)
+#define MLX5_FLOW_ACTION_JUMP (1u << 11)
 
 #define MLX5_FLOW_FATE_ACTIONS \
 	(MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_QUEUE | MLX5_FLOW_ACTION_RSS)
@@ -125,6 +126,10 @@
 /* Max number of actions per DV flow. */
 #define MLX5_DV_MAX_NUMBER_OF_ACTIONS 8
 
+/* Due to a limitation on driver/FW. */
+#define MLX5_FLOW_GROUP_ID_MAX 3
+#define MLX5_FLOW_GROUP_PRIORITY_MAX 14
+
 enum mlx5_flow_drv_type {
 	MLX5_FLOW_TYPE_MIN,
 	MLX5_FLOW_TYPE_DV,
drivers/net/mlx5/mlx5_flow_tcf.c +69 -9

159 lines not on this page · raw message

Signature · 1 line
2.11.0