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 73B9A42C40; Tue, 6 Jun 2023 17:24:46 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 657654067B; Tue, 6 Jun 2023 17:24:46 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2044.outbound.protection.outlook.com [40.107.93.44]) by mails.dpdk.org (Postfix) with ESMTP id 0248340223 for ; Tue, 6 Jun 2023 17:24:44 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zs23wBmorsYcmRkiZ+skORBZXRm9sX+esGsJ4TrvULhwg2k5bXqCDEQLKBLar7Sd40IdLCNu47yttb1rbPphw57mmYmXUeYsslrdbYYaQ4+3nl93o/xgaA6miZMIswn0RLubiBH2KkuwOSeSjNzwjdR8du71y7WpdZmOZ0GPIncZNwJN7ZQLuCDRdAuVO0GjqDYJS4XYwhi3J5pzwgHPPyee+SUTAWd1rfIuf2UVSaUqP2/WdnNY4EOXJ6YoxBcgiehDNwqwyZJPr2RF9gcu1cl9Kym318ClmThuH8GvtTBKnh6C3DYuiYOWovizhJycogUnuLmWlO1U4f4B/xZnxg== 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=ccanFcOa9DhkS8b89dp5FQD3M7onORYMYjdlP1ffDgM=; b=N718wdvf89QO+WUVLm+hWH1xGgXie0rHkR3FpDsdFpPCQfLruGuaBLlJsA8N4n7iC86nOdNCjYjF6qLG0ySGt6F/0GVDEw/I96VkkQYwepsdNzvJW5mE63jdMZCQCMSpIN7eyom/GDWNPMs+vyHh3v8z9rSl9DxJMRZ2/Ye0hQM9ARxGi3e7NEP7BygHnu7A6VrME82EEVuvHZ9dK+xJuPx7m8Nu8gpTrDsoXTy1fOS6dsoWqMxtJd00u+cMJrGjvYMBuyM/AUvwmKc9c5kXtnrYUn82ERU2x/WoapoiMzMgmN3iCWCbw0CRQziCK/WMUn3Df7171qFZ6j5vdIuEUw== 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=ccanFcOa9DhkS8b89dp5FQD3M7onORYMYjdlP1ffDgM=; b=ZlZPMKTSrWmRlbhzTMqtMJR7Q7rVvcTSY9OTdA0FyOyoUK5SK4pikklfEDb58fiAjD0EYge4FAGft75oddvycYaS2tmuSgwoNlP+Eb7xZbLPPTJSM+chqxfCd7lFEADGwsj7Xt28iKoc3AJeRwZqI3agLjUTIHUwFFsxsRQlTyg= 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 SA3PR12MB8024.namprd12.prod.outlook.com (2603:10b6:806:312::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6477.19; Tue, 6 Jun 2023 15:24:42 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::cf07:30f7:a92a:c53b]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::cf07:30f7:a92a:c53b%4]) with mapi id 15.20.6455.030; Tue, 6 Jun 2023 15:24:41 +0000 Message-ID: <2365bf8b-aafd-872b-2b13-8ba09d985747@amd.com> Date: Tue, 6 Jun 2023 16:24:36 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [PATCH] ethdev: validate reserved fields Content-Language: en-US To: Stephen Hemminger , dev@dpdk.org Cc: thomas@monjalon.net, Andrew Rybchenko References: <20230525203942.129413-1-stephen@networkplumber.org> From: Ferruh Yigit In-Reply-To: <20230525203942.129413-1-stephen@networkplumber.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0367.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a3::19) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SA3PR12MB8024:EE_ X-MS-Office365-Filtering-Correlation-Id: 4f0708ee-2efc-43ea-0d23-08db66a22648 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: O8pqVhnVW441SMutelGlmnl33tfghWaHPMDPOPFyDTDlQIblGSqo1Mh6RG0ASesSz0o/I5mA4gM3giqUF9U6elSHIfKsL8PlY8lSF+jPtJP++XpAhXrYYE5eLWmZbaIKpaKiajKvvCLOEsP18ujZ0tKkZYcThDQv/bnM8NxM2sMpRtsvFBKC0S5u7cRtCn2tMMuDoTYEUfRnzO+h+CJFubIrRIfWpDw1SEmPYU2hOvpBfUaelzGgMtVHuRJvjN9g9gWQ7Ktcg5ZtN/FpL7YQJEXIOuVL4CQCtmT/0QzcFlA46w9SJxxWl/t2TL2jj+NGyU9j+vu3Aa8gJ+VVzj89isj2EgMF2DXV0PM4hLFkAMb+je93QVgB/2gEhYNvrkOr+YJUkz0R/giovByJpFbTGQWdq2LFUVbdh0X+ihmNa4gmbDfZ05IdW4wVgRitPtf7+rR0miDiySVEok1GAe53HxWEYYzXogH3vRiasHNeho/PqjzvNac0S40Wu8FDdNHmcJt3PS/GDMxPR0UHzWBZl6O78xlb/FKtEsxl6bYRmbM6jEeG9W9QYviiJm2DF1L4n3ospSU9lzeb6IWtrhbSzTfQQKjv6ImjHYofckSiSAgHsDz5u9K844iynWXlwKmgI5plrQnbkVFmIm571Ebk6w== 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:(13230028)(4636009)(136003)(346002)(376002)(366004)(396003)(39860400002)(451199021)(41300700001)(8936002)(8676002)(478600001)(6486002)(6666004)(316002)(38100700002)(66556008)(66946007)(66476007)(4326008)(36756003)(5660300002)(15650500001)(31686004)(186003)(2616005)(86362001)(2906002)(31696002)(83380400001)(26005)(6512007)(6506007)(53546011)(44832011)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SVlHbnc0bncydlBGZEdUWkEvcUNuMHJaVnpZSFo2VVg3TElnN1BHTHVNMTlz?= =?utf-8?B?bXpzaTJ2NWpuWDJWbGV4YzVDM0phRFIvZDhUM2hlbEJ4c3RlNExEL05tVGtp?= =?utf-8?B?anEzV2s2VGxaTEt1MFBiRVRuNFl5M2lsaCtwNFRHVGN5UjN5SGhKUmxuSkxq?= =?utf-8?B?RXR0eUxsd3ZrOFFmNWJDQzF5YmR6TitqRDZTNnkwci9ha0hHMWtoenVQcXZk?= =?utf-8?B?UnBieGZ4ZzdHUW5YMlBpN3p1Y3VXTVdFVWdrWUd5eEJucnR1SHVFMmt1K2dr?= =?utf-8?B?R1NFVXBCczBuZUV5YlBUNjJoeFp2ODF2VVdYZllHd2hRbVNpWjZaVFp0SWpM?= =?utf-8?B?N1Q3SjhlUTczMFJXTGU1SXpWT3lkRDhEQmZYQmUvVVhNMmtzUEFqMVlMaz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66a22648 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2023 15:24:41.7392 (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: EZHeSmas/PnMiYD8pKOczcbbGECUSxgyTlbn62vDUk7xxfFztjq++T4jWUKDlApx X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB8024 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 5/25/2023 9:39 PM, Stephen Hemminger wrote: > The various reserved fields added to ethdev could not be > safely used for future extensions because they were never > checked on input. Therefore ABI would be broken if these > fields were added in a future DPDK release. > > Fixes: 436b3a6b6e62 ("ethdev: reserve space in main structs for extension") > Cc: thomas@monjalon.net > Signed-off-by: Stephen Hemminger > --- > lib/ethdev/rte_ethdev.c | 41 +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 41 insertions(+) > > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index 4d0325568322..4f937a1914c9 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -1228,6 +1228,25 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q, > /* Backup mtu for rollback */ > old_mtu = dev->data->mtu; > > + /* fields must be zero to reserve them for future ABI changes */ > + if (dev_conf->rxmode.reserved_64s[0] != 0 || > + dev_conf->rxmode.reserved_64s[1] != 0 || > + dev_conf->rxmode.reserved_ptrs[0] != NULL || > + dev_conf->rxmode.reserved_ptrs[1] != NULL) { > + RTE_ETHDEV_LOG(ERR, "Rxmode reserved fields not zero\n"); > + ret = -EINVAL; > + goto rollback; > + } > + > + if (dev_conf->txmode.reserved_64s[0] != 0 || > + dev_conf->txmode.reserved_64s[1] != 0 || > + dev_conf->txmode.reserved_ptrs[0] != NULL || > + dev_conf->txmode.reserved_ptrs[1] != NULL) { > + RTE_ETHDEV_LOG(ERR, "txmode reserved fields not zero\n"); > + ret = -EINVAL; > + goto rollback; > + } > + > No objection on validating reserved fields, but if any application passing not zero values before (I think this was possible), it will break with this change, so can we get this patch in this release? Or should it need to wait ABI break release? If we will wait v23.11, perhaps this should be applied to all structs with reserved fields, and may be good to add a deprecation notice in this release, what do you think?