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 EC01041BBE; Fri, 3 Feb 2023 16:02:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 941984067B; Fri, 3 Feb 2023 16:02:52 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2069.outbound.protection.outlook.com [40.107.244.69]) by mails.dpdk.org (Postfix) with ESMTP id 7076A4021E for ; Fri, 3 Feb 2023 16:02:51 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hAm+xT5xMb6wLm+DU42qQ7t1iLPE7RYK5s6Osl6xLV/gma2rFVm+Lh3VZsery0wJqA1ob9p5emuheXh3w144B8sXTqf3Fpc1UJha1psghD7xUYxpJuhZIxxtaNmDjkVQ2YnGsqsSNiCy7NSTAft+zW8u/OOQIv/y/sGJB/XrFYykbFcJndOWXOMl3qi8jc0WDTilbR9IcCngKCGCukqwIYwe67hnhc1txbOv+hVP45vpeMPSVJfdtXW2oJHccq8TTEpUaPohSwZZ/R8vSs4aJV9rdytdo8354dLO2s2qbpIGpqceMvWTyK5APsKRUW/rJImRd7dwnHdqy1qIKv8EhA== 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=3Y6TmGWEdKFpyUxhEJBL2BcPBAeZdVAb3yZihMwzAb0=; b=N2WCbMV9ckKbzLyiXphaiRV2LadMwxV2VM4N8AJg3A0dpscuf/11WL3b3zWwuV2e5xDx8E2qFYBPwKxbVZsuf5+cJvq717nCh76jMTV0WT+TZeUO4uGUybxSvjWhoT7+K73fXAJt43d3pEkvz7IlcU0+VekJEFYEcJHFhVj65eDtMCafCsdXygsIg5jlZI86PBmTHMpqAKASftSbVYBIgs+VYx2wvhnRIG7J4WGA5ayGJ9zeK395KVGE2uTgAG66BF9kbzqRY5duLJLjexAQtyBxbg7qNtBpvK5cpjpxr0DLhiu4MlrFab/MCaCjUmn7vLK764mgIG51JKfuSvzYWw== 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=3Y6TmGWEdKFpyUxhEJBL2BcPBAeZdVAb3yZihMwzAb0=; b=iz/vi3a4xnklJYhsABlRLvnp3VpHEshxSkAOeSmBlxoxxZ6cjAUXe0iiMj1vDrUmLLJ/8/9o7pBU/JnFzGrIRy0uo2yCdDS7jOjfz1PzJzshEiEq6ixCWVYAF78eln6H62+7Q/TFdjlROTfhwmHXeOq2Gfn117fGI0jWq+hsKzg= 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 IA1PR12MB8466.namprd12.prod.outlook.com (2603:10b6:208:44b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.31; Fri, 3 Feb 2023 15:02:48 +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.6064.031; Fri, 3 Feb 2023 15:02:48 +0000 Message-ID: Date: Fri, 3 Feb 2023 15:02:41 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Content-Language: en-US To: Thomas Monjalon Cc: Wisam Jaddo , Ori Kam , Aman Singh , Yuying Zhang , Ajit Khaparde , Somnath Kotur , Hemant Agrawal , Sachin Saxena , Matan Azrad , Viacheslav Ovsiienko , Chaoyong He , =?UTF-8?Q?Niklas_S=c3=b6derlund?= , Andrew Rybchenko , Olivier Matz , David Marchand , dev@dpdk.org References: <20221025214410.715864-1-thomas@monjalon.net> <20230202124500.2578857-1-ferruh.yigit@amd.com> <20230202124500.2578857-5-ferruh.yigit@amd.com> <837964623.0ifERbkFSE@thomas> From: Ferruh Yigit Subject: Re: [PATCH v6 4/8] ethdev: use GRE protocol struct for flow matching In-Reply-To: <837964623.0ifERbkFSE@thomas> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0517.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:272::20) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|IA1PR12MB8466:EE_ X-MS-Office365-Filtering-Correlation-Id: 0180c886-16ae-47ab-0e87-08db05f7b6b3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H/TNo2A14Xjw0RppnCLZq0O2vwTMzpQjwD6oYq+iRJ6sDKDA9tk/pUj7VqtgoxUmVpuLtPyI6SNRgxI0FpRiu5pi2NGY/h1u+ZhFi593vyMvUSrH17CyDgAlz0m+JgkzGCaVDZ6DQ8rgpIZV8LobwIK8cmft9VuXxKZ908eKqAKC57RgRMqh07rHtWMZABeCT/GmXbzpJFXlbvOHS4EeeJLU72e0JNOTbXRBQwcYTlR0hLiKZ5m8YpExye9qC+bhAQnTByO+2524YEXlmrG8SkMUCUzUQSl66Qch/IZIBRO+UzkiKFmxCzNkUuxGtrKTGgVgV9vaCyP5Qw+n0tJ3EVuWVDZaHjBK6B1irWtThUMSLdYaUILDFuJdXJJgyXGge4nqdJiBfo6hTXUQ3Ecy1QvByn5kUu3CR3nkgFYGGIjEADzTHyHWRAOFCJMxuc3RjRsfpj0/8zvDJwjwXO6nX6wrX083YVivPKPCL05JOh/noUq7RqBiSlZOhFBrvk/iElFxx8S+nnlcG+A6ApUPdJHp9f/RMtb/KPwMWzxGTMJN66f4qHQs+jBcyVuIjw3EvHL4PZsIe75afBrbqvePnjN2S9MhFXFWkGDpBLIgMieYDQvR8DMHMY2cHovRvCIeZbN2jQkaGTYJ+ztgE0dWk2LQ0z+PnAYNTmTRhEHpsbKrYbzJ4i7RnY/hYJA7gHPyoqvXD/5zNfGEqUlwknMTO4Gf5a6Nu2KztbZLJiCUgHM= 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)(376002)(39860400002)(136003)(346002)(366004)(396003)(451199018)(8936002)(31686004)(7416002)(5660300002)(2906002)(44832011)(54906003)(41300700001)(66946007)(6916009)(36756003)(66476007)(66556008)(4326008)(8676002)(316002)(6486002)(38100700002)(83380400001)(86362001)(478600001)(2616005)(31696002)(186003)(26005)(6512007)(53546011)(6506007)(6666004)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Q0k3cDVJTGcrUVlHN1ZtZkpGcUQ3eUdpem9qbVZLUkRFWnBoREdFQnB4NVBw?= =?utf-8?B?Vm9adTdSMnlWaTN0Smh1SXVxdklteGZoQmhtNk1LT0dMeU5LMDEvTXpuMjNT?= =?utf-8?B?R1lzdFpaRjdBUFJFTVpRd01MdTN1SmtFRy9sdjM2TzgvSU9vWHNycEo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eFlBRTVuWFJUMkw0RitJOWNyZlRNdEhY?= =?utf-8?B?K1FQeGtjWm9QRXJjc2NNcDFOZE5NQVVqR1E0SFQxeXlsRitMdjgvTittOHBT?= =?utf-8?B?aFhVcnVGbDNGOWw3TkRNcDJpdUhHM0cxN1F1T3lLVkJCWkxLcVNiTm81SzR0?= =?utf-8?Q?Pn5YMYMq3VKqAysfdOlat6nSa?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0180c886-16ae-47ab-0e87-08db05f7b6b3 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Feb 2023 15:02:48.5493 (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: hyNBFKuFj+e/58hb5f5xc78oSBNvn2+JOrq1LiTnlBnzcemgArQSNz67Q0PtIQAu X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8466 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 2/2/2023 5:16 PM, Thomas Monjalon wrote: > 02/02/2023 13:44, Ferruh Yigit: >> --- a/lib/net/rte_gre.h >> +++ b/lib/net/rte_gre.h >> @@ -28,6 +28,8 @@ extern "C" { >> */ >> __extension__ >> struct rte_gre_hdr { >> + union { >> + struct { >> #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN >> uint16_t res2:4; /**< Reserved */ >> uint16_t s:1; /**< Sequence Number Present bit */ >> @@ -45,6 +47,9 @@ struct rte_gre_hdr { >> uint16_t res3:5; /**< Reserved */ >> uint16_t ver:3; /**< Version Number */ >> #endif >> + }; >> + rte_be16_t c_rsvd0_ver; >> + }; >> uint16_t proto; /**< Protocol Type */ > > Why adding an unioned field c_rsvd0_ver? > > Because existing usage in the drivers require to access these fields as a single 16 bytes variable. like mlx was using it as: `X(SET_BE16, gre_c_ver, v->c_rsvd0_ver, rte_flow_item_gre) \` When all usage switched to flow item specific fields to generic headers, there needs a way to represent this in the generic header. By adding 'c_rsvd0_ver' to generic header it becomes: `X(SET_BE16, gre_c_ver, v->hdr.c_rsvd0_ver, rte_flow_item_gre) \` Or another sample, previous version of code was updated as following: ` - size = sizeof(((struct rte_flow_item_gre *)NULL)->c_rsvd0_ver); + size = sizeof(((struct rte_flow_item_gre *)NULL)->hdr.proto); ` Because generic field to represent 'c_rsvd0_ver' is missing, 'hdr.proto' was used, this was wrong. Although the sizes of fields are same and functionally works, they are different fields, this is worse than sizeof(uint16_t); Another usage in testpmd: ` [ITEM_GRE_C_RSVD0_VER] = { .name = "c_rsvd0_ver", @@ -4082,7 +4082,7 @@ static const struct token token_list[] = { .next = NEXT(item_gre, NEXT_ENTRY(COMMON_UNSIGNED), item_param), .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_gre, - c_rsvd0_ver)), + hdr.c_rsvd0_ver)), ` But looking it again perhaps it can be named differently, because it is not a reserved field in the generic header, though I am not sure what can be a good variable name.