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 CBCA345BCC; Thu, 31 Oct 2024 00:12:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B70954348B; Thu, 31 Oct 2024 00:12:18 +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 B90184348B for ; Thu, 31 Oct 2024 00:12:17 +0100 (CET) Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02lp2104.outbound.protection.outlook.com [104.47.11.104]) by mx-outbound47-144.eu-central-1c.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 30 Oct 2024 23:12:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VKczqqZ0iCiBjWy7KKidc8VvxnOW+Wbu+hOWJYYxFXzHX71dUEomqn2DRdw9YK/O1blLbPHjAHh/5C/8QStnBY/opfl2Xyz6bUR1U0s4//yy2qlMP/A3cBc75FeiFG9yfch+5/Iat9LeQWxwgiTmwMrZrrtzrtLCPap/e4FSfzpwZ2/0tne3zGyOuDC9uW6Ma//3uqYoisekyrb/HhPV2EybTHQrGspngKVxXHrs0Hp7QI3aFAe6E9qukMj0rYV+2vQSv5p6fxnDlNlqfvhA1IfzJvoylvZIz5UXCV1VeAiPZi3HZ2Hg47HVRoizACuBtHvrg2app8bs9zVU54ehfw== 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=hZ/tH9hjW6WabsdVHEBmHz8cGd6wyfL7QFB3EiQ9N+0=; b=YzkoOooCQoCH/gxn/rsEfO3ilF+jLylR1tvFwncgsY9vzluQTPDQhufy5YGorxA9j2gXiJk27L9SuacYOKzWupg/wBcxJgz8yrGRKT38W/m/P8nyObA0prYIKjYWOEj3o9jNZ8ep03CyMCy0nThJCezAEqWKvJ0tGCTpwx6R3VkfVNIwckMi9Rq1ISWrUgONhGtHSOmk2+uRyfz9cH+HA4nnZmQTHgAVMQ9lj0e5wvYyJLJiOMFKoUTrA/M/gBUf5b3ZHS1yWoi1OasXZf4Pw24SyBn3fGYjNGEwJq7azSGtTdS/4z0q/CrIikXm79vdC2PJGArxCAvVGnwvEdHQPg== 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=hZ/tH9hjW6WabsdVHEBmHz8cGd6wyfL7QFB3EiQ9N+0=; b=VsuqrIZRWspBcOd8I6wYUmOOkl3++fAZhIBj2om9WgWvj9m50zcukCa6lDQmkqfvMQZ6AA1ZOH1eaVXHmKVQhsdzqUhSGZ2niczDCgjaAfsdPkI59iyaupD5yscZkuFNn+wVaEU/rzPRZzt8XN0OWnFzcIt/jBmoe8wpe83b+bQ= Received: from DUZPR01CA0008.eurprd01.prod.exchangelabs.com (2603:10a6:10:3c3::17) by AM9P190MB1252.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:262::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.27; Wed, 30 Oct 2024 21:40:37 +0000 Received: from DU2PEPF00028D13.eurprd03.prod.outlook.com (2603:10a6:10:3c3:cafe::f6) by DUZPR01CA0008.outlook.office365.com (2603:10a6:10:3c3::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.22 via Frontend Transport; Wed, 30 Oct 2024 21:40: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 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:40:36 +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, Oleksandr Kolomeiets Subject: [PATCH v5 46/80] net/ntnic: add MAC Tx module registers Date: Wed, 30 Oct 2024 22:38:53 +0100 Message-ID: <20241030213940.3470062-47-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_|AM9P190MB1252:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 4d735137-eb16-4abf-c9e0-08dcf92b7dbe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|376014|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?fuDtCMIYp3RxN+IB/1rVo1i6OITnNDc5iIBGTkuMjS30MfqzjGPv2bfqZEyo?= =?us-ascii?Q?0h8aKQSTaCUd5KgNRD6JI8GFRNUrPW5bsnPlh057su1S+KhGkrt7tYMZgHy9?= =?us-ascii?Q?Ws1B8KapRgCileJx1wnXUXFlvlNkBIn6E0pD8xvvwo9MKi2QLuQ1GxOujhFL?= =?us-ascii?Q?zLXhEwoCH+CKGb0lhKneaVp5pCS7C23z/JVPB44Af9DLdRYSQbmx0xI4RfPW?= =?us-ascii?Q?wY6HW9+uy3UBClqFxL2I2HsD7iokYnZENx2xPLKxCjlieDoYwihUg47I7Fms?= =?us-ascii?Q?jI2PdLxHI9ycnRr4NCbsE2Ouumex6nMt0+9898XEoOD7rYclCj529y7mfHvm?= =?us-ascii?Q?gkS5Da6KHEPEKmRKNpF70bGuoJsvBQPwO3JKWmbPsKYO706LewvdF0SB/t+B?= =?us-ascii?Q?hlR9/fxYGIRw2Buu/W1Qiv+tfZ6mTkILu+7C2wW/P2PptZSvWdIYxGexLoYS?= =?us-ascii?Q?BJcDuer9m42X2CPh0wHCYr8J2iivuqHdMd85YNCIxcZ+ix/jUb4+LejuGZT1?= =?us-ascii?Q?omJGFqIFBotvVkv+hBOi9JN04v9H+24mJmKe8hnzEgPkuhfteYjC8Nq8LABS?= =?us-ascii?Q?RUkxq0ULESvs/OYnJfFMlFZF/p5S/v5oCQkpzdX84hAW3pZA/yQk8LR2grPX?= =?us-ascii?Q?yp7gCYRttSPo7LxkUNRpKlLLfQaDIGtPwRWOww8L66vNjp0zg8qf5UGcfWVf?= =?us-ascii?Q?0IA7xOWuxkKb1hCSiFg+GZOXj3hrufnkX4MrKbuZwMYOpry5arPcTVanPJxT?= =?us-ascii?Q?e06XPLbS9UOnDVPUaX7jSSL/UG5A+JtZ+hq5BWfcYFlm6b2rbtfKq+5fKdhL?= =?us-ascii?Q?eNfvhg3IYY6AWlFNys7OKoV6aLARriC0iYf+C50J/wMCedGPPCGuQUIEcc5O?= =?us-ascii?Q?WsELgrSUCx1Jqr9tDwGEhy3oQZfue42yyCd3+X3NpKE+XyxsUngqnPfaHN88?= =?us-ascii?Q?wgCsvWhhQG2NKR9THW0KVuZWmaX1OtEQ9Z8xZld1f6jp8GWSRPv4sQu4N1Rx?= =?us-ascii?Q?M/lQMzgQA/fMr0QaVJUMKxxG0CWfjkyehxZE2sf6tkwb30hVEGIExxyIeeGl?= =?us-ascii?Q?2UQOmW9EJxsyVuvTBn6PwpKAVV61OTF2Lk0nxdbCji+5gorL4MCuU0Llaa6Z?= =?us-ascii?Q?eirg5sjjI7cng5h+5z7YBdi0XANAi1U64YSmInH1QFqArV9B9Lhb7pyS14+F?= =?us-ascii?Q?thKPovxa6b4I935jRPaMIGkC+9tlalUY21rvi6zS8hikTF+3uIc52Lamq/Ls?= =?us-ascii?Q?kzkwckdBs8Ihvovq3cqEfj6OTR9xL/YvSe4UI077fWygdl1ESUCHumRsj95b?= =?us-ascii?Q?3+CAtH3GOSCAsJmkmsyQBypSW7aXrkFObxZxmwr8cwMm/WGJ4oJz9f0yLlcC?= =?us-ascii?Q?iLeVFy6zcxU/9so7PPR3Ry3uT9HDLrbxyCTUM061vLVXY6fOew=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)(1800799024)(36860700013)(376014)(82310400026); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 1xljAfxhOmGVWNxqsWYqU4EGFcyZREi2D7p1fWSy1rqIPiN4aU7akIkN98hDHg+Gu9pfUZMNd8SzI/2zCLQ3FF7xoz8kuV9+ebOjVfT+RESTCD/Otp5s6/2vpGhlLL1C/oRE6sIiHYXmeVqLcPrWp1QhYXbkyZbkn4yaOilQuMXaJRrAPAmM94aW+sfySQ4QZuw7MDJMiAmxjq5XaWYN47p9A4Vtu8IHTR4ms3sRhPjD8K5pe1BTntA2X2w5I2x7W+cVJvNtc52idwSMnNEi/Luh7Ai4DBXpI8AdisXwV/fcq5wW+f5t1CmfpQJpIrb8gzux84aGL+ERRNuSW7KWDIRxvtPysPXRqEI45jreJ1v5ataP8mcamanCFz8FQGu9QZoGEJG7TEdHCOFtifucKZeszIJF6PNbtmaBf0MMfnuaD/oM6Cx4p3XO/5qoc81yCd1pGAjQDSVg8bJpgYbXOa1euJH5AR80kQJ5/nvi4+rmIwaRfPWiv9Cg8dVP6h3OzBjp6+kBqg8vDzaXpKNOve5TpoDISpiAM8qAfy0X1iAuJ0gtl4Rfy1tEmcdw0B+EIGPIzwK7/yxm2zJi6MVQ7A6PK4PRx4mfH5B77dhJkn3JbYvjkiCz4/IAgM6RzYH0R4YoIx30HlkFaP1PfA1Gw16ORr89flkEo6n1xOhfN7Q= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Oct 2024 21:40:36.5364 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4d735137-eb16-4abf-c9e0-08dcf92b7dbe 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: AM9P190MB1252 X-OriginatorOrg: napatech.com X-BESS-ID: 1730329934-312176-12713-43836-1 X-BESS-VER: 2019.1_20241018.1852 X-BESS-Apparent-Source-IP: 104.47.11.104 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKVqZmBoZAVgZQ0NAgzSzR1DLVIM XcwCTRItUgNSnZzMjEMjEp0dzSzCxVqTYWADbDt0pBAAAA X-BESS-Outbound-Spam-Score: 0.00 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.260092 [from cloudscan20-80.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 From: Oleksandr Kolomeiets The Media Access Control Transmit module contains counters that keep track on transmitted packets. Signed-off-by: Oleksandr Kolomeiets --- .../supported/nthw_fpga_9563_055_049_0000.c | 38 ++++++++++++++++++- .../ntnic/nthw/supported/nthw_fpga_mod_defs.h | 3 +- .../ntnic/nthw/supported/nthw_fpga_reg_defs.h | 1 + .../supported/nthw_fpga_reg_defs_mac_tx.h | 21 ++++++++++ 4 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_mac_tx.h diff --git a/drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_049_0000.c b/drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_049_0000.c index eecd6342c0..7a2f5aec32 100644 --- a/drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_049_0000.c +++ b/drivers/net/ntnic/nthw/supported/nthw_fpga_9563_055_049_0000.c @@ -1831,6 +1831,40 @@ static nthw_fpga_register_init_s mac_rx_registers[] = { { MAC_RX_UNDERSIZE, 8, 32, NTHW_FPGA_REG_TYPE_RO, 0, 1, mac_rx_undersize_fields }, }; +static nthw_fpga_field_init_s mac_tx_packet_small_fields[] = { + { MAC_TX_PACKET_SMALL_COUNT, 32, 0, 0x0000 }, +}; + +static nthw_fpga_field_init_s mac_tx_total_bytes_fields[] = { + { MAC_TX_TOTAL_BYTES_COUNT, 32, 0, 0x0000 }, +}; + +static nthw_fpga_field_init_s mac_tx_total_good_bytes_fields[] = { + { MAC_TX_TOTAL_GOOD_BYTES_COUNT, 32, 0, 0x0000 }, +}; + +static nthw_fpga_field_init_s mac_tx_total_good_packets_fields[] = { + { MAC_TX_TOTAL_GOOD_PACKETS_COUNT, 32, 0, 0x0000 }, +}; + +static nthw_fpga_field_init_s mac_tx_total_packets_fields[] = { + { MAC_TX_TOTAL_PACKETS_COUNT, 32, 0, 0x0000 }, +}; + +static nthw_fpga_register_init_s mac_tx_registers[] = { + { MAC_TX_PACKET_SMALL, 2, 32, NTHW_FPGA_REG_TYPE_RO, 0, 1, mac_tx_packet_small_fields }, + { MAC_TX_TOTAL_BYTES, 3, 32, NTHW_FPGA_REG_TYPE_RO, 0, 1, mac_tx_total_bytes_fields }, + { + MAC_TX_TOTAL_GOOD_BYTES, 4, 32, NTHW_FPGA_REG_TYPE_RO, 0, 1, + mac_tx_total_good_bytes_fields + }, + { + MAC_TX_TOTAL_GOOD_PACKETS, 1, 32, NTHW_FPGA_REG_TYPE_RO, 0, 1, + mac_tx_total_good_packets_fields + }, + { MAC_TX_TOTAL_PACKETS, 0, 32, NTHW_FPGA_REG_TYPE_RO, 0, 1, mac_tx_total_packets_fields }, +}; + static nthw_fpga_field_init_s pci_rd_tg_tg_ctrl_fields[] = { { PCI_RD_TG_TG_CTRL_TG_RD_RDY, 1, 0, 0 }, }; @@ -2182,6 +2216,8 @@ static nthw_fpga_module_init_s fpga_modules[] = { }, { MOD_MAC_RX, 0, MOD_MAC_RX, 0, 0, NTHW_FPGA_BUS_TYPE_RAB2, 10752, 9, mac_rx_registers }, { MOD_MAC_RX, 1, MOD_MAC_RX, 0, 0, NTHW_FPGA_BUS_TYPE_RAB2, 12288, 9, mac_rx_registers }, + { MOD_MAC_TX, 0, MOD_MAC_TX, 0, 0, NTHW_FPGA_BUS_TYPE_RAB2, 11264, 5, mac_tx_registers }, + { MOD_MAC_TX, 1, MOD_MAC_TX, 0, 0, NTHW_FPGA_BUS_TYPE_RAB2, 12800, 5, mac_tx_registers }, { MOD_PCI_RD_TG, 0, MOD_PCI_RD_TG, 0, 1, NTHW_FPGA_BUS_TYPE_RAB0, 2320, 6, pci_rd_tg_registers @@ -2353,5 +2389,5 @@ static nthw_fpga_prod_param_s product_parameters[] = { }; nthw_fpga_prod_init_s nthw_fpga_9563_055_049_0000 = { - 200, 9563, 55, 49, 0, 0, 1726740521, 152, product_parameters, 28, fpga_modules, + 200, 9563, 55, 49, 0, 0, 1726740521, 152, product_parameters, 30, fpga_modules, }; diff --git a/drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h b/drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h index 5983ba7095..f4a913f3d2 100644 --- a/drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h +++ b/drivers/net/ntnic/nthw/supported/nthw_fpga_mod_defs.h @@ -30,6 +30,7 @@ #define MOD_KM (0xcfbd9dbeUL) #define MOD_MAC_PCS (0x7abe24c7UL) #define MOD_MAC_RX (0x6347b490UL) +#define MOD_MAC_TX (0x351d1316UL) #define MOD_PCIE3 (0xfbc48c18UL) #define MOD_PCI_RD_TG (0x9ad9eed2UL) #define MOD_PCI_WR_TG (0x274b69e1UL) @@ -44,7 +45,7 @@ #define MOD_TX_CPY (0x60acf217UL) #define MOD_TX_INS (0x59afa100UL) #define MOD_TX_RPL (0x1095dfbbUL) -#define MOD_IDX_COUNT (31) +#define MOD_IDX_COUNT (32) /* aliases - only aliases go below this point */ #endif /* _NTHW_FPGA_MOD_DEFS_H_ */ diff --git a/drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h b/drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h index 5ebbec6c7e..7741aa563f 100644 --- a/drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h +++ b/drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs.h @@ -31,6 +31,7 @@ #include "nthw_fpga_reg_defs_km.h" #include "nthw_fpga_reg_defs_mac_pcs.h" #include "nthw_fpga_reg_defs_mac_rx.h" +#include "nthw_fpga_reg_defs_mac_tx.h" #include "nthw_fpga_reg_defs_pcie3.h" #include "nthw_fpga_reg_defs_pci_rd_tg.h" #include "nthw_fpga_reg_defs_pci_wr_tg.h" diff --git a/drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_mac_tx.h b/drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_mac_tx.h new file mode 100644 index 0000000000..6a77d449ae --- /dev/null +++ b/drivers/net/ntnic/nthw/supported/nthw_fpga_reg_defs_mac_tx.h @@ -0,0 +1,21 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2024 Napatech A/S + */ + +#ifndef _NTHW_FPGA_REG_DEFS_MAC_TX_ +#define _NTHW_FPGA_REG_DEFS_MAC_TX_ + +/* MAC_TX */ +#define MAC_TX_PACKET_SMALL (0xcfcb5e97UL) +#define MAC_TX_PACKET_SMALL_COUNT (0x84345b01UL) +#define MAC_TX_TOTAL_BYTES (0x7bd15854UL) +#define MAC_TX_TOTAL_BYTES_COUNT (0x61fb238cUL) +#define MAC_TX_TOTAL_GOOD_BYTES (0xcf0260fUL) +#define MAC_TX_TOTAL_GOOD_BYTES_COUNT (0x8603398UL) +#define MAC_TX_TOTAL_GOOD_PACKETS (0xd89f151UL) +#define MAC_TX_TOTAL_GOOD_PACKETS_COUNT (0x12c47c77UL) +#define MAC_TX_TOTAL_PACKETS (0xe37b5ed4UL) +#define MAC_TX_TOTAL_PACKETS_COUNT (0x21ddd2ddUL) + +#endif /* _NTHW_FPGA_REG_DEFS_MAC_TX_ */ -- 2.45.0