From patchwork Wed Sep 30 14:10:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dekel Peled X-Patchwork-Id: 79359 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 43BD1A04B5; Wed, 30 Sep 2020 16:11:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A6CF41DB4A; Wed, 30 Sep 2020 16:10:53 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 8BDA71DB3E for ; Wed, 30 Sep 2020 16:10:49 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from dekelp@nvidia.com) with SMTP; 30 Sep 2020 17:10:48 +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 08UEAWtg023904; Wed, 30 Sep 2020 17:10:48 +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: Wed, 30 Sep 2020 17:10:11 +0300 Message-Id: <1c0211586b73c14e58fa1da2d97077c3d950f717.1601474841.git.dekelp@nvidia.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: References: Subject: [dpdk-dev] [PATCH 03/10] app/testpmd: support IPv4 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" This patch updates testpmd CLI to support fragment_offset field of IPv4 header item. To match on non-fragmented IPv4 packets, need to use pattern: ... ipv4 fragment_offset spec 0 fragment_offset mask 0x3fff ... To match on fragmented IPv4 packets, need to use pattern: ... ipv4 fragment_offset spec 1 fragment_offset last 0x3fff fragment_offset mask 0x3fff ... (Use the full available range 1 to 0x3fff to include all possible values.) To match on any IPv4 packets, fragmented and non-fragmented, the fragment_offset field should not be specified for match. 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 6263d30..0c964c1 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -129,6 +129,7 @@ enum index { ITEM_VLAN_INNER_TYPE, ITEM_IPV4, ITEM_IPV4_TOS, + ITEM_IPV4_FRAGMENT_OFFSET, ITEM_IPV4_TTL, ITEM_IPV4_PROTO, ITEM_IPV4_SRC, @@ -871,6 +872,7 @@ struct parse_action_priv { static const enum index item_ipv4[] = { ITEM_IPV4_TOS, + ITEM_IPV4_FRAGMENT_OFFSET, ITEM_IPV4_TTL, ITEM_IPV4_PROTO, ITEM_IPV4_SRC, @@ -2093,6 +2095,13 @@ static int comp_set_raw_index(struct context *, const struct token *, .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ipv4, hdr.type_of_service)), }, + [ITEM_IPV4_FRAGMENT_OFFSET] = { + .name = "fragment_offset", + .help = "fragmentation flags and fragment offset", + .next = NEXT(item_ipv4, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ipv4, + hdr.fragment_offset)), + }, [ITEM_IPV4_TTL] = { .name = "ttl", .help = "time to live",