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 84ACF42490; Thu, 26 Jan 2023 11:45:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6819C40A79; Thu, 26 Jan 2023 11:45:30 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by mails.dpdk.org (Postfix) with ESMTP id 664E840697 for ; Thu, 26 Jan 2023 11:45:29 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TUnqPGBLW0qbETui9myj7Rw+vg/8uN/Q9aQMk0MTf/Hm1zMbgdgptvDPfyiH3WJ1+yJwhBA5wxRIonMK3v4lJHgLDN6TvueTajxGaGe/8kRgVgL+TD9Ko5vOeBYUHHlEx6sG70mBmBoSXHMJxWKe2W1s9d8PUREyoBtu6Y9lcfRcKBw9BNWmDxPJGGJPSCrOq9Qoojm6fylz6kBtUpc7oUNKMWEstas8uaalbFKPgWEs6t9m2YwxOh20qZYaXb00Eip92vlT8F5uB7fZuW409TP26jxHhgUIrOl6LhPE8AIx2/FRWI1sktw8CprWAzk4asfqrLkAYmSBufNOvg15+A== 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=rbXnYL/DHPBXBeHkbyugc9g61vX9xYEpqPvR1HQ6fvo=; b=VhH1e8F3rtpDa4yN2CIsF7pPkwfhso5XQt78iyIwnGmcS8f4et/6KdXTKrmqilDhCJhHv5mh62LfWmk7QbRkqqcSWKwokDg3XTrlK/iczyrm6Jix3SCIjnGyihmvseeprO02pz9kHQVce2Yn0PTfMPUqBzQXggCKZII1iNQPksHfhaFxLr/N+3rCbYsJM2/Om8AHwX6w67k5V83ujjXzANXHoGEx0FGpEDNNWYPkRI0dIEza6UjGxBL+mfd6duS+4cFZhPEBuMqg4j5rlgncHIB+MTEAqiAUzoChor8g0NEUyxYiud9rw58b1Vpq6qCWS1KjjHCBNhs20AEq8JU3GA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rbXnYL/DHPBXBeHkbyugc9g61vX9xYEpqPvR1HQ6fvo=; b=eHtfEaS5FCufqyT0NjsctAYkF+jlfkxiW4BzznkS8fWrWJLKY2RhYb7f5Q1x7XsEiiSnjMPCsI17giKg4AJvxVc9IjUJy+SUyBtVWdoA2LTXzO/neBnzqeYPrBwoUikG6QFYhdMV2vfZiMqF2O7rkI3t8/4PFuwAfkruPhG409M= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by MN2PR12MB4095.namprd12.prod.outlook.com (2603:10b6:208:1d1::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22; Thu, 26 Jan 2023 10:45:27 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a%8]) with mapi id 15.20.6043.022; Thu, 26 Jan 2023 10:45:27 +0000 Message-ID: <6e4003ae-97dc-0f64-bf2a-619f89a248fe@amd.com> Date: Thu, 26 Jan 2023 10:45:21 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH v2 1/3] ethdev: add ICMPv6 ID and sequence Content-Language: en-US To: Leo Xu , dev@dpdk.org Cc: Bing Zhao , Ori Kam , Aman Singh , Yuying Zhang , Thomas Monjalon , Andrew Rybchenko , Olivier Matz References: <20221212085923.2314350-1-yongquanx@nvidia.com> <20221220074403.1015411-1-yongquanx@nvidia.com> <20221220074403.1015411-2-yongquanx@nvidia.com> From: Ferruh Yigit In-Reply-To: <20221220074403.1015411-2-yongquanx@nvidia.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0347.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18d::10) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|MN2PR12MB4095:EE_ X-MS-Office365-Filtering-Correlation-Id: 26c283be-e54c-462c-753b-08daff8a6f84 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3FHeHgx7BslwIVP4CVYPqZcx/L1wIbi4rhwf1zHvx9SAZS7toG3NjCzKhlckChAPIFFKCbAVfdz9cb2Gh1F8yLoWtWwgANE/SpbdcPTS066v47gfcL+HIO6QpWoYEguUuPtg68A2gttNwTrltgzeo5JBIsHu+dDJngKBzjvnzaum0m2vfpnp0ZmJVVnUwLPBAGM/NG+YUjd+neHReIhSJvoSBr9eGs86+yCQvK4agyQPt3I7dKmIIsMiD7zKduLWQpBiTQd0PGkRbtt3fawwC6COUu3mIG+3CvlekpdRJI9qCOU05y2HpSooPDRc9OJvvRNQkYg99E+Di7o1lPE5CebUArGj8JMDIMdXAhVA4Rgi0IkhkbSHVp+igd08JSzZYIld+7ne6JaLULVWrbV1kM7j7fpNvpeeiHAnCgcu/wM0NiZBln9XdLADKzgTTJ4N2MKHBgtCC2L3CWMbwmmlG9KrHZxZny6i31ZQ9PrVLzrzwtdJHbSC7vlZCDrOVKaG0XZKhPfsmpdr1kyZaX6zylD7mjcEiz11xOSXhRBOgQToV3lBbQ4vfAYIhgxLoD7SCHHiaPl88R2O+zgdssfIQPUTXnLy+yhcs5/LtoK91kmSRWRVeU7r9bCR2KNdwaGmLTCJiGPAo+2qByyt3vZO/uzdVkbCBTcbQEXxsqD3oX+/RYIIE5Wzm242rHPUQ8sYh05/UkQvUA8zAceY9FZsqD8TVMQWb4vIlKJ7ofWUCi8= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(346002)(366004)(396003)(376002)(136003)(39860400002)(451199018)(66476007)(41300700001)(8936002)(5660300002)(36756003)(44832011)(30864003)(66556008)(2906002)(31686004)(66946007)(478600001)(54906003)(8676002)(4326008)(6486002)(38100700002)(31696002)(86362001)(6506007)(83380400001)(53546011)(2616005)(316002)(186003)(6512007)(26005)(6666004)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?UUVQNmJ4SzdManpKWjdMQmZSNG53RkRsSXJzaUxOSUU3YmtCY2FjaUsvNm94?= =?utf-8?B?L1hpMmUrdWhDemo3SkJkemRQWG4ra0ZJbXlRZ2NHZWtCODlzTElVOHArTDIw?= =?utf-8?B?Z1FZMVJLYVJoUGY5US93bWo5b0pjbU9KcGpXUzR0NTJ2dzd3U3ZpZ0taYXda?= =?utf-8?B?elJmcFdmRnI5UEp0UUFvTU53dlNBL3ZLMUFEbmpPZ29QOXd6azc5dyt2S1A3?= =?utf-8?B?QklmZ2xpT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RVbWJndm9odnVL?= =?utf-8?B?aUptZ2FvVlhYUjZJeXdVWVBhMnAzczBiMDI0bkR3ZjNiaWRNcllPSCtQRXQ3?= =?utf-8?Q?jxKBdy2RkJByzZCUr1JMwnsct?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26c283be-e54c-462c-753b-08daff8a6f84 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2023 10:45:26.9743 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: h1NPWKF1cU20G0y5t0d46rRotKac+Ui1trbB63HLi7nd4hCMg0MxRPcj6GiPMWAD X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4095 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 On 12/20/2022 7:44 AM, Leo Xu wrote: > 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 header file rte_icmp6.h for ICMPv6 packet definitions. > 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 > Signed-off-by: Bing Zhao > --- > app/test-pmd/cmdline_flow.c | 70 +++++++++++++++++++++ > doc/guides/prog_guide/rte_flow.rst | 14 +++++ > doc/guides/rel_notes/release_23_03.rst | 4 ++ > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 10 +++ > lib/ethdev/rte_flow.c | 4 ++ > lib/ethdev/rte_flow.h | 25 ++++++++ > lib/net/meson.build | 1 + > lib/net/rte_icmp6.h | 48 ++++++++++++++ > 8 files changed, 176 insertions(+) > create mode 100644 lib/net/rte_icmp6.h Please update .mailmap with in this patch. > > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c > index 88108498e0..7dc1528899 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, > + echo.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, > + echo.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, > + echo.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, > + echo.sequence)), > + }, > [ITEM_ICMP6_ND_NS] = { > .name = "icmp6_nd_ns", > .help = "match ICMPv6 neighbor discovery solicitation", > diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst > index 3e6242803d..59932e82a6 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. > + > +- ``echo``: ICMP6 echo definition (``rte_icmp6.h``). > + > +Item: ``ICMP6_ECHO_REPLY`` > +^^^^^^^^^^^^^^^^^^^^^^^^^^ > + > +Matches an ICMPv6 echo reply. > + > +- ``echo``: ICMP6 echo definition (``rte_icmp6.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 b8c5b68d6c..5af9c43dd9 100644 > --- a/doc/guides/rel_notes/release_23_03.rst > +++ b/doc/guides/rel_notes/release_23_03.rst > @@ -55,6 +55,10 @@ New Features > Also, make sure to start the actual text at the margin. > ======================================================= > > +* **Added rte_flow support for matching ICMPv6 ID and sequence fields.** > + > + Added ``icmp6_echo`` item in rte_flow to support ID and sequence > + matching in ICMPv6 echo request/reply packets. > Should keep two empty lines before next section. > 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..39cd4f9817 100644 > --- a/lib/ethdev/rte_flow.c > +++ b/lib/ethdev/rte_flow.c > @@ -123,6 +123,10 @@ 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)), Syntax, please merge lines, to make it more readable. > 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..72695aca8a 100644 > --- a/lib/ethdev/rte_flow.h > +++ b/lib/ethdev/rte_flow.h > @@ -21,6 +21,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -624,6 +625,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 +1318,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_icmp6_echo echo; > +}; > + > /** > * RTE_FLOW_ITEM_TYPE_ICMP6_ND_NS > * > diff --git a/lib/net/meson.build b/lib/net/meson.build > index 379d161ee0..ce3ca67bdc 100644 > --- a/lib/net/meson.build > +++ b/lib/net/meson.build > @@ -22,6 +22,7 @@ headers = files( > 'rte_geneve.h', > 'rte_l2tpv2.h', > 'rte_ppp.h', > + 'rte_icmp6.h', Can you please move just below rte_icmp.h to group them. > ) > > sources = files( > diff --git a/lib/net/rte_icmp6.h b/lib/net/rte_icmp6.h > new file mode 100644 > index 0000000000..bf6956d7c9 > --- /dev/null > +++ b/lib/net/rte_icmp6.h > @@ -0,0 +1,48 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright (c) 2022 NVIDIA Corporation & Affiliates 2023? > + */ > + > +#ifndef _RTE_ICMP6_H_ > +#define _RTE_ICMP6_H_ > + > +/** > + * @file > + * > + * ICMP6-related defines > + */ > + > +#include > + > +#include > + > +#ifdef __cplusplus > +extern "C" { > +#endif > + > +/** > + * ICMP6 header > + */ > +struct rte_icmp6_hdr { > + uint8_t type; > + uint8_t code; > + rte_be16_t checksum; > +} __rte_packed; > + > +/** > + * ICMP6 echo > + */ > +struct rte_icmp6_echo { > + struct rte_icmp6_hdr hdr; > + 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 > + > +#endif /* RTE_ICMP6_H_ */