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 1A13141D91; Mon, 27 Feb 2023 14:46:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9AA1B40A84; Mon, 27 Feb 2023 14:46:53 +0100 (CET) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2080.outbound.protection.outlook.com [40.107.212.80]) by mails.dpdk.org (Postfix) with ESMTP id 05C7040A7D; Mon, 27 Feb 2023 14:46:52 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WW2V2OgXUqbVYPwdW7lzGCWdCmsp2z/umq16CCQ01B49/z8x5iXA6PoD6hha1oSmxrlNLuKaFslKPJTdQ666JYrWyApRpRof38sDdxFYdkuUeItmgQffqT6H5XCR8kO/aMK9PsP1pehU2NnhdjF05/yei2ZBw3uNIPndePgB1Q00SVaVrEH7toihg/F5Wo5w/ipXVxBuCSRuE4sUB/yjuORY/oInqFcNvfz0wf2ex8XItmGXZyqGlHmNGmNM9VGEG7vwKT3LxLBXoDK8v17Seu/XGmQC3AGAbHdBfjTisy3Bfhl+QXQgst40MTefZmTqzyt3NJwFZB/4OzSUjZxxUA== 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=KpBS1ZKIZwh7lh3xUR/DMv8/iE57JLahZT9AYpQnRic=; b=Sbs0/I9czfuZwu57nHl8Cej9qEeV0/Pa6T7mo3PBbXwe51fy1MjP13BmaLW2t7hv3Mb919YX/zOnh/UE2cv0sZjY1BRXGN9yX/61ixngJQJUhNv8ZrsGFv0gKDhXftwfBe4xkwGyR9RgR6h7Qib/wFyFSNGmFVoKlt+SLGR/J+Ixnac6ZnjAaJQqH/9Tdmwu/N3DUNhYfZ+yPeJoE8QXfJAnj4Jj0RX1Z7R9bL66kjSH8HLbR+3Mt2I0S/CL+xccGn2THvX8UkVpQ/DfBNxUG9gWhjhih8RlRnCHBNSIuttZBPTQBix0fKjZA7PgcpJwYZp2RbXy5Ou+iq33oOE2iQ== 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=KpBS1ZKIZwh7lh3xUR/DMv8/iE57JLahZT9AYpQnRic=; b=zo9VpbYeWkzhSXCN1mSRtUM53dSArGeS74vSEEW6GHGohKRawMZuIIZsJ3uqH++a5oBje/PHIlT891LvwC+WhPEgcqjGADxTtd9jDdeXFTSPm9MMaSFumGuqLWvQrBpRORP6AT1CSrEKYSa35c/wJB7lgjUxxR7YpVIaaMOFBnY= 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 PH7PR12MB6444.namprd12.prod.outlook.com (2603:10b6:510:1f8::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29; Mon, 27 Feb 2023 13:46:50 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48%7]) with mapi id 15.20.6134.029; Mon, 27 Feb 2023 13:46:50 +0000 Message-ID: Date: Mon, 27 Feb 2023 13:46:43 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Content-Language: en-US To: Thomas Monjalon , Andrew Rybchenko , Jerin Jacob Kollanukkaran , Qi Z Zhang , David Marchand References: <20230213021956.2953088-1-mingxia.liu@intel.com> <20230216003010.3439881-1-mingxia.liu@intel.com> <20230216003010.3439881-2-mingxia.liu@intel.com> Cc: dev@dpdk.org, Mingxia Liu , yuying.zhang@intel.com, beilei.xing@intel.com, "techboard@dpdk.org" From: Ferruh Yigit Subject: Re: [PATCH v7 01/21] net/cpfl: support device initialization In-Reply-To: <20230216003010.3439881-2-mingxia.liu@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P265CA0135.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2c4::10) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|PH7PR12MB6444:EE_ X-MS-Office365-Filtering-Correlation-Id: 0937bab8-4f49-4e3a-4c28-08db18c913ac X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TUnTD08d8a/wp4yJURF6b3DW25yA1FWHgtsDXeVJLyEOQBthrUvcXMkqGHoqx1Q2fRCZEIZ3/0dUpxQbxLXLh3rgDluM/KJIvda0zOAKf8t3qZLn4UBbEpDI9MhxuiFrKKMFdLuPOAtuTapX3dlauzRAgiJHOzjtOYnXGkkL6SSVFYZA3VehXTtD16ux+Ixk3QMkBAAQRfWL94bI6fwjJBdrxNIjjwtbmEhaQXpmzIPlBZ0y/C7kkeZeluaVvlKr44D/Z0adrkP46IZ7H2sjnSvirWpwkxqDFnU7+ReONMAq02bbJm5wk/efabQWxLU8cqRgOWxI1TwMVt68S4T4KSgTU9CSi4xUlsfL6H9uGH/5h0HoR4QQP/CgIoeEESbZ/kL9RApww0GbVUCHdDuecIbg3+DRArFtnLinBwbb72saF8EAs4O55GLB5kRkkQAP8oUeTLBTR/FdS1TGcFH0XvkBNDW0d86gCZUob/v4Kcx8XjyUyFImoI+4L46dD7hVj1GOqZaSscGvuqAKVOoTpXuQXD3CZDlMg30lkwNI5DnIUgl8JDWhm6JWW7A+5Y1bYzyzWIGA4Amu4PeFojwos/OA5DAtOcXV9LsAeUlK0woyd9PxxFI7ypjXfD4hMrCWXqlSY7q4nwopDq8qd/7UVxcMwQuMdVpKxmaA8xPA+EUzOwjr7vMC/vsw+3pjLwx80bbjMd5JWMfOrts7nOu6ZE0FxlzTg1mO0y8rm633SXo= 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)(366004)(39860400002)(136003)(376002)(346002)(396003)(451199018)(31686004)(8936002)(7416002)(2906002)(5660300002)(44832011)(36756003)(41300700001)(4326008)(8676002)(316002)(110136005)(66476007)(54906003)(53546011)(31696002)(66556008)(6486002)(478600001)(66946007)(6506007)(26005)(6666004)(38100700002)(6512007)(2616005)(86362001)(186003)(83380400001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?L1BxM0RJbXhxZlQyMEpaS0JwTjRIL0lrQWZyOStIZDh1U2F6Z2FsdlFQbjd3?= =?utf-8?B?TWFBSVQ0UklGbWQzQ3pFRVRsaC9xQ3Q4NVNUekVPNDR2Q3RvSWZseDZmRExS?= =?utf-8?B?TnVETDh3b05wemlnWGk2YlFBQzI1OVdQdEdqRTFnbVNIUzZ1L3JLVThuc3Jx?= =?utf-8?B?MkZpVE0zZ0xkQUlMMUtGRmsvelk1VnY1OXEwNWpITm1uNkEzOHZKc2xmTUV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jd2RlK2d5QmZkSWs5SVNuRmYwb0w2?= =?utf-8?B?NVppK0JxaWZXSitKdnlnSkttRGYxVTg0ZDdrQy9OWHhTY0JCQmpUQzRSNXBi?= =?utf-8?Q?57W4Gt4zWSAP9z2K5qAfgWJU8?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0937bab8-4f49-4e3a-4c28-08db18c913ac X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2023 13:46:50.3421 (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: YzaDp9DqdqwguouQTKk5tKtENS8YQQdtcYEJ/ax190ipvNO15gAEfAuL5ZzdDPDt X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6444 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/16/2023 12:29 AM, Mingxia Liu wrote: > +static int > +cpfl_dev_configure(struct rte_eth_dev *dev) > +{ > + struct rte_eth_conf *conf = &dev->data->dev_conf; > + > + if (conf->link_speeds & RTE_ETH_LINK_SPEED_FIXED) { > + PMD_INIT_LOG(ERR, "Setting link speed is not supported"); > + return -ENOTSUP; > + } > + > + if (conf->txmode.mq_mode != RTE_ETH_MQ_TX_NONE) { > + PMD_INIT_LOG(ERR, "Multi-queue TX mode %d is not supported", > + conf->txmode.mq_mode); > + return -ENOTSUP; > + } > + > + if (conf->lpbk_mode != 0) { > + PMD_INIT_LOG(ERR, "Loopback operation mode %d is not supported", > + conf->lpbk_mode); > + return -ENOTSUP; > + } > + > + if (conf->dcb_capability_en != 0) { > + PMD_INIT_LOG(ERR, "Priority Flow Control(PFC) if not supported"); > + return -ENOTSUP; > + } > + > + if (conf->intr_conf.lsc != 0) { > + PMD_INIT_LOG(ERR, "LSC interrupt is not supported"); > + return -ENOTSUP; > + } > + > + if (conf->intr_conf.rxq != 0) { > + PMD_INIT_LOG(ERR, "RXQ interrupt is not supported"); > + return -ENOTSUP; > + } > + > + if (conf->intr_conf.rmv != 0) { > + PMD_INIT_LOG(ERR, "RMV interrupt is not supported"); > + return -ENOTSUP; > + } > + > + return 0; This is '.dev_configure()' dev ops of a driver, there is nothing wrong with the function but it is a good example to highlight a point. 'rte_eth_dev_configure()' can fail from various reasons, what can an application do in this case? It is not clear why configuration failed, there is no way to figure out failed config option dynamically. Application developer can read the log and find out what caused the failure, but what can do next? Put a conditional check for the particular device, assuming application supports multiple devices, before configuration? I think we need better error value, to help application detect what went wrong and adapt dynamically, perhaps a bitmask of errors one per each config option, what do you think? And I think this is another reason why we should not make a single API too overloaded and complex.