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 12F91A0540 for ; Tue, 13 Dec 2022 14:55:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8907240146; Tue, 13 Dec 2022 14:55:20 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by mails.dpdk.org (Postfix) with ESMTP id 3AA43400D5 for ; Tue, 13 Dec 2022 14:55:19 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m2heF1UFSy9ZiaSTFVCQoV+5BAV1R9lcd/LCLXn336wHv2EqLb6/AqKIekVMvQssIWXWnDkkXJDibiewEwb3LRw0vpZ6kbQXAcUeXm+l6Q+R7h126NUI5m4U49yDqvBzEp/cMr+HjUWupH2vrc3pd4xzg6hZ+6CqtCX0kMN3GwWlk7/B6PQS6og/iPxAVGeUdc05HlvLpPfwa0glRzx+HsE3DfrN7fgYOXl26P4npoOOG2KyqjVhFUI5pSjGdlzmiWa3mN8+i2HWJvWaurGpH6VAWt4Ii360RJdO5NOUFxF5RaVTu0s53/idimY16TV/vrck/976GVgE3/5j9dG7Cw== 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=quLOUDPU14n2S2UBKKF3/1xHe3HT4lAUjKLKNnhHBcc=; b=MnD9PYv0Q8SlpN42pjehKJTBDJ5L8i55hBPrS0Rcin/CBkDv1bw6tMRD13IOrkmMogpfd9hrBfoHf8aGDfvFhIHPP6Y1AsQ2Kvs7v47lOpeuP94SoejxaDy+woN3+jMfpzvEma+Xlf+CaVcsq/I9Qm5h1PsCX+CFUiCngLKJPEtd/mLA8jeevXB8uy7SARtojd01DYZq4bQwxdlYKFQeKiZdZPTz+zP8oJKWfTM4W4Lul+yS3FFoYwozfm/8e+FN14/WBGYgo1UuLunjebcDUzLHUp6LbjgwYqZ9xBymuTtr8lVdNOwrbWRW1sQQz7fadB3IiGumdjdiFyuN1052Mw== 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=quLOUDPU14n2S2UBKKF3/1xHe3HT4lAUjKLKNnhHBcc=; b=Y4Xm7A9DBtJY/kunakPho3m7X/l7AUDi54NU9pSHA0E1yPLKjLFFcU0N8kT4KKr6nq3F1AMS87aHReTClmhJjffJz/WynBGkaMCwQU562btsnFzOOqhbZoYKcgfBCogjrYaKBru4jZj34fUw33AJrcdfXHbYmJH+F5DAuaIcp5k= 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 DM4PR12MB5964.namprd12.prod.outlook.com (2603:10b6:8:6b::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Tue, 13 Dec 2022 13:55:16 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::b482:d5bd:c7d0:3842]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::b482:d5bd:c7d0:3842%8]) with mapi id 15.20.5880.019; Tue, 13 Dec 2022 13:55:15 +0000 Message-ID: Date: Tue, 13 Dec 2022 13:55:10 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Content-Language: en-US To: Antonio Di Bacco References: From: Ferruh Yigit Cc: users@dpdk.org Subject: Re: Anonymous structs in DPDK In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0124.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:192::21) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|DM4PR12MB5964:EE_ X-MS-Office365-Filtering-Correlation-Id: 3fda5f73-e673-4753-e383-08dadd11a9ac X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZWSgvUdZoWeBRc4tg4+cTGHkcWgq4D7KayPSzayqC+t1jj6dcftlVGYy2EAG5KD1lD9H0JHnse7+Xqt4lAor2JE3auWnkBoI8dQcEHfWICCeWP6nYqGQnR1PNpmNrXiqdHZ6r/ITGMgGtQtly0JymVVgFq2S7F7w/PuvVcJO0yPsOKZzXTCW/Lsa4ZJi2dCDH+Fa4PBAWy4rXU1aTVvtbiOi531nZPGkKp/FTZXAuNdchqbXcYIuTHXo0/tGnvsXxx1/6VP3SkHqIz8SX76wLOIk0qcnWuJXKLo+0fjXon0UVb8IhrC3nlHDY3BHeIuRfem2lTSkKI0cAVO044FW4hPRo2ce+khSaX5A6niwWtm2EAt6PmSX9lCznteA2yTrG24vO9vAQHdXwQklG37371BbRwl8RBZD5timHv54lkFSRiP5UssMxmve7yn3QB0reCJr4TRaw5vZW9UGYU3cjj8FwDIMNBQhkv84V2pxu1ciW8EUBPBNt6HULtvp7q+cdxgru7oZwWDE/nObL0nIbK5TFqomVPS4SeIqorwXABhkcGJ81h0m20neldjVBfEXcUGlw3E41chBiO8mmv2s+YC34iaT2nXnk5VKT4MlXtLIvHGgMfK7lvnyg6o/bFHpScqOCzfJJ9MzQ80IacxUdRgV5HINs3hyW46d53ufbPgkKqkF9HYgfGJSISiPo24KOri0s5YAPsYgZxPJqUOStSye4jIl8UVoG0fxhbvUBPs= 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:(13230022)(4636009)(376002)(396003)(136003)(346002)(366004)(39860400002)(451199015)(316002)(5660300002)(6916009)(8936002)(86362001)(6486002)(4326008)(66476007)(6512007)(8676002)(41300700001)(6666004)(3480700007)(36756003)(31696002)(66556008)(53546011)(6506007)(83380400001)(186003)(2616005)(478600001)(66946007)(2906002)(31686004)(4744005)(26005)(38100700002)(44832011)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?V3pibm9FbnlyL1dKMzJ3eTVpclhHTW5VWllsMWZwRnlrR25SSlJxVFZlaUVZ?= =?utf-8?B?ZStDMzNRKzV3Y2ZHa2JrUERnZWNZdU4wSzlmSXNuT2ZBTDhPMjNMemZYZEdm?= =?utf-8?B?aytuYTEzVWUzWEx3VkNSOHVMNDQ1U1ZZZnlyVEN3NTRFOS82ZVQ5b0d2QUNG?= =?utf-8?B?VHVpdXdzRjFPRnNuYlVCYjN6bG4yMzlwaDg5NnAyUndXSnlJaEZMUzdsZU1a?= =?utf-8?B?dU1INmdTYzFZL3hYY3J5cEdVWG9PeTNHOWpqQ1NKQmNNTG1HbkF2QXNveE8r?= =?utf-8?B?cFNUaEZlWUxXYklIckNoclJSckdJbGI5MFNPdUh1QS9OTFBLNlAyREJQb2tT?= =?utf-8?B?bXlJb2pzeTJHbVp3bWxhU0MzZ3A5TG03N1ZiTjNKdmt5WVI4OXEyY3RkM3FC?= =?utf-8?B?RzcydHd3c004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f-8?B?QWFrS1VUd2VwZkhQVmVCMXRYdEEzQStEdTVUUVFXZ3JXWDNxVytXY2E1M0Vr?= =?utf-8?B?WmgybEQ3aEtWamtocUMxUTV1YVovaUIrelpHNDBZZ0hDU2RLWmFTR3RVQ2xx?= =?utf-8?B?M0JKSnFGbUM3WGNwNXQwSDVHODRtSGtoOXZ3U2NYVzFNRnJGRGlrYm9aQWZy?= =?utf-8?B?WkF1WVZuZ1ZZb2xnN0cxaGZkU2ZMVGtjVGxoU2ttU2I3ZGkybTEyT25ITTFD?= =?utf-8?B?MVYyTlcrUFlVTHRFMXE0UDFvcE84a0pFMnJ2VDQ1cVRNZHI4MHVpUUtneTB3?= =?utf-8?B?OTVoTjllL3ZiTzN3VTdsVkt0dGhzVjcyeUhLcWNnbUhReUNVa2NNYVA0SFph?= =?utf-8?B?cGgydnovbVBleDJRSFFlWUI1czdWalFFbDFWN0lVK25kZWVPalJzZFpTMDV3?= =?utf-8?B?MzR2NWlpWmxVSzBURGwwTlI4TldodTA5eG1HTFdGd2NlYllvZG81R0F2M2VM?= =?utf-8?B?N0x4OG5yZzZOY3pVeEV0VnJqdE1TQTJaYlNNSkF1dVVzZDhaOEZJN0ZsNkZp?= =?utf-8?B?SlhMRUtkSEYrK3FXOUhYUURwUWNkazYvZ0pEYXF3UnA1ampzZnFhbnF0VDZq?= =?utf-8?B?eDFwVnduQUNGcmYxUmc0VDVGaE9lKzczcmlZenRmNUI4TUliTGxZWG9WRnNr?= =?utf-8?B?MFFQb1VKNHY0SmNId1pQaktrVW54S1VFYTI0SXJrZ3VhS3A0WDROL2Fuc0tO?= =?utf-8?B?ZnJYVVV2dzg0c2pBODVWVlJrTjk3QjlQcWE2UHJqSkNDbzhCTlRRR3NPeFdm?= =?utf-8?Q?769Tdkii6jKDHGMjv65XnovEe?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3fda5f73-e673-4753-e383-08dadd11a9ac X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2022 13:55:15.9083 (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: nKNMV/vzv9qyh0poWOQvK7GhGstuf/Z0qqGArbY/59UrGua/Z6WjQOrKu0BJWAmL X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5964 X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: users-bounces@dpdk.org On 12/13/2022 12:51 PM, Antonio Di Bacco wrote: > I noticed that DPDK include files have a number of anonymous/unnamed struct: > > For example: > > /** > * The rte_spinlock_t type. > */ > typedef struct { > volatile int locked; /**< lock status 0 = unlocked, 1 = locked */ > } rte_spinlock_t; > > This choice doesn't allow to use forward declaration. I need forward > declaration because I'm using a rte_spinlock_t pointer in a C++ class > and I don't want to include rte_spinlock.h to prevent my application > to include it as well. > > Is there any reason to use unnamed structures? > Hi Antonio Di, I don't think there is a specific reason to not use named struct, I assume that is only because there was no need to have it. So if you need, you can send a simple patch to convert anonymous struct to named struct, although I am not clear why you can't include 'rte_spinlock.h' in the file you declare your class. Cheers, ferruh