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 37DA4455F3; Thu, 11 Jul 2024 14:08:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 51D2242E77; Thu, 11 Jul 2024 14:07:58 +0200 (CEST) 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 4310B4021F for ; Thu, 11 Jul 2024 14:07:54 +0200 (CEST) Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03lp2108.outbound.protection.outlook.com [104.47.30.108]) by mx-outbound41-230.eu-central-1c.ess.aws.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 11 Jul 2024 12:07:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=c1KSx9qNfJNoe01JDDoNTajiuGZ5xuNPuD6umZjeB4OUDyH5M0eAAFRYyvpMImV8IJMryIo916/YOEDVVo2VUOgabVQXktl3F5zgqQfu7AULFqGC4ooBX4j0OkWQli+H+MYqM8swF07vlyKVCJyeQZJx78lbjxJ3KTOJnV8HVxm3FO5dI0aG2/SzADli7hvkPS57dbt+YLfu2mHso0gtNskVW/O09MeIk4DdfEx0gcsQqA5XTYVN1idfHeirOAFzb5LimgnlgOYR7t5gioXuIo8uKOo3v4Vu3VhW2p+H2aIA047cHcvmZywnfiEL6ZSP7Zfy9VL7pU7Q4p4ttqTkaw== 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=cd/A/3jLbbg9kcV3eXyvggAx4SbOy+RcrrhsS8KQopk=; b=Eoa4qlzkqf2WjrSE84SaSVQ2XIspO2sE/ZcaeCXJfo9HoDvghDZVkUWoLDlDuEUfyWHmuLtdQUJOYYGj5qSf74kEysehoy6MA4vS9OPMDc4q7vxlNsPPJgY/LK3nz68Q6kUSypRNoDYUyBkLJSzvfVzNj0OYvOjXA0rQ3PQ+rdNGtl1uqAmogh0eEntJ64M0mEqsUTBYlfd4MBNIGIdv3ZQ9uQQSQkM8ul9uCYhrHJ0CCYO8pigkrOXZ5hdQNkxve19e/zu0Ux+lc1EHUEcJtQXNuLmEWyuPmEivFkZXM6ggkeWioAV9fhJ5AiTJjrSxH7j7CCm3Z0bOkauqUiLywQ== 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=cd/A/3jLbbg9kcV3eXyvggAx4SbOy+RcrrhsS8KQopk=; b=PDy8DNsSUf3MJq/kRlAtx7j+KXk7ni2pM6d3jjFVBQ/iWBTBHUutBQT0+OE2Ea0ksm1AobwPIqooHuWuj/xJ0KM4wMJN4rZJOtSGhyLNtSO57Dp1NQL1FQs/ziqBMSdZ26LhIlHvwDssve+eVzSLNOwNsm5nuCTW+Ns2jAB6t08= Received: from AS9PR04CA0092.eurprd04.prod.outlook.com (2603:10a6:20b:50e::6) by AM9P190MB1298.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:26e::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.20; Thu, 11 Jul 2024 12:07:51 +0000 Received: from AMS0EPF0000019F.eurprd05.prod.outlook.com (2603:10a6:20b:50e:cafe::6a) by AS9PR04CA0092.outlook.office365.com (2603:10a6:20b:50e::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.22 via Frontend Transport; Thu, 11 Jul 2024 12:07:51 +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 AMS0EPF0000019F.mail.protection.outlook.com (10.167.16.251) with Microsoft SMTP Server id 15.20.7762.17 via Frontend Transport; Thu, 11 Jul 2024 12:07:51 +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 Subject: [PATCH v6 07/21] net/ntnic: add core platform structures Date: Thu, 11 Jul 2024 14:07:18 +0200 Message-ID: <20240711120737.698176-7-sil-plv@napatech.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240711120737.698176-1-sil-plv@napatech.com> References: <20240530144929.4127931-1-sil-plv@napatech.com> <20240711120737.698176-1-sil-plv@napatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS0EPF0000019F:EE_|AM9P190MB1298:EE_ Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: 1776f8b9-958f-4bbe-491a-08dca1a216af X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700013|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?tw1BDOpwQkpbGyKMx2LgqZy7eyDBml+GMDyVurW4t25HDV3qRky0oymGpANc?= =?us-ascii?Q?Vo9tj5fPzHfyurChtW5vMNZd12X8h25V9T4bmkn7lejLTlVYRT+qpRw5eW2z?= =?us-ascii?Q?qfzF+COPzViovG6wAcLJvL7iYOs59Wd82OpAqw1oAc+BiHZA7OO7RfrkVkKb?= =?us-ascii?Q?5km2WxZihVbKhXFZFxt1dOFDhH+AWVz4QrlAYDGQENPtaF4Rb20/VxOLcP5g?= =?us-ascii?Q?0p3KY++FR2+Q47UkOJiNANU62XN+fQc7E6ENfIn5GJL2p6KISgmdZa6vK1fZ?= =?us-ascii?Q?vR5UYKOKxPtAJGoabzSpdKWsSV170+FYTXuErrd46u0aW453i18ojjXbp8eE?= =?us-ascii?Q?wDEblRZRPQYbacsJ3PCvWNqNKUvN8XvGQduKAYBLuvd96dnRWT7LRl65Ge3n?= =?us-ascii?Q?Bsgk4aJ7uUI7J8a66gMXDTz/5F5ffLIxLZDo2afDx9DiawYJoXsrHjeqTb+o?= =?us-ascii?Q?Vq86Oj8L8koqXI7lUmIqqBX+j5uzTomfz2uiKizWu3zRZiVglW0kppdcILMU?= =?us-ascii?Q?mdxeX4uY8PWp4RjqsARbqs/oFpHwUMlp3De2L5k8jqXtxVSrjoBWXTL7KB8m?= =?us-ascii?Q?1UbKBSpiGDdSo/Al8qTJRV1WayFeff128w4GhUguZOSKA1N4MMIp2HvmaYGU?= =?us-ascii?Q?ohq8HddobTMpYsO9XmgYNo6Mfci2BQb1WNxrworvtl72PYB/oEPBgmyB6q5b?= =?us-ascii?Q?kH9JhVb3c2TFINGGl+rAt3+nVOn2/J0RJmC/fQLdhpEBtGJx4ckC/rjPVfau?= =?us-ascii?Q?Lvd5/E5d+Pklu6EEMSuf1HuN9NTLBXNq//qFjbrVAj95PyGRP9ig6xPuipoq?= =?us-ascii?Q?BY5+APbPCMa4PMfb03vwQ6BpA80Ifq9/1PMqFRimllXTRklnG8mBGgktW9ci?= =?us-ascii?Q?5J7VFypqbR0LldaDEer3SlWWz7IqzMptsmSeT6BHvgJWOD7ftW6lCWYdB5e8?= =?us-ascii?Q?pQjiN5pr1rMj0/P6vziXfx02yCFgSyN4QRv+gkQgUsZzldtV+Bwo/e0nODlt?= =?us-ascii?Q?27ZWATpI8C0GMqU6T/6ZM/SDxgit7yKT+y0pJSANCO56tjh8LWmAG+kdlHuA?= =?us-ascii?Q?SfSf5+4on4S4P01s+YmnRDvPW02tPVP0IP1/vJocKz3dRySpq2l7fBKrn2d2?= =?us-ascii?Q?bpUpGcbzk/wAx5471AWtKOdBX3rSOZK20HnDoyEejQf62Crwj+ZdvgaYgidi?= =?us-ascii?Q?OWT1/UXZJpqYRrZspJrcKRzenl3G99/auzlDc3NqVxlaHpDr8o5J19uRSQRe?= =?us-ascii?Q?DIAFXgteRL2uhxFR/LbulKLIBDa80Z0NXT2cesH++1Vc1zKKc9qcY/B/zvK1?= =?us-ascii?Q?wWDiHlH0McNC7PIaDZwgeOazlVQGTOX79Pm7zzDpQ4w98Nl3ODpx4Txdo9Iw?= =?us-ascii?Q?5MgS+jQAJD3aAhVs3vz2evJ8jI22H6vQ2NZ7uBXN7R0im+dNmcL7ruHDBakA?= =?us-ascii?Q?VKHP/iAkk2sHjzLAn4Zw3lSQ/EicTfBJ?= 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)(36860700013)(1800799024)(376014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: SMfxhfV9fE1ZAfcop1WLjqJYcCyuoUuTcumspo5tfcDNxe//Vncj3zy7PARGOgK1xpwWVpY5ngaCdPaB4f76aDqI4uJTu6J46dazABlnfoKvYa5uHZKBZAk+6fqLrYpXMrJCEU/gmH1pNUfykZusOFaLDrVGwMcqDhoIx0ecQ0L18UkyZTx6VxZe15/rf3rjsnKDk19/IcLeapGXUcMWuDFzdenkG94BF3iy8B1w0eEIM4ioFsWktFIRwr5Jql7SoRI18l1opQuj0URqxFVEnHPjXgpSe65pvq6+erlW284UQvP/fs/Mj5xGNQDDSt4enRGSuSx3tpvsd/W3Y3FDuT5j8WSNmlkRr9vOIfXK+Zm/pJcw9hJbGGWXh1wHQxhaGc3VM/tcy61HtnQWbAouLQNPB6s7EaHe6PdOmjx3/VOVWAKi0orS45YeftFkdfuEkpq0q91HltdqtEwldPHXK29vJ1F1igor9ZzUFZmfye/lgLp8x5qNCcIsfg80cWoQDw8xQGU+bidg4FGxTT0nJbLrnGSubTt8dHV/LPtqUqpT0B+Wh2Jbs/n7l/5sauB9EzKG1BUcj0yrFBDHgr00fxVawy11ZqJHNSzzcQpeEviLN8R1PKIZCEDZmwHO+JfdGsHvHl1AdhDGtIj3rF+qH/sBHfCAInKUnDo6wO9mtdA= X-OriginatorOrg: napatech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jul 2024 12:07:51.5721 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1776f8b9-958f-4bbe-491a-08dca1a216af 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: AMS0EPF0000019F.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9P190MB1298 X-BESS-ID: 1720699673-310726-12661-23592-1 X-BESS-VER: 2019.1_20240702.1505 X-BESS-Apparent-Source-IP: 104.47.30.108 X-BESS-Parts: H4sIAAAAAAACA4uuVkqtKFGyUioBkjpK+cVKViYWpqZAVgZQ0DLRxMTCMCXZ3N gyzTjNJNk02djE1CjFzCTRwsjU1MxMqTYWAPtmMjFBAAAA X-BESS-Outbound-Spam-Score: 0.50 X-BESS-Outbound-Spam-Report: Code version 3.2, rules version 3.2.2.257551 [from cloudscan11-141.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 Adds many of the high level structures needed by the ntnic FPGA modules and adapter control. This is considered the first part of the skeleton of ntnic FPGA support Signed-off-by: Serhii Iliushyk --- drivers/net/ntnic/include/ntos_drv.h | 2 + drivers/net/ntnic/meson.build | 2 + drivers/net/ntnic/nthw/nthw_drv.h | 88 ++++++++++++++++++++++ drivers/net/ntnic/nthw/nthw_platform.c | 14 ++++ drivers/net/ntnic/nthw/nthw_platform_drv.h | 21 ++++++ 5 files changed, 127 insertions(+) create mode 100644 drivers/net/ntnic/nthw/nthw_drv.h create mode 100644 drivers/net/ntnic/nthw/nthw_platform.c create mode 100644 drivers/net/ntnic/nthw/nthw_platform_drv.h diff --git a/drivers/net/ntnic/include/ntos_drv.h b/drivers/net/ntnic/include/ntos_drv.h index fa12d8f328..e3d8ffb91c 100644 --- a/drivers/net/ntnic/include/ntos_drv.h +++ b/drivers/net/ntnic/include/ntos_drv.h @@ -13,6 +13,8 @@ #include +#include "nthw_drv.h" + #define NUM_MAC_ADDRS_PER_PORT (16U) #define NUM_MULTICAST_ADDRS_PER_PORT (16U) diff --git a/drivers/net/ntnic/meson.build b/drivers/net/ntnic/meson.build index f372b0c3cf..73c4188da0 100644 --- a/drivers/net/ntnic/meson.build +++ b/drivers/net/ntnic/meson.build @@ -13,10 +13,12 @@ includes = [ include_directories('include'), include_directories('ntlog'), include_directories('ntutil'), + include_directories('nthw'), ] # all sources sources = files( + 'nthw/nthw_platform.c', 'ntlog/ntlog.c', 'ntutil/nt_util.c', 'ntnic_vfio.c', diff --git a/drivers/net/ntnic/nthw/nthw_drv.h b/drivers/net/ntnic/nthw/nthw_drv.h new file mode 100644 index 0000000000..0b89a5c5a0 --- /dev/null +++ b/drivers/net/ntnic/nthw/nthw_drv.h @@ -0,0 +1,88 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2023 Napatech A/S + */ + +#ifndef __NTHW_DRV_H__ +#define __NTHW_DRV_H__ + +#include +#include "nthw_platform_drv.h" + +typedef enum nt_meta_port_type_e { + PORT_TYPE_PHYSICAL, + PORT_TYPE_VIRTUAL, + PORT_TYPE_OVERRIDE, +} nt_meta_port_type_t; + +enum fpga_info_profile { + FPGA_INFO_PROFILE_UNKNOWN = 0, + FPGA_INFO_PROFILE_VSWITCH = 1, + FPGA_INFO_PROFILE_INLINE = 2, + FPGA_INFO_PROFILE_CAPTURE = 3, +}; + +typedef struct mcu_info_s { + int mn_mcu_type; + int mn_mcu_dram_size; +} mcu_info_t; + +typedef struct nthw_hw_info_s { + /* From FW */ + int hw_id; + int hw_id_emulated; + char hw_plat_id_str[32]; + + struct vpd_info_s { + int mn_mac_addr_count; + uint64_t mn_mac_addr_value; + uint8_t ma_mac_addr_octets[6]; + } vpd_info; +} nthw_hw_info_t; + +typedef struct fpga_info_s { + uint64_t n_fpga_ident; + + int n_fpga_type_id; + int n_fpga_prod_id; + int n_fpga_ver_id; + int n_fpga_rev_id; + + int n_fpga_build_time; + + int n_fpga_debug_mode; + + int n_phy_ports; + int n_phy_quads; + int n_rx_ports; + int n_tx_ports; + int n_vf_offset; + + enum fpga_info_profile profile; + + struct nthw_fpga_s *mp_fpga; + + struct nthw_rac *mp_nthw_rac; + struct nthw_hif *mp_nthw_hif; + struct nthw_pcie3 *mp_nthw_pcie3; + struct nthw_tsm *mp_nthw_tsm; + + uint8_t *bar0_addr; /* Needed for register read/write */ + size_t bar0_size; + + int adapter_no; /* Needed for nthw_rac DMA array indexing */ + uint32_t pciident; /* Needed for nthw_rac DMA memzone_reserve */ + int numa_node; /* Needed for nthw_rac DMA memzone_reserve */ + + char *mp_adapter_id_str;/* Pointer to string literal used in nthw log messages */ + + struct mcu_info_s mcu_info; + + struct nthw_hw_info_s nthw_hw_info; + + nthw_adapter_id_t n_nthw_adapter_id; + +} fpga_info_t; + + +#endif /* __NTHW_DRV_H__ */ diff --git a/drivers/net/ntnic/nthw/nthw_platform.c b/drivers/net/ntnic/nthw/nthw_platform.c new file mode 100644 index 0000000000..181330dd37 --- /dev/null +++ b/drivers/net/ntnic/nthw/nthw_platform.c @@ -0,0 +1,14 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2023 Napatech A/S + */ + +#include "nthw_platform_drv.h" + +nthw_adapter_id_t nthw_platform_get_nthw_adapter_id(const uint16_t n_pci_device_id) +{ + switch (n_pci_device_id) { + default: + return NT_HW_ADAPTER_ID_UNKNOWN; + } +} diff --git a/drivers/net/ntnic/nthw/nthw_platform_drv.h b/drivers/net/ntnic/nthw/nthw_platform_drv.h new file mode 100644 index 0000000000..ab26d8149a --- /dev/null +++ b/drivers/net/ntnic/nthw/nthw_platform_drv.h @@ -0,0 +1,21 @@ +/* + * SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2023 Napatech A/S + */ + +#ifndef __NTHW_PLATFORM_DRV_H__ +#define __NTHW_PLATFORM_DRV_H__ + +#include + +#define NT_HW_PCI_VENDOR_ID (0x18f4) + +enum nthw_adapter_id_e { + NT_HW_ADAPTER_ID_UNKNOWN = 0, +}; + +typedef enum nthw_adapter_id_e nthw_adapter_id_t; + +nthw_adapter_id_t nthw_platform_get_nthw_adapter_id(const uint16_t n_pci_device_id); + +#endif /* __NTHW_PLATFORM_DRV_H__ */ -- 2.45.0