From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70073.outbound.protection.outlook.com [40.107.7.73]) by dpdk.org (Postfix) with ESMTP id 70A3C1B185 for ; Fri, 12 Oct 2018 10:42:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BjdItne8ztJDTc0wT3vWozgSIMplb9nBw8PyAB3YD7w=; b=yNUptwnC5b6UPBsha0cAypt71TyHH5k3HH5jzkkgeKg+I90Wvxv4fEGpXHCI2ou0rK9bngy1huLylV4NIxXoRVIpazziAyV4e76LNgb/LSL+REIIL3sitEGPgW8H6xzViItIc9TQUeI8IW+yNVqg9MEweuaUXmGbanXaZWmHYIg= Received: from AM0PR0502MB3971.eurprd05.prod.outlook.com (52.133.40.151) by AM0PR0502MB3793.eurprd05.prod.outlook.com (52.133.47.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25; Fri, 12 Oct 2018 08:42:33 +0000 Received: from AM0PR0502MB3971.eurprd05.prod.outlook.com ([fe80::cdde:1e48:5899:c509]) by AM0PR0502MB3971.eurprd05.prod.outlook.com ([fe80::cdde:1e48:5899:c509%4]) with mapi id 15.20.1228.020; Fri, 12 Oct 2018 08:42:33 +0000 From: Yongseok Koh To: Shahaf Shuler CC: "dev@dpdk.org" , Yongseok Koh Thread-Topic: [PATCH v4] net/mlx5: support multiple groups and jump action Thread-Index: AQHUYgeE1Ly6nXBQdEeWevW3pD7oaQ== Date: Fri, 12 Oct 2018 08:42:33 +0000 Message-ID: <20181012084222.10464-1-yskoh@mellanox.com> References: <20181003015640.36306-1-yskoh@mellanox.com> In-Reply-To: <20181003015640.36306-1-yskoh@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR11CA0056.namprd11.prod.outlook.com (2603:10b6:a03:80::33) To AM0PR0502MB3971.eurprd05.prod.outlook.com (2603:10a6:208:11::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [209.116.155.178] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM0PR0502MB3793; 6:/Jv4RWtX/Bh0bQ3rLdMLlkNb/nq2j+4nSAAi1As5CbQPzCEXmvowsE0VUKxD6jsX2084n1InpmLfihhEWpiSXborOlEDsVFA3TF7OL3SccR+3eVGizrsCqx4tXWLFARcLPqhFeLNEtpa6bM1omkMrSmnJ+iMVeVVwZPXtUIIkEFUkaOnmJRxdym1fPqeFQH9IKI3VZFnffdLFIbhzZ4tpDwCO6j9vNjG3kedUVv70XsSLwIAArOGu4ABIOw29KOp4AbXwMtWVtYNuSJUnRI58yH++dYnc4RpmUGPd/WG1cCtml2iomsACVDSORHbXFxjDbYKitNYxNTcEVsBCXPs6gcG/Avw8L6SnOzIwrbugsysoNTyOCtxkHcEynBSc4wMqO8MtsA5VvSIb6a5F5MJgWTrpB2xDzEVLvusteM+SeHMRVDwzZI3kzDMQ+8+XurL9QPfBqaoS5NKBpdlTF7CJA==; 5:qp8boU/Wk4fFrrv47Ay/x46p4onGNJITHTsKH8vXmJyDyhYEBDtFGhgS5bdfvWNOA0ic3/RwsuSdIAvQdbnIUfShgayWScrEZfKiY6LnXFCfa0D7XrLfsWkRElcsERMtXsUsCpaVo6r9oy49Gtfq3+Bh9s1W04IOvfLS9ZT7pXw=; 7:nYk34Bi9GSS3vmtVU3S3mi9LzAmByHXghSrcOU8oQclRpACyXSdkPT/MqQJAwm2vklIMhdCjVAXODE2KgBFgRdRbs8lBjEZUlJ6Qzo0ww2+fF3tr5On4LH+9hUHdCk/1QYN7ZbL8xKsIf1vlltfKznphsdbkeSq24hKmagOeJvlA450VeGoUoZe6AJMLMkKBB3lFOav0FWT6BGpwGfh0JoIrLRvcLobQknF3mS522fzOx5EY/CIVlFh8cVJMBIWn x-ms-office365-filtering-correlation-id: 1f0cf087-8ca2-4a56-7abe-08d6301ea738 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR0502MB3793; x-ms-traffictypediagnostic: AM0PR0502MB3793: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231355)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(149066)(150057)(6041310)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR0502MB3793; BCL:0; PCL:0; RULEID:; SRVR:AM0PR0502MB3793; x-forefront-prvs: 0823A5777B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(366004)(39860400002)(136003)(376002)(396003)(189003)(199004)(68736007)(71190400001)(5660300001)(7736002)(2900100001)(53936002)(3846002)(6636002)(71200400001)(6116002)(2906002)(1076002)(6436002)(97736004)(6486002)(6512007)(14454004)(4744004)(478600001)(305945005)(8936002)(5250100002)(8676002)(81156014)(102836004)(26005)(186003)(6862004)(2616005)(66066001)(11346002)(446003)(386003)(486006)(476003)(76176011)(6506007)(25786009)(81166006)(107886003)(36756003)(575784001)(316002)(86362001)(37006003)(54906003)(105586002)(256004)(14444005)(99286004)(52116002)(106356001)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3793; H:AM0PR0502MB3971.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 1LygoESajYg1akPItIcAxJtzWEz4HYx4Ee51blb8OFiZL5Pt0LV99oRfPtZqZI8UX00co7q9QRTwu7qALrhngFGhULevu7xodXyBlUnQ9kqbXPid2qh5KHzgc90gYMq8eQvhfD9LTydudHQUoddZqVKiuPJXcFnBj7WNXaQECkT9V/v4PS4jn8P6yIjbqJhukNjbBIzhWikyxXdXXiJY+vxdQ7A4BvxzWBMqatprw1EfrXQP2u/to7pIAzEOTNmcD81D+uYW4LXwfU3ewp/CStbLITpLvJI1ZcL1A0an7cQrfTCVp0s323FTEVmIxZgdU7I1cFePkAIrZLcRuqyxLe6bQs3vCSGZi3T5vZmOcLc= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1f0cf087-8ca2-4a56-7abe-08d6301ea738 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2018 08:42:33.7465 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3793 Subject: [dpdk-dev] [PATCH v4] net/mlx5: support multiple groups and jump action X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2018 08:42:35 -0000 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. Signed-off-by: Yongseok Koh --- v4: * rebase on "net/mlx5: rewrite IP address UDP/TCP port by E-Switch" v3: * reorder build macros v2: * drop ethdev patch as it had already been fixed by Adrien's patch * move TCF macros from mlx5_flow.h to mlx5_flow_tcf.c drivers/net/mlx5/Makefile | 10 ++++ drivers/net/mlx5/meson.build | 4 ++ drivers/net/mlx5/mlx5_flow.h | 1 + drivers/net/mlx5/mlx5_flow_tcf.c | 110 +++++++++++++++++++++++++++++++----= ---- 4 files changed, 102 insertions(+), 23 deletions(-) diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile index 1c0b848d5a..1e9c0b42ac 100644 --- a/drivers/net/mlx5/Makefile +++ b/drivers/net/mlx5/Makefile @@ -207,6 +207,11 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config= -h.sh enum IFLA_PHYS_PORT_NAME \ $(AUTOCONF_OUTPUT) $Q sh -- '$<' '$@' \ + HAVE_TCA_CHAIN \ + linux/rtnetlink.h \ + enum TCA_CHAIN \ + $(AUTOCONF_OUTPUT) + $Q sh -- '$<' '$@' \ HAVE_TCA_FLOWER_ACT \ linux/pkt_cls.h \ enum TCA_FLOWER_ACT \ @@ -352,6 +357,11 @@ mlx5_autoconf.h.new: $(RTE_SDK)/buildtools/auto-config= -h.sh enum TCA_FLOWER_KEY_TCP_FLAGS_MASK \ $(AUTOCONF_OUTPUT) $Q sh -- '$<' '$@' \ + HAVE_TC_ACT_GOTO_CHAIN \ + linux/pkt_cls.h \ + define TC_ACT_GOTO_CHAIN \ + $(AUTOCONF_OUTPUT) + $Q sh -- '$<' '$@' \ HAVE_TC_ACT_VLAN \ linux/tc_act/tc_vlan.h \ enum TCA_VLAN_PUSH_VLAN_PRIORITY \ diff --git a/drivers/net/mlx5/meson.build b/drivers/net/mlx5/meson.build index 801f02871f..c192d44c10 100644 --- a/drivers/net/mlx5/meson.build +++ b/drivers/net/mlx5/meson.build @@ -126,6 +126,8 @@ if build 'IFLA_PHYS_SWITCH_ID' ], [ 'HAVE_IFLA_PHYS_PORT_NAME', 'linux/if_link.h', 'IFLA_PHYS_PORT_NAME' ], + [ 'HAVE_TCA_CHAIN', 'linux/rtnetlink.h', + 'TCA_CHAIN' ], [ 'HAVE_TCA_FLOWER_ACT', 'linux/pkt_cls.h', 'TCA_FLOWER_ACT' ], [ 'HAVE_TCA_FLOWER_FLAGS', 'linux/pkt_cls.h', @@ -184,6 +186,8 @@ if build 'TCA_FLOWER_KEY_TCP_FLAGS' ], [ 'HAVE_TCA_FLOWER_KEY_TCP_FLAGS_MASK', 'linux/pkt_cls.h', 'TCA_FLOWER_KEY_TCP_FLAGS_MASK' ], + [ 'HAVE_TC_ACT_GOTO_CHAIN', 'linux/pkt_cls.h', + 'TC_ACT_GOTO_CHAIN' ], [ 'HAVE_TC_ACT_VLAN', 'linux/tc_act/tc_vlan.h', 'TCA_VLAN_PUSH_VLAN_PRIORITY' ], [ 'HAVE_TC_ACT_PEDIT', 'linux/tc_act/tc_pedit.h', diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index 860fb1f6e8..094f6668fa 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -84,6 +84,7 @@ #define MLX5_FLOW_ACTION_SET_IPV6_DST (1u << 14) #define MLX5_FLOW_ACTION_SET_TP_SRC (1u << 15) #define MLX5_FLOW_ACTION_SET_TP_DST (1u << 16) +#define MLX5_FLOW_ACTION_JUMP (1u << 17) =20 #define MLX5_FLOW_FATE_ACTIONS \ (MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_QUEUE | MLX5_FLOW_ACTION_RSS) diff --git a/drivers/net/mlx5/mlx5_flow_tcf.c b/drivers/net/mlx5/mlx5_flow_= tcf.c index aaafaf52d6..1e1102e079 100644 --- a/drivers/net/mlx5/mlx5_flow_tcf.c +++ b/drivers/net/mlx5/mlx5_flow_tcf.c @@ -124,6 +124,9 @@ struct tc_pedit_sel { #ifndef TCA_CLS_FLAGS_SKIP_SW #define TCA_CLS_FLAGS_SKIP_SW (1 << 1) #endif +#ifndef HAVE_TCA_CHAIN +#define TCA_CHAIN 11 +#endif #ifndef HAVE_TCA_FLOWER_ACT #define TCA_FLOWER_ACT 3 #endif @@ -211,6 +214,9 @@ struct tc_pedit_sel { #ifndef HAVE_TCA_FLOWER_KEY_TCP_FLAGS_MASK #define TCA_FLOWER_KEY_TCP_FLAGS_MASK 72 #endif +#ifndef HAVE_TC_ACT_GOTO_CHAIN +#define TC_ACT_GOTO_CHAIN 0x20000000 +#endif =20 #ifndef IPV6_ADDR_LEN #define IPV6_ADDR_LEN 16 @@ -297,7 +303,14 @@ struct flow_tcf_ptoi { unsigned int ifindex; /**< Network interface index. */ }; =20 -#define MLX5_TCF_FATE_ACTIONS (MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_PO= RT_ID) +/* Due to a limitation on driver/FW. */ +#define MLX5_TCF_GROUP_ID_MAX 3 +#define MLX5_TCF_GROUP_PRIORITY_MAX 14 + +#define MLX5_TCF_FATE_ACTIONS \ + (MLX5_FLOW_ACTION_DROP | MLX5_FLOW_ACTION_PORT_ID | \ + MLX5_FLOW_ACTION_JUMP) + #define MLX5_TCF_VLAN_ACTIONS \ (MLX5_FLOW_ACTION_OF_POP_VLAN | MLX5_FLOW_ACTION_OF_PUSH_VLAN | \ MLX5_FLOW_ACTION_OF_SET_VLAN_VID | MLX5_FLOW_ACTION_OF_SET_VLAN_PCP) @@ -308,9 +321,9 @@ struct flow_tcf_ptoi { MLX5_FLOW_ACTION_SET_TP_SRC | MLX5_FLOW_ACTION_SET_TP_DST) =20 #define MLX5_TCF_CONFIG_ACTIONS \ - (MLX5_FLOW_ACTION_PORT_ID | MLX5_FLOW_ACTION_OF_PUSH_VLAN | \ - MLX5_FLOW_ACTION_OF_SET_VLAN_VID | MLX5_FLOW_ACTION_OF_SET_VLAN_PCP | \ - MLX5_TCF_PEDIT_ACTIONS) + (MLX5_FLOW_ACTION_PORT_ID | MLX5_FLOW_ACTION_JUMP | \ + MLX5_FLOW_ACTION_OF_PUSH_VLAN | MLX5_FLOW_ACTION_OF_SET_VLAN_VID | \ + MLX5_FLOW_ACTION_OF_SET_VLAN_PCP | MLX5_TCF_PEDIT_ACTIONS) =20 #define MAX_PEDIT_KEYS 128 #define SZ_PEDIT_KEY_VAL 4 @@ -704,14 +717,25 @@ flow_tcf_validate_attributes(const struct rte_flow_at= tr *attr, struct rte_flow_error *error) { /* - * Supported attributes: no groups, some priorities and ingress only. - * Don't care about transfer as it is the caller's problem. + * Supported attributes: groups, some priorities and ingress only. + * group is supported only if kernel supports chain. Don't care about + * transfer as it is the caller's problem. */ - if (attr->group) + if (attr->group > MLX5_TCF_GROUP_ID_MAX) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ATTR_GROUP, attr, - "groups are not supported"); - if (attr->priority > 0xfffe) + "group ID larger than " + RTE_STR(MLX5_TCF_GROUP_ID_MAX) + " isn't supported"); + else if (attr->group > 0 && + attr->priority > MLX5_TCF_GROUP_PRIORITY_MAX) + return rte_flow_error_set(error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ATTR_PRIORITY, + attr, + "lowest priority level is " + RTE_STR(MLX5_TCF_GROUP_PRIORITY_MAX) + " when group is configured"); + else if (attr->priority > 0xfffe) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ATTR_PRIORITY, attr, @@ -762,6 +786,7 @@ flow_tcf_validate(struct rte_eth_dev *dev, } spec, mask; union { const struct rte_flow_action_port_id *port_id; + const struct rte_flow_action_jump *jump; const struct rte_flow_action_of_push_vlan *of_push_vlan; const struct rte_flow_action_of_set_vlan_vid * of_set_vlan_vid; @@ -995,11 +1020,6 @@ flow_tcf_validate(struct rte_eth_dev *dev, break; case RTE_FLOW_ACTION_TYPE_PORT_ID: current_action_flag =3D MLX5_FLOW_ACTION_PORT_ID; - if (action_flags & MLX5_TCF_FATE_ACTIONS) - return rte_flow_error_set - (error, EINVAL, - RTE_FLOW_ERROR_TYPE_ACTION, actions, - "can't have multiple fate actions"); if (!actions->conf) break; conf.port_id =3D actions->conf; @@ -1018,12 +1038,19 @@ flow_tcf_validate(struct rte_eth_dev *dev, " ifindex"); port_id_dev =3D &rte_eth_devices[conf.port_id->id]; break; - case RTE_FLOW_ACTION_TYPE_DROP: - if (action_flags & MLX5_TCF_FATE_ACTIONS) + case RTE_FLOW_ACTION_TYPE_JUMP: + current_action_flag =3D MLX5_FLOW_ACTION_JUMP; + if (!actions->conf) + break; + conf.jump =3D actions->conf; + if (attr->group >=3D conf.jump->group) return rte_flow_error_set - (error, EINVAL, - RTE_FLOW_ERROR_TYPE_ACTION, actions, - "can't have multiple fate actions"); + (error, ENOTSUP, + RTE_FLOW_ERROR_TYPE_ACTION, + actions, + "can jump only to a group forward"); + break; + case RTE_FLOW_ACTION_TYPE_DROP: current_action_flag =3D MLX5_FLOW_ACTION_DROP; break; case RTE_FLOW_ACTION_TYPE_OF_POP_VLAN: @@ -1082,7 +1109,7 @@ flow_tcf_validate(struct rte_eth_dev *dev, "action configuration not set"); } if ((current_action_flag & MLX5_TCF_PEDIT_ACTIONS) && - pedit_validated) + pedit_validated) return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION, actions, @@ -1091,6 +1118,13 @@ flow_tcf_validate(struct rte_eth_dev *dev, if ((current_action_flag & ~MLX5_TCF_PEDIT_ACTIONS) && (action_flags & MLX5_TCF_PEDIT_ACTIONS)) pedit_validated =3D 1; + if ((current_action_flag & MLX5_TCF_FATE_ACTIONS) && + (action_flags & MLX5_TCF_FATE_ACTIONS)) + return rte_flow_error_set(error, EINVAL, + RTE_FLOW_ERROR_TYPE_ACTION, + actions, + "can't have multiple fate" + " actions"); action_flags |=3D current_action_flag; } if ((action_flags & MLX5_TCF_PEDIT_ACTIONS) && @@ -1179,7 +1213,8 @@ flow_tcf_validate(struct rte_eth_dev *dev, * Maximum size of memory for items. */ static int -flow_tcf_get_items_and_size(const struct rte_flow_item items[], +flow_tcf_get_items_and_size(const struct rte_flow_attr *attr, + const struct rte_flow_item items[], uint64_t *item_flags) { int size =3D 0; @@ -1188,6 +1223,8 @@ flow_tcf_get_items_and_size(const struct rte_flow_ite= m items[], size +=3D SZ_NLATTR_STRZ_OF("flower") + SZ_NLATTR_NEST + /* TCA_OPTIONS. */ SZ_NLATTR_TYPE_OF(uint32_t); /* TCA_CLS_FLAGS_SKIP_SW. */ + if (attr->group > 0) + size +=3D SZ_NLATTR_TYPE_OF(uint32_t); /* TCA_CHAIN. */ for (; items->type !=3D RTE_FLOW_ITEM_TYPE_END; items++) { switch (items->type) { case RTE_FLOW_ITEM_TYPE_VOID: @@ -1277,6 +1314,13 @@ flow_tcf_get_actions_and_size(const struct rte_flow_= action actions[], SZ_NLATTR_TYPE_OF(struct tc_mirred); flags |=3D MLX5_FLOW_ACTION_PORT_ID; break; + case RTE_FLOW_ACTION_TYPE_JUMP: + size +=3D SZ_NLATTR_NEST + /* na_act_index. */ + SZ_NLATTR_STRZ_OF("gact") + + SZ_NLATTR_NEST + /* TCA_ACT_OPTIONS. */ + SZ_NLATTR_TYPE_OF(struct tc_gact); + flags |=3D MLX5_FLOW_ACTION_JUMP; + break; case RTE_FLOW_ACTION_TYPE_DROP: size +=3D SZ_NLATTR_NEST + /* na_act_index. */ SZ_NLATTR_STRZ_OF("gact") + @@ -1371,7 +1415,7 @@ flow_tcf_nl_brand(struct nlmsghdr *nlh, uint32_t hand= le) * otherwise NULL and rte_ernno is set. */ static struct mlx5_flow * -flow_tcf_prepare(const struct rte_flow_attr *attr __rte_unused, +flow_tcf_prepare(const struct rte_flow_attr *attr, const struct rte_flow_item items[], const struct rte_flow_action actions[], uint64_t *item_flags, uint64_t *action_flags, @@ -1384,7 +1428,7 @@ flow_tcf_prepare(const struct rte_flow_attr *attr __r= te_unused, struct nlmsghdr *nlh; struct tcmsg *tcm; =20 - size +=3D flow_tcf_get_items_and_size(items, item_flags); + size +=3D flow_tcf_get_items_and_size(attr, items, item_flags); size +=3D flow_tcf_get_actions_and_size(actions, action_flags); dev_flow =3D rte_zmalloc(__func__, size, MNL_ALIGNTO); if (!dev_flow) { @@ -1455,6 +1499,7 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct ml= x5_flow *dev_flow, } spec, mask; union { const struct rte_flow_action_port_id *port_id; + const struct rte_flow_action_jump *jump; const struct rte_flow_action_of_push_vlan *of_push_vlan; const struct rte_flow_action_of_set_vlan_vid * of_set_vlan_vid; @@ -1490,6 +1535,8 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct ml= x5_flow *dev_flow, */ tcm->tcm_info =3D TC_H_MAKE((attr->priority + 1) << 16, RTE_BE16(ETH_P_ALL)); + if (attr->group > 0) + mnl_attr_put_u32(nlh, TCA_CHAIN, attr->group); mnl_attr_put_strz(nlh, TCA_KIND, "flower"); na_flower =3D mnl_attr_nest_start(nlh, TCA_OPTIONS); mnl_attr_put_u32(nlh, TCA_FLOWER_FLAGS, TCA_CLS_FLAGS_SKIP_SW); @@ -1782,6 +1829,23 @@ flow_tcf_translate(struct rte_eth_dev *dev, struct m= lx5_flow *dev_flow, mnl_attr_nest_end(nlh, na_act); mnl_attr_nest_end(nlh, na_act_index); break; + case RTE_FLOW_ACTION_TYPE_JUMP: + conf.jump =3D actions->conf; + na_act_index =3D + mnl_attr_nest_start(nlh, na_act_index_cur++); + assert(na_act_index); + mnl_attr_put_strz(nlh, TCA_ACT_KIND, "gact"); + na_act =3D mnl_attr_nest_start(nlh, TCA_ACT_OPTIONS); + assert(na_act); + mnl_attr_put(nlh, TCA_GACT_PARMS, + sizeof(struct tc_gact), + &(struct tc_gact){ + .action =3D TC_ACT_GOTO_CHAIN | + conf.jump->group, + }); + mnl_attr_nest_end(nlh, na_act); + mnl_attr_nest_end(nlh, na_act_index); + break; case RTE_FLOW_ACTION_TYPE_DROP: na_act_index =3D mnl_attr_nest_start(nlh, na_act_index_cur++); --=20 2.11.0