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 52DCD41BBE; Fri, 3 Feb 2023 16:16:14 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E69BB4067B; Fri, 3 Feb 2023 16:16:13 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2072.outbound.protection.outlook.com [40.107.243.72]) by mails.dpdk.org (Postfix) with ESMTP id 710C74021E for ; Fri, 3 Feb 2023 16:16:12 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SUEZkWrx2cW/4euMB+gZIqDEYohF+Vf7bU6mvZ/qTVR8mE1E+rfDD0KNQxuGgKNj1CNs2adWiPea+ZM392aYffnahIAn3Say5oaShlBCaPRTJFQxzlokiTf4GDmFuXGh65oOK0HxaptDycfgF273WUWGuM95lFUsDoZmnibaZR7wAK4m8ZUvkrLWZ1DU6oq2a2XSorYvIEZHy8OUpqrpa/Miwh8sft1Zv29JhGJVKmCkj8Gserg3YIUxwCEDLy7p6WFlCKMBYmJ4TtAm3uzWLpYW2kRb/Mrgpb05IyGNwFmHeX9FQLt/zZMYb49EIhqfYxf+mWNhAoZJ6XR45ryjpg== 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=wCYxX9w4ZIqyNuWMtwboKwa1ZqMHCzts2ZjZI+CaNPg=; b=L4QqTxlfOKzbpr0OAmSZBXhldex6CBCQQBVTx1UapdZkxp26KGCUtS9wiUWWbm5UiaZMNWwxOfmLjVTWNkPYpsq3gfQJtcmvrSorMD+uTn3x/8P23/J5v+eLQdRab3NyjUnAhCFC6tKxdXPUZy/+grfVtT9gGgHP5Lk53lH/yY1RGymr06VwPR970bOrkZrqQwvA5HdYKOGdlIW9Cdxr4T5W0X3v5xG8rc96HiOjOsB+Wp6clfeiIepD13MWVBiTDeBfySvASk3CKILExBcL61vN5jGitJR9W8zcMrdIhW+KOIWZvv45efI2O6ZKyRkpufU8MLaxC1s6Eg8AOCWhhw== 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=wCYxX9w4ZIqyNuWMtwboKwa1ZqMHCzts2ZjZI+CaNPg=; b=oAIP7RufjmpmUnFSyu9iZAdBeAm6nFj+JffqZIH6iyE05C3qSEW9xd8QgLUJHhHfdEQC8M8F5f/iMdxTZO0T2o8NVbZmbOdZKhPeL8yG6t9JHWlyWi74zXbv1lqtdwhbWvCUhgh2SgsGx3/i5T5moEcdFjZ4SxOiDcFKzA72guU= 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 DS7PR12MB6360.namprd12.prod.outlook.com (2603:10b6:8:93::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Fri, 3 Feb 2023 15:16:09 +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:16:09 +0000 Message-ID: <9da6f8b4-f3fd-a42a-7cd0-0e3b83636f66@amd.com> Date: Fri, 3 Feb 2023 15:16:02 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH v6 4/8] ethdev: use GRE protocol struct for flow matching 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> <837964623.0ifERbkFSE@thomas> <10218004.nUPlyArG6x@thomas> From: Ferruh Yigit In-Reply-To: <10218004.nUPlyArG6x@thomas> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0503.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1ab::22) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|DS7PR12MB6360:EE_ X-MS-Office365-Filtering-Correlation-Id: 2b7c1531-bed7-4ffb-25ff-08db05f9940c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ELuLRsQCyItTHHmN4UomaJMSnhBPsUWuwpfRARAk+2/qyRt2RsVh+fGE1v+kwz6IAb91fu75H9gqdAbhBgZxg0HILT2QRUxF3Pqo9wQ30iI0wctiRxa0QgU1R5IZ8BHmBIxaJs46VQ+zF685srAXI5T87YcCUlvLFdPnXgC27ZZkozmdOR4OMXnznCs57fuPzAxI/ifHVbxU6FdKrvIyxglFkAeWhXLWhr5fjrXm01+GMNOcUX2PF2n5s2kVJYmqLSi2bGa8uQA1CSIo5/BTkc4yDTPK5pI8bWggluow8p4GjddsR9ftIeZglb1l5+ow1LhmC/HoNzxszjMI/jibHiebbI8Vc22e2HFn+sAIZSKTWV0vbzIzMSn0UctCTqp7UA0FLgoicb5yULHubQmyGEVv7GFfyDsIw2Yt0VE/pM2dgx005HwS7daVrFBjQOTIv40n0umlpvgFC3LGUMYjC8+EkBfEBNSm06dvHTSv1xjI4sFKg3gUtnymXMDCV5tHKSzSQ75Ywm4wUB9wDRbFrHeUuHOUzvKKhbygoZASmWQTfbTB+vBIreFdInSTpVaKQ6U77T1Gml46rlr6G0jL3iwgq170B2Awyk3LhdWAvGi6qmPeSMJaUdKA11MKrPn7Rka1pd8x7dTk10xowwh4lm//KmaYtNBEEYc6T5civ3FGeZNKLkLh8yO3rXn2cuIhIV/3Ohw9RwKOs383JOBtZxp77jLomwaqJzlijS3NUIM= 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)(376002)(366004)(136003)(39860400002)(396003)(451199018)(2906002)(44832011)(36756003)(38100700002)(6666004)(83380400001)(54906003)(2616005)(316002)(6512007)(26005)(186003)(4326008)(66556008)(6506007)(53546011)(66946007)(6486002)(478600001)(5660300002)(8936002)(66476007)(41300700001)(86362001)(31696002)(7416002)(8676002)(6916009)(31686004)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dVFPYTVqRFIrekl3YU1aQVloTWY2TmZOcUVnbGJHTFd4c1BSMlRZeWlCNXJa?= =?utf-8?B?YWttSWcxZXh1MXBKTW9Qd3FTVllNODNOSVB1ZVRqcXNubS9ZUG1zOGx0UVdj?= =?utf-8?B?V1p2NnZCbWJaWlZGcldxZXp5VjZSSVl6Q0krK3M2ckMyRWp6NUJmSHBXenE1?=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FZYWZkWUd2ZjI4bWhzZWpOUUw1MEgz?= =?utf-8?B?b3pTWlp2U283VVBFNFZJd0VxdmdOU0JLKzYzNUc0eFFGTU40ZitRNmNSTXF0?= =?utf-8?B?STdwMWkya3Zrd0pYYUdzdnJ1a1B6MEd0cGZCWGlVWmRoUEVTdTN0NU4yekdO?= =?utf-8?Q?w6LtXDjZm+3TPQfNrqcS3Ubid?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2b7c1531-bed7-4ffb-25ff-08db05f9940c 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:16:09.3595 (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: R36+kppKLfKkgekNpGlABI4aSQSt70G3txGyaPtwGKkCGVWlty6r3WZI9Lu2oP0u X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6360 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/3/2023 3:12 PM, Thomas Monjalon wrote: > 03/02/2023 16:02, Ferruh Yigit: >> 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. > > The best would be to try not using this field at all. > I suggest to remove this patch from the series for now. > I could try to work on it for the next release. > OK