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 7C141432E5; Thu, 9 Nov 2023 15:30:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6CF1D40281; Thu, 9 Nov 2023 15:30:04 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) by mails.dpdk.org (Postfix) with ESMTP id 1DEA94026B for ; Thu, 9 Nov 2023 15:30:03 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NmlmPCBlI36fo6ExGK1feHLv0IDhY9yFsBfFzcFtkimEv6RAV4B4zL9sQAqdOgdJnRnkDcF7j2Qk9fiLm7MdkJERoq3hvshEcUAjS/ZX2rLcA4sIfCU2v2OWl6AgrIejKaHMyvE+Efx019BkEn6DQq4NBGsVpvFn3pOrPQRHgqSpjVVr5bdDHK09hg/L/9LxbKKS0AkPKAmJvpnSnv28onRTFfWtOpySU/qt9UOGzZQQmd3Rg1FtBGCC3Bvfmma0AAtyhRPt5oz1Ms0sjoTdVV16CLuvHn3+B7NqtNz2X+62++zUQbpAvBlzwlChAF7MHFeZV83LUIjtOBBHmlyTwg== 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=IhQpRhJNS5kyITsKS+UKZTtk/IZ9+Hz8FsI6329S9Ec=; b=Vt4PTSnVvGiUbP3ZYfVPGi6ZLKz6mUmndokvP2mnuOSh4JoqUOqmlEFs0a4E3tMISNjKYltdNw0OzHtHlNbm17e/YSQWHykvOungzNSZG0BU9KeTLD2Ks3um3XsSLzfmatSMnkRlyLXh5jAgvD2z7/p2yUhk5yeMu3uZv1G8k6gvtqhg8Q4E1s9Cop3DMVAzBrEeFfxfjIFcRHkdDXjLtxRo4TIRpd6AdjeIGLA1I0oNRVc2wR2H8nkYBYM4iFg7vDRbgXulYcJHa8qp92RSdhpU3oaEyKsP+8nObG8I2VnVz1QlRq5AbJbh+V8P/pvXPN5MpfVmxD/uKWk4N99QRQ== 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=IhQpRhJNS5kyITsKS+UKZTtk/IZ9+Hz8FsI6329S9Ec=; b=osxoaixBifDY33n8FIIXDYN16t4Dha4Ua6yq62Tsgb1OtN+daHKaFTNzjms4CYI5OS1S0+Hpzy5uS8mnLHMtUl2IZWF+g4nUqtKQSKngBOyCrECcOIAHxfY2OhypJnjd0PMuEDir0N5+uLADavDiUU/rhMxI+txc9R1wa6TdpI4= 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 CY8PR12MB7708.namprd12.prod.outlook.com (2603:10b6:930:87::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6977.19; Thu, 9 Nov 2023 14:29:59 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::2569:edb2:670f:816f]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::2569:edb2:670f:816f%6]) with mapi id 15.20.6954.029; Thu, 9 Nov 2023 14:29:59 +0000 Message-ID: Date: Thu, 9 Nov 2023 14:29:37 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] net/ena: fix coverity issues Content-Language: en-US To: shaibran@amazon.com Cc: dev@dpdk.org, rbeider@amazon.com, atrwajee@amazon.com, amitbern@amazon.com References: <20231109140816.2844-1-shaibran@amazon.com> From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@amd.com; keydata= xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9 RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ N3AmBIxZ/A7UXBKLaOyZ+/i3sE6Wb53nrO4i8+0K2Qwyh6LjTeiJAIjYKN43ppxz3DaI+QwQ vI+uyHr4Gg0Da9EPPz/YyKauSeOZCfCB5gIfICO0j6x0SCl8uQ2nLpjxcZkf0gjcwUzP3h+S 3x6NfDji9YEij0zczW/dcSpGgZ6vsFpPrtnP9ZXy6J53yp0kJtOJoOlkEFFdU2yCZnCDseum CoudmGLZVvS0/DzHDJejq+3kK3FDGktZBOxZIIpal+nFqS7lVgOZc4+huVv3jyhzoAUOEyXA XK5j6o7g8STUY+z33QNnHpdLvecMwuzmvqy0jR54yAbZ64mB9QARAQABzSNGZXJydWggWWln aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULCQgHAgYVCgkICwIEFgID AQIeAQIXgAIZARYhBEm7aYjps5XGsPHCElRTPtCKKm/6BQJkdyEEBQkE3meNAAoJEFRTPtCK Km/6UdcP/0/kEp49aIUhkRnQfmKmN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: <20231109140816.2844-1-shaibran@amazon.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR4P281CA0358.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:f4::17) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|CY8PR12MB7708:EE_ X-MS-Office365-Filtering-Correlation-Id: 2925aea1-ce45-4003-0f7b-08dbe1305a53 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nga0QQ1UumjDqkMm39Evah+wZqQLVaedMsh6EdBZR3hDFCwGhTOGcBwXOHRBpNOy04L+cOVWeUupv30KZUOgWX3tyKRKS9koHKU95686o8yw/kQeVYN/VBVy8OANVAutg+YpO9NEr1nT1lf/WVBiONfnRwqwtkgB0Dws954HVJfoU4yLOCe9NP2dMbcSGdYZG/ft5+wyH4IXnvFuYj2WlkuVHY7+G7ueU6+7isYv+0NRmBeNfPtEZEI2jJqZTaMF70tfSnMMQhIzN3NyZRSgJkCF/fvir+Nfk4HXSeCOf5DIr1mlh5ABbUtIF8Y3JPqeovLt1JSqNpCOVg1uLUozXztGb+kawI9X290HFa+RQN5D5dB873hQ2SCf4dV90LXA9yXiBt0/J8KGOSVlKf3klw8jnPgc5J/f022OsCLz4xJIL0NAODkgY89cmQxU0bhKL3Ji4ZGCFnlbf0db9afb2dC1/TftZY/QGSXIpIvCmRr480xWDcwjPNNOPwTj8SntaST+wgjxpHBq4By23Rx7BHu0hAwR1NbShcyBgNQ7tXKSn3R2/L77BSaQo5tlV0uvVjV/AlFKoRhOB7AI4xFnH/Dt/VBo1HgmnSo9QGMkQcL5sdC4cIonf5w12Cz9csV8byCcOYPOCaB9IEpjOHk0UYvMLFFPrddMQ3s1lXQOtKEpyQ3hd9p024XCie20vDxg 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:(13230031)(396003)(376002)(39860400002)(136003)(346002)(366004)(230922051799003)(230173577357003)(230273577357003)(451199024)(1800799009)(186009)(64100799003)(38100700002)(2906002)(6486002)(478600001)(41300700001)(6666004)(53546011)(6506007)(44832011)(66476007)(66556008)(316002)(6916009)(66946007)(4326008)(8676002)(8936002)(83380400001)(5660300002)(6512007)(26005)(2616005)(86362001)(31696002)(31686004)(36756003)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?N3F1SThwWDl2M01EeUZtbURycE1PdStZU2JDS1dIbVpXT1FaWHJtZ1VDZFpN?= =?utf-8?B?T3RYVE9ackVMSklqaHVqU1hRQUEvWEVpMHQyK0FOYkQ5ZVJDZ1FMV2xoNGRw?= =?utf-8?B?dmZ0ZVNQYVBaN05IS1Y0TDRqRE5WWmw1eFA0MGpBM1BWRlh5bEgzU2F1Rjda?= =?utf-8?B?cjQxTkp3STNzNHZ2TnNsOXd4K054UVlucWlVR2xvczcySVlEQ0NZRXlnTU9I?= =?utf-8?B?c0t5NFl6VWpaRjVRSWxqbER6RUhoTlFnQng0dmp4VzZ2ZUVBc05JWXlvK05B?= =?utf-8?B?OUoyOVpzVmxIckZEYUFRKzdYdS94MWdLU0svcW9mWWhZb05NaU1CdjJOby9D?= =?utf-8?B?Q283VHhtTEIxQjJFazVEbUVBTzNvMXg5eUttRmUxNzR5cjVESWNwY0xYc2t2?= =?utf-8?B?eERqSnRGTlRqZDF4UjJ2aWNyMVV5SjJnOUd3RUlmdmtvRlhGck5MaDIwL29V?= =?utf-8?B?enh5MCtURlZBc21QbE5XZ1R6bEkzSldvS1VaS2c0S2JaYkhKcHoxYURKZzgy?= =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DNHBYemNhdFE3OWdRejNQ?= =?utf-8?B?QjE1S3pYbWNDRGlWa0RveXlzbWQ0RHJrQUJ0RDd3cHNOYytaUUlXTTZQZXBp?= =?utf-8?B?VGF0RkxRcllrVEtLeERKYThkbzVGbWZTSnR1MzhObFdFUTdSc0Q2R1lCMStB?= =?utf-8?B?a0lGNWk4NmdWalZrRGNhVGF5ZUZVbXRWZ3pwN05YYW5LcHVCOTlBWG93Y0x6?= =?utf-8?B?WWExTFVDT0crSjczYzZlcnllRzl4bXlTVzdodVB5eDNIc1NPcCtkT1ZnMzg2?= =?utf-8?B?bFFpVGo5SWVoajlaNGwrL1poNXhuVkFvQ2JQaUE1SEpLYXREUG5zYUhjT1FH?= =?utf-8?B?K2xmTGx2T1czREZWbjBNMGErQXVvOXlxbVJML0ljSnVJRVIwYmMyN3NxYjRv?= =?utf-8?B?enRvWXVOMGpuK2tRU0dtNHRZZWZaSUFwbVl4MmxWUFozSTVpM2ZFdG0wTnZl?= =?utf-8?B?bTJsbCtUMGNwajRUeE5HSWxaeEUrM0hub2t1WHNzRnltNzErdWhneHA4cUdC?= =?utf-8?B?ckJQNHNFcnNIRXZobFI4R3RSNDVwU29heVlGa0h0amkxZkRoTG9KS3ZNTzBC?= =?utf-8?B?Q2Z5VlZYZ2pPN0tUYlJqZVBxRy9LUDJiTEtTZHVYdDJKdWpkamtkU280U3pN?= =?utf-8?B?S2I4QUR3TVlkbEpUcGxiL3JUbDhXc1Faak5hclpkQWZQMU4xbFJsVFo1RGhL?= =?utf-8?Q?24F4=3D?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2925aea1-ce45-4003-0f7b-08dbe1305a53 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2023 14:29:59.5572 (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: e2Cw/6f1c7PnYZIzu7wjN9jHqpKAybYVxCTlbNhg6Zrg25s1Pr5ebUMmZwUojljF X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7708 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 11/9/2023 2:08 PM, shaibran@amazon.com wrote: > From: Shai Brandes > > Changed the rte_memcpy call to use the precomputed buf_size. > Rearranged the ena adapter structure and removed redundant > '&' operators as a precaution. > What is the reason of the structure rearrange? > Coverity issue: 405363 > Coverity issue: 405357 > Coverity issue: 405359 > Can you please split the patch per each fix if they are not logically related or caused from same code. > Fixes: 92401abfbcb9 ("net/ena: support connection tracking stats") > Signed-off-by: Shai Brandes > --- > drivers/net/ena/ena_ethdev.c | 21 ++++++++++----------- > drivers/net/ena/ena_ethdev.h | 4 ++-- > 2 files changed, 12 insertions(+), 13 deletions(-) > > diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c > index dc846d2e84..53e7251874 100644 > --- a/drivers/net/ena/ena_ethdev.c > +++ b/drivers/net/ena/ena_ethdev.c > @@ -531,8 +531,8 @@ ENA_PROXY_DESC(ena_com_get_eni_stats, ENA_MP_ENI_STATS_GET, > ({ > ENA_TOUCH(rsp); > ENA_TOUCH(ena_dev); > - if (stats != (struct ena_admin_eni_stats *)&adapter->metrics_stats) > - rte_memcpy(stats, &adapter->metrics_stats, sizeof(*stats)); > + if (stats != (struct ena_admin_eni_stats *)adapter->metrics_stats) > + rte_memcpy(stats, adapter->metrics_stats, sizeof(*stats)); > }), > struct ena_com_dev *ena_dev, struct ena_admin_eni_stats *stats); > > @@ -590,9 +590,8 @@ ENA_PROXY_DESC(ena_com_get_customer_metrics, ENA_MP_CUSTOMER_METRICS_GET, > ({ > ENA_TOUCH(rsp); > ENA_TOUCH(ena_dev); > - ENA_TOUCH(buf_size); > - if (buf != (char *)&adapter->metrics_stats) > - rte_memcpy(buf, &adapter->metrics_stats, adapter->metrics_num * sizeof(uint64_t)); > + if (buf != (char *)adapter->metrics_stats) > + rte_memcpy(buf, adapter->metrics_stats, buf_size); > }), > struct ena_com_dev *ena_dev, char *buf, size_t buf_size); > > @@ -3240,7 +3239,7 @@ static uint16_t eth_ena_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, > } > > static void ena_copy_customer_metrics(struct ena_adapter *adapter, uint64_t *buf, > - size_t num_metrics) > + size_t num_metrics) > Please drop unrelated changed from the set. > { > struct ena_com_dev *ena_dev = &adapter->ena_dev; > int rc; > @@ -3252,10 +3251,10 @@ static void ena_copy_customer_metrics(struct ena_adapter *adapter, uint64_t *buf > } > rte_spinlock_lock(&adapter->admin_lock); > rc = ENA_PROXY(adapter, > - ena_com_get_customer_metrics, > - &adapter->ena_dev, > - (char *)buf, > - num_metrics * sizeof(uint64_t)); > + ena_com_get_customer_metrics, > + &adapter->ena_dev, > + (char *)buf, > + num_metrics * sizeof(uint64_t)); > ditto > rte_spinlock_unlock(&adapter->admin_lock); > if (rc != 0) { > PMD_DRV_LOG(WARNING, "Failed to get customer metrics, rc: %d\n", rc); > @@ -4088,7 +4087,7 @@ ena_mp_primary_handle(const struct rte_mp_msg *mp_msg, const void *peer) > case ENA_MP_CUSTOMER_METRICS_GET: > res = ena_com_get_customer_metrics(ena_dev, > (char *)adapter->metrics_stats, > - sizeof(uint64_t) * adapter->metrics_num); > + adapter->metrics_num * sizeof(uint64_t)); > Does above change makes any difference? What is the motivation? > break; > case ENA_MP_SRD_STATS_GET: > res = ena_com_get_ena_srd_info(ena_dev, > diff --git a/drivers/net/ena/ena_ethdev.h b/drivers/net/ena/ena_ethdev.h > index 4988fbffb5..17d292101c 100644 > --- a/drivers/net/ena/ena_ethdev.h > +++ b/drivers/net/ena/ena_ethdev.h > @@ -344,8 +344,8 @@ struct ena_adapter { > * Helper variables for holding the information about the supported > * metrics. > */ > - uint64_t metrics_stats[ENA_MAX_CUSTOMER_METRICS] __rte_cache_aligned; > - uint16_t metrics_num; > + uint16_t metrics_num __rte_cache_aligned; > + uint64_t metrics_stats[ENA_MAX_CUSTOMER_METRICS]; > struct ena_stats_srd srd_stats __rte_cache_aligned; > }; >