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 962E6460D6; Tue, 21 Jan 2025 18:11:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2AD0040DD0; Tue, 21 Jan 2025 18:09:03 +0100 (CET) Received: from egress-ip42b.ess.de.barracuda.com (egress-ip42b.ess.de.barracuda.com [18.185.115.246]) by mails.dpdk.org (Postfix) with ESMTP id 9273040687 for ; Tue, 21 Jan 2025 18:08:46 +0100 (CET) Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03lp2172.outbound.protection.outlook.com [104.47.51.172]) by mx-outbound22-172.eu-central-1b.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 21 Jan 2025 17:08:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jYJq+bXCLjWhzrvKZxaV4p3ZzomBzUgWKRsIiwW1xh1vAPL7AM8EoJKrr8s3u9ATvHoAnh9x7CblknLRvmvjT8oWv4gRVcmyqJ1oM70a8HzMGqTfH2rvgqTTBVgwO03y14udDXMdP/EVRCpwt9F0xka01cPurCHKaTCXKzha56nc0hOFYaqwiN/iUVVwRX41iClywihr6iOHdseAJ6msvXpR2W5Kmx5VD5+cCR+2Hcv97Ft4e4w7D5TSb3S2FLOwhGcfxSFbd87mB5eWw53GCJRVnwRQA03z2aeK/Ux3gHUfYTMm3z4pV+2eDlaRHsKPpxNU1ta/KYl2pHcyrh5q7Q== 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=n2wax9YajM+oK7FsXicTvEjAPRPmgjdkjxHI+UEyut8=; b=TbGx8xiickU7ABy059PSYDoUinLpwCkOcxwA0idYm/MZGB27stuce3DWiWkd/gWczqd55+uQ80cy6t74cnz1E8j3snW2mUJUIAQj/6cHY80syj3RUmrveKt3OPOQuE7Y4sKdebfX5eiBexRM14AoWJPK5Rtdesg4nGFYIVQZuKD52LwWQ40IicHiYsAOpTk4sumXK6301RDSIwYN/YtGlDt3VRAERudVeocKWOPjYmJOi/vAaWZm/lF9UgUm3oEStSa6+y24KlO7NfYJFd71okrV/EjvyKV3dXBZXMUoMm1QZkYktmswjnIo6EwLFvxRezw5VnJ5V4sXx0/3k7BWGA== 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=n2wax9YajM+oK7FsXicTvEjAPRPmgjdkjxHI+UEyut8=; b=R0FzPSqYRsGG5b/NGj64C9X+CcitbLzySJhj2l7x6ulavjFtya+fnLN8SoolUkA//Y1IpxuIiQTP9jJUfA1LL5n5Nk0dGKuvbAPDrHPcNg3mB2sFyaBW/JO2rnq3IdTWtAoRDwxQe2RVn0qJX7D/d9K1uPV2qyfhxxY+mJRWUds= Received: from AS4P251CA0017.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:5d3::6) by PR3P190MB1002.EURP190.PROD.OUTLOOK.COM (2603:10a6:102:92::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.18; Tue, 21 Jan 2025 17:08:43 +0000 Received: from AM2PEPF0001C70A.eurprd05.prod.outlook.com (2603:10a6:20b:5d3:cafe::80) by AS4P251CA0017.outlook.office365.com (2603:10a6:20b:5d3::6) 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:43 +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:43 +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 , Oleksandr Kolomeiets Subject: [PATCH v1 28/31] net/ntnic: fix group print Date: Tue, 21 Jan 2025 18:08:06 +0100 Message-ID: <20250121170814.3252171-29-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_|PR3P190MB1002:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 0e32298d-cad6-4788-92a3-08dd3a3e42c9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?38I6KqO4C2BJzmqPixAm1usFnU3loL26Eat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bzm5/UqBCa4aoeDSuka/aKac2CcVIJeVWbtDr2fKKTg?= =?us-ascii?Q?pOvFSbUv5jasmzweFT/wJopVJvYxOdTlPhQFUlBshQ1ByKthznJ4HbDNqxOV?= =?us-ascii?Q?H0+W1w2MVWvRqq/AgW4RapK82YwmJomXFgb7lwKRyIit4NDRx9bwBGVWwdrE?= =?us-ascii?Q?t28JQGpaZFK8nPXqnaAYvMiTK/rXUEymSyyXWd3e88lSMxL6zxwxGl4rw8Nn?= =?us-ascii?Q?vaCWK0f4S7ryUIdw6+uTPvDMpZH8EhJfZVqVfKZRI/VG1qVvkYO4ciCDZBUy?= =?us-ascii?Q?9dLVOjvzX4IrgHwzKICkxX7Yw31CFJt1EnmXAh5nSKaOYIY+D3HEbNamyRe/?= =?us-ascii?Q?erIG21GSgsiWgX9DIhsVvoyOkLWkKZIhamEruVvLOUKgUIpinMxlXH9y5g5J?= =?us-ascii?Q?i5pCfNLBKzD2lzhl/InfcPoswqIxJcTnCNA1Kwn9+AcIXJ8d2STxY+zf1l1W?= =?us-ascii?Q?KdZL7Q+RHniuHHVEMxaVtET3+BpNGv26qOrOQwHDyK12OuJbnjmYWTOPNQD+?= =?us-ascii?Q?DtUd+fw0ewIZ0QO/JPNJszAsSWx6YfZK2nSRD9+ntlmoQOqubE+JjA=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)(82310400026)(1800799024)(376014)(36860700013); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: mAHja9xg9shvOrdZTmq6h/6vnG3gizM2vEhPC3oIDBMM2Vdm0k6y89TsPkqW+nIP/r2/jdPQw53O1A8NKnjwDIR7sAAsUP+KwIAi+1OPU+raegnwg/LAmkCONAarHqy+Ln1lBOM7/8TH/36TXPiJPVaomP4JbWoIOABnY3zH9KKMCeBk0BZNVnzoP1bnJ+hep7cCa/RfSQHl4Q1eKUB7fxfit9ijPSP7EdwkZ/+5+p31dpMUNJHNL1kMstBZcSDDi3xHfDWEnhnM8Fqlde0DOwnIfFpktlBZNju9U9IDzckvciKNPt2YSE4DSLA2EGVLOpGkW9PlB0+zXK4bvKs7JJaC+KzkvaH+DyLy/KNV+f2Ftvp9OSf6hhw2RsNz32XUjZwMJF6cIRBI/enhBX7VDWebZhB9zNmy3IqA22KZaAbdsGhR0cwpXgIAsj/4JU4SFL57pyk/v14PXaXKCtJR4NW/lBhWnfMcYdiMKrDM+fgAu/3+ldOmFmn4Bdsyy/hT5PK0w5MW5sNkuwpC2DmBQVbG/+5Mp8YxdRpJ/rhgMYXwXhoHDZi8I0KuLig7D0oADXBfBscaxgavZrt3+efLXdMGSvwRFliZJ9EK1sWEh0b1QUglRgKxbSZupGbiZSEV7AM/KyHm2F5tKpxM6JtVOA== X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jan 2025 17:08:43.7962 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0e32298d-cad6-4788-92a3-08dd3a3e42c9 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: PR3P190MB1002 X-BESS-ID: 1737479325-305804-13347-8316-1 X-BESS-VER: 2019.1_20250117.1903 X-BESS-Apparent-Source-IP: 104.47.51.172 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVibGJhZAVgZQ0CDJLNEszcQo1c TMLNnYLCXVyNLUEsg3T0o2TDJMNlSqjQUAx82QtEEAAAA= X-BESS-Outbound-Spam-Score: 0.50 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.261957 [from cloudscan9-151.eu-central-1a.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 Flow dump output was fixed to show original group number for `jumps` stored in action and match sets. Fixes: 6f0fe142caed ("net/ntnic: add flow dump") Signed-off-by: Danylo Vodopianov --- drivers/net/ntnic/include/flow_api_engine.h | 2 ++ drivers/net/ntnic/nthw/flow_api/flow_group.c | 26 +++++++++++++++++++ .../profile_inline/flow_api_hw_db_inline.c | 24 ++++++++++++----- 3 files changed, 45 insertions(+), 7 deletions(-) diff --git a/drivers/net/ntnic/include/flow_api_engine.h b/drivers/net/ntnic/include/flow_api_engine.h index 636c53b260..262317002f 100644 --- a/drivers/net/ntnic/include/flow_api_engine.h +++ b/drivers/net/ntnic/include/flow_api_engine.h @@ -425,5 +425,7 @@ int flow_group_handle_destroy(void **handle); int flow_group_translate_get(void *handle, uint8_t owner_id, uint8_t port_id, uint32_t group_in, uint32_t *group_out); +int flow_group_translate_get_orig_group(void *handle, uint32_t translated_group, + uint32_t *group_orig); #endif /* _FLOW_API_ENGINE_H_ */ diff --git a/drivers/net/ntnic/nthw/flow_api/flow_group.c b/drivers/net/ntnic/nthw/flow_api/flow_group.c index f76986b178..d1fa0193e1 100644 --- a/drivers/net/ntnic/nthw/flow_api/flow_group.c +++ b/drivers/net/ntnic/nthw/flow_api/flow_group.c @@ -14,6 +14,7 @@ struct group_lookup_entry_s { uint64_t ref_counter; uint32_t *reverse_lookup; + uint32_t group_orig; }; struct group_handle_s { @@ -83,6 +84,7 @@ int flow_group_translate_get(void *handle, uint8_t owner_id, uint8_t port_id, ui if (lookup < group_handle->group_count) { group_handle->lookup_entries[lookup].reverse_lookup = table_ptr; group_handle->lookup_entries[lookup].ref_counter += 1; + group_handle->lookup_entries[lookup].group_orig = group_in; *table_ptr = lookup; @@ -97,3 +99,27 @@ int flow_group_translate_get(void *handle, uint8_t owner_id, uint8_t port_id, ui *group_out = lookup; return 0; } + +int flow_group_translate_get_orig_group(void *handle, uint32_t translated_group, + uint32_t *group_orig) +{ + struct group_handle_s *group_handle = (struct group_handle_s *)handle; + struct group_lookup_entry_s *lookup; + + if (group_handle == NULL || translated_group >= group_handle->group_count) + return -1; + + /* Don't translate group 0 */ + if (translated_group == 0) { + *group_orig = 0; + return 0; + } + + lookup = &group_handle->lookup_entries[translated_group]; + + if (lookup->reverse_lookup && lookup->ref_counter > 0) { + *group_orig = lookup->group_orig; + return 0; + } + return -1; +} diff --git a/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.c b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.c index 22cbf61b60..278be8b180 100644 --- a/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.c +++ b/drivers/net/ntnic/nthw/flow_api/profile_inline/flow_api_hw_db_inline.c @@ -429,9 +429,14 @@ void hw_db_inline_dump(struct flow_nic_dev *ndev, void *db_handle, const struct data->cat.ids, data->km.id1, data->km_ft.id1, data->action_set.ids); - if (data->jump) - fprintf(file, " Jumps to %d\n", data->jump); - + if (data->jump) { + uint32_t group_orig = 0; + if (flow_group_translate_get_orig_group(ndev->group_handle, + data->jump, &group_orig) < 0) + fprintf(file, " Jumps to %d (encoded)\n", data->jump); + else + fprintf(file, " Jumps to %d\n", group_orig); + } break; } @@ -440,15 +445,20 @@ void hw_db_inline_dump(struct flow_nic_dev *ndev, void *db_handle, const struct &db->action_set[idxs[i].ids].data; fprintf(file, " ACTION_SET %d\n", idxs[i].ids); - if (data->contains_jump) - fprintf(file, " Jumps to %d\n", data->jump); + if (data->contains_jump) { + uint32_t group_orig = 0; + if (flow_group_translate_get_orig_group(ndev->group_handle, + data->jump, &group_orig) < 0) + fprintf(file, " Jumps to %d (encoded)\n", data->jump); - else + else + fprintf(file, " Jumps to %d\n", group_orig); + } else { fprintf(file, " COT id %d, QSL id %d, SLC_LR id %d, TPE id %d, HSH id %d, SCRUB id %d\n", data->cot.ids, data->qsl.ids, data->slc_lr.ids, data->tpe.ids, data->hsh.ids, data->scrub.ids); - + } break; } -- 2.45.0