From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id AF1E0A04AA; Tue, 8 Sep 2020 14:26:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CE5391B9B7; Tue, 8 Sep 2020 14:26:51 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 809C22BA8 for ; Tue, 8 Sep 2020 12:06:40 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from lizh@nvidia.com) with SMTP; 8 Sep 2020 13:06:39 +0300 Received: from nvidia.com (c-235-15-1-006.mtl.labs.mlnx [10.235.15.6]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 088A6doH015884; Tue, 8 Sep 2020 13:06:39 +0300 From: lizh To: dekelp@nvidia.com, orika@nvidia.com, viacheslavo@nvidia.com, matan@nvidia.com Cc: dev@dpdk.org, thomas@monjalon.net, rasland@nvidia.com Date: Tue, 8 Sep 2020 13:06:36 +0300 Message-Id: <20200908100636.4575-1-lizh@nvidia.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Tue, 08 Sep 2020 14:26:51 +0200 Subject: [dpdk-dev] [RFC] app/testpmd: distinguish ICMP identifier fields in packet 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" Ability to distinguish ICMP identifier fields in packets. Dstinguish ICMP sequence number field too. Already supports ICMP code and type fields in current version. Existing fields in ICMP header contain the required information. ICMP header already is supported and no code change in RTE FLOW. Extend testpmd CLI to include the fields of ident and sequence number. One example: flow create 0 ingress pattern eth / ipv4 / icmp code is 1 ident is 5 seq is 6 / end actions count / queue index 0 / end The ICMP packet with code 1, identifier 5 and sequence number 6 will be matched. It will implement action counter and forward to queue 0. Signed-off-by: lizh --- app/test-pmd/cmdline_flow.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 6263d307ed..6e04d538ea 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -143,6 +143,8 @@ enum index { ITEM_ICMP, ITEM_ICMP_TYPE, ITEM_ICMP_CODE, + ITEM_ICMP_IDENT, + ITEM_ICMP_SEQ, ITEM_UDP, ITEM_UDP_SRC, ITEM_UDP_DST, @@ -893,6 +895,8 @@ static const enum index item_ipv6[] = { static const enum index item_icmp[] = { ITEM_ICMP_TYPE, ITEM_ICMP_CODE, + ITEM_ICMP_IDENT, + ITEM_ICMP_SEQ, ITEM_NEXT, ZERO, }; @@ -2193,6 +2197,20 @@ static const struct token token_list[] = { .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp, hdr.icmp_code)), }, + [ITEM_ICMP_IDENT] = { + .name = "ident", + .help = "ICMP packet identifier", + .next = NEXT(item_icmp, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp, + hdr.icmp_ident)), + }, + [ITEM_ICMP_SEQ] = { + .name = "seq", + .help = "ICMP packet sequence number", + .next = NEXT(item_icmp, NEXT_ENTRY(UNSIGNED), item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp, + hdr.icmp_seq_nb)), + }, [ITEM_UDP] = { .name = "udp", .help = "match UDP header", -- 2.21.0