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 D8D1C42C04; Thu, 1 Jun 2023 17:12:27 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B32FC40DDC; Thu, 1 Jun 2023 17:12:27 +0200 (CEST) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2084.outbound.protection.outlook.com [40.107.96.84]) by mails.dpdk.org (Postfix) with ESMTP id DBA0E406BA for ; Thu, 1 Jun 2023 17:12:25 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YKwmeGeyHOXDwKTsLJQOqNShkOD8srawxtvud8ZbhvI+60co7wpOgvyFqVmkFmexTeM7XEoOhvM5Xe3Ml/Im9/Er9TdVJ52bidehbN8PEe/UF0ZEaRKKPwNE2XyuxbtMPfVMTkThJA9eZ1M3vedg4gefQhjmF9/kxGNnAEGI0B12XnF0SdhsgmlIKPh+tF+2egWRWBiUHKxjCFUWphKCUrdFvcHCiRqtHmQaaBBPgdEZF/eolo21dfE8o3M9ZjlKwvCH7TtCFwaadOoaTZ4EJ33P+Yirts0Kb3rvtir3dccGGXw83C5eORi/wb+4y+dfiv12Xq/5Zz0B+vh00exqWg== 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=FW6sdrtNcT3pOLgqI6BCMS3cpZbN4EEUM0/ETXwm0+s=; b=U6cc9y3LgoFO3k1Om8DHM2fH6Ulg28V+bNGaHsZqb6Jp4IDObgYO01OsYgEdBZRWhH1XIbQorpnZHRxSVBGlUdthPDzj/wmqu/U8777hcsCIG6qMjSZRIRrhzjeKmoPkxym9jv0rsXrIQAOu/UU4d2GhESLK6TrBV8XVUKbM2QYQazSXrj5XL/TDnUZp2mdzJ11LOtOwNW85gsFHrUWJU9jyQUL0EIRiA6/lTddJjH4WgS3r0ECgv1MdyVqmpSD7XDFwcdesF7StrjeQVH/HGMKnDKKrDryC35JcRlLXP/94BkVUj2FYc11TSKgKDpTvDl0v6m2rB3rk2A0GwUa7cA== 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=FW6sdrtNcT3pOLgqI6BCMS3cpZbN4EEUM0/ETXwm0+s=; b=hkjL5JjikQeYivtdCNSMueVTMUYzX2vIW3RkvgDF4zZi4tZUZ9BFJ+iziuaLgiCoaYy/RWrH09nDNaYR/SUJjaPYu+i9vFEXB976VYD7xeZChE/iaRRSsQHVEmu5F5XvIdky8/DQvm4HCKFFcyBPDow9/eNr9iSp16LBXuxXzGo= 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 IA0PR12MB8086.namprd12.prod.outlook.com (2603:10b6:208:403::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.23; Thu, 1 Jun 2023 15:12:23 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::7957:641d:6aba:3f9a]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::7957:641d:6aba:3f9a%4]) with mapi id 15.20.6433.022; Thu, 1 Jun 2023 15:12:23 +0000 Message-ID: <9c2780cc-2e8d-3d4a-5e43-cb2cd848b1a9@amd.com> Date: Thu, 1 Jun 2023 16:12:17 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Content-Language: en-US To: Kaijun Zeng , jbehrens@vmware.com Cc: dev@dpdk.org References: <20230528143734.145326-1-user@sklga> From: Ferruh Yigit Subject: Re: [PATCH] drivers: fix vmxnet3 return wrong error code in initializing In-Reply-To: <20230528143734.145326-1-user@sklga> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0678.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:351::18) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|IA0PR12MB8086:EE_ X-MS-Office365-Filtering-Correlation-Id: 90a7393e-12ff-4981-ca51-08db62b29a2d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PdwCo91rigZMkbu8sES8GyKlPYEQrCA3GpJ9ujbsxfMmW4rO7FfFWcgvY9oz0vQjT9WNph6AONSHL5mA9gZPSk+mfg/XPLqhEnBXHwK7/J6gmd+PUobYZPg7Hc7GQbyL+4DGpzN0KFdVu3BzZ+CCXzPE1C0Pm23GFzjG4f1D22VUF4m6XWatGkAwcj/eMojsyDdS+PdKGia5ux02Zjpga8EWEOt9W7JnXa+bGqy/mYgIRym3pO0QLaeT/uKGN6vp6WZrX5BdNE0e45toY+R3nXW65TUpbZEXBFMHYn4+6Iq4u2M44oSjIIkyUw5WXZ+ps1Ec0rhCbrf053i1ydtNpXAogZTb9Musaw4W81USflc0KsNMz27hLnGx4oxlajhfr2/CjTnie894xfELqRaTuyXJjPEkBJ8NfBKb0MxHW8QwXGRPpoUhsX5goyOyT+V23FepXArkak+h5RrgoewDBgjQJfUUoMmWwowMtg9TKdJThD6AG5OkND4dh55wT9Ut9zqEOD4kve8uK/ilyxRkUn4ujdbRcZu0Jk3D6J3qc0vDUu87xbrzplfsrL/VmFTx2qpGfSAhWjXoJBFePdy7cyfLlpiHDRreKpdFvx/U4Y2o9edJDre1SJW55WA70YbvQVAows3d5R3/oSikomAorA== 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)(39860400002)(396003)(376002)(346002)(136003)(366004)(451199021)(31686004)(38100700002)(2616005)(66556008)(66476007)(83380400001)(478600001)(66946007)(31696002)(86362001)(4326008)(2906002)(6666004)(6512007)(53546011)(186003)(26005)(316002)(6506007)(6486002)(41300700001)(5660300002)(8936002)(966005)(44832011)(8676002)(36756003)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?QUZpVW40Z2Q3a2FEZkowU1A3aTVzRmJnaE5KRi96UGxHcHlzTDQ4ay9yZnN2?= =?utf-8?B?NmR0UzRpK2JxWmhlTmhZem1oZ0dFRzVrSldaODRxN1ZlWVVLQ1owZmRXSEhK?= =?utf-8?B?M1d0ZlJnSUFVaXJubGkzK3gxN0prdXhzNURxc1hOQWlRdVkyd0RJNmV5blNx?= =?utf-8?B?R0wyVnY5R2V3Y3RxNnBIdGtxbmJwdTBkUEZHdU9ZN2NNNG5sTTkvQ1ozVWpa?= =?utf-8?B?eUJKNFNiZDhmSGhSK0Y1eGp3VFlJUVoybHg1U2N3bmhtQ2lkOWRzb0JJbU1S?= =?utf-8?B?T1k4ejNnQW53U0ZITGRWL3NmOGpNcTBoQzYxRy9VNVBOb1BkUlhILzE2UXR1?= =?utf-8?B?YVpWeGtoazRnT3NWdFZFUkI3SVN5TzZscUJxUC9kNGQ5VUZqemNieTk1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exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2023 15:12:23.6591 (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: pTHad8P6+XpZTzQl71XUYuSm9HLFHtXvFxXkKv0/kGx5XeHiXMdQCNn52317xCpT X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8086 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/28/2023 3:37 PM, root wrote: > From: Kaijun Zeng > > In vmxnet3_dev_rxtx_init(), a wrong error code may be thrown after it invokes > vmxnet3_post_rx_bufs() because it negates the error code before returning it. > It causes rte_eth_dev_start() to give a positive number to the invoker, but it > should be a negative number, as described in the comments. > > Bugzilla ID: 1239 > > Signed-off-by: Kaijun Zeng > --- > drivers/net/vmxnet3/vmxnet3_rxtx.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c > index a875ffec07..73ec1e4727 100644 > --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c > +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c > @@ -1315,7 +1315,7 @@ vmxnet3_dev_rxtx_init(struct rte_eth_dev *dev) > PMD_INIT_LOG(ERR, > "ERROR: Posting Rxq: %d buffers ring: %d", > i, j); > - return -ret; > + return ret; Hi Kaijun, Thanks for the fix, it looks valid. But 'ret' being 0 also seems problematic, mentioned code is as following: ``` ret = vmxnet3_post_rx_bufs(rxq, j); if (ret <= 0) { PMD_INIT_LOG(ERR, "ERROR: Posting Rxq: %d buffers ring: %d", i, j); return ret; } ``` 'vmxnet3_dev_rxtx_init()' can return 0 and failure, but caller will take it as success. Perhaps better to send an explicit error: ``` if (ret <= 0) { ... return -EXXX } ``` btw, for the next version of the patch, please use 'net/vmxnet3: ' prefix for patch title, like: "net/vmxnet3: fix return code in initializing" Also please include following Fixes tag in the commit log: ``` Fixes: dfaff37fc46d ("vmxnet3: import new vmxnet3 poll mode driver implementation") Cc: stable@dpdk.org ``` For more details you can check contribution guide: https://doc.dpdk.org/guides/contributing/patches.html#commit-messages-subject-line