From patchwork Tue Oct 13 13:32:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dekel Peled X-Patchwork-Id: 80505 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B9FC3A04B7; Tue, 13 Oct 2020 15:34:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 219601DB6E; Tue, 13 Oct 2020 15:34:02 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 79F5A1DB6E for ; Tue, 13 Oct 2020 15:33:59 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from dekelp@nvidia.com) with SMTP; 13 Oct 2020 16:33:57 +0300 Received: from mtl-vdi-280.wap.labs.mlnx. (mtl-vdi-280.wap.labs.mlnx [10.228.134.250]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 09DDXkMe022551; Tue, 13 Oct 2020 16:33:57 +0300 From: Dekel Peled To: orika@nvidia.com, thomas@monjalon.net, ferruh.yigit@intel.com, arybchenko@solarflare.com, konstantin.ananyev@intel.com, olivier.matz@6wind.com, wenzhuo.lu@intel.com, beilei.xing@intel.com, bernard.iremonger@intel.com, matan@nvidia.com, shahafs@nvidia.com, viacheslavo@nvidia.com Cc: dev@dpdk.org Date: Tue, 13 Oct 2020 16:32:43 +0300 Message-Id: <054e9683da4383ffcad3187fac098d5638d4690b.1602595426.git.dekelp@nvidia.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: References: Subject: [dpdk-dev] [PATCH v6 4/5] app/testpmd: support IPv6 fragments 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" rte_flow update, following RFC [1], introduced has_frag_ext field for IPv6 header item, used to indicate match on fragmented/non-fragmented packets. This patch updates testpmd CLI to support the new field. To match on non-fragmented IPv6 packets, need to use pattern: ... ipv6 has_frag_ext spec 0 has_frag_ext mask 1 ... To match on fragmented IPv6 packets, need to use pattern: ... ipv6 has_frag_ext spec 1 has_frag_ext mask 1 ... To match on any IPv6 packets, the has_frag_ext field should not be specified for match. [1] https://mails.dpdk.org/archives/dev/2020-August/177257.html Signed-off-by: Dekel Peled Acked-by: Ori Kam --- app/test-pmd/cmdline_flow.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index cfbf57b..d311b85 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -142,6 +142,7 @@ enum index { ITEM_IPV6_HOP, ITEM_IPV6_SRC, ITEM_IPV6_DST, + ITEM_IPV6_HAS_FRAG_EXT, ITEM_ICMP, ITEM_ICMP_TYPE, ITEM_ICMP_CODE, @@ -891,6 +892,7 @@ struct parse_action_priv { ITEM_IPV6_HOP, ITEM_IPV6_SRC, ITEM_IPV6_DST, + ITEM_IPV6_HAS_FRAG_EXT, ITEM_NEXT, ZERO, }; @@ -2186,6 +2188,13 @@ static int comp_set_raw_index(struct context *, const struct token *, .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ipv6, hdr.dst_addr)), }, + [ITEM_IPV6_HAS_FRAG_EXT] = { + .name = "has_frag_ext", + .help = "fragment packet attribute", + .next = NEXT(item_ipv6, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_BF(struct rte_flow_item_ipv6, + has_frag_ext, 1)), + }, [ITEM_ICMP] = { .name = "icmp", .help = "match ICMP header",