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 45BAC460D6; Tue, 21 Jan 2025 18:10:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 43D30406FF; Tue, 21 Jan 2025 18:08:51 +0100 (CET) Received: from egress-ip42a.ess.de.barracuda.com (egress-ip42a.ess.de.barracuda.com [18.185.115.201]) by mails.dpdk.org (Postfix) with ESMTP id 122E040667 for ; Tue, 21 Jan 2025 18:08:39 +0100 (CET) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05lp2112.outbound.protection.outlook.com [104.47.18.112]) by mx-outbound11-0.eu-central-1a.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 21 Jan 2025 17:08:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KLkNQak2PAkoo9Uvr/C1wA8Pc8lMpgZqAG6OK3BAJhwFYWzvMMNyCXj+PQ1AJ+wVGN5IrASRKd5ylf6HCG2dlji3KveD/L3b1UhWWC77b55HqrUQJfVah2YmsOvL/PJ2ZKIVBuxAhfiCf9hrtrV3TitIv3xcG8p7LBEQ0dV+Uf9nNOw06D59Ua55+O9ISw22JCTvaZkHQcozBVzxYEAeHPP0e29pofdrrjPsXtXSDEwCPpNySFffNGjwnQBuSrhytKnX+KLKyCUgcLA7mI91tZ+TVuHeZnl0dB5ZzSSyKFkaxAKa32UJQR02S7FwqzNyqXaLM0B3X91Ykb/DRGQbrA== 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=MUdU/e+TIQ2Gtag9GbB90j1lCus4XUDlz56NGixrcKE=; b=orlqB3KGMi7+fK94Gdcr5XQNPUhebbX9oJM27agM9PzpSpn0gWpawtNgY13dChOXMiju2b0rFY07C26NFsVYi7DLFEHM1QAoilIRJ2EVySyDDdurmYa1yUq1f2AY18VGi8qMNFgPfvluhmeImIL6PS/XTNhUybCQUt0Swm6HgiP2IUtCwlpOE0qkPFP8t4PsnK/Bs4gE688GWrYNhfbIlQfq9X7+Dfthm8zJxDVX7jQ2QPWQW6jf/OsMdkPnIvtB+F55qxgksafPZHCET0DxbZAaj5rPf5t1uIprC5/9IElq/mUPPhw1kIALkx6SyczPF+iZE/9gli5c5WXvqpuvWQ== 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=MUdU/e+TIQ2Gtag9GbB90j1lCus4XUDlz56NGixrcKE=; b=SDtavCzbPk9dD/OOaYCos7ShhSHdcXkpF24WvAPauoT7Nmt9C8BxtJPDRng2Y7qCap6mfmQWQgkJsm2T5F1b079ifRoeCKG386w9e8doNTQPNuPjZ1hh2HewZ/bGKQHk5Q/Kq5CmVJDiko5q/3g994/NSR/ps0RujNuXrHWe3wk= Received: from AS4P251CA0030.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:5d3::18) by AM7P190MB0599.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:120::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.21; Tue, 21 Jan 2025 17:08:36 +0000 Received: from AM2PEPF0001C70A.eurprd05.prod.outlook.com (2603:10a6:20b:5d3:cafe::3e) by AS4P251CA0030.outlook.office365.com (2603:10a6:20b:5d3::18) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8356.21 via Frontend Transport; Tue, 21 Jan 2025 17:08:36 +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 AM2PEPF0001C70A.mail.protection.outlook.com (10.167.16.198) with Microsoft SMTP Server id 15.20.8377.8 via Frontend Transport; Tue, 21 Jan 2025 17:08:36 +0000 From: Serhii Iliushyk To: dev@dpdk.org Cc: mko-plv@napatech.com, sil-plv@napatech.com, ckm@napatech.com, stephen@networkplumber.org, Danylo Vodopianov Subject: [PATCH v1 19/31] net/ntnic: remove convert error func Date: Tue, 21 Jan 2025 18:07:57 +0100 Message-ID: <20250121170814.3252171-20-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20250121170814.3252171-1-sil-plv@napatech.com> References: <20250121170814.3252171-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM2PEPF0001C70A:EE_|AM7P190MB0599:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: cdaec975-bb26-4bb1-dd2a-08dd3a3e3e23 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?uvNb9LcQBsfdlrmXuYGjEOb3Wo+WNkrR4/LMvSGI9eyv9gkoTjoOq2z2PzLM?= =?us-ascii?Q?PcByJEDhZ11rvgr9bWLct9tJQngYB49fFYJF6JOxwvM0HJ/KtQvjs8Zv0WWW?= =?us-ascii?Q?OYIMIxHy3TQuR4WfLTWlh2x99PqC68Ro3uakFMcN6f328lfWPSUwEU41Jr2/?= =?us-ascii?Q?fs81GbKqV90MbMG6yXPrl/jj7n3kPDTiw5rDiqmPWBywzgFrmuaGJjOLe+xa?= =?us-ascii?Q?SxCGKMCn+ZUXZcZCAWut47DEWHLi+zGp098CEIzNNcJPiyXtItuBNh9lsA9u?= =?us-ascii?Q?Nj7iyucAhKTXzWnKCBEjuLTznbr8JCQKSrJ+oHHURxuColNOc8l4EZAIKXnP?= =?us-ascii?Q?JCLO4oP8LO1H7DhyDNO+fYJ3drcpJ0DOmEK4nertBKUnRTMmrp3msMupvZ/N?= =?us-ascii?Q?3G8yVDBxqlkXaqDnrVMy5nHFw8in0XpxV25Od2bGMR5AWyu48eGNzayKZLBR?= =?us-ascii?Q?pDqLRxL8cgDyai4hgJicPpEHsMEIAT2QozygvmzCiP31537GkaM3/RO05Xza?= =?us-ascii?Q?Q2VxbWWx2nHhHXRoiF1LSRPPmriWU4ezXGHpIotBZlSCz8sYATteXDNFbjUJ?= =?us-ascii?Q?rrn6gmQRqkCfQeIY4F79gtJB2m9FplrrZxQsrC7zbeyctSRXtSulxs7aUz4w?= =?us-ascii?Q?18VKUpKrpC46B1Ohmy5Wk2/vpJbvpTMgBfs3MMK77pATmHbIi3bHf/JPhGd3?= =?us-ascii?Q?gi68VMcwHZRtdIr2ZB9N7W//nyMnn3u4psXiiExnxYnBMtcPQAHrb9Gtfke2?= =?us-ascii?Q?JpBJEY/RoVKOVo9rWqG7eaF9f2tuU87axNc4lBDuPaD6baDxtThdumMbCDli?= =?us-ascii?Q?lDQ9qzKJhXQVLwYag4cnkkTZdvtRowv9gxCtVIhafiyLgDlK0D0fxTcHlHD5?= =?us-ascii?Q?gMwR/M9Y06+kBtv+m11bl8hXgRZSWHVRXcPzQQgGsGb6QIg4W5jghVJHUC8/?= =?us-ascii?Q?N8a5+Y/gmw+IOkwdQCE3V3rB0fLpkuI1bogxLVW9d/zQf8p/+jb1d3ybmPHr?= =?us-ascii?Q?arwCjwYzR3NaAJJxsU27tn4KzszngCvP+gtIioCGueDahZXFXotbL4Gubkny?= =?us-ascii?Q?hxFy8zTBLCU+OiZnSVlk1aq7uXKkR/7qwUoqbxm0sM/gi2HsTSGv4tCUYv4U?= =?us-ascii?Q?Gxmu4LdUWZy7qpvR/tZeOX0Baa4QNuE4aDu72179j4M6MNKFS+49n+vl5wSw?= =?us-ascii?Q?O38epu/TSvbMSecLwI0rZGXXne8iKxhzvFdiuPJd/ooneoWQgYWlelyu4//f?= =?us-ascii?Q?fz0uprkaVJeQ2gNKjd6caQrj7eNeGtdq/xpAseeYJCIFK6IHRrStfSK6J0S2?= =?us-ascii?Q?WPcyYaUVkjsE7c0YS1WJSomHxrb6y9X73jFoXn8f5aXkQ777zfDBVfk5Wk7n?= =?us-ascii?Q?VwDb8uuLIoUdWMkqg01ZkwNhbz42RrCndYadVax4XdihDi+8qqnUpVrExojj?= =?us-ascii?Q?9FviYEAUseFgRj8MZQEvX1aZv8MRr0ubVLWdSkdOPvzEp3SsNLG5e3AwSdNx?= =?us-ascii?Q?Zw8gCDQLf+DnAO0=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)(36860700013)(82310400026)(1800799024)(376014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: /KgzcU1rWwxRGtnTZuB8qD9ComENry94C3Ge3uCSdG1Ki/I6R+NY7upl3YbLzdR1lnFmWMBbe1aYYP1QVPB95KLjzwdCngXE6eZTCAvYUgeuNqWeudmDKAxyleZwUEHoVFw5JNvTL338/nh2tJd3YZ6+zGYxeTw0QoloL9FBQ8dYH/w/vjE7qvVqZQ/sb3FJH0694T4iQV7gEpd0jJ1H5qBlMzuH0X5LL2iCohrx7Q4BWhGcYBPitt779KxegwEbhHh89Pjz3aOudMQbaZai0MKBBZOamc+PmDjyEARoiDsv7Lw1jGGmHKbcEjzUDoMqR9yusqzNKMgNrTUQHeO1dOfqiWRsZ8H0k1200kKbp7ihxbiVr91PUYwpqRkpn3griOYx4u3fAJCwVQsRiIL2FcVfKVlKzAMB4sBS3L9SYjXd0ojBJPV5gfk5Fv+sA29S45QTS4hWciyT1TiBN2IdhTtASpsFPeTPHQyttXdwlNxVoH8sdEiwVB63bR2ornYZh6AcsZ5LSUpnKOnkas0vyC+Ujuj8dtsOv5kUA9eUX6/rGkd7dln03qlhPgzRgTwegZZ/aWxebAdtFixPhIDZxR0u//6qNXb4Y+21cEpugfyOEfjNrv1q59xYhfv9XUTzN9HenzpytWm8pN+G2PhlEg== X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2025 17:08:36.0149 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cdaec975-bb26-4bb1-dd2a-08dd3a3e3e23 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: AM2PEPF0001C70A.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7P190MB0599 X-BESS-ID: 1737479317-302816-13354-7956-1 X-BESS-VER: 2019.1_20250117.1903 X-BESS-Apparent-Source-IP: 104.47.18.112 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVoYmFpbmQGYGUNTEwsTINDHJyM DCMs3YxNzA1NjA0sLSKMXYLDUxMTktTak2FgClcjC4QgAAAA== X-BESS-Outbound-Spam-Score: 0.50 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.261957 [from cloudscan21-179.eu-central-1b.ess.aws.cudaops.com] Rule breakdown below pts rule name description ---- ---------------------- -------------------------------- 0.50 BSF_RULE7568M META: Custom Rule 7568M 0.00 BSF_BESS_OUTBOUND META: BESS Outbound X-BESS-Outbound-Spam-Status: SCORE=0.50 using account:ESS113687 scores of KILL_LEVEL=7.0 tests=BSF_RULE7568M, 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 From: Danylo Vodopianov convert_error func was removed as far as this approach was deprecated. Coverity issue: 448973 Fixes: e526adf1fdef ("net/ntnic: add minimal create/destroy flow operations") Signed-off-by: Danylo Vodopianov --- drivers/net/ntnic/include/create_elements.h | 1 - drivers/net/ntnic/ntnic_filter/ntnic_filter.c | 151 ++++++------------ 2 files changed, 53 insertions(+), 99 deletions(-) diff --git a/drivers/net/ntnic/include/create_elements.h b/drivers/net/ntnic/include/create_elements.h index 1456977837..f0b9410cb9 100644 --- a/drivers/net/ntnic/include/create_elements.h +++ b/drivers/net/ntnic/include/create_elements.h @@ -61,7 +61,6 @@ enum nt_rte_flow_item_type { extern rte_spinlock_t flow_lock; int interpret_raw_data(uint8_t *data, uint8_t *preserve, int size, struct rte_flow_item *out); -int convert_error(struct rte_flow_error *error, struct rte_flow_error *rte_flow_error); int create_attr(struct cnv_attr_s *attribute, const struct rte_flow_attr *attr); int create_match_elements(struct cnv_match_s *match, const struct rte_flow_item items[], int max_elem); diff --git a/drivers/net/ntnic/ntnic_filter/ntnic_filter.c b/drivers/net/ntnic/ntnic_filter/ntnic_filter.c index b07e16c1d3..70bff776be 100644 --- a/drivers/net/ntnic/ntnic_filter/ntnic_filter.c +++ b/drivers/net/ntnic/ntnic_filter/ntnic_filter.c @@ -246,23 +246,6 @@ int interpret_raw_data(uint8_t *data, uint8_t *preserve, int size, struct rte_fl return hdri + 1; } -int convert_error(struct rte_flow_error *error, struct rte_flow_error *rte_flow_error) -{ - if (error) { - error->cause = NULL; - error->message = rte_flow_error->message; - - if (rte_flow_error->type == RTE_FLOW_ERROR_TYPE_NONE || - rte_flow_error->type == RTE_FLOW_ERROR_TYPE_NONE) - error->type = RTE_FLOW_ERROR_TYPE_NONE; - - else - error->type = RTE_FLOW_ERROR_TYPE_UNSPECIFIED; - } - - return 0; -} - int create_attr(struct cnv_attr_s *attribute, const struct rte_flow_attr *attr) { memset(&attribute->attr, 0x0, sizeof(struct rte_flow_attr)); @@ -497,13 +480,10 @@ static int convert_flow(struct rte_eth_dev *eth_dev, 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 = { - .type = RTE_FLOW_ERROR_TYPE_NONE, .message = "none" }; + error->type = RTE_FLOW_ERROR_TYPE_NONE; + error->message = "none"; uint32_t queue_offset = 0; - /* Set initial error */ - convert_error(error, &flow_error); - if (!internals) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, "Missing eth_dev"); @@ -559,23 +539,19 @@ eth_flow_destroy(struct rte_eth_dev *eth_dev, struct rte_flow *flow, struct rte_ struct pmd_internals *internals = eth_dev->data->dev_private; - static struct rte_flow_error flow_error = { - .type = RTE_FLOW_ERROR_TYPE_NONE, .message = "none" }; + error->type = RTE_FLOW_ERROR_TYPE_NONE; + error->message = "none"; int res = 0; - /* Set initial error */ - convert_error(error, &flow_error); if (!flow) return 0; if (is_flow_handle_typecast(flow)) { - res = flow_filter_ops->flow_destroy(internals->flw_dev, (void *)flow, &flow_error); - convert_error(error, &flow_error); + res = flow_filter_ops->flow_destroy(internals->flw_dev, (void *)flow, error); } else { res = flow_filter_ops->flow_destroy(internals->flw_dev, flow->flw_hdl, - &flow_error); - convert_error(error, &flow_error); + error); rte_spinlock_lock(&flow_lock); flow->used = 0; @@ -606,8 +582,8 @@ static struct rte_flow *eth_flow_create(struct rte_eth_dev *eth_dev, struct cnv_match_s match = { 0 }; struct cnv_action_s action = { 0 }; - static struct rte_flow_error flow_error = { - .type = RTE_FLOW_ERROR_TYPE_NONE, .message = "none" }; + error->type = RTE_FLOW_ERROR_TYPE_NONE; + error->message = "none"; uint32_t flow_stat_id = 0; if (convert_flow(eth_dev, attr, items, actions, &attribute, &match, &action, error) < 0) @@ -620,8 +596,7 @@ static struct rte_flow *eth_flow_create(struct rte_eth_dev *eth_dev, void *flw_hdl = flow_filter_ops->flow_create(internals->flw_dev, &attribute.attr, attribute.forced_vlan_vid, attribute.caller_id, match.rte_flow_item, action.flow_actions, - &flow_error); - convert_error(error, &flow_error); + error); return (struct rte_flow *)flw_hdl; } @@ -648,8 +623,7 @@ static struct rte_flow *eth_flow_create(struct rte_eth_dev *eth_dev, flow->flw_hdl = flow_filter_ops->flow_create(internals->flw_dev, &attribute.attr, attribute.forced_vlan_vid, attribute.caller_id, match.rte_flow_item, action.flow_actions, - &flow_error); - convert_error(error, &flow_error); + error); if (!flow->flw_hdl) { rte_spinlock_lock(&flow_lock); @@ -678,14 +652,14 @@ static int eth_flow_flush(struct rte_eth_dev *eth_dev, struct rte_flow_error *er struct pmd_internals *internals = eth_dev->data->dev_private; - static struct rte_flow_error flow_error = { - .type = RTE_FLOW_ERROR_TYPE_NONE, .message = "none" }; + error->type = RTE_FLOW_ERROR_TYPE_NONE; + error->message = "none"; int res = 0; /* Main application caller_id is port_id shifted above VDPA ports */ uint16_t caller_id = get_caller_id(eth_dev->data->port_id); if (internals->flw_dev) { - res = flow_filter_ops->flow_flush(internals->flw_dev, caller_id, &flow_error); + res = flow_filter_ops->flow_flush(internals->flw_dev, caller_id, error); rte_spinlock_lock(&flow_lock); for (int flow = 0; flow < MAX_RTE_FLOWS; flow++) { @@ -702,8 +676,6 @@ static int eth_flow_flush(struct rte_eth_dev *eth_dev, struct rte_flow_error *er rte_spinlock_unlock(&flow_lock); } - convert_error(error, &flow_error); - return res; } @@ -721,8 +693,8 @@ static int eth_flow_actions_update(struct rte_eth_dev *eth_dev, struct pmd_internals *internals = eth_dev->data->dev_private; - static struct rte_flow_error flow_error = { .type = RTE_FLOW_ERROR_TYPE_NONE, - .message = "none" }; + error->type = RTE_FLOW_ERROR_TYPE_NONE; + error->message = "none"; int res = -1; if (internals->flw_dev) { @@ -756,18 +728,16 @@ static int eth_flow_actions_update(struct rte_eth_dev *eth_dev, res = flow_filter_ops->flow_actions_update(internals->flw_dev, (void *)flow, action.flow_actions, - &flow_error); + error); } else { res = flow_filter_ops->flow_actions_update(internals->flw_dev, flow->flw_hdl, action.flow_actions, - &flow_error); + error); } } - convert_error(error, &flow_error); - return res; } @@ -785,17 +755,16 @@ static int eth_flow_dev_dump(struct rte_eth_dev *eth_dev, struct pmd_internals *internals = eth_dev->data->dev_private; - static struct rte_flow_error flow_error = { - .type = RTE_FLOW_ERROR_TYPE_NONE, .message = "none" }; + error->type = RTE_FLOW_ERROR_TYPE_NONE; + error->message = "none"; uint16_t caller_id = get_caller_id(eth_dev->data->port_id); int res = flow_filter_ops->flow_dev_dump(internals->flw_dev, is_flow_handle_typecast(flow) ? (void *)flow : flow->flw_hdl, - caller_id, file, &flow_error); + caller_id, file, error); - convert_error(error, &flow_error); return res; } @@ -813,16 +782,14 @@ static int eth_flow_get_aged_flows(struct rte_eth_dev *eth_dev, struct pmd_internals *internals = eth_dev->data->dev_private; - static struct rte_flow_error flow_error = { - .type = RTE_FLOW_ERROR_TYPE_NONE, - .message = "none" }; + error->type = RTE_FLOW_ERROR_TYPE_NONE; + error->message = "none"; uint16_t caller_id = get_caller_id(eth_dev->data->port_id); int res = flow_filter_ops->flow_get_aged_flows(internals->flw_dev, caller_id, context, - nb_contexts, &flow_error); + nb_contexts, error); - convert_error(error, &flow_error); return res; } @@ -842,17 +809,15 @@ static int eth_flow_info_get(struct rte_eth_dev *dev, struct rte_flow_port_info struct pmd_internals *internals = dev->data->dev_private; - static struct rte_flow_error flow_error = { - .type = RTE_FLOW_ERROR_TYPE_NONE, - .message = "none" }; + error->type = RTE_FLOW_ERROR_TYPE_NONE; + error->message = "none"; int res = flow_filter_ops->flow_info_get(internals->flw_dev, get_caller_id(dev->data->port_id), (struct rte_flow_port_info *)port_info, (struct rte_flow_queue_info *)queue_info, - &flow_error); + error); - convert_error(error, &flow_error); return res; } @@ -869,18 +834,16 @@ static int eth_flow_configure(struct rte_eth_dev *dev, const struct rte_flow_por struct pmd_internals *internals = dev->data->dev_private; - static struct rte_flow_error flow_error = { - .type = RTE_FLOW_ERROR_TYPE_NONE, - .message = "none" }; + error->type = RTE_FLOW_ERROR_TYPE_NONE; + error->message = "none"; int res = flow_filter_ops->flow_configure(internals->flw_dev, get_caller_id(dev->data->port_id), (const struct rte_flow_port_attr *)port_attr, nb_queue, (const struct rte_flow_queue_attr **)queue_attr, - &flow_error); + error); - convert_error(error, &flow_error); return res; } @@ -897,8 +860,8 @@ static struct rte_flow_pattern_template *eth_flow_pattern_template_create(struct struct pmd_internals *internals = dev->data->dev_private; - static struct rte_flow_error flow_error = { .type = RTE_FLOW_ERROR_TYPE_NONE, - .message = "none" }; + error->type = RTE_FLOW_ERROR_TYPE_NONE; + error->message = "none"; struct cnv_match_s match = { 0 }; struct rte_flow_pattern_template_attr attr = { @@ -918,9 +881,8 @@ static struct rte_flow_pattern_template *eth_flow_pattern_template_create(struct struct flow_pattern_template *res = flow_filter_ops->flow_pattern_template_create(internals->flw_dev, &attr, caller_id, - match.rte_flow_item, &flow_error); + match.rte_flow_item, error); - convert_error(error, &flow_error); return (struct rte_flow_pattern_template *)res; } @@ -937,15 +899,14 @@ static int eth_flow_pattern_template_destroy(struct rte_eth_dev *dev, struct pmd_internals *internals = dev->data->dev_private; - static struct rte_flow_error rte_flow_error = { .type = RTE_FLOW_ERROR_TYPE_NONE, - .message = "none" }; + error->type = RTE_FLOW_ERROR_TYPE_NONE; + error->message = "none"; int res = flow_filter_ops->flow_pattern_template_destroy(internals->flw_dev, (struct flow_pattern_template *) pattern_template, - &rte_flow_error); + error); - convert_error(error, &rte_flow_error); return res; } @@ -964,8 +925,8 @@ static struct rte_flow_actions_template *eth_flow_actions_template_create(struct struct pmd_internals *internals = dev->data->dev_private; struct fpga_info_s *fpga_info = &internals->p_drv->ntdrv.adapter_info.fpga_info; - static struct rte_flow_error rte_flow_error = { .type = RTE_FLOW_ERROR_TYPE_NONE, - .message = "none" }; + error->type = RTE_FLOW_ERROR_TYPE_NONE; + error->message = "none"; struct cnv_action_s action = { 0 }; struct cnv_action_s mask = { 0 }; @@ -1004,9 +965,8 @@ static struct rte_flow_actions_template *eth_flow_actions_template_create(struct struct flow_actions_template *res = flow_filter_ops->flow_actions_template_create(internals->flw_dev, &attr, caller_id, action.flow_actions, - mask.flow_actions, &rte_flow_error); + mask.flow_actions, error); - convert_error(error, &rte_flow_error); return (struct rte_flow_actions_template *)res; } @@ -1023,15 +983,14 @@ static int eth_flow_actions_template_destroy(struct rte_eth_dev *dev, struct pmd_internals *internals = dev->data->dev_private; - static struct rte_flow_error rte_flow_error = { .type = RTE_FLOW_ERROR_TYPE_NONE, - .message = "none" }; + error->type = RTE_FLOW_ERROR_TYPE_NONE; + error->message = "none"; int res = flow_filter_ops->flow_actions_template_destroy(internals->flw_dev, (struct flow_actions_template *) actions_template, - &rte_flow_error); + error); - convert_error(error, &rte_flow_error); return res; } @@ -1050,8 +1009,8 @@ static struct rte_flow_template_table *eth_flow_template_table_create(struct rte struct pmd_internals *internals = dev->data->dev_private; - static struct rte_flow_error rte_flow_error = { .type = RTE_FLOW_ERROR_TYPE_NONE, - .message = "none" }; + error->type = RTE_FLOW_ERROR_TYPE_NONE; + error->message = "none"; struct rte_flow_template_table_attr attr = { .flow_attr = { @@ -1071,9 +1030,8 @@ static struct rte_flow_template_table *eth_flow_template_table_create(struct rte forced_vlan_vid, caller_id, (struct flow_pattern_template **)pattern_templates, nb_pattern_templates, (struct flow_actions_template **)actions_templates, - nb_actions_templates, &rte_flow_error); + nb_actions_templates, error); - convert_error(error, &rte_flow_error); return (struct rte_flow_template_table *)res; } @@ -1090,15 +1048,14 @@ static int eth_flow_template_table_destroy(struct rte_eth_dev *dev, struct pmd_internals *internals = dev->data->dev_private; - static struct rte_flow_error rte_flow_error = { .type = RTE_FLOW_ERROR_TYPE_NONE, - .message = "none" }; + error->type = RTE_FLOW_ERROR_TYPE_NONE; + error->message = "none"; int res = flow_filter_ops->flow_template_table_destroy(internals->flw_dev, (struct flow_template_table *) template_table, - &rte_flow_error); + error); - convert_error(error, &rte_flow_error); return res; } @@ -1118,8 +1075,8 @@ static struct rte_flow *eth_flow_async_create(struct rte_eth_dev *dev, uint32_t struct pmd_internals *internals = dev->data->dev_private; struct fpga_info_s *fpga_info = &internals->p_drv->ntdrv.adapter_info.fpga_info; - static struct rte_flow_error rte_flow_error = { .type = RTE_FLOW_ERROR_TYPE_NONE, - .message = "none" }; + error->type = RTE_FLOW_ERROR_TYPE_NONE; + error->message = "none"; struct cnv_action_s action = { 0 }; struct cnv_match_s match = { 0 }; @@ -1159,9 +1116,8 @@ static struct rte_flow *eth_flow_async_create(struct rte_eth_dev *dev, uint32_t action.flow_actions, actions_template_index, user_data, - &rte_flow_error); + error); - convert_error(error, &rte_flow_error); return (struct rte_flow *)res; } @@ -1178,17 +1134,16 @@ static int eth_flow_async_destroy(struct rte_eth_dev *dev, uint32_t queue_id, struct pmd_internals *internals = dev->data->dev_private; - static struct rte_flow_error rte_flow_error = { .type = RTE_FLOW_ERROR_TYPE_NONE, - .message = "none" }; + error->type = RTE_FLOW_ERROR_TYPE_NONE; + error->message = "none"; int res = flow_filter_ops->flow_async_destroy(internals->flw_dev, queue_id, (const struct rte_flow_op_attr *)op_attr, (struct flow_handle *)flow, user_data, - &rte_flow_error); + error); - convert_error(error, &rte_flow_error); return res; } -- 2.45.0