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 6049242A3F; Tue, 2 May 2023 16:58:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C9CC4114B; Tue, 2 May 2023 16:58:04 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2046.outbound.protection.outlook.com [40.107.94.46]) by mails.dpdk.org (Postfix) with ESMTP id 8D57B40E2D for ; Tue, 2 May 2023 16:58:02 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YPbw/3ySrxVgY0JXcMOkKOV89lxamYiK3SCrkzupVVv1XLAgbW0/ux63PGfAXeQzdf36jNt4uW3AJBVA0JoIJW7o0o+Jcnl2aL2oAZQ9iMjBksd5jYq3Dk0Ftm+QjPLqenJo12xLnW55ZpHUbNLuCNTt3z+kb4JZsi9twzPDBC4kdN3xTuZ/jfizuJE0zEwgYkHg2m8+SKOZFZ4E2EMKFxp7Sp8dXh5p1XNDamr5Ho/+CR9VwmZ0nGyPKz127DXrhUT805HuTaKzfgn8oApFK+kr4tlXHfsSTLm1QgGN8PYH/yg3kMCW3Qude6+FoZVmi8sQbPVi8Kz7I6JAuXJjMA== 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=I9jEcbpcNRdEl68JgPXwlVTr5hPVg7cHWcfvvV8b7/A=; b=Adg7nmEVruG8Wf0nR3FFuE/SFnpOerQ2X0kiEmGleyLpBBQaadET8z7H4qixSqMLQEWtuztdn9GfANaMOu9ZdBD9HUwbNvV+WwFabxv5gBAeKedhl4veHu6Nz/1a4Xp2UwdD//VrCD9wEwRlzvhKQ+H8ihghbSls+jzv7NvlFN2YDK+C79N9kExiBQ1wyAACi6TpvMOrodD4GzBsIOimhWrPrMBrvPp15U+lCGlbs39FGlS9BR4LLM1Nd2r5nUhR+hdWUD+XDPvIru4sMhcsQuUTF4jGf1MRN3Ze4BBWFjmBJ5DzJhlsVAFO3XHHKhKw4sL6YYZW8ZOAHvsNpvyXXg== 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=I9jEcbpcNRdEl68JgPXwlVTr5hPVg7cHWcfvvV8b7/A=; b=z/QDoyFqw1H5aJelvX1/WdvjSo+glH3TtZQewgGeDL1LWwcrfYy2xGlhM3l0ULrdK01XZCbnb7oVDwPbALYQS7lkN+cKXE7e5HK6mtkScDhGxSk+mK9Z/+4dbsswBgCGEKqfYHCIEBJy3ho5K23Jm8YlIrbbTLJ6AcgUNCXvWYQ= 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 IA1PR12MB8493.namprd12.prod.outlook.com (2603:10b6:208:447::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6340.30; Tue, 2 May 2023 14:58:00 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::e818:77ea:75b5:f8cc]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::e818:77ea:75b5:f8cc%5]) with mapi id 15.20.6340.031; Tue, 2 May 2023 14:58:00 +0000 Message-ID: Date: Tue, 2 May 2023 15:57:54 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [RFC PATCH 2/3] ethdev: check that at least one FEC mode is specified Content-Language: en-US To: Denis Pryazhennikov , dev@dpdk.org Cc: Ivan Malov , Viacheslav Galaktionov , Thomas Monjalon , Andrew Rybchenko References: <20230428102728.51956-1-denis.pryazhennikov@arknetworks.am> <20230428102728.51956-3-denis.pryazhennikov@arknetworks.am> From: Ferruh Yigit In-Reply-To: <20230428102728.51956-3-denis.pryazhennikov@arknetworks.am> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0226.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a6::15) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|IA1PR12MB8493:EE_ X-MS-Office365-Filtering-Correlation-Id: 04b040eb-ccfe-46bf-96ba-08db4b1d9f72 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kFLJZRQx6bqo3JQZ16p7lwQ6T4jVWwzU18RED5reDrmPeDwzBrxKIOgTpLZtuXnMYw0ZF0RUPogldYq1fJhoU33141nubQ+npVYPrmDsmOGv+PzHib4FBkaZvre36dhK5Vao3ftVjgUzrCctmtAri+L3/Cy19z9EhUw5bq2Zc9huhfiv7QpU8/S4qRaSe5c41pe+9ydWRUKMqZSXQOdoRN8iGnFdZApIgmPlOhn8zH5RQg37qRY5ruMbmNZD3BOsekmCbvqjHqSmI6ANfY0tO6QkG0t/xCq0uGVyfUn83Te/HXIwNUmJ4HrkPzNaps2g54wH5wevociJkQYxG9vaHtYpLAASZoTVHsCzcEHdz2lMCliTohofobZK+UvdcsgRwzaCDPa1woVmhUMr9p/H9QB1te3j50McfdTe4FGkqC9y2QQDIEVjNErqc+/yHzJzTgvpt4hyh0plh+4JjZzkv8ED8MWT3z6Dhy2mYEGXt/f9fsuksYlzQqOYXXTqak0wL7OYFhLwOyUxWHNpWTfRKWW+3Sy3Je/1BlAhkQBc8NGPakx78TBPdTv2Pz0Jsg7pK8oWwjv1DBK6xkWrKCddcDTq8hMoKcscx4HgrHETLEXjBlShPlYD1PBoXpixhVDOTsn61+2k4WLK2g3nZGHsKQ== 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)(396003)(376002)(366004)(346002)(136003)(39860400002)(451199021)(478600001)(31686004)(36756003)(5660300002)(38100700002)(2906002)(8936002)(8676002)(86362001)(316002)(31696002)(66556008)(66476007)(4326008)(66946007)(44832011)(41300700001)(54906003)(6506007)(6512007)(186003)(26005)(53546011)(2616005)(6486002)(6666004)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SjNqRzdDMGs4aHJ0OG1aZENKaWQzZnIrU0JzWjc1SGxPaVRkSEgvNEM2SFhy?= =?utf-8?B?T25VV1JOSHplSFh2UU1meStSMlJaY0dYVjJESTRQTWJGcVU4NHdvcXFUY1FQ?= =?utf-8?B?MzBPZTdTbWV1V2ZaaTYrWW1xY2FLbVc2MWx4V3FrWjF3eTJGWkgxZnJlK1Mx?= =?utf-8?B?eGZpUXJGSWtUMDFCWGZIeHQ5MGI1bkVQSnpTNmluNzJFV20wYjRrOWs4bzV0?= =?utf-8?B?Z2hxQklXQ2FkOTFkYk5qWHFoVjA4aldFTldKYnRvaXAwaW5jSUMyb1RxYWNk?= =?utf-8?B?N1ZqaWpFOFFyazIvdllVRUoyUHFaMjdRVVNNMHVYRTN2N0JvZ0dSRHV5dzd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9?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 04b040eb-ccfe-46bf-96ba-08db4b1d9f72 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2023 14:58:00.5983 (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: EjAJGvWt2YeDfLsI0Oql/K0rnwEs54b7C0T0aPb6YZQdWKZ/GxXDQ38UdoJs/e0p X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB8493 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 4/28/2023 11:27 AM, Denis Pryazhennikov wrote: > The behaviour is undefined in the rte_eth_fec_set() function > when the fec_capa parameter is equal to zero. > Add a check to handle this case. > > Signed-off-by: Denis Pryazhennikov > Acked-by: Ivan Malov > Acked-by: Viacheslav Galaktionov > --- > lib/ethdev/rte_ethdev.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c > index 4d0325568322..d02ee161cf6d 100644 > --- a/lib/ethdev/rte_ethdev.c > +++ b/lib/ethdev/rte_ethdev.c > @@ -4751,6 +4751,11 @@ rte_eth_fec_set(uint16_t port_id, uint32_t fec_capa) > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > > + if (fec_capa == 0) { > + RTE_ETHDEV_LOG(ERR, "At least one FEC mode should be specified\n"); > + return -EINVAL; > + } > + > if (*dev->dev_ops->fec_set == NULL) > return -ENOTSUP; > ret = eth_err(port_id, (*dev->dev_ops->fec_set)(dev, fec_capa)); Acked-by: Ferruh Yigit