From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C7B1E41BDB; Sun, 5 Feb 2023 14:42:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B2BE040ED6; Sun, 5 Feb 2023 14:42:50 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2049.outbound.protection.outlook.com [40.107.223.49]) by mails.dpdk.org (Postfix) with ESMTP id DCDBC40A7D for ; Sun, 5 Feb 2023 14:42:48 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dI1QJ2rxrJWm16GdjSikwnIAgYU9D5AkzL82n1CMJu8efi0ttiw3tckg2amsD2FCQgwlwPqY7UN2o2G8/A35vovDM/rrU92GQWu+ofVt7Lr+ifaDNVGoszjvL+2ZeChnXxUwFolbbJyWFvEEhHiFpPgXjtfB5eng8EYOy5dZi9qBlHsnylMnRDO177C5bqM1Lrdeb/N7GvwpPZwGZAytbEy4RVAjXzqJ4Nab8RACmFiq3EJe8HVxOYwcmcE7atudx9ldgx15JaX17Dgf3lVtSnH+04GKp1nsEVM4AvgKd/9OFHE5wlS4tEv2bDvhNh+DMyB/9+3uI6/MzUgIFTPyBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QybdI0xKsDJJZg9Mrzr6Hyc7r6O0FAAC3g3XV+kmNmU=; b=ZuB7CuT0B/iLj8wsdFlwZKj4/YApS/rg+Ql0/cIPBNdtdgBsRElvDuS0yGXan7x/i5FWvpjkkvRVRc6J9UK7qSAkJtcfEwM8B/GB6U5DwkQfWi1c/MmuObg6BUoxlMgtqPLu8328HQeypn0cXQVQrJ8R13PJ7N9mJmnK5gHdN2oZu8Qmu9hK1yjPu7Wizu78E25wMGRGlDEP7mVV+Cz1wJqbfJcTbOlrFSfUZtQfyHIZqnPYHK02qx7I6blstAQ4hnyroBIYJolws0twJzaeuiiUxnAieyETykc3g4mpOey+CWqxmKxvfvy8NM1S1lnxR+fDuFOKkHXDFEp29tVQEg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QybdI0xKsDJJZg9Mrzr6Hyc7r6O0FAAC3g3XV+kmNmU=; b=ubx2SoK1JmH79DrLlT/pIxAVZyCbR7GWbf2kBSKBZfTKJMfYe2wDJ3KMv3NHcTf51ecIRD0G79bM9I9L9cLPR2l/ABwV+CSxAWrxSoYhoTVG/qaybIQs4WwRfMWcOTAT1IElL4rNLgafi0vnmvgCNetqE1Ra7TbPhObK8zlGJDIsO9PO5w7DlVGazFPYAgMwU2dfn9zKle7NaCpuRsC2fpLfQgelpdKez8N3LL/xSEJP1Q76rtyh7hxH3l8icQXfhhnnzy4lXGPbdxspE+c5kGnCQrO+lyFT2/at6bM01DoQoamB4Evb0QXs4gU360eC4WxK/mJFkOfW+MWEqFUhIg== Received: from MW4P221CA0007.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::12) by PH7PR12MB7210.namprd12.prod.outlook.com (2603:10b6:510:205::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.32; Sun, 5 Feb 2023 13:42:45 +0000 Received: from CO1PEPF00001A63.namprd05.prod.outlook.com (2603:10b6:303:8b:cafe::f4) by MW4P221CA0007.outlook.office365.com (2603:10b6:303:8b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.34 via Frontend Transport; Sun, 5 Feb 2023 13:42:45 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by CO1PEPF00001A63.mail.protection.outlook.com (10.167.241.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.20 via Frontend Transport; Sun, 5 Feb 2023 13:42:44 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Sun, 5 Feb 2023 05:42:32 -0800 Received: from nvidia.com (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Sun, 5 Feb 2023 05:42:29 -0800 From: Leo Xu To: CC: Ori Kam , Thomas Monjalon , "Aman Singh" , Yuying Zhang , Ferruh Yigit , Andrew Rybchenko , Olivier Matz Subject: [PATCH v3 1/3] ethdev: add ICMPv6 ID and sequence Date: Sun, 5 Feb 2023 15:41:52 +0200 Message-ID: <20230205134154.408984-2-yongquanx@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230205134154.408984-1-yongquanx@nvidia.com> References: <20221220074403.1015411-1-yongquanx@nvidia.com> <20230205134154.408984-1-yongquanx@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF00001A63:EE_|PH7PR12MB7210:EE_ X-MS-Office365-Filtering-Correlation-Id: b8d4e598-72e4-4171-0b80-08db077edc63 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: DBaqGMks1Iv6X497mfo7TOmK4J6F3rNuwq8c4qXXWvkv2UvVAuXdpgxuFLPQvgD7uhP3GcD9hHQ+H/TVIRRQGTvg8e1ok5E4z7xBJPnECMF8V8Voem51H3NlI/oyplDKvKMnxUcO4HBTJQupA6UcV1oZ3a5eyS3Tp3xkkc3SeAUiTN8Jqxu0ndACD3a9LSkeCH4i6z/82Cc0lHU0/RTXrCZj6GVIk5vvl0MRabDfXhASMuFmHyw3v9xgbmG5DGWJunkeNTv21tasx9WSDUJtN9q35ZLv4VimP0MXPTmN7KW32xk7Gm2P4q3ruRhX7+lyYBS3QrGDCP6+HulojuecFAAfXhnCXAOV4bAGP61CHoAcWYosiY7V8YXmR/WXaQbYYNB5uutxXF7C1B2fBU01mGXI+d1OMFFjWnfRcAh70C4hZkgisBxpjgDDfbkuE+o4BEnEn2UlRE26mftPYs/7UUWgXQJf/wi9fBkRcbMLWrTdzsUMZSqTAy0gT9YUiN+cNKes35rv3ExdMMWNO5H6c93Ea7zL+kKKJsSaAIcUWsf+K4fAMRw5s+IZdq3ieBeufFGBK3EHjBWUkKrRxbDQO0Xi+PNQBJAXWMBpX4p/msf6dTn33xbYv4HxCRhzPMFjuGm7sV+6+nMeQg9FGea5UKJfq0f9TVMcm68eGvMWd1Cp/qy1+skMUFT3vNtsueJXYsYZnTuvV/b7o7jR22idtg== X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230025)(4636009)(136003)(376002)(396003)(39860400002)(346002)(451199018)(36840700001)(40470700004)(46966006)(55016003)(40480700001)(2906002)(6666004)(478600001)(54906003)(7696005)(7636003)(86362001)(36756003)(82310400005)(40460700003)(82740400003)(356005)(2616005)(26005)(336012)(47076005)(426003)(316002)(6916009)(5660300002)(4326008)(8676002)(70586007)(70206006)(83380400001)(41300700001)(186003)(8936002)(6286002)(16526019)(1076003)(36860700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Feb 2023 13:42:44.6247 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b8d4e598-72e4-4171-0b80-08db077edc63 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF00001A63.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7210 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org This patch adds API support for ICMPv6 ID and sequence. 1: Add two new pattern item types for ICMPv6 echo request and reply: RTE_FLOW_ITEM_TYPE_ICMP6_ECHO_REQUEST RTE_FLOW_ITEM_TYPE_ICMP6_ECHO_REPLY 2: Add new structures for ICMP packet definitions. struct rte_icmp_base_hdr; # For basic header of all ICMP/ICMPv6 header struct rte_icmp_echo_hdr; # For ICMP/ICMPv6 echo header The existing struct rte_icmp_hdr should not be used in new code. It should be set to be deprecated in future. The reason for that is, icmp_ident/icmp_seq_nb are not common fields of ICMP/ICMPv6 packets. 3: Enhance testpmd flow pattern to support ICMPv6 identifier and sequence. Example of ICMPv6 echo pattern in testpmd command: pattern eth / ipv6 / icmp6_echo_request / end pattern eth / ipv6 / icmp6_echo_reply / end pattern eth / ipv6 / icmp6_echo_request ident is 20 seq is 30 / end Signed-off-by: Leo Xu Acked-by: Ori Kam --- .mailmap | 1 + app/test-pmd/cmdline_flow.c | 70 +++++++++++++++++++++ doc/guides/nics/features/default.ini | 2 + doc/guides/prog_guide/rte_flow.rst | 14 +++++ doc/guides/rel_notes/release_23_03.rst | 5 ++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 10 +++ lib/ethdev/rte_flow.c | 2 + lib/ethdev/rte_flow.h | 24 +++++++ lib/net/rte_icmp.h | 22 +++++++ 9 files changed, 150 insertions(+) diff --git a/.mailmap b/.mailmap index 75884b6fe2..310853bd5e 100644 --- a/.mailmap +++ b/.mailmap @@ -728,6 +728,7 @@ Lei Gong Lei Ji Lei Yao Leonid Myravjev +Leo Xu Leszek Zygo Levend Sayar Lev Faerman diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c index 88108498e0..97ab742abd 100644 --- a/app/test-pmd/cmdline_flow.c +++ b/app/test-pmd/cmdline_flow.c @@ -360,6 +360,12 @@ enum index { ITEM_ICMP6, ITEM_ICMP6_TYPE, ITEM_ICMP6_CODE, + ITEM_ICMP6_ECHO_REQUEST, + ITEM_ICMP6_ECHO_REQUEST_ID, + ITEM_ICMP6_ECHO_REQUEST_SEQ, + ITEM_ICMP6_ECHO_REPLY, + ITEM_ICMP6_ECHO_REPLY_ID, + ITEM_ICMP6_ECHO_REPLY_SEQ, ITEM_ICMP6_ND_NS, ITEM_ICMP6_ND_NS_TARGET_ADDR, ITEM_ICMP6_ND_NA, @@ -1327,6 +1333,8 @@ static const enum index next_item[] = { ITEM_IPV6_EXT, ITEM_IPV6_FRAG_EXT, ITEM_ICMP6, + ITEM_ICMP6_ECHO_REQUEST, + ITEM_ICMP6_ECHO_REPLY, ITEM_ICMP6_ND_NS, ITEM_ICMP6_ND_NA, ITEM_ICMP6_ND_OPT, @@ -1575,6 +1583,20 @@ static const enum index item_icmp6[] = { ZERO, }; +static const enum index item_icmp6_echo_request[] = { + ITEM_ICMP6_ECHO_REQUEST_ID, + ITEM_ICMP6_ECHO_REQUEST_SEQ, + ITEM_NEXT, + ZERO, +}; + +static const enum index item_icmp6_echo_reply[] = { + ITEM_ICMP6_ECHO_REPLY_ID, + ITEM_ICMP6_ECHO_REPLY_SEQ, + ITEM_NEXT, + ZERO, +}; + static const enum index item_icmp6_nd_ns[] = { ITEM_ICMP6_ND_NS_TARGET_ADDR, ITEM_NEXT, @@ -4323,6 +4345,54 @@ static const struct token token_list[] = { .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp6, code)), }, + [ITEM_ICMP6_ECHO_REQUEST] = { + .name = "icmp6_echo_request", + .help = "match ICMPv6 echo request", + .priv = PRIV_ITEM(ICMP6_ECHO_REQUEST, + sizeof(struct rte_flow_item_icmp6_echo)), + .next = NEXT(item_icmp6_echo_request), + .call = parse_vc, + }, + [ITEM_ICMP6_ECHO_REQUEST_ID] = { + .name = "ident", + .help = "ICMPv6 echo request identifier", + .next = NEXT(item_icmp6_echo_request, NEXT_ENTRY(COMMON_UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp6_echo, + hdr.identifier)), + }, + [ITEM_ICMP6_ECHO_REQUEST_SEQ] = { + .name = "seq", + .help = "ICMPv6 echo request sequence", + .next = NEXT(item_icmp6_echo_request, NEXT_ENTRY(COMMON_UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp6_echo, + hdr.sequence)), + }, + [ITEM_ICMP6_ECHO_REPLY] = { + .name = "icmp6_echo_reply", + .help = "match ICMPv6 echo reply", + .priv = PRIV_ITEM(ICMP6_ECHO_REPLY, + sizeof(struct rte_flow_item_icmp6_echo)), + .next = NEXT(item_icmp6_echo_reply), + .call = parse_vc, + }, + [ITEM_ICMP6_ECHO_REPLY_ID] = { + .name = "ident", + .help = "ICMPv6 echo reply identifier", + .next = NEXT(item_icmp6_echo_reply, NEXT_ENTRY(COMMON_UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp6_echo, + hdr.identifier)), + }, + [ITEM_ICMP6_ECHO_REPLY_SEQ] = { + .name = "seq", + .help = "ICMPv6 echo reply sequence", + .next = NEXT(item_icmp6_echo_reply, NEXT_ENTRY(COMMON_UNSIGNED), + item_param), + .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_icmp6_echo, + hdr.sequence)), + }, [ITEM_ICMP6_ND_NS] = { .name = "icmp6_nd_ns", .help = "match ICMPv6 neighbor discovery solicitation", diff --git a/doc/guides/nics/features/default.ini b/doc/guides/nics/features/default.ini index 510cc6679d..976a020985 100644 --- a/doc/guides/nics/features/default.ini +++ b/doc/guides/nics/features/default.ini @@ -105,6 +105,8 @@ gtp_psc = higig2 = icmp = icmp6 = +icmp6_echo_request = +icmp6_echo_reply = icmp6_nd_na = icmp6_nd_ns = icmp6_nd_opt = diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index 3e6242803d..b910ea51bd 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -1165,6 +1165,20 @@ Matches any ICMPv6 header. - ``checksum``: ICMPv6 checksum. - Default ``mask`` matches ``type`` and ``code``. +Item: ``ICMP6_ECHO_REQUEST`` +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Matches an ICMPv6 echo request. + +- ``hdr``: ICMP6 echo header definition (``rte_icmp.h``). + +Item: ``ICMP6_ECHO_REPLY`` +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Matches an ICMPv6 echo reply. + +- ``hdr``: ICMP6 echo header definition (``rte_icmp.h``). + Item: ``ICMP6_ND_NS`` ^^^^^^^^^^^^^^^^^^^^^ diff --git a/doc/guides/rel_notes/release_23_03.rst b/doc/guides/rel_notes/release_23_03.rst index c15f6fbb9f..3f5c7af3b6 100644 --- a/doc/guides/rel_notes/release_23_03.rst +++ b/doc/guides/rel_notes/release_23_03.rst @@ -69,6 +69,11 @@ New Features ``rte_event_dev_config::nb_single_link_event_port_queues`` parameter required for eth_rx, eth_tx, crypto and timer eventdev adapters. +* **Added rte_flow support for matching ICMPv6 ID and sequence fields.** + + * Added flow items to match ICMPv6 echo request and reply packets. + Matching patterns can include ICMP identifier and sequence numbers. + Removed Items ------------- diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst index 0037506a79..f497bba26d 100644 --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst @@ -3622,6 +3622,16 @@ This section lists supported pattern items and their attributes, if any. - ``type {unsigned}``: ICMPv6 type. - ``code {unsigned}``: ICMPv6 code. +- ``icmp6_echo_request``: match ICMPv6 echo request. + + - ``ident {unsigned}``: ICMPv6 echo request identifier. + - ``seq {unsigned}``: ICMPv6 echo request sequence number. + +- ``icmp6_echo_reply``: match ICMPv6 echo reply. + + - ``ident {unsigned}``: ICMPv6 echo reply identifier. + - ``seq {unsigned}``: ICMPv6 echo reply sequence number. + - ``icmp6_nd_ns``: match ICMPv6 neighbor discovery solicitation. - ``target_addr {ipv6 address}``: target address. diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index 7d0c24366c..adcd4a61be 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -123,6 +123,8 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = { MK_FLOW_ITEM(IPV6_EXT, sizeof(struct rte_flow_item_ipv6_ext)), MK_FLOW_ITEM(IPV6_FRAG_EXT, sizeof(struct rte_flow_item_ipv6_frag_ext)), MK_FLOW_ITEM(ICMP6, sizeof(struct rte_flow_item_icmp6)), + MK_FLOW_ITEM(ICMP6_ECHO_REQUEST, sizeof(struct rte_flow_item_icmp6_echo)), + MK_FLOW_ITEM(ICMP6_ECHO_REPLY, sizeof(struct rte_flow_item_icmp6_echo)), MK_FLOW_ITEM(ICMP6_ND_NS, sizeof(struct rte_flow_item_icmp6_nd_ns)), MK_FLOW_ITEM(ICMP6_ND_NA, sizeof(struct rte_flow_item_icmp6_nd_na)), MK_FLOW_ITEM(ICMP6_ND_OPT, sizeof(struct rte_flow_item_icmp6_nd_opt)), diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index b60987db4b..3ce6f188a3 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -624,6 +624,20 @@ enum rte_flow_item_type { * See struct rte_flow_item_meter_color. */ RTE_FLOW_ITEM_TYPE_METER_COLOR, + + /** + * Matches an ICMPv6 echo request. + * + * @see struct rte_flow_item_icmp6_echo. + */ + RTE_FLOW_ITEM_TYPE_ICMP6_ECHO_REQUEST, + + /** + * Matches an ICMPv6 echo reply. + * + * @see struct rte_flow_item_icmp6_echo. + */ + RTE_FLOW_ITEM_TYPE_ICMP6_ECHO_REPLY, }; /** @@ -1303,6 +1317,16 @@ static const struct rte_flow_item_icmp6 rte_flow_item_icmp6_mask = { }; #endif +/** + * RTE_FLOW_ITEM_TYPE_ICMP6_ECHO_REQUEST + * RTE_FLOW_ITEM_TYPE_ICMP6_ECHO_REPLY + * + * Matches an ICMPv6 echo request or reply. + */ +struct rte_flow_item_icmp6_echo { + struct rte_icmp_echo_hdr hdr; +}; + /** * RTE_FLOW_ITEM_TYPE_ICMP6_ND_NS * diff --git a/lib/net/rte_icmp.h b/lib/net/rte_icmp.h index 4429e8e29f..7aaf0fd096 100644 --- a/lib/net/rte_icmp.h +++ b/lib/net/rte_icmp.h @@ -37,6 +37,28 @@ struct rte_icmp_hdr { #define RTE_IP_ICMP_ECHO_REPLY 0 #define RTE_IP_ICMP_ECHO_REQUEST 8 +/** + * ICMP base header + */ +struct rte_icmp_base_hdr { + uint8_t type; + uint8_t code; + rte_be16_t checksum; +} __rte_packed; + +/** + * ICMP echo header + */ +struct rte_icmp_echo_hdr { + struct rte_icmp_base_hdr base; + rte_be16_t identifier; + rte_be16_t sequence; +} __rte_packed; + +/* ICMP6 packet types */ +#define RTE_ICMP6_ECHO_REQUEST 128 +#define RTE_ICMP6_ECHO_REPLY 129 + #ifdef __cplusplus } #endif -- 2.27.0