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 618FF45BCC; Thu, 31 Oct 2024 00:14:34 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 09F1F43543; Thu, 31 Oct 2024 00:14:11 +0100 (CET) Received: from egress-ip11b.ess.de.barracuda.com (egress-ip11b.ess.de.barracuda.com [18.185.115.215]) by mails.dpdk.org (Postfix) with ESMTP id 6A8F143511 for ; Thu, 31 Oct 2024 00:14:09 +0100 (CET) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05lp2173.outbound.protection.outlook.com [104.47.17.173]) by mx-outbound17-81.eu-central-1b.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 30 Oct 2024 23:14:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tJIIzmUdIr65CKlPrVEuJskHAcO95GI/bgNwDSSzl3uU7dWbqARHeomlhS+zdisgmILBRW60k4WzG86EQcS47bRkDpIxiylugobujZiTAozc8CxVNnXX+pUkuoc/zytRhGl0BpZLyf7dT+NFeweNPyX17mlhPmwrHqLsYJrUFnTDHKTKM6KhN/cBjJ1tzd9NZ802XNHPC8+vbAkhSLxMl7/L5Pea21r35TnSnx7MYWDbO5dZVJEFs8IkJ3ga4aqpT4s+WdEhdvSg3PeSTHgUupN9goFNAGL2nwdxaHdrepnMSy7K+52UmPLV+maIqAwJ1uaXOHnklfBR0Vp8Qf4T4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=r8jQt/rK0HUxoYmPKHVeI0EckT1eTLMn4pBpJEYVJHI=; b=A26R/Cwk2+vzWBQSa885h6xmVgvSQ8U/F3sPLhKXL0Um7F5UlcchSrrMwKFXmEp50M+a8YuYga0TzbUUdsZV5fxI8JXbbLFPeqGscQ1Mrj/ZN1nHe4UOToIydVW6NUzKo1wJwV81MeMKwhsduDf/uN8eDDHoxRRdsnOgPTnip9shX4HtJOsE5n9SpKq0Sbo1bcUceN22HOA+TcT/eMbHE48h0ZlNTP/WnjVW+3QpH/SJlSMpD2fJxfhigGcJscMd4aqePkcYfjFDm5oiviy+Vv3IQnu+VgfSUIGGIezh4iCUo8PQIc+n/VPlsxV/2Ubl3Rr3A/gsH4aJORB/dNEY8A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 178.72.21.4) smtp.rcpttodomain=dpdk.org smtp.mailfrom=napatech.com; dmarc=fail (p=reject sp=reject pct=100) action=oreject header.from=napatech.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=napatech.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=r8jQt/rK0HUxoYmPKHVeI0EckT1eTLMn4pBpJEYVJHI=; b=HiyBB45lDNcFcYl1WyxO8DrmufieRP6M0G+HR5cOG1tSEbEk3PNhwMOT244rwRdyXUpPtqBtGdrX7exm9Ng4dCrVtu/zVeHhOOBY91l0kH2y0wEu12IJ0k4x+418tMm72YnQEVrp/n2B4353yjvYUmbmnBLvAYe4nbNCBnrC+dg= Received: from DUZPR01CA0013.eurprd01.prod.exchangelabs.com (2603:10a6:10:3c3::6) by VI0P190MB2084.EURP190.PROD.OUTLOOK.COM (2603:10a6:800:24e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.25; Wed, 30 Oct 2024 21:41:06 +0000 Received: from DU2PEPF00028D13.eurprd03.prod.outlook.com (2603:10a6:10:3c3:cafe::9e) by DUZPR01CA0013.outlook.office365.com (2603:10a6:10:3c3::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.20 via Frontend Transport; Wed, 30 Oct 2024 21:41:06 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 178.72.21.4) smtp.mailfrom=napatech.com; dkim=none (message not signed) header.d=none;dmarc=fail action=oreject header.from=napatech.com; Received-SPF: Fail (protection.outlook.com: domain of napatech.com does not designate 178.72.21.4 as permitted sender) receiver=protection.outlook.com; client-ip=178.72.21.4; helo=localhost.localdomain; Received: from localhost.localdomain (178.72.21.4) by DU2PEPF00028D13.mail.protection.outlook.com (10.167.242.27) with Microsoft SMTP Server id 15.20.8114.16 via Frontend Transport; Wed, 30 Oct 2024 21:41:06 +0000 From: Serhii Iliushyk To: dev@dpdk.org Cc: mko-plv@napatech.com, sil-plv@napatech.com, ckm@napatech.com, andrew.rybchenko@oktetlabs.ru, ferruh.yigit@amd.com, stephen@networkplumber.org Subject: [PATCH v5 75/80] net/ntnic: remove unnecessary Date: Wed, 30 Oct 2024 22:39:22 +0100 Message-ID: <20241030213940.3470062-76-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20241030213940.3470062-1-sil-plv@napatech.com> References: <20241021210527.2075431-1-sil-plv@napatech.com> <20241030213940.3470062-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PEPF00028D13:EE_|VI0P190MB2084:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 1af78ebe-f0f8-426d-b1d1-08dcf92b8f7c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|36860700013|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?exVaQZmlrifa9CwJuWR61x7rvTpiRxShJnvOzgArBrH9dA85gCLrF2+Xsv6b?= =?us-ascii?Q?N0xKgVPHcImemti/8mOaBtMKCLRSd8EOg1Hdn39HzpfbuHnz+sCt0urCBfOr?= =?us-ascii?Q?R5cr67P9IXx3qA0nKwSJz705nYPWqAybr/6WTKmE1wQM9DTs3eXv831gbpxu?= =?us-ascii?Q?hSf5UwYBhTGq+tC/54rBqL5w4xuvxNNW4AAL7oduKp9QLATgFzzCMUjOKLIm?= =?us-ascii?Q?EEkYDExyq+8ftWe8UW/w3B+jwCcuMjicDULvFSZYAIfzBmMd8tOCL6vEAMCa?= =?us-ascii?Q?O/sGfI8ukGVsVDKKjcMCTI2FqEwu/BXkqqBINzTTNZzWHxHpE0O20umJF9xy?= =?us-ascii?Q?eu/F7462h23nXS1F7svbIjEqvlgcKm9kggCMVZ/pxeABowrr9K5Jw7AHOfWX?= =?us-ascii?Q?VTN9MFveI1tJk6X5IK3I/plR+ohhtQS2pOSKzLb9enhrvjGoTzmvH+HMPns1?= =?us-ascii?Q?vvTEjWBPMJMGiiuCE4KqszGGIKZeNkbamffp7zqY5wXo1Pm7cQWTBVJ9Yftm?= =?us-ascii?Q?orqdLc20E3YTKuUfsZiwZeMopoYhyFTRBLIWpB2HhJevOEafAl9jz3Ezpe9g?= =?us-ascii?Q?aI6ZOLkBWgBFeOApBDYEi3YkyC+iOsTfVbagBsNXbTHUn4nfmVuyyF+KCVzN?= =?us-ascii?Q?omhEsN+rljC3/h/KnCTFvvkdBW42yYvBoSXfU148VnNNyoq/tCQ9ewMYEXuc?= =?us-ascii?Q?n5FoiTqwB2AePVJnFTH8NNJvN79+hvbAdXHn/mapupeB0U/tA/MRhXYBRyZ2?= =?us-ascii?Q?0jzqU9K6dwx0Ppe7nskN1zQR3FjDcB7019JQ0zcoKqKKKSD26v+LcK8E0cnV?= =?us-ascii?Q?gJJzZDkhUJ1TWRcaDLteYMTJeT29TlwtJ49ZcReLZkFszniuGS1wZph5tB3J?= =?us-ascii?Q?szaZveZ6CDrRS9B/6z/xdCBZWxc4XDfe9WLuMMZxXXvWITKUlyrbb7JQwJiu?= =?us-ascii?Q?ZfPSR64d4DuF0maMXqBz600umcJ1KS5Fmpk5ogcDPU4S+1039ec9LptHRIks?= =?us-ascii?Q?wEG821cag9/xrUaHrpFd2q81VItnndH2sf579x3si1fKC1Ezvv8aRnBPXbyf?= =?us-ascii?Q?A0rEMomrQtXicJ3P3mGBRLExUml+JQBvr3nohZl/pG2JjF20XtT0yJcoM7cD?= =?us-ascii?Q?ruAFbfgJzO90I+sHtU3jFu7l6lTtURoxEFTYqyMq/UVhZ7rvBrVe/qB79BES?= =?us-ascii?Q?8OXJIYTjzSqLvzyo2zDzNUeLx0vMhbGy1zc9CQT8E27VjwdqLAKmTjNkmwZ8?= =?us-ascii?Q?8bCT3iFGjC1R2TgB4r5H9dAk/7wi5C1oac0Qnu2ImcI/rDN+9PJz04dRXqBQ?= =?us-ascii?Q?3Gbg4PHAm9AgGKdSMTvcbNupi8piCdG2UlhljHPWXeHopa7fNo8c1NNTUzk7?= =?us-ascii?Q?UIG8yN2nW3+7bcrHuGP5LhCtanJyJQItvJX5mqD3G/Eo0vo3IA=3D=3D?= X-Forefront-Antispam-Report: CIP:178.72.21.4; CTRY:DK; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:localhost.localdomain; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(376014)(36860700013)(82310400026)(1800799024); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: n/ZpbzWdDvW4Nssl1RnkKMCcDiJ4cq7iJyHV/SzNTZnM93y6K9OIbwTQpTfBHISz7Y4fqlB103fTQ6cv8CRcewkuW/ZMZL9NXmMznh4/hpafddEmdJ4GeG/LLpSNqsYGl67Rklwc/dM/W6ZwfLqy4+jZzCjZVkN0gBTqtxE0mrle2NccAyOtr5jcS2GeOLslnJVh6pQsnoROX+dALUKzHnS703EGVjccq5g+U4J//AuDAlgVeGbJX0Wyisp2mbBQBVcIWBvNZyuosw3YUujdCkPjnUl0KGwc7eISqjgOjPp5rgd38aM8JU0sPfszoq78ghX6Vs9svPKAZJXswacSKUMw8ghf88XT23IjD8+1h7Obp1fCebYwYhx+ZjGNscEurPrrtescG6m1cD/Wbs0c6EVXWMOU4el8SICTTyNPF4S+DmUD+v3DaaB5rZpM+uzt7jv70J1GIwrj7+sSufPvZA6ocYxc9GuPcpclM9wa10Oi9+SbGiVQkHM2DHYz4+o9CJUHLj5Frucur8afbTqziiuWTunnGuVDGA9wqK7pdaono5MntqwKEsy/fiE/jlqAZEPxowxnuNbrDkI9o1u5FpZQC+H+kzYRTWBBtrF7svMjLSdzXQ0/KOCSrdVM5CGqekIWSR4ziIIIF/07qdLAwGT6MC2WCHguWlLabbQJMsE= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2024 21:41:06.3335 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1af78ebe-f0f8-426d-b1d1-08dcf92b8f7c X-MS-Exchange-CrossTenant-Id: c4540d0b-728a-4233-9da5-9ea30c7ec3ed X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=c4540d0b-728a-4233-9da5-9ea30c7ec3ed; Ip=[178.72.21.4]; Helo=[localhost.localdomain] X-MS-Exchange-CrossTenant-AuthSource: DU2PEPF00028D13.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0P190MB2084 X-OriginatorOrg: napatech.com X-BESS-ID: 1730330045-304433-12638-48438-1 X-BESS-VER: 2019.1_20241018.1852 X-BESS-Apparent-Source-IP: 104.47.17.173 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVoYWpgbGQGYGUDQ1KTHJKDXVLN HQ0tzSwMLAICU5zSzVMNXExNQ4xcTIRKk2FgBwNq5eQgAAAA== X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.260092 [from cloudscan16-249.eu-central-1b.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.00 using account:ESS113687 scores of KILL_LEVEL=7.0 tests=BSF_BESS_OUTBOUND X-BESS-BRTS-Status: 1 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 Type casting: The dev_private has type void * and type casting is not necessary. FLOW_DEBUG condition Use the dynamic logging Signed-off-by: Serhii Iliushyk --- drivers/net/ntnic/nthw/flow_api/flow_api.c | 4 -- .../net/ntnic/nthw/ntnic_meter/ntnic_meter.c | 18 +++---- drivers/net/ntnic/ntnic_ethdev.c | 48 +++++++++---------- drivers/net/ntnic/ntnic_filter/ntnic_filter.c | 16 +++---- 4 files changed, 41 insertions(+), 45 deletions(-) diff --git a/drivers/net/ntnic/nthw/flow_api/flow_api.c b/drivers/net/ntnic/nthw/flow_api/flow_api.c index 337902f654..ef8caefd9a 100644 --- a/drivers/net/ntnic/nthw/flow_api/flow_api.c +++ b/drivers/net/ntnic/nthw/flow_api/flow_api.c @@ -342,7 +342,6 @@ static void flow_ndev_reset(struct flow_nic_dev *ndev) ndev->flow_unique_id_counter = 0; -#ifdef FLOW_DEBUG /* * free all resources default allocated, initially for this NIC DEV * Is not really needed since the bitmap will be freed in a sec. Therefore @@ -354,9 +353,7 @@ static void flow_ndev_reset(struct flow_nic_dev *ndev) for (unsigned int i = 0; i < RES_COUNT; i++) { int err = 0; -#if defined(FLOW_DEBUG) NT_LOG(DBG, FILTER, "RES state for: %s", dbg_res_descr[i]); -#endif for (unsigned int ii = 0; ii < ndev->res[i].resource_count; ii++) { int ref = ndev->res[i].ref[ii]; @@ -373,7 +370,6 @@ static void flow_ndev_reset(struct flow_nic_dev *ndev) NT_LOG(DBG, FILTER, "ERROR - some resources not freed"); } -#endif } int flow_delete_eth_dev(struct flow_eth_dev *eth_dev) diff --git a/drivers/net/ntnic/nthw/ntnic_meter/ntnic_meter.c b/drivers/net/ntnic/nthw/ntnic_meter/ntnic_meter.c index e4e8fe0c7d..33593927a4 100644 --- a/drivers/net/ntnic/nthw/ntnic_meter/ntnic_meter.c +++ b/drivers/net/ntnic/nthw/ntnic_meter/ntnic_meter.c @@ -42,7 +42,7 @@ static int eth_mtr_capabilities_get_inline(struct rte_eth_dev *eth_dev, return -1; } - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; uint8_t caller_id = get_caller_id(eth_dev->data->port_id); @@ -110,7 +110,7 @@ static int eth_mtr_meter_profile_add_inline(struct rte_eth_dev *eth_dev, return -1; } - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; if (meter_profile_id >= profile_inline_ops->flow_mtr_meter_policy_n_max()) return -rte_mtr_error_set(error, EINVAL, RTE_MTR_ERROR_TYPE_METER_PROFILE_ID, NULL, @@ -161,7 +161,7 @@ static int eth_mtr_meter_profile_delete_inline(struct rte_eth_dev *eth_dev, return -1; } - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; if (meter_profile_id >= profile_inline_ops->flow_mtr_meter_policy_n_max()) return -rte_mtr_error_set(error, EINVAL, RTE_MTR_ERROR_TYPE_METER_PROFILE_ID, NULL, @@ -184,7 +184,7 @@ static int eth_mtr_meter_policy_add_inline(struct rte_eth_dev *eth_dev, return -1; } - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; if (policy_id >= profile_inline_ops->flow_mtr_meter_policy_n_max()) return -rte_mtr_error_set(error, EINVAL, RTE_MTR_ERROR_TYPE_METER_POLICY_ID, NULL, @@ -250,7 +250,7 @@ static int eth_mtr_create_inline(struct rte_eth_dev *eth_dev, return -1; } - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; uint8_t caller_id = get_caller_id(eth_dev->data->port_id); @@ -316,7 +316,7 @@ static int eth_mtr_destroy_inline(struct rte_eth_dev *eth_dev, return -1; } - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; uint8_t caller_id = get_caller_id(eth_dev->data->port_id); @@ -348,7 +348,7 @@ static int eth_mtr_stats_adjust_inline(struct rte_eth_dev *eth_dev, const uint64_t adjust_bit = 1ULL << 63; const uint64_t probe_bit = 1ULL << 62; - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; uint8_t caller_id = get_caller_id(eth_dev->data->port_id); if (mtr_id >= @@ -409,7 +409,7 @@ static int eth_mtr_stats_read_inline(struct rte_eth_dev *eth_dev, return -1; } - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; uint8_t caller_id = get_caller_id(eth_dev->data->port_id); @@ -445,7 +445,7 @@ static const struct rte_mtr_ops mtr_ops_inline = { static int eth_mtr_ops_get(struct rte_eth_dev *eth_dev, void *ops) { - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; ntdrv_4ga_t *p_nt_drv = &internals->p_drv->ntdrv; enum fpga_info_profile profile = p_nt_drv->adapter_info.fpga_info.profile; diff --git a/drivers/net/ntnic/ntnic_ethdev.c b/drivers/net/ntnic/ntnic_ethdev.c index 91669caceb..068c3d932a 100644 --- a/drivers/net/ntnic/ntnic_ethdev.c +++ b/drivers/net/ntnic/ntnic_ethdev.c @@ -272,7 +272,7 @@ eth_link_update(struct rte_eth_dev *eth_dev, int wait_to_complete __rte_unused) return -1; } - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; const int n_intf_no = internals->n_intf_no; struct adapter_info_s *p_adapter_info = &internals->p_drv->ntdrv.adapter_info; @@ -302,14 +302,14 @@ eth_link_update(struct rte_eth_dev *eth_dev, int wait_to_complete __rte_unused) static int eth_stats_get(struct rte_eth_dev *eth_dev, struct rte_eth_stats *stats) { - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; dpdk_stats_collect(internals, stats); return 0; } static int eth_stats_reset(struct rte_eth_dev *eth_dev) { - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; struct drv_s *p_drv = internals->p_drv; struct ntdrv_4ga_s *p_nt_drv = &p_drv->ntdrv; const int if_index = internals->n_intf_no; @@ -327,7 +327,7 @@ eth_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *dev_info return -1; } - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; const int n_intf_no = internals->n_intf_no; struct adapter_info_s *p_adapter_info = &internals->p_drv->ntdrv.adapter_info; @@ -957,14 +957,14 @@ static int deallocate_hw_virtio_queues(struct hwq_s *hwq) static void eth_tx_queue_release(struct rte_eth_dev *eth_dev, uint16_t queue_id) { - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; struct ntnic_tx_queue *tx_q = &internals->txq_scg[queue_id]; deallocate_hw_virtio_queues(&tx_q->hwq); } static void eth_rx_queue_release(struct rte_eth_dev *eth_dev, uint16_t queue_id) { - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; struct ntnic_rx_queue *rx_q = &internals->rxq_scg[queue_id]; deallocate_hw_virtio_queues(&rx_q->hwq); } @@ -994,7 +994,7 @@ static int eth_rx_scg_queue_setup(struct rte_eth_dev *eth_dev, { NT_LOG_DBGX(DBG, NTNIC, "Rx queue setup"); struct rte_pktmbuf_pool_private *mbp_priv; - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; struct ntnic_rx_queue *rx_q = &internals->rxq_scg[rx_queue_id]; struct drv_s *p_drv = internals->p_drv; struct ntdrv_4ga_s *p_nt_drv = &p_drv->ntdrv; @@ -1062,7 +1062,7 @@ static int eth_tx_scg_queue_setup(struct rte_eth_dev *eth_dev, } NT_LOG_DBGX(DBG, NTNIC, "Tx queue setup"); - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; struct drv_s *p_drv = internals->p_drv; struct ntdrv_4ga_s *p_nt_drv = &p_drv->ntdrv; struct ntnic_tx_queue *tx_q = &internals->txq_scg[tx_queue_id]; @@ -1185,7 +1185,7 @@ eth_mac_addr_add(struct rte_eth_dev *eth_dev, if (index >= NUM_MAC_ADDRS_PER_PORT) { const struct pmd_internals *const internals = - (struct pmd_internals *)eth_dev->data->dev_private; + eth_dev->data->dev_private; NT_LOG_DBGX(DBG, NTNIC, "Port %i: illegal index %u (>= %u)", internals->n_intf_no, index, NUM_MAC_ADDRS_PER_PORT); return -1; @@ -1211,7 +1211,7 @@ eth_set_mc_addr_list(struct rte_eth_dev *eth_dev, struct rte_ether_addr *mc_addr_set, uint32_t nb_mc_addr) { - struct pmd_internals *const internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *const internals = eth_dev->data->dev_private; struct rte_ether_addr *const mc_addrs = internals->mc_addrs; size_t i; @@ -1252,7 +1252,7 @@ eth_dev_start(struct rte_eth_dev *eth_dev) return -1; } - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; const int n_intf_no = internals->n_intf_no; struct adapter_info_s *p_adapter_info = &internals->p_drv->ntdrv.adapter_info; @@ -1313,7 +1313,7 @@ eth_dev_start(struct rte_eth_dev *eth_dev) static int eth_dev_stop(struct rte_eth_dev *eth_dev) { - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; NT_LOG_DBGX(DBG, NTNIC, "Port %u", internals->n_intf_no); @@ -1341,7 +1341,7 @@ eth_dev_set_link_up(struct rte_eth_dev *eth_dev) return -1; } - struct pmd_internals *const internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *const internals = eth_dev->data->dev_private; struct adapter_info_s *p_adapter_info = &internals->p_drv->ntdrv.adapter_info; const int port = internals->n_intf_no; @@ -1367,7 +1367,7 @@ eth_dev_set_link_down(struct rte_eth_dev *eth_dev) return -1; } - struct pmd_internals *const internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *const internals = eth_dev->data->dev_private; struct adapter_info_s *p_adapter_info = &internals->p_drv->ntdrv.adapter_info; const int port = internals->n_intf_no; @@ -1440,7 +1440,7 @@ drv_deinit(struct drv_s *p_drv) static int eth_dev_close(struct rte_eth_dev *eth_dev) { - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; struct drv_s *p_drv = internals->p_drv; if (internals->type != PORT_TYPE_VIRTUAL) { @@ -1478,7 +1478,7 @@ eth_dev_close(struct rte_eth_dev *eth_dev) static int eth_fw_version_get(struct rte_eth_dev *eth_dev, char *fw_version, size_t fw_size) { - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; if (internals->type == PORT_TYPE_VIRTUAL || internals->type == PORT_TYPE_OVERRIDE) return 0; @@ -1506,7 +1506,7 @@ static int dev_flow_ops_get(struct rte_eth_dev *dev __rte_unused, const struct r static int eth_xstats_get(struct rte_eth_dev *eth_dev, struct rte_eth_xstat *stats, unsigned int n) { - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; struct drv_s *p_drv = internals->p_drv; ntdrv_4ga_t *p_nt_drv = &p_drv->ntdrv; nt4ga_stat_t *p_nt4ga_stat = &p_nt_drv->adapter_info.nt4ga_stat; @@ -1531,7 +1531,7 @@ static int eth_xstats_get_by_id(struct rte_eth_dev *eth_dev, uint64_t *values, unsigned int n) { - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; struct drv_s *p_drv = internals->p_drv; ntdrv_4ga_t *p_nt_drv = &p_drv->ntdrv; nt4ga_stat_t *p_nt4ga_stat = &p_nt_drv->adapter_info.nt4ga_stat; @@ -1554,7 +1554,7 @@ static int eth_xstats_get_by_id(struct rte_eth_dev *eth_dev, static int eth_xstats_reset(struct rte_eth_dev *eth_dev) { - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; struct drv_s *p_drv = internals->p_drv; ntdrv_4ga_t *p_nt_drv = &p_drv->ntdrv; nt4ga_stat_t *p_nt4ga_stat = &p_nt_drv->adapter_info.nt4ga_stat; @@ -1576,7 +1576,7 @@ static int eth_xstats_reset(struct rte_eth_dev *eth_dev) static int eth_xstats_get_names(struct rte_eth_dev *eth_dev, struct rte_eth_xstat_name *xstats_names, unsigned int size) { - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; struct drv_s *p_drv = internals->p_drv; ntdrv_4ga_t *p_nt_drv = &p_drv->ntdrv; nt4ga_stat_t *p_nt4ga_stat = &p_nt_drv->adapter_info.nt4ga_stat; @@ -1596,7 +1596,7 @@ static int eth_xstats_get_names_by_id(struct rte_eth_dev *eth_dev, struct rte_eth_xstat_name *xstats_names, unsigned int size) { - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; struct drv_s *p_drv = internals->p_drv; ntdrv_4ga_t *p_nt_drv = &p_drv->ntdrv; nt4ga_stat_t *p_nt4ga_stat = &p_nt_drv->adapter_info.nt4ga_stat; @@ -1627,7 +1627,7 @@ static int eth_dev_rss_hash_update(struct rte_eth_dev *eth_dev, struct rte_eth_r return -1; } - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; struct flow_nic_dev *ndev = internals->flw_dev->ndev; struct nt_eth_rss_conf tmp_rss_conf = { 0 }; @@ -1662,7 +1662,7 @@ static int eth_dev_rss_hash_update(struct rte_eth_dev *eth_dev, struct rte_eth_r static int rss_hash_conf_get(struct rte_eth_dev *eth_dev, struct rte_eth_rss_conf *rss_conf) { - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; struct flow_nic_dev *ndev = internals->flw_dev->ndev; rss_conf->algorithm = (enum rte_eth_hash_function)ndev->rss_conf.algorithm; @@ -1723,7 +1723,7 @@ static struct eth_dev_ops nthw_eth_dev_ops = { */ THREAD_FUNC port_event_thread_fn(void *context) { - struct pmd_internals *internals = (struct pmd_internals *)context; + struct pmd_internals *internals = context; struct drv_s *p_drv = internals->p_drv; ntdrv_4ga_t *p_nt_drv = &p_drv->ntdrv; struct adapter_info_s *p_adapter_info = &p_nt_drv->adapter_info; diff --git a/drivers/net/ntnic/ntnic_filter/ntnic_filter.c b/drivers/net/ntnic/ntnic_filter/ntnic_filter.c index 4c18088681..0e20606a41 100644 --- a/drivers/net/ntnic/ntnic_filter/ntnic_filter.c +++ b/drivers/net/ntnic/ntnic_filter/ntnic_filter.c @@ -491,7 +491,7 @@ static int convert_flow(struct rte_eth_dev *eth_dev, struct cnv_action_s *action, struct rte_flow_error *error) { - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; struct fpga_info_s *fpga_info = &internals->p_drv->ntdrv.adapter_info.fpga_info; static struct rte_flow_error flow_error = { @@ -554,7 +554,7 @@ eth_flow_destroy(struct rte_eth_dev *eth_dev, struct rte_flow *flow, struct rte_ return -1; } - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; static struct rte_flow_error flow_error = { .type = RTE_FLOW_ERROR_TYPE_NONE, .message = "none" }; @@ -595,7 +595,7 @@ static struct rte_flow *eth_flow_create(struct rte_eth_dev *eth_dev, return NULL; } - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; struct fpga_info_s *fpga_info = &internals->p_drv->ntdrv.adapter_info.fpga_info; @@ -673,7 +673,7 @@ static int eth_flow_flush(struct rte_eth_dev *eth_dev, struct rte_flow_error *er return -1; } - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; static struct rte_flow_error flow_error = { .type = RTE_FLOW_ERROR_TYPE_NONE, .message = "none" }; @@ -716,7 +716,7 @@ static int eth_flow_actions_update(struct rte_eth_dev *eth_dev, return -1; } - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; static struct rte_flow_error flow_error = { .type = RTE_FLOW_ERROR_TYPE_NONE, .message = "none" }; @@ -724,7 +724,7 @@ static int eth_flow_actions_update(struct rte_eth_dev *eth_dev, if (internals->flw_dev) { struct pmd_internals *dev_private = - (struct pmd_internals *)eth_dev->data->dev_private; + eth_dev->data->dev_private; struct fpga_info_s *fpga_info = &dev_private->p_drv->ntdrv.adapter_info.fpga_info; struct cnv_action_s action = { 0 }; @@ -780,7 +780,7 @@ static int eth_flow_dev_dump(struct rte_eth_dev *eth_dev, return -1; } - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; static struct rte_flow_error flow_error = { .type = RTE_FLOW_ERROR_TYPE_NONE, .message = "none" }; @@ -808,7 +808,7 @@ static int eth_flow_get_aged_flows(struct rte_eth_dev *eth_dev, return -1; } - struct pmd_internals *internals = (struct pmd_internals *)eth_dev->data->dev_private; + struct pmd_internals *internals = eth_dev->data->dev_private; static struct rte_flow_error flow_error = { .type = RTE_FLOW_ERROR_TYPE_NONE, -- 2.45.0