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 2F5CD41D9B; Tue, 28 Feb 2023 10:53:32 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 25C8840EE4; Tue, 28 Feb 2023 10:53:32 +0100 (CET) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2079.outbound.protection.outlook.com [40.107.212.79]) by mails.dpdk.org (Postfix) with ESMTP id 078C84021F; Tue, 28 Feb 2023 10:53:30 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aIZXzmLMaBdvvPT+yn8J6kbxX3OYTnkg2TiUwdqKBj7ZwhVa2JCWiF9wdEW7WpQ7NC/NW6/UluMXQhbBrTbucxdyi8kJpQuTFJvFHeqk3NF5hJi223r9VrUAft64D+iBDCagXusL2Ek7QmBXp1jgXIPQhcNZBWCEXs4xEa/SgowqsN2Jvd1m6WrZYC+yujHewLB8PqQyTe/ybv2ZRyQ0Kl3cYLgtidEXXv7ioTMkeyQDNi19DyTY8ou0kHLGsKggxuEybNz0gDONVTkCqT0Ubpii4Lw8EZl4RxHY4jlmeNSSokP81HBLZeTOB0yxOQnN9T7+eOVC5Z/KrrBmcBi4tQ== 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=r2os0fFXN3JJxBU1+L6yjUC4dbge1KggxpUJ4vZ/U5c=; b=TJyRJffjH2KpdTSWvVY7zzcJzOfJmGWFcgHELYMJSB5kztglvAHx+uBZjrPXwehCIZhwEPa5fZrynGqH8mK6keq5xe6NEp6xyis7/fSVAZ0myFYjwEkoFL0duRreZ5soDm4KnX+dGW65ii4NhJkSczE75PoyUoATRjwKwEgfmMztxTExYef23BCXT2OITP0kIc53jVrum/951lFWXIx88qg2IvMQBCIzm/bjYk6kRN/J+XUhlTUm2n0HP49ZmXhNlXpmcMEkTVnfGeCoM5AhZ/SVmBYf+n42irR436mi3N9uuoHW1fIRiqHGZm5BUeovkPfdb/2e6Dh54mCoLVc9ew== 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=r2os0fFXN3JJxBU1+L6yjUC4dbge1KggxpUJ4vZ/U5c=; b=tbz+LNqTi/8dSroZpIi7r/hc1PDN4h5IEpDCC9PJxmRL4EAZo45+qbQGWo6oOv3je3LBR65Skn3oNl3PfWIMn20A6Nvz9XlI1g68+b8u5FBtxcniIkR8ER6/vcxpXJx1Szl1sfmPlvK4cqr+9xA5WheWWaHfsjJau7eCpCzXkPc= 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 CY8PR12MB7364.namprd12.prod.outlook.com (2603:10b6:930:50::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.30; Tue, 28 Feb 2023 09:53:28 +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.030; Tue, 28 Feb 2023 09:53:28 +0000 Message-ID: Date: Tue, 28 Feb 2023 09:53:21 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v7 01/21] net/cpfl: support device initialization Content-Language: en-US To: "Liu, Mingxia" , Thomas Monjalon , Andrew Rybchenko , Jerin Jacob Kollanukkaran , "Zhang, Qi Z" , David Marchand Cc: "dev@dpdk.org" , "Zhang, Yuying" , "Xing, Beilei" , "techboard@dpdk.org" References: <20230213021956.2953088-1-mingxia.liu@intel.com> <20230216003010.3439881-2-mingxia.liu@intel.com> <1745700.4herOUoSWf@thomas> From: Ferruh Yigit In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO6P265CA0013.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:339::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_|CY8PR12MB7364:EE_ X-MS-Office365-Filtering-Correlation-Id: a8ab4bb0-f3cc-4dee-02d0-08db1971a3ee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sV16XPDTNnEXBrrgA6QFxM26Ns0HFDuKeUUUKAqkko84Rn+UZXe/7x8q40ofwtQuzaACs+rczGbtYTg92GV3QuPKuLgtpXLGPdO9S8cyG5rFxBlUIJntnn4jMuOfDvgnm8REHX0B888hLXC+UIDWquV/BEtfe54+Bvsy7VNQ0XyiOBD98pZIGMshEt5U2aG+mjbXwFwXZIOsZ8pLLcDjFiMBaXURfWQbIhk/eZtHGobsGSG29QVM5HQQK72ux7cs9uTdLywCKL31Th8hg80WdUId6f1gIBPEPsuN9HcN44EPYWIk+cJEIz4jRRC99+1HlI/WJI8Rb6aUUjWBhXVGtZFVr6dFa4X5J0Y3ibXoFl//M+IDbAAOBH8tEq4deqVOd36u0M9+iCoQaRt30jrd/3zsAVngo61D6M2Kaz+QaWS+Rsek8l3I77lwVt1nPAdQSBLTyTD9G7lNNkrqtmv0U7PJ8++8tTkTUTv/n0QziEk67XMN/IHDcZ+vJmUKoJz/M2EbqR1yLa3+7AFCKMrfVJ07iW/vdDc9FX0MLiPdR+mobTN8p5cXAn4dcfR33kBpHUDVHH1QP9+NRMiUKQrfC3Khdypfltr5ep30K/D9yktmggkQEa3nAbRLx7GMCbbEQG5Tvx+DGt4Wo0jmurJumVWpMeEU81FpK2u+ZZwZ/ZcOfl0BVZlZKA2fI6Amd+5iSetAG8snge7tOCkYQ+e5xQt9HJQyDwSN81mLv5jDQ4E= 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)(396003)(136003)(376002)(366004)(39860400002)(346002)(451199018)(38100700002)(36756003)(86362001)(44832011)(2906002)(7416002)(41300700001)(66476007)(66946007)(66556008)(5660300002)(8676002)(8936002)(31696002)(4326008)(2616005)(53546011)(6506007)(6512007)(186003)(26005)(83380400001)(110136005)(478600001)(316002)(54906003)(6666004)(6486002)(31686004)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZDIvcElUUWVYV2RZZFhmbFFiTUd3elFoNmtPNnRoZ0ZjbXdqNTcrdjF4UmdB?= =?utf-8?B?UnRHK2hwbEcybDBiTnVzQ2YvOVdqYlFUcG4zZWtRdHhEY3YwMkhRTE9yb3hQ?= =?utf-8?B?WWl2Z3JkMFVXa2gvM3ZPOGJFN29SY1hSTnFMcnZSY0dhWFQ0aENieEVMOUdl?= =?utf-8?B?VU5CZnB5OWVGWUZwM1FQdTFKVTZSUmU3L2NLWDZNeVNaQjErbHNUSlErNjUr?= =?utf-8?B?V3Rza0hLQVkyVnRoVl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Ynkz?= =?utf-8?B?cHd2NVdDbmlXVGRhT1k0aDA2UWhicS9GOWJHTE1WVU0vU0dZWUtVMG0ycXM0?= =?utf-8?Q?5MM2EV5nJxsTks/hBB1yJR3IE?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: a8ab4bb0-f3cc-4dee-02d0-08db1971a3ee X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2023 09:53:27.8152 (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: QIO0LPXH3EOrZaIPXHoEFtZa4cs9G3p6j6yh1azLOf1ycpiO7XsqzKq5YPxZDOzw X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7364 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/28/2023 2:06 AM, Liu, Mingxia wrote: > Thanks you all! > It's a good question, but as it is experimental version and rc2 is approaching, > we won't optimize this function now, and will do it at the time of the official product release. > Hi Mingxia, The discussion is not specific to the driver, it is for ethdev API and for long term. >> -----Original Message----- >> From: Thomas Monjalon >> Sent: Monday, February 27, 2023 11:46 PM >> To: Andrew Rybchenko ; Jerin Jacob >> Kollanukkaran ; Zhang, Qi Z ; >> David Marchand ; Ferruh Yigit >> >> Cc: dev@dpdk.org; Liu, Mingxia ; Zhang, Yuying >> ; Xing, Beilei ; >> techboard@dpdk.org >> Subject: Re: [PATCH v7 01/21] net/cpfl: support device initialization >> >> 27/02/2023 14:46, Ferruh Yigit: >>> 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. >> >> There are some capabilities to read before calling "configure". >> >>> 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? >> >> Which failures cannot be guessed with capability flags? >> >>> 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? >> >> I am not sure we can change such an old API. >> >>> And I think this is another reason why we should not make a single API >>> too overloaded and complex. >> >> Right, and I would support a work to have some of those "configure" >> features available as small functions. >> >