CN118069568A - External device topology configuration method, data processor, device and program product - Google Patents

External device topology configuration method, data processor, device and program product Download PDF

Info

Publication number
CN118069568A
CN118069568A CN202410468141.XA CN202410468141A CN118069568A CN 118069568 A CN118069568 A CN 118069568A CN 202410468141 A CN202410468141 A CN 202410468141A CN 118069568 A CN118069568 A CN 118069568A
Authority
CN
China
Prior art keywords
topology
data processor
external device
topology configuration
configuration request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202410468141.XA
Other languages
Chinese (zh)
Other versions
CN118069568B (en
Inventor
刘静涛
陈安庆
刘玉雪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yunbao Chuangxin Nanjing Intelligent Technology Co ltd
Shenzhen Yunbao Intelligent Co ltd
Original Assignee
Yunbao Chuangxin Nanjing Intelligent Technology Co ltd
Shenzhen Yunbao Intelligent Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yunbao Chuangxin Nanjing Intelligent Technology Co ltd, Shenzhen Yunbao Intelligent Co ltd filed Critical Yunbao Chuangxin Nanjing Intelligent Technology Co ltd
Priority to CN202410468141.XA priority Critical patent/CN118069568B/en
Publication of CN118069568A publication Critical patent/CN118069568A/en
Application granted granted Critical
Publication of CN118069568B publication Critical patent/CN118069568B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4004Coupling between buses
    • G06F13/4022Coupling between buses using switching circuits, e.g. switching matrix, connection or expansion network
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0026PCI express

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Computer Hardware Design (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请涉及一种外部设备拓扑配置方法、数据处理器、计算机设备、计算机程序产品。该方法包括:接收拓扑配置请求;根据拓扑配置请求生成拓扑配置文件;根据拓扑配置文件,生成多个设备标识、以及设备标识对应的资源分配信息;根据设备标识和资源分配信息配置硬件资源,得到相应的外部设备拓扑。采用本方法能够动态地基于拓扑配置请求自动配置外部设备拓扑,提升数据处理器的适配性,满足实际应用环境需求。能够通过拓扑配置请求调整设备数量或调整资源的分配情况,保证了数据处理器及装载有数据处理器的设备的可扩展性。通过自动化地配置方式,能够提升外部设备拓扑的配置效率。

The present application relates to a method for configuring the topology of an external device, a data processor, a computer device, and a computer program product. The method includes: receiving a topology configuration request; generating a topology configuration file according to the topology configuration request; generating multiple device identifiers and resource allocation information corresponding to the device identifiers according to the topology configuration file; configuring hardware resources according to the device identifiers and the resource allocation information to obtain the corresponding external device topology. This method can be used to automatically configure the external device topology based on the topology configuration request dynamically, improve the adaptability of the data processor, and meet the needs of the actual application environment. The number of devices or the allocation of resources can be adjusted through the topology configuration request, ensuring the scalability of the data processor and the device equipped with the data processor. Through the automated configuration method, the configuration efficiency of the external device topology can be improved.

Description

外部设备拓扑配置方法、数据处理器、设备和程序产品External device topology configuration method, data processor, device and program product

技术领域Technical Field

本申请涉及数据处理器技术领域,特别是涉及一种外部设备拓扑配置方法、数据处理器、计算机设备、计算机程序产品。The present application relates to the technical field of data processors, and in particular to an external device topology configuration method, a data processor, a computer device, and a computer program product.

背景技术Background technique

随着云计算、大数据技术的发展,海量数据处理和海量数据计算成为一个极为重要的问题。为了卸载CPU(Central Processing Unit,中央处理器)的压力,DPU(DataProcessing Unit,数据处理器)应运而生。目前不论是基于FPGA(Field ProgrammableGate Array,现场可编程逻辑门阵列)还是ASIC(Application Specific IntegratedCircuit,专用集成电路)卡实现的DPU,均能提供网络功能和存储功能。目前的系统框架的核心是PCIE(Peripheral Component Interconnect Express)设备的管理和模拟,目前的DPU网卡,只能实现固定的拓扑,由于HOST(主机)侧服务器BIOS(Basic Input OutputSystem,基本输入输出系统)上PCIE BUS(PCIE总线)分配的限制,导致DPU网卡的适配性较差。With the development of cloud computing and big data technology, massive data processing and massive data calculation have become an extremely important issue. In order to unload the pressure of the CPU (Central Processing Unit), DPU (Data Processing Unit) came into being. At present, whether it is based on FPGA (Field Programmable Gate Array) or ASIC (Application Specific Integrated Circuit) card, DPU can provide network functions and storage functions. The core of the current system framework is the management and simulation of PCIE (Peripheral Component Interconnect Express) devices. The current DPU network card can only realize fixed topology. Due to the limitation of PCIE BUS (PCIE bus) allocation on the server BIOS (Basic Input Output System) on the HOST side, the adaptability of DPU network card is poor.

发明内容Summary of the invention

基于此,有必要针对上述技术问题,提供一种外部设备拓扑配置方法、数据处理器、计算机设备、计算机程序产品,能够动态地基于拓扑配置请求自动配置外部设备拓扑,提升数据处理器的适配性。Based on this, it is necessary to provide an external device topology configuration method, a data processor, a computer device, and a computer program product to address the above technical problems, which can automatically configure the external device topology based on the topology configuration request dynamically and improve the adaptability of the data processor.

第一方面,本申请提供了一种外部设备拓扑配置方法。所述方法包括:In a first aspect, the present application provides a method for configuring external device topology. The method comprises:

接收拓扑配置请求;receiving a topology configuration request;

根据所述拓扑配置请求生成拓扑配置文件;Generate a topology configuration file according to the topology configuration request;

根据所述拓扑配置文件,生成多个设备标识、以及所述设备标识对应的资源分配信息;Generate multiple device identifiers and resource allocation information corresponding to the device identifiers according to the topology configuration file;

根据所述设备标识和所述资源分配信息配置硬件资源,得到相应的外部设备拓扑。Hardware resources are configured according to the device identification and the resource allocation information to obtain a corresponding external device topology.

在其中一个实施例中,所述方法还包括:In one embodiment, the method further comprises:

截获包含有外部设备标识符的事务层数据包,所述外部设备标识符是装载有所述数据处理器的设备在对PCIE总线上连接的外部设备进行扫描时所获取到的;intercepting a transaction layer data packet containing an external device identifier, wherein the external device identifier is obtained when a device equipped with the data processor scans an external device connected to a PCIE bus;

将所述外部设备标识符与生成的设备标识进行绑定,得到映射信息;Binding the external device identifier with the generated device identifier to obtain mapping information;

根据所述映射信息对所述硬件资源进行更新。The hardware resources are updated according to the mapping information.

在其中一个实施例中,所述根据所述拓扑配置请求生成拓扑配置文件,包括:In one embodiment, generating a topology configuration file according to the topology configuration request includes:

在预设拓扑资源库中存在拓扑模型与所述拓扑配置请求匹配的情况下,根据匹配的拓扑模型,生成拓扑配置文件。In the case that there is a topology model in the preset topology resource library that matches the topology configuration request, a topology configuration file is generated according to the matched topology model.

在其中一个实施例中,所述方法还包括:In one embodiment, the method further comprises:

在预设拓扑资源库中不存在拓扑模型与所述拓扑配置请求匹配的情况下,基于所述数据处理器的第一性能信息、装载有所述数据处理器的设备的第二性能信息以及所述拓扑配置请求进行分析,获得目标拓扑结构;If there is no topology model matching the topology configuration request in the preset topology resource library, analyzing based on the first performance information of the data processor, the second performance information of the device equipped with the data processor, and the topology configuration request to obtain a target topology structure;

根据所述目标拓扑结构生成拓扑配置文件。A topology configuration file is generated according to the target topology structure.

在其中一个实施例中,所述基于所述数据处理器的第一性能信息、装载有所述数据处理器的设备的第二性能信息以及所述拓扑配置请求进行分析,获得目标拓扑结构,包括:In one embodiment, the obtaining of the target topology structure by analyzing based on the first performance information of the data processor, the second performance information of the device equipped with the data processor, and the topology configuration request includes:

在根据所述第一性能信息确定所述拓扑配置请求未超出第一资源限制、且根据所述第二性能信息确定所述拓扑配置请求未超出第二资源限制的情况下,根据所述拓扑配置请求生成目标拓扑结构。When it is determined according to the first performance information that the topology configuration request does not exceed the first resource limit, and when it is determined according to the second performance information that the topology configuration request does not exceed the second resource limit, a target topology structure is generated according to the topology configuration request.

在其中一个实施例中,所述硬件资源包括寄存器资源、IO资源或者地址路由资源中的至少一项。In one of the embodiments, the hardware resources include at least one of register resources, IO resources or address routing resources.

在其中一个实施例中,所述截获包含有外部设备标识符的事务层数据包之后,所述方法还包括:In one embodiment, after intercepting the transaction layer data packet including the external device identifier, the method further comprises:

在基于所述地址路由资源确定所述事务层数据包用于访问配置空间的情况下,执行将所述外部设备标识符与生成的设备标识进行绑定,得到映射信息的步骤;In the case where it is determined based on the address routing resource that the transaction layer data packet is used to access the configuration space, performing a step of binding the external device identifier with the generated device identification to obtain mapping information;

在基于所述地址路由资源确定所述事务层数据包用于访问门铃地址的情况下,将装载有所述数据处理器的设备上所述事务层数据包相应的数据,搬移至目标IO队列中;所述目标IO队列为所述外部设备标识符相应的IO资源。When it is determined based on the address routing resource that the transaction layer data packet is used to access the doorbell address, data corresponding to the transaction layer data packet on the device equipped with the data processor is moved to a target IO queue; the target IO queue is an IO resource corresponding to the external device identifier.

第二方面,本申请还提供了一种数据处理器。所述数据处理器包括:In a second aspect, the present application further provides a data processor. The data processor comprises:

调度中心模块,用于接收拓扑配置请求;The scheduling center module is used to receive topology configuration requests;

拓扑生成模块,用于根据所述拓扑配置请求生成拓扑配置文件;A topology generation module, used to generate a topology configuration file according to the topology configuration request;

固件实现模块,用于根据所述拓扑配置文件,生成多个设备标识、以及所述设备标识对应的资源分配信息;根据所述设备标识和所述资源分配信息配置硬件资源,得到相应的外部设备拓扑。The firmware implementation module is used to generate multiple device identifiers and resource allocation information corresponding to the device identifiers according to the topology configuration file; configure hardware resources according to the device identifiers and the resource allocation information to obtain corresponding external device topology.

在其中一个实施例中,所述数据处理器还包括硬件实现模块;In one of the embodiments, the data processor further includes a hardware implementation module;

所述硬件实现模块,用于截获包含有外部设备标识符的事务层数据包,将所述事务层数据包转发至所述固件实现模块,所述外部设备标识符是装载有所述数据处理器的设备在对PCIE总线上连接的外部设备进行扫描时所获取到的;The hardware implementation module is used to intercept a transaction layer data packet containing an external device identifier, and forward the transaction layer data packet to the firmware implementation module, wherein the external device identifier is obtained when the device equipped with the data processor scans an external device connected to the PCIE bus;

所述固件实现模块,还用于将所述外部设备标识符与生成的设备标识进行绑定,得到映射信息;根据所述映射信息对所述硬件资源进行更新。The firmware implementation module is further used to bind the external device identifier with the generated device identification to obtain mapping information; and update the hardware resources according to the mapping information.

在其中一个实施例中,所述拓扑生成模块,具体用于在预设拓扑资源库中存在拓扑模型与所述拓扑配置请求匹配的情况下,根据匹配的拓扑模型,生成拓扑配置文件。In one of the embodiments, the topology generation module is specifically configured to generate a topology configuration file according to the matched topology model when there is a topology model in a preset topology resource library that matches the topology configuration request.

在其中一个实施例中,所述拓扑生成模块,具体用于在预设拓扑资源库中不存在拓扑模型与所述拓扑配置请求匹配的情况下,基于所述数据处理器的第一性能信息、装载有所述数据处理器的设备的第二性能信息以及所述拓扑配置请求进行分析,获得目标拓扑结构;根据所述目标拓扑结构生成拓扑配置文件。In one of the embodiments, the topology generation module is specifically used to obtain a target topology structure by analyzing based on first performance information of the data processor, second performance information of a device equipped with the data processor, and the topology configuration request when there is no topology model matching the topology configuration request in a preset topology resource library; and generate a topology configuration file according to the target topology structure.

在其中一个实施例中,所述拓扑生成模块,具体用于在根据所述第一性能信息确定所述拓扑配置请求未超出第一资源限制、且根据所述第二性能信息确定所述拓扑配置请求未超出第二资源限制的情况下,根据所述拓扑配置请求生成目标拓扑结构。In one of the embodiments, the topology generation module is specifically used to generate a target topology structure according to the topology configuration request when it is determined according to the first performance information that the topology configuration request does not exceed the first resource limit and when it is determined according to the second performance information that the topology configuration request does not exceed the second resource limit.

在其中一个实施例中,所述硬件资源包括寄存器资源、IO资源或者地址路由资源中的至少一项。In one of the embodiments, the hardware resources include at least one of register resources, IO resources or address routing resources.

在其中一个实施例中,所述硬件实现模块,具体用于在基于所述地址路由资源确定所述事务层数据包用于访问配置空间的情况下,将所述事务层数据包转发至所述固件实现模块;在基于所述地址路由资源确定所述事务层数据包用于访问门铃地址的情况下,将装载有所述数据处理器的设备上所述事务层数据包相应的数据,搬移至目标IO队列中;所述目标IO队列为所述外部设备标识符相应的IO资源。In one of the embodiments, the hardware implementation module is specifically used to forward the transaction layer data packet to the firmware implementation module when it is determined based on the address routing resources that the transaction layer data packet is used to access the configuration space; when it is determined based on the address routing resources that the transaction layer data packet is used to access the doorbell address, move the data corresponding to the transaction layer data packet on the device equipped with the data processor to a target IO queue; the target IO queue is the IO resource corresponding to the external device identifier.

第三方面,本申请还提供了一种计算机设备。所述计算机设备包括如上所述的数据处理器。In a third aspect, the present application further provides a computer device, wherein the computer device comprises the data processor as described above.

第四方面,本申请还提供了一种计算机程序产品。所述计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现如上所述的外部设备拓扑配置方法的步骤。In a fourth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the external device topology configuration method described above are implemented.

上述外部设备拓扑配置方法、数据处理器、计算机设备、计算机程序产品,接收拓扑配置请求;根据拓扑配置请求生成拓扑配置文件;根据拓扑配置文件,生成多个设备标识、以及设备标识对应的资源分配信息;根据设备标识和资源分配信息配置硬件资源,得到相应的外部设备拓扑。通过上述方式,能够动态地基于拓扑配置请求自动配置外部设备拓扑,提升数据处理器的适配性,满足实际应用环境需求。能够通过拓扑配置请求调整设备数量或调整资源的分配情况,保证了数据处理器及装载有数据处理器的设备的可扩展性。通过自动化地配置方式,能够提升外部设备拓扑的配置效率。The above-mentioned external device topology configuration method, data processor, computer device, and computer program product receive a topology configuration request; generate a topology configuration file according to the topology configuration request; generate multiple device identifiers and resource allocation information corresponding to the device identifiers according to the topology configuration file; configure hardware resources according to the device identifiers and resource allocation information to obtain the corresponding external device topology. Through the above-mentioned method, the external device topology can be automatically configured based on the topology configuration request dynamically, the adaptability of the data processor can be improved, and the requirements of the actual application environment can be met. The number of devices or the allocation of resources can be adjusted through the topology configuration request, which ensures the scalability of the data processor and the device equipped with the data processor. Through the automated configuration method, the configuration efficiency of the external device topology can be improved.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为一个实施例中外部设备拓扑配置方法的应用环境图;FIG1 is an application environment diagram of a method for configuring external device topology in one embodiment;

图2为一个实施例中外部设备拓扑配置方法的流程示意图;FIG2 is a schematic diagram of a flow chart of a method for configuring a topology of an external device in one embodiment;

图3为另一个实施例中外部设备拓扑配置方法的流程示意图;FIG3 is a schematic diagram of a flow chart of a method for configuring external device topology in another embodiment;

图4为一个实施例中拓扑校验的流程示意图;FIG4 is a schematic diagram of a topology verification process in one embodiment;

图5为一个实施例中数据处理器的结构框图;FIG5 is a block diagram of a data processor in one embodiment;

图6为另一个实施例中数据处理器的结构框图;FIG6 is a block diagram of a data processor in another embodiment;

图7为一个实施例中计算机设备的内部结构图。FIG. 7 is a diagram showing the internal structure of a computer device in one embodiment.

具体实施方式Detailed ways

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

本申请实施例提供的外部设备拓扑配置方法,可以应用于如图1所示的应用环境中。其中,数据处理系统包括数据处理器102、以及装载有数据处理器102的设备104,数据处理器102为了卸载设备104上的CPU的压力,使得设备104发挥最大的计算能力。以图1为例,数据处理器102管理有多个网络接口卡(Network Interface Card,NIC)和多个固态硬盘(Solid State Drives,SSD),这些外部设备通过PCIE总线(在实际应用中,还可以通过PCI总线)与设备104通信,形成外部设备拓扑(PCIE拓扑或PCI拓扑)。传统的DPU网卡只能实现固定的拓扑。而本实施例的数据处理器102能够动态地基于拓扑配置请求自动配置外部设备拓扑,适配应用于不同场景的设备104。其中,设备104可以但不限于是各种个人计算机、笔记本电脑、智能手机、服务器等。在一种实现方法中,设备104可以用独立的服务器或者是多个服务器组成的服务器集群来实现。The external device topology configuration method provided in the embodiment of the present application can be applied to the application environment shown in Figure 1. Among them, the data processing system includes a data processor 102, and a device 104 equipped with the data processor 102. The data processor 102 is used to unload the pressure of the CPU on the device 104 so that the device 104 can exert the maximum computing power. Taking Figure 1 as an example, the data processor 102 manages multiple network interface cards (Network Interface Card, NIC) and multiple solid-state drives (Solid State Drives, SSD). These external devices communicate with the device 104 through the PCIE bus (in actual applications, they can also communicate with the PCI bus) to form an external device topology (PCIE topology or PCI topology). Traditional DPU network cards can only achieve fixed topologies. The data processor 102 of this embodiment can dynamically automatically configure the external device topology based on the topology configuration request, and adapt to the device 104 applied to different scenarios. Among them, the device 104 can be, but is not limited to, various personal computers, laptops, smart phones, servers, etc. In one implementation method, the device 104 can be implemented with an independent server or a server cluster consisting of multiple servers.

在一个实施例中,如图2所示,提供了一种外部设备拓扑配置方法,以该方法应用于图1中的数据处理器102为例进行说明,包括以下步骤:In one embodiment, as shown in FIG. 2 , a method for configuring a topology of an external device is provided, and the method is applied to the data processor 102 in FIG. 1 as an example for description, including the following steps:

步骤202,接收拓扑配置请求。Step 202: Receive a topology configuration request.

其中,拓扑配置请求为针对外部设备拓扑提出的特定的设置需求或调整需求。在一种实现方式中,预设有配置接口,通过配置接口接收由用户输入的拓扑配置请求。拓扑配置请求包括设备数量、设备类型、资源需求以及设备特性等参数。外部设备是指挂载于PCIE总线(或PCI总线)上的PCIE设备(或PCI设备)。可以理解的是,本实施例中的外部设备拓扑配置方法除了应用于PCIE总线外,还可以应用于PCI总线以及其他类似的总线,本实施例对此不加以限制。Among them, the topology configuration request is a specific setting requirement or adjustment requirement for the external device topology. In one implementation, a configuration interface is preset, and the topology configuration request input by the user is received through the configuration interface. The topology configuration request includes parameters such as the number of devices, device type, resource requirements, and device characteristics. The external device refers to a PCIE device (or PCI device) mounted on a PCIE bus (or PCI bus). It can be understood that the external device topology configuration method in this embodiment can be applied to the PCI bus and other similar buses in addition to the PCIE bus, and this embodiment does not limit this.

在一种实现方式中,装载有数据处理器的设备提供图形化的配置管理工具,用户可以根据配置需求在配置管理工具运行的界面上选择外部设备拓扑的配置选项,基于界面操作生成拓扑配置请求,调用数据处理器的配置接口将拓扑配置请求传递至数据处理器。In one implementation, a device equipped with a data processor provides a graphical configuration management tool, and a user can select configuration options for external device topology on the interface where the configuration management tool runs according to configuration requirements, generate a topology configuration request based on the interface operation, and call the configuration interface of the data processor to pass the topology configuration request to the data processor.

可选地,针对拓扑配置请求以表单的形式进行记录,参照以下表1,表1中示出了一种拓扑配置请求的需求表单。其中,bar为Base Address Register,表示的是设备在系统地址空间中的基础地址。Sriov为Single Root I/O Virtualization,是一种基于硬件的虚拟化技术。VF为虚拟功能Virtual Function,是指在硬件设备中通过虚拟化技术将设备的功能进行分解,以便让多个虚拟机或容器能够独占部分设备资源。ARI是指AlternativeRouting-ID,即备选路由ID,是一种支持把Routing ID的部分或全部替换掉的机制。DP为Downstream Port,指的是位于PCIE拓扑结构中的下游设备或端口。UP为Upstream Port,指的是位于PCIE拓扑结构中的上游设备或端口。ACS为Access Control Services,是指访问控制服务。Optionally, the topology configuration request is recorded in the form of a form, refer to the following Table 1, which shows a requirement form for a topology configuration request. Among them, bar is Base Address Register, which represents the base address of the device in the system address space. Sriov is Single Root I/O Virtualization, which is a hardware-based virtualization technology. VF is Virtual Function, which refers to the decomposition of device functions in hardware devices through virtualization technology so that multiple virtual machines or containers can monopolize part of the device resources. ARI refers to Alternative Routing-ID, that is, alternative routing ID, which is a mechanism that supports partial or complete replacement of Routing ID. DP is Downstream Port, which refers to a downstream device or port in the PCIE topology structure. UP is Upstream Port, which refers to an upstream device or port in the PCIE topology structure. ACS is Access Control Services, which refers to access control services.

表1:Table 1:

步骤204,根据拓扑配置请求生成拓扑配置文件。Step 204: Generate a topology configuration file according to the topology configuration request.

其中,根据拓扑配置请求中携带的参数生成支持软件读取的拓扑配置文件。在一种实现方式中,预创建有配置模板,配置模板中包括配置选项和参数,根据拓扑配置请求对配置模板进行修改和补充,生成拓扑配置文件。A topology configuration file that supports software reading is generated according to the parameters carried in the topology configuration request. In one implementation, a configuration template is pre-created, the configuration template includes configuration options and parameters, and the configuration template is modified and supplemented according to the topology configuration request to generate a topology configuration file.

可选地,将拓扑配置请求中的配置参数进行整合,并对配置参数进行校验和合理性分析,根据校验后的配置参数生成拓扑配置文件。Optionally, the configuration parameters in the topology configuration request are integrated, and the configuration parameters are verified and analyzed for rationality, and a topology configuration file is generated based on the verified configuration parameters.

步骤206,根据拓扑配置文件,生成多个设备标识、以及设备标识对应的资源分配信息。Step 206: Generate multiple device identifiers and resource allocation information corresponding to the device identifiers according to the topology configuration file.

其中,解析拓扑配置文件,分析用户拓扑意图,模拟多个外部设备,为每个模拟的外部设备生成设备标识,并根据配置情况确定每个模拟的外部设备的资源分配信息。资源分配信息为针对每个模拟的外部设备所分配的具体资源详情,确保每个模拟的外部设备都能获得其正常运行所需的资源,并且这些资源的分配是合理、有效且不会相互冲突的。Among them, the topology configuration file is parsed, the user's topology intention is analyzed, multiple external devices are simulated, a device identifier is generated for each simulated external device, and the resource allocation information of each simulated external device is determined according to the configuration. The resource allocation information is the specific resource details allocated to each simulated external device, ensuring that each simulated external device can obtain the resources required for its normal operation, and the allocation of these resources is reasonable, effective and does not conflict with each other.

在一种实现方式中,资源分配信息至少包括配置空间信息以及IO(输入输出)资源信息,数据处理器上设置有控制面程序和数据面程序。其中,控制面程序负责对外部设备的配置空间进行模拟,数据面程序负责对外部设备的IO资源进行处理。In one implementation, the resource allocation information includes at least configuration space information and IO (input and output) resource information, and a control plane program and a data plane program are provided on the data processor, wherein the control plane program is responsible for simulating the configuration space of the external device, and the data plane program is responsible for processing the IO resources of the external device.

步骤208,根据设备标识和资源分配信息配置硬件资源,得到相应的外部设备拓扑。Step 208: configure hardware resources according to the device identification and resource allocation information to obtain a corresponding external device topology.

其中,根据设备标识和资源分配信息为每个模拟的外部设备分配硬件资源,使得硬件被抽象为多个PCIE设备挂载于PCIE总线上。通过软件定义硬件的方式,实现PCIE拓扑的动态配置。Among them, hardware resources are allocated to each simulated external device according to the device identification and resource allocation information, so that the hardware is abstracted into multiple PCIE devices mounted on the PCIE bus. Through the software-defined hardware method, the dynamic configuration of the PCIE topology is realized.

在一种实现方式中,数据处理器被配置为实现外部设备拓扑中的上游(UP)接口,根据配置需求挂载有至少一个PCIE交换机(switch),每个switch包括多个下游端口,switch的下游端口可以与EP(Endpoint,终端设备,也即PCIE设备)、桥、或其他switch的上游端口相连,具体的拓扑结构可以根据实际需求进行配置。In one implementation, the data processor is configured to implement an upstream (UP) interface in an external device topology, and at least one PCIE switch is mounted according to configuration requirements. Each switch includes multiple downstream ports. The downstream ports of the switch can be connected to EP (Endpoint, terminal device, also known as PCIE device), bridge, or upstream port of other switches. The specific topology can be configured according to actual needs.

可以理解的是,数据处理器在物理层面展现为一张网卡,通过本实施例的配置,将数据处理器装载于目标设备后,目标设备将数据处理器识别为PCIE总线上的多个PCIE设备,每个PCIE设备具备至少一个功能,通过配置硬件资源即可实现对PCIE拓扑结构的配置。It can be understood that the data processor appears as a network card at the physical level. Through the configuration of this embodiment, after the data processor is loaded on the target device, the target device identifies the data processor as multiple PCIE devices on the PCIE bus. Each PCIE device has at least one function. The configuration of the PCIE topology structure can be achieved by configuring hardware resources.

上述外部设备拓扑配置方法中,接收拓扑配置请求;根据拓扑配置请求生成拓扑配置文件;根据拓扑配置文件,生成多个设备标识、以及设备标识对应的资源分配信息;根据设备标识和资源分配信息配置硬件资源,得到相应的外部设备拓扑。通过上述方式,能够动态地基于拓扑配置请求自动配置外部设备拓扑,提升数据处理器的适配性,满足实际应用环境需求。能够通过拓扑配置请求调整设备数量或调整资源的分配情况,保证了数据处理器及装载有数据处理器的设备的可扩展性。通过自动化地配置方式,能够提升外部设备拓扑的配置效率。In the above external device topology configuration method, a topology configuration request is received; a topology configuration file is generated according to the topology configuration request; a plurality of device identifiers and resource allocation information corresponding to the device identifiers are generated according to the topology configuration file; hardware resources are configured according to the device identifiers and resource allocation information to obtain the corresponding external device topology. Through the above method, the external device topology can be automatically configured based on the topology configuration request dynamically, the adaptability of the data processor can be improved, and the requirements of the actual application environment can be met. The number of devices or the allocation of resources can be adjusted through the topology configuration request, which ensures the scalability of the data processor and the device equipped with the data processor. Through the automated configuration method, the configuration efficiency of the external device topology can be improved.

在一个实施例中,如图3所示,所述方法还包括:In one embodiment, as shown in FIG3 , the method further includes:

步骤302,截获包含有外部设备标识符的事务层数据包,外部设备标识符是装载有数据处理器的设备在对PCIE总线上连接的外部设备进行扫描时所获取到的。Step 302: intercepting a transaction layer data packet containing an external device identifier, where the external device identifier is obtained when a device equipped with a data processor scans an external device connected to a PCIE bus.

其中,装载有数据处理器的设备(本实施例以服务器为例)在上电后会发起PCIE设备的扫描,为扫描到的PCIE设备分配设备标识符。设备标识符为用于唯一标识和识别外部设备的字符串或代码,在PCIE总线上,设备标识符为BDF(Bus总线号,Device设备号,Function功能号)。Among them, the device equipped with a data processor (the server is used as an example in this embodiment) will initiate a scan of the PCIE device after power-on, and assign a device identifier to the scanned PCIE device. The device identifier is a string or code used to uniquely identify and recognize an external device. On the PCIE bus, the device identifier is BDF (Bus number, Device number, Function number).

在一种实现方式中,服务器通过数据处理器的硬件资源进行PCIE设备扫描,为每个模拟的外部设备分配外部设备标识符。In one implementation, the server performs PCIE device scanning through hardware resources of a data processor and allocates an external device identifier to each simulated external device.

在服务器利用挂载在PCIE总线上的外部设备进行数据处理时,由数据处理器截获得到事务层数据包(Transaction Layer Packet,TLP)。When the server uses an external device mounted on the PCIE bus to process data, a transaction layer packet (TLP) is intercepted by the data processor.

步骤304,将外部设备标识符与生成的设备标识进行绑定,得到映射信息。Step 304: Bind the external device identifier with the generated device identifier to obtain mapping information.

其中,由运行于数据处理器上的控制面程序,将由服务器分配的外部设备标识符与数据处理器模拟生成的设备标识进行绑定,得到映射信息(MAP)。The control plane program running on the data processor binds the external device identifier assigned by the server with the device identifier simulated and generated by the data processor to obtain mapping information (MAP).

步骤306,根据映射信息对硬件资源进行更新。Step 306: Update the hardware resources according to the mapping information.

其中,通过更新硬件资源上的映射信息,使得数据处理器模拟的外部设备能够基于该映射关系确定服务器侧的外部设备标识,保证数据处理器与服务器上设备标识的一致性,有利于服务器与PCIE设备之间的数据传递。Among them, by updating the mapping information on the hardware resources, the external device simulated by the data processor can determine the external device identification on the server side based on the mapping relationship, ensuring the consistency of the device identification on the data processor and the server, which is beneficial to data transmission between the server and the PCIE device.

本实施例中,将由服务器分配的外部设备标识符与数据处理器模拟生成的设备标识进行绑定,能够提升数据处理器与服务器之间的兼容性。In this embodiment, the external device identifier assigned by the server is bound to the device identifier simulated and generated by the data processor, which can improve the compatibility between the data processor and the server.

在一个实施例中,步骤206,包括:在预设拓扑资源库中存在拓扑模型与拓扑配置请求匹配的情况下,根据匹配的拓扑模型,生成拓扑配置文件。In one embodiment, step 206 includes: if there is a topology model in the preset topology resource library that matches the topology configuration request, generating a topology configuration file according to the matched topology model.

其中,数据处理器设置有预设拓扑资源库,预设拓扑资源库中存储有至少一个拓扑模型,将拓扑配置请求中携带的参数与每个拓扑模型进行比对,确定预设拓扑资源库中是否存在拓扑模型与拓扑配置请求相匹配。在一种实现方式中,预设拓扑资源库中存储有多个服务器类型对应的拓扑模型,根据采集的当前服务器类型,从预设拓扑资源库中获取与当前服务器类型对应的至少一个拓扑模型,将拓扑配置请求中携带的参数与获取到的每个拓扑模型进行比对,确定预设拓扑资源库中是否存在拓扑模型与拓扑配置请求相匹配。The data processor is provided with a preset topology resource library, in which at least one topology model is stored, and the parameters carried in the topology configuration request are compared with each topology model to determine whether there is a topology model in the preset topology resource library that matches the topology configuration request. In one implementation, the preset topology resource library stores topology models corresponding to multiple server types, and according to the collected current server type, at least one topology model corresponding to the current server type is obtained from the preset topology resource library, and the parameters carried in the topology configuration request are compared with each obtained topology model to determine whether there is a topology model in the preset topology resource library that matches the topology configuration request.

在一种实现方式中,解析该匹配的拓扑模型,提取出用于生成配置文件的必要信息,将提取到的信息对配置模板进行修改和补充,生成拓扑配置文件。In one implementation, the matched topology model is parsed to extract necessary information for generating a configuration file, and the configuration template is modified and supplemented with the extracted information to generate a topology configuration file.

在一个实施例中,所述方法还包括:在预设拓扑资源库中不存在拓扑模型与拓扑配置请求匹配的情况下,基于数据处理器的第一性能信息、装载有数据处理器的设备的第二性能信息以及拓扑配置请求进行分析,获得目标拓扑结构;根据目标拓扑结构生成拓扑配置文件。In one embodiment, the method also includes: when there is no topology model matching the topology configuration request in the preset topology resource library, analyzing based on the first performance information of the data processor, the second performance information of the device equipped with the data processor and the topology configuration request to obtain the target topology structure; generating a topology configuration file according to the target topology structure.

其中,第一性能信息至少包括数据处理器的能力(Capability),第二性能信息至少包括服务器(即装载有数据处理器的设备)的能力、可承载设备个数。The first performance information includes at least the capability of the data processor, and the second performance information includes at least the capability of the server (ie, the device equipped with the data processor) and the number of devices that can be supported.

数据处理器设置有采集程序,通过采集程序采集第二性能信息。在一种实现方式中,参照表2和表3,第二性能信息包括HOST BRIGE(主桥)个数、PCI domain(域)个数、固件类型、固件版本以及OS(操作系统),表3中示出了每一个主桥的详细情况。The data processor is provided with a collection program, and the second performance information is collected through the collection program. In one implementation, referring to Table 2 and Table 3, the second performance information includes the number of HOST BRIGEs, the number of PCI domains, the firmware type, the firmware version, and the OS (operating system). Table 3 shows the details of each host bridge.

表2:Table 2:

表3:table 3:

表2中UEFI/BIOS是指基于统一可扩展固件接口(Unified Extensible FirmwareInterface)的计算机基本输入输出系统(Basic Input/Output System);centos为Community Enterprise Operating System,是指社区企业操作系统。表3中Name是指主桥名称,Device-id是指设备标识;vendor-id是指供应商识别号;BUS是指总线;Cap是指能力(Capability);ACS为访问控制服务;ATS为地址转换服务。In Table 2, UEFI/BIOS refers to the computer basic input/output system (Basic Input/Output System) based on the Unified Extensible Firmware Interface (Unified Extensible Firmware Interface); centos is the Community Enterprise Operating System, which refers to the community enterprise operating system. In Table 3, Name refers to the main bridge name, Device-id refers to the device identifier; vendor-id refers to the vendor identification number; BUS refers to the bus; Cap refers to capability (Capability); ACS is the access control service; ATS is the address translation service.

其中,将数据处理器的性能信息与用户的需求进行匹配,并将服务器的性能信息与用户的需求进行匹配,保证生成的目标拓扑结构满足用户需求的同时,能够得到数据处理器性能以及服务器性能的支持。The performance information of the data processor is matched with the user's needs, and the performance information of the server is matched with the user's needs, to ensure that the generated target topology structure meets the user's needs while being supported by the data processor performance and the server performance.

在一种实现方式中,根据设备数量与第二性能信息确定拓扑分支,并在拓扑分支上生成与设备数量一致的拓扑节点,根据设备类型、资源需求以及设备特性为生成每个拓扑节点的属性,得到目标拓扑结构。In one implementation, a topology branch is determined based on the number of devices and the second performance information, and topology nodes consistent with the number of devices are generated on the topology branch. Attributes of each topology node are generated based on device type, resource requirements, and device characteristics to obtain a target topology structure.

在一种实现方式中,解析目标拓扑结构,提取出用于生成配置文件的必要信息,将提取到的信息对配置模板进行修改和补充,生成拓扑配置文件。In one implementation, the target topology structure is parsed to extract necessary information for generating a configuration file, and the configuration template is modified and supplemented with the extracted information to generate a topology configuration file.

在一个实施例中,基于数据处理器的第一性能信息、装载有数据处理器的设备的第二性能信息以及拓扑配置请求进行分析,获得目标拓扑结构,包括:在根据第一性能信息确定拓扑配置请求未超出第一资源限制、且根据第二性能信息确定拓扑配置请求未超出第二资源限制的情况下,根据拓扑配置请求生成目标拓扑结构。In one embodiment, a target topology structure is obtained based on analysis of first performance information of a data processor, second performance information of a device equipped with the data processor, and a topology configuration request, including: when it is determined according to the first performance information that the topology configuration request does not exceed the first resource limit, and when it is determined according to the second performance information that the topology configuration request does not exceed the second resource limit, generating the target topology structure according to the topology configuration request.

其中,第一资源限制是指数据处理器的资源限制,第二资源限制是指服务器的资源限制。具体地,将数据处理器的第一性能信息、服务器的第二性能信息和用户的需求进行整合和合理性校验,以确定拓扑配置请求是否超出第一资源限制,并确定拓扑配置请求是否超出第二资源限制。在一种实现方式中,预创建有配置模板,配置模板中包括配置选项和参数,在合理性校验通过后,根据拓扑配置请求对配置模板进行修改和补充,生成拓扑配置文件。The first resource limitation refers to the resource limitation of the data processor, and the second resource limitation refers to the resource limitation of the server. Specifically, the first performance information of the data processor, the second performance information of the server, and the user's needs are integrated and rationally checked to determine whether the topology configuration request exceeds the first resource limitation, and to determine whether the topology configuration request exceeds the second resource limitation. In one implementation, a configuration template is pre-created, and the configuration template includes configuration options and parameters. After the rationality check passes, the configuration template is modified and supplemented according to the topology configuration request to generate a topology configuration file.

在一种实现方式中,参照图4,分析过程具体包括信息整合、合理性校验、以及拓扑结构分析。其中,信息整合的步骤包括:统计拓扑配置请求中的设备总数量、BAR空间总大小、IO队列总需求、设备的CAP(即Capability,能力)特性,统计数据处理器的CAP,统计服务器可承载设备上限、服务器最大的CAP范围,其中,BAR空间是指寄存器区域。合理性校验的步骤包括:分别确定BAR空间总大小、IO队列总需求、设备的CAP是否超出数据处理器的CAP;若未超出,则确定设备总数量是否大于服务器可承载设备上限;若设备总数量未超出上限,则判断设备的CAP是否与服务器的CAP范围互斥;若CAP匹配,则进行拓扑结构分析。拓扑结构分析的步骤包括:判断设备总数量是否大于32、判断设备总数量是否小于255、判断设备是否支持sriov、判断设备是否支持ARI,在设备总数量大于32且小于255、设备支持sriov、支持ARI的情况下,确定单个总线(bus)满足要求;在设备总数量小于32的情况下,使用BDF中的Device(设备号)来标记各个模拟的外部设备;在设备总数量大于255的情况下,在拓扑结构中添加新的交换机(switch)。In one implementation, referring to FIG. 4 , the analysis process specifically includes information integration, rationality check, and topology analysis. The information integration step includes: counting the total number of devices in the topology configuration request, the total size of the BAR space, the total demand for IO queues, the CAP (i.e., Capability) characteristics of the device, counting the CAP of the data processor, counting the upper limit of the devices that the server can carry, and the maximum CAP range of the server, wherein the BAR space refers to the register area. The rationality check step includes: determining whether the total size of the BAR space, the total demand for IO queues, and the CAP of the device exceed the CAP of the data processor; if not, determining whether the total number of devices is greater than the upper limit of the devices that the server can carry; if the total number of devices does not exceed the upper limit, determining whether the CAP of the device is mutually exclusive with the CAP range of the server; if the CAP matches, performing topology analysis. The steps of topology analysis include: determining whether the total number of devices is greater than 32, determining whether the total number of devices is less than 255, determining whether the devices support sriov, and determining whether the devices support ARI. When the total number of devices is greater than 32 and less than 255, and the devices support sriov and ARI, determine whether a single bus meets the requirements; when the total number of devices is less than 32, use the Device (device number) in the BDF to mark each simulated external device; when the total number of devices is greater than 255, add a new switch to the topology.

通过本实施例的方式,能够充分利用数据处理器和服务器的资源,灵活地修改数据处理器模拟的外部设备的拓扑结构,在满足硬件限制的同时,满足用户的需求;能够规避因配置不合理导致的故障,提升了数据处理器和服务器的稳定性。Through the method of this embodiment, the resources of the data processor and the server can be fully utilized, and the topology of the external device simulated by the data processor can be flexibly modified to meet the needs of users while meeting hardware limitations; failures caused by unreasonable configuration can be avoided, and the stability of the data processor and the server is improved.

在一个实施例中,硬件资源包括寄存器资源、IO资源或者地址路由资源中的至少一项。In one embodiment, the hardware resources include at least one of register resources, IO resources, or address routing resources.

其中,寄存器资源用于存储模拟的外部设备的配置空间信息,IO资源是指模拟的外部设备的IO队列,地址路由资源用于标记与模拟的外部设备相关的路由或寻址机制。Among them, the register resource is used to store the configuration space information of the simulated external device, the IO resource refers to the IO queue of the simulated external device, and the address routing resource is used to mark the routing or addressing mechanism related to the simulated external device.

在一种实现方式中,数据处理器设置有数据面程序和控制面程序,由控制面程序接收拓扑配置文件,确定多个设备标识和每个设备标识的配置空间资源,配置数据处理器硬件中的寄存器,完成寄存器的配置和初始化。控制面程序基于拓扑配置文件确定IO队列的分配情况,通过消息队列通知数据面程序IO队列的分配情况,数据面程序分配固件与硬件之间的ring buffer(环形消息缓冲区),并在硬件的IO队列中分配资源。控制面程序接收数据面程序的初始化结果,将IO队列编号、设备编号建立MAP(映射)关系,配置到硬件的寄存器中。控制面程序还用于配置数据处理器硬件中的地址路由资源。In one implementation, the data processor is provided with a data plane program and a control plane program, and the control plane program receives a topology configuration file, determines multiple device identifiers and configuration space resources for each device identifier, configures registers in the data processor hardware, and completes the configuration and initialization of the registers. The control plane program determines the allocation of IO queues based on the topology configuration file, notifies the data plane program of the allocation of IO queues through a message queue, and the data plane program allocates a ring buffer (ring message buffer) between the firmware and the hardware, and allocates resources in the hardware's IO queue. The control plane program receives the initialization result of the data plane program, establishes a MAP (mapping) relationship between the IO queue number and the device number, and configures them in the hardware register. The control plane program is also used to configure the address routing resources in the data processor hardware.

在一个实施例中,步骤302之后,所述方法还包括:在基于地址路由资源确定事务层数据包用于访问配置空间的情况下,执行步骤304;在基于地址路由资源确定事务层数据包用于访问门铃地址的情况下,将装载有数据处理器的设备上事务层数据包相应的数据,搬移至目标IO队列中;目标IO队列为外部设备标识符相应的IO资源。In one embodiment, after step 302, the method further includes: executing step 304 when it is determined based on the address routing resources that the transaction layer data packet is used to access the configuration space; when it is determined based on the address routing resources that the transaction layer data packet is used to access the doorbell address, moving data corresponding to the transaction layer data packet on the device equipped with the data processor to a target IO queue; the target IO queue is the IO resource corresponding to the external device identifier.

其中,数据处理器通过地址路由资源确定事务层数据包用于访问配置空间还是门铃(Doorbell,DB)地址。对于访问配置空间的情况,由数据处理器调用控制面程序对事务层数据包进行处理。对于访问门铃地址的情况,由数据处理器调用预设控制器,将服务器上事务层数据包相应的数据,搬移至目标IO队列中,以待下一步处理。The data processor determines whether the transaction layer data packet is used to access the configuration space or the doorbell (DB) address through the address routing resource. In the case of accessing the configuration space, the data processor calls the control plane program to process the transaction layer data packet. In the case of accessing the doorbell address, the data processor calls the preset controller to move the corresponding data of the transaction layer data packet on the server to the target IO queue for the next step of processing.

在一种实现方式中,设置有TLP队列,数据处理器轮询(POLL)该TLP队列,接收发送至PCIE设备的消息,调用控制面程序进行处理,将处理结果封装为TLP消息,经由TLP队列发送给服务器。In one implementation, a TLP queue is provided, and a data processor polls (POLL) the TLP queue, receives a message sent to a PCIE device, calls a control plane program for processing, encapsulates the processing result into a TLP message, and sends the result to a server via the TLP queue.

通过本实施例的方式,能够实现配置空间的访问与门铃地址的访问的隔离,减少潜在的冲突和错误,提升了数据处理器和服务器的稳定性。Through the method of this embodiment, it is possible to isolate the access to the configuration space from the access to the doorbell address, reduce potential conflicts and errors, and improve the stability of the data processor and the server.

应该理解的是,虽然如上所述的各实施例所涉及的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,如上所述的各实施例所涉及的流程图中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

基于同样的发明构思,本申请实施例还提供了一种用于实现上述所涉及的外部设备拓扑配置方法的外部设备拓扑配置装置。该装置所提供的解决问题的实现方案与上述方法中所记载的实现方案相似,故下面所提供的一个或多个外部设备拓扑配置装置实施例中的具体限定可以参见上文中对于外部设备拓扑配置方法的限定,在此不再赘述。Based on the same inventive concept, the embodiment of the present application also provides an external device topology configuration device for implementing the external device topology configuration method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more external device topology configuration device embodiments provided below can refer to the limitations of the external device topology configuration method above, and will not be repeated here.

在一个实施例中,如图5所示,提供了一种数据处理器,包括:In one embodiment, as shown in FIG5 , a data processor is provided, including:

调度中心模块502,用于接收拓扑配置请求。The scheduling center module 502 is used to receive a topology configuration request.

拓扑生成模块504,用于根据拓扑配置请求生成拓扑配置文件。The topology generation module 504 is used to generate a topology configuration file according to a topology configuration request.

固件实现模块506,用于根据拓扑配置文件,生成多个设备标识、以及设备标识对应的资源分配信息;根据设备标识和资源分配信息配置硬件资源,得到相应的外部设备拓扑。The firmware implementation module 506 is used to generate multiple device identifiers and resource allocation information corresponding to the device identifiers according to the topology configuration file; configure hardware resources according to the device identifiers and resource allocation information to obtain corresponding external device topology.

上述数据处理器中,接收拓扑配置请求;根据拓扑配置请求生成拓扑配置文件;根据拓扑配置文件,生成多个设备标识、以及设备标识对应的资源分配信息;根据设备标识和资源分配信息配置硬件资源,得到相应的外部设备拓扑。通过上述方式,能够动态地基于拓扑配置请求自动配置外部设备拓扑,提升数据处理器的适配性,满足实际应用环境需求。能够通过拓扑配置请求调整设备数量或调整资源的分配情况,保证了数据处理器及装载有数据处理器的设备的可扩展性。通过自动化地配置方式,能够提升外部设备拓扑的配置效率。In the above data processor, a topology configuration request is received; a topology configuration file is generated according to the topology configuration request; a plurality of device identifiers and resource allocation information corresponding to the device identifiers are generated according to the topology configuration file; hardware resources are configured according to the device identifiers and resource allocation information to obtain the corresponding external device topology. Through the above method, the external device topology can be automatically configured based on the topology configuration request dynamically, thereby improving the adaptability of the data processor and meeting the requirements of the actual application environment. The number of devices or the allocation of resources can be adjusted through the topology configuration request, thereby ensuring the scalability of the data processor and the device equipped with the data processor. Through the automated configuration method, the configuration efficiency of the external device topology can be improved.

在一个实施例中,数据处理器还包括硬件实现模块;In one embodiment, the data processor further comprises a hardware implementation module;

硬件实现模块,用于截获包含有外部设备标识符的事务层数据包,将事务层数据包转发至固件实现模块506,外部设备标识符是装载有数据处理器的设备在对PCIE总线上连接的外部设备进行扫描时所获取到的;A hardware implementation module, used to intercept a transaction layer data packet containing an external device identifier, and forward the transaction layer data packet to the firmware implementation module 506, wherein the external device identifier is obtained when the device equipped with the data processor scans the external device connected to the PCIE bus;

固件实现模块506,还用于将外部设备标识符与生成的设备标识进行绑定,得到映射信息;根据映射信息对硬件资源进行更新。The firmware implementation module 506 is further used to bind the external device identifier with the generated device identifier to obtain mapping information; and update the hardware resources according to the mapping information.

在一个实施例中,拓扑生成模块504,具体用于在预设拓扑资源库中存在拓扑模型与拓扑配置请求匹配的情况下,根据匹配的拓扑模型,生成拓扑配置文件。In one embodiment, the topology generation module 504 is specifically configured to generate a topology configuration file according to the matched topology model when there is a topology model in the preset topology resource library that matches the topology configuration request.

在一个实施例中,拓扑生成模块504,具体用于在预设拓扑资源库中不存在拓扑模型与拓扑配置请求匹配的情况下,基于数据处理器的第一性能信息、装载有数据处理器的设备的第二性能信息以及拓扑配置请求进行分析,获得目标拓扑结构;根据目标拓扑结构生成拓扑配置文件。In one embodiment, the topology generation module 504 is specifically used to obtain a target topology structure by analyzing the first performance information of the data processor, the second performance information of the device equipped with the data processor, and the topology configuration request when there is no topology model matching the topology configuration request in the preset topology resource library; and generate a topology configuration file according to the target topology structure.

在一个实施例中,拓扑生成模块504,具体用于在根据第一性能信息确定拓扑配置请求未超出第一资源限制、且根据第二性能信息确定拓扑配置请求未超出第二资源限制的情况下,根据拓扑配置请求生成目标拓扑结构。In one embodiment, the topology generation module 504 is specifically used to generate a target topology structure according to the topology configuration request when it is determined according to the first performance information that the topology configuration request does not exceed the first resource limit and when it is determined according to the second performance information that the topology configuration request does not exceed the second resource limit.

在一个实施例中,硬件资源包括寄存器资源、IO资源或者地址路由资源中的至少一项。In one embodiment, the hardware resources include at least one of register resources, IO resources, or address routing resources.

在一个实施例中,硬件实现模块,具体用于在基于地址路由资源确定事务层数据包用于访问配置空间的情况下,将事务层数据包转发至固件实现模块506;在基于地址路由资源确定事务层数据包用于访问门铃地址的情况下,将装载有数据处理器的设备上事务层数据包相应的数据,搬移至目标IO队列中;目标IO队列为外部设备标识符相应的IO资源。In one embodiment, the hardware implementation module is specifically used to forward the transaction layer data packet to the firmware implementation module 506 when it is determined based on the address routing resources that the transaction layer data packet is used to access the configuration space; when it is determined based on the address routing resources that the transaction layer data packet is used to access the doorbell address, the corresponding data of the transaction layer data packet on the device equipped with the data processor is moved to the target IO queue; the target IO queue is the IO resource corresponding to the external device identifier.

在一种实现方式中,参照图6,图6中示出了另一种数据处理器的结构框图。装载有数据处理器的设备为服务器,数据处理器(以下简称DPU)包括调度中心模块、拓扑生成模块、固件实现模块以及硬件实现模块。其中:In one implementation, refer to FIG. 6 , which shows a block diagram of another data processor. The device equipped with the data processor is a server, and the data processor (hereinafter referred to as DPU) includes a scheduling center module, a topology generation module, a firmware implementation module, and a hardware implementation module. Among them:

1、调度中心模块包括用户管理、资源管理以及设备调度层。1. The dispatch center module includes user management, resource management and equipment dispatching layer.

用户管理负责接收用户的拓扑配置请求(包括有PCIE的拓扑需求),将用户的拓扑配置请求转发至拓扑生成模块;用户管理还可以负责接收用户针对拓扑目标的选择指令。资源管理模块负责对DPU的资源进行管理,可以为拓扑分析提供DPU的第一性能信息。设备调度层用于接收拓扑配置文件,发送给固件实现模块进行设备创建和外部设备拓扑配置。User management is responsible for receiving topology configuration requests from users (including topology requirements for PCIE) and forwarding them to the topology generation module. User management can also be responsible for receiving user selection instructions for topology targets. The resource management module is responsible for managing the resources of the DPU and can provide the first performance information of the DPU for topology analysis. The device scheduling layer is used to receive topology configuration files and send them to the firmware implementation module for device creation and external device topology configuration.

2、拓扑生成模块包括BIOS/UEFI采集模块、服务器信息采集模块、拓扑资源库、用户拓扑注入模块和用户拓扑分析模块。2. The topology generation module includes a BIOS/UEFI acquisition module, a server information acquisition module, a topology resource library, a user topology injection module, and a user topology analysis module.

BIOS/UEFI采集模块和服务器信息采集模块负责处理和分析服务器的PCI BUS资源的信息。可选地,利用DPU的云盘启动模式,拉起服务器一次,在测试云盘中通过信息采集Agent(代理程序)执行采集命令并输出到Server(服务器)中。例如,在Agent中执行采集脚本lspci -tv,查看当前服务器信息的采集,将采集的信息进行汇总归纳。The BIOS/UEFI acquisition module and the server information acquisition module are responsible for processing and analyzing the information of the server's PCI BUS resources. Optionally, use the cloud disk startup mode of the DPU to pull up the server once, execute the acquisition command through the information acquisition Agent in the test cloud disk, and output it to the Server. For example, execute the acquisition script lspci -tv in the Agent to view the current server information collection and summarize the collected information.

拓扑资源库存储有已适配的服务器类型支持的所有拓扑结构。可选地,拓扑生成模块将拓扑资源库中服务器支持的拓扑模型发送给调度中心,由调度中心反馈给用户进行下一步操作,用户可以首先从拓扑资源库中查询,如果存在满足需求的拓扑,则直接利用该拓扑生成拓扑配置文件;如果不存在,则利用用户拓扑注入和用户拓扑分析确定满足用户需求的拓扑结构。The topology resource library stores all topologies supported by the adapted server type. Optionally, the topology generation module sends the topology model supported by the server in the topology resource library to the dispatch center, which then feeds back to the user for the next step. The user can first query from the topology resource library. If there is a topology that meets the requirements, the topology configuration file is directly generated using the topology. If not, the topology injection and analysis are used to determine the topology that meets the user's requirements.

用户注入模块对拓扑配置请求进行整理;用户拓扑分析模块将用户需求进行合理性校验,并由拓扑生成模块确定满足用户需求的拓扑结构,生成拓扑配置文件发送给调度中心,由调度中心发送至固件实现模块进行下一步处理。The user injection module organizes the topology configuration requests; the user topology analysis module verifies the rationality of user requirements, and the topology generation module determines the topology structure that meets user requirements, generates a topology configuration file and sends it to the scheduling center, which then sends it to the firmware implementation module for further processing.

3、固件实现模块包括数据面单元、控制面单元和硬件接口HAL层(HardwareAbstraction Layer,硬件抽象层)。控制面单元包括寄存器管理模块、模拟模块、TLP编解码模块、以及消息接口层。数据面单元包括存储IO管理模块、网络IO管理模块、以及消息接口层。固件实现模块与硬件实现模块之间通过互联总线进行数据交互。3. The firmware implementation module includes a data plane unit, a control plane unit, and a hardware interface HAL layer (Hardware Abstraction Layer). The control plane unit includes a register management module, an analog module, a TLP encoding and decoding module, and a message interface layer. The data plane unit includes a storage IO management module, a network IO management module, and a message interface layer. The firmware implementation module and the hardware implementation module exchange data through an interconnect bus.

控制面单元用于接收拓扑配置文件,分析拓扑配置情况,确定多个设备标识和每个设备标识的配置空间资源,调用寄存器管理模块操作硬件接口HAL层,以配置DPU硬件中的寄存器,完成寄存器的配置和初始化。The control plane unit is used to receive the topology configuration file, analyze the topology configuration, determine multiple device identifiers and the configuration space resources of each device identifier, call the register management module to operate the hardware interface HAL layer to configure the registers in the DPU hardware, and complete the configuration and initialization of the registers.

控制面单元通过消息接口层通知数据面单元IO队列的分配情况,数据面单元的存储IO管理模块和网络IO管理模块基于接收到的信息,通过硬件接口HAL层在DPU硬件的IO队列中分配资源。The control plane unit notifies the data plane unit of the allocation of the IO queue through the message interface layer. Based on the received information, the storage IO management module and the network IO management module of the data plane unit allocate resources in the IO queue of the DPU hardware through the hardware interface HAL layer.

控制面单元接收数据面单元的初始化结果,将IO队列编号、设备编号建立MAP(映射)关系,配置到DPU硬件的寄存器中。The control plane unit receives the initialization result of the data plane unit, establishes a MAP (mapping) relationship between the IO queue number and the device number, and configures it in the register of the DPU hardware.

控制面单元通过硬件接口HAL层,配置DPU硬件中的地址路由模块。The control plane unit configures the address routing module in the DPU hardware through the hardware interface HAL layer.

TLP编解码模块用于调用硬件接口HAL层,接收DPU硬件上送的TLP消息并进行解码,将解码后的消息发送至模拟模块;TLP编解码模块还用于将本地消息组装成外部设备的TLP消息发送给DPU硬件。The TLP codec module is used to call the hardware interface HAL layer, receive and decode the TLP messages sent by the DPU hardware, and send the decoded messages to the simulation module; the TLP codec module is also used to assemble local messages into TLP messages of external devices and send them to the DPU hardware.

模拟模块用于为每个模拟的外部设备分配配置空间资源,解析TLP编解码模块发送的消息并进行本地PCIE设备(或PCI设备)的模拟,将处理结果传递给TLP编解码模块。采用这种方式,能够基于控制面单元配置外部设备拓扑结构,并模拟外部设备进行数据的处理。The simulation module is used to allocate configuration space resources for each simulated external device, parse the message sent by the TLP codec module, simulate the local PCIE device (or PCI device), and pass the processing result to the TLP codec module. In this way, the external device topology can be configured based on the control plane unit, and the external device can be simulated to process data.

4、硬件实现模块包括UP(上游)硬件实现层、寄存器、IO队列、TLP队列、地址路由模块、DMA(Direct Memory Access)控制器。硬件实现模块与服务器之间通过PCIE接口进行数据交互。4. The hardware implementation module includes the UP (upstream) hardware implementation layer, registers, IO queues, TLP queues, address routing modules, and DMA (Direct Memory Access) controllers. The hardware implementation module and the server exchange data through the PCIE interface.

服务器上电发起PCIE设备的扫描。UP硬件实现层截获TLP消息传递给地址路由模块。地址路由模块检查该TLP消息是对PCIE设备的配置空间访问,还是对PCIE设备的Doorbell(门铃)地址访问。The server initiates a scan of the PCIE device after power-on. The UP hardware implementation layer intercepts the TLP message and passes it to the address routing module. The address routing module checks whether the TLP message is an access to the configuration space of the PCIE device or an access to the Doorbell address of the PCIE device.

若为配置空间访问,地址路由模块调用DMA控制器将TLP消息发送至固件实现模块的硬件接口HAL层。DPU固件实现模块的TLP编解码模块不断地POLL设备的TLP队列,在确定有消息到来的情况下,将TLP消息送到控制面单元进行处理,控制面单元在处理后,将处理结果封装成TLP消息,添加到TLP队列。调用硬件接口HAL层的Doorbell接口,通知硬件。DPU硬件接收到通知,调用DMA控制器将TLP数据通过UP硬件实现层发送给服务器。通过这种方式,由固件实现模块的控制面程序模拟PCIE设备进行数据处理。在这一过程中,模拟模块将服务器为每一个设备分配的BDF和DPU固件实现模块上分配的设备编号进行绑定,并且将绑定后的MAP关系,更新到DPU硬件的寄存器中。If it is a configuration space access, the address routing module calls the DMA controller to send the TLP message to the hardware interface HAL layer of the firmware implementation module. The TLP codec module of the DPU firmware implementation module continuously POLLs the TLP queue of the device. When it is determined that a message has arrived, the TLP message is sent to the control plane unit for processing. After processing, the control plane unit encapsulates the processing result into a TLP message and adds it to the TLP queue. Call the Doorbell interface of the hardware interface HAL layer to notify the hardware. The DPU hardware receives the notification and calls the DMA controller to send the TLP data to the server through the UP hardware implementation layer. In this way, the control plane program of the firmware implementation module simulates the PCIE device for data processing. In this process, the simulation module binds the BDF assigned by the server to each device and the device number assigned on the DPU firmware implementation module, and updates the bound MAP relationship to the register of the DPU hardware.

若为Doorbell地址访问,地址路由模块识别到服务器在进行数据的收发,DPU硬件调用DMA控制器,将服务器上PCIE设备的DMA数据搬移到PCIE设备的IO队列中,以待进行下一步的处理。If it is a Doorbell address access, the address routing module recognizes that the server is sending and receiving data, and the DPU hardware calls the DMA controller to move the DMA data of the PCIE device on the server to the IO queue of the PCIE device for the next step of processing.

上述外部设备拓扑配置装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。Each module in the above-mentioned external device topology configuration device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图7所示。该计算机设备包括处理器、存储器、输入/输出接口(Input/Output,简称I/O)和通信接口。其中,处理器、存储器和输入/输出接口通过系统总线连接,通信接口通过输入/输出接口连接到系统总线。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质和内存储器。该非易失性存储介质存储有操作系统、计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的输入/输出接口用于处理器与外部设备之间交换信息。该计算机设备的通信接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种外部设备拓扑配置方法。In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG7. The computer device includes a processor, a memory, an input/output interface (Input/Output, referred to as I/O) and a communication interface. The processor, the memory and the input/output interface are connected via a system bus, and the communication interface is connected to the system bus via the input/output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input/output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for configuring the topology of an external device is implemented.

本领域技术人员可以理解,图7中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art will understand that the structure shown in FIG. 7 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

在一个实施例中,提供了一种计算机设备,包括如上任意一个实施例所述的数据处理器;数据处理器包括:In one embodiment, a computer device is provided, comprising a data processor as described in any one of the above embodiments; the data processor comprises:

调度中心模块,用于接收拓扑配置请求;The scheduling center module is used to receive topology configuration requests;

拓扑生成模块,用于根据拓扑配置请求生成拓扑配置文件;A topology generation module, used to generate a topology configuration file according to a topology configuration request;

固件实现模块,用于根据拓扑配置文件,生成多个设备标识、以及设备标识对应的资源分配信息;根据设备标识和资源分配信息配置硬件资源,得到相应的外部设备拓扑。The firmware implementation module is used to generate multiple device identifications and resource allocation information corresponding to the device identifications according to the topology configuration file; configure hardware resources according to the device identifications and resource allocation information to obtain corresponding external device topology.

在一个实施例中,数据处理器还包括硬件实现模块;In one embodiment, the data processor further comprises a hardware implementation module;

硬件实现模块,用于截获包含有外部设备标识符的事务层数据包,将事务层数据包转发至固件实现模块,外部设备标识符是装载有数据处理器的设备在对PCIE总线上连接的外部设备进行扫描时所获取到的;The hardware implementation module is used to intercept the transaction layer data packet containing the external device identifier and forward the transaction layer data packet to the firmware implementation module. The external device identifier is obtained when the device equipped with the data processor scans the external device connected to the PCIE bus;

固件实现模块,还用于将外部设备标识符与生成的设备标识进行绑定,得到映射信息;根据映射信息对硬件资源进行更新。The firmware implementation module is also used to bind the external device identifier with the generated device identifier to obtain mapping information; and update the hardware resources according to the mapping information.

在一个实施例中,拓扑生成模块,具体用于在预设拓扑资源库中存在拓扑模型与拓扑配置请求匹配的情况下,根据匹配的拓扑模型,生成拓扑配置文件。In one embodiment, the topology generation module is specifically configured to generate a topology configuration file according to the matched topology model when there is a topology model in a preset topology resource library that matches the topology configuration request.

在一个实施例中,拓扑生成模块,具体用于在预设拓扑资源库中不存在拓扑模型与拓扑配置请求匹配的情况下,基于数据处理器的第一性能信息、装载有数据处理器的设备的第二性能信息以及拓扑配置请求进行分析,获得目标拓扑结构;根据目标拓扑结构生成拓扑配置文件。In one embodiment, a topology generation module is specifically used to obtain a target topology structure by analyzing first performance information of a data processor, second performance information of a device equipped with a data processor, and a topology configuration request when there is no topology model matching a topology configuration request in a preset topology resource library; and generate a topology configuration file according to the target topology structure.

在一个实施例中,拓扑生成模块,具体用于在根据第一性能信息确定拓扑配置请求未超出第一资源限制、且根据第二性能信息确定拓扑配置请求未超出第二资源限制的情况下,根据拓扑配置请求生成目标拓扑结构。In one embodiment, the topology generation module is specifically used to generate a target topology structure according to the topology configuration request when it is determined according to the first performance information that the topology configuration request does not exceed the first resource limit and when it is determined according to the second performance information that the topology configuration request does not exceed the second resource limit.

在一个实施例中,硬件资源包括寄存器资源、IO资源或者地址路由资源中的至少一项。In one embodiment, the hardware resources include at least one of register resources, IO resources, or address routing resources.

在一个实施例中,硬件实现模块,具体用于在基于地址路由资源确定事务层数据包用于访问配置空间的情况下,将事务层数据包转发至固件实现模块;在基于地址路由资源确定事务层数据包用于访问门铃地址的情况下,将装载有数据处理器的设备上事务层数据包相应的数据,搬移至目标IO队列中;目标IO队列为外部设备标识符相应的IO资源。In one embodiment, the hardware implementation module is specifically used to forward the transaction layer data packet to the firmware implementation module when it is determined based on the address routing resources that the transaction layer data packet is used to access the configuration space; when it is determined based on the address routing resources that the transaction layer data packet is used to access the doorbell address, the corresponding data of the transaction layer data packet on the device equipped with the data processor is moved to the target IO queue; the target IO queue is the IO resource corresponding to the external device identifier.

在一个实施例中,提供了一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现以下步骤:接收拓扑配置请求;根据拓扑配置请求生成拓扑配置文件;根据拓扑配置文件,生成多个设备标识、以及设备标识对应的资源分配信息;根据设备标识和资源分配信息配置硬件资源,得到相应的外部设备拓扑。In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the following steps: receiving a topology configuration request; generating a topology configuration file according to the topology configuration request; generating multiple device identifiers and resource allocation information corresponding to the device identifiers according to the topology configuration file; configuring hardware resources according to the device identifiers and the resource allocation information to obtain a corresponding external device topology.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:截获包含有外部设备标识符的事务层数据包,外部设备标识符是装载有数据处理器的设备在对PCIE总线上连接的外部设备进行扫描时所获取到的;将外部设备标识符与生成的设备标识进行绑定,得到映射信息;根据映射信息对硬件资源进行更新。In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: intercepting a transaction layer data packet containing an external device identifier, where the external device identifier is obtained by a device equipped with a data processor when scanning an external device connected to a PCIE bus; binding the external device identifier with the generated device identifier to obtain mapping information; and updating hardware resources according to the mapping information.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:在预设拓扑资源库中存在拓扑模型与拓扑配置请求匹配的情况下,根据匹配的拓扑模型,生成拓扑配置文件。In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: when there is a topology model in the preset topology resource library that matches the topology configuration request, a topology configuration file is generated according to the matched topology model.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:在预设拓扑资源库中不存在拓扑模型与拓扑配置请求匹配的情况下,基于数据处理器的第一性能信息、装载有数据处理器的设备的第二性能信息以及拓扑配置请求进行分析,获得目标拓扑结构;根据目标拓扑结构生成拓扑配置文件。In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when there is no topology model matching the topology configuration request in the preset topology resource library, analyzing based on the first performance information of the data processor, the second performance information of the device equipped with the data processor, and the topology configuration request to obtain the target topology structure; generating a topology configuration file according to the target topology structure.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:在根据第一性能信息确定拓扑配置请求未超出第一资源限制、且根据第二性能信息确定拓扑配置请求未超出第二资源限制的情况下,根据拓扑配置请求生成目标拓扑结构。In one embodiment, when the computer program is executed by a processor, the following steps are also implemented: when it is determined based on the first performance information that the topology configuration request does not exceed the first resource limit, and when it is determined based on the second performance information that the topology configuration request does not exceed the second resource limit, a target topology structure is generated based on the topology configuration request.

在一个实施例中,计算机程序被处理器执行时还实现以下步骤:在基于地址路由资源确定事务层数据包用于访问配置空间的情况下,执行将外部设备标识符与生成的设备标识进行绑定,得到映射信息的步骤;在基于地址路由资源确定事务层数据包用于访问门铃地址的情况下,将装载有数据处理器的设备上事务层数据包相应的数据,搬移至目标IO队列中;目标IO队列为外部设备标识符相应的IO资源。In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when it is determined based on the address routing resources that the transaction layer data packet is used to access the configuration space, the step of binding the external device identifier with the generated device identifier to obtain mapping information is executed; when it is determined based on the address routing resources that the transaction layer data packet is used to access the doorbell address, the data corresponding to the transaction layer data packet on the device equipped with the data processor is moved to the target IO queue; the target IO queue is the IO resource corresponding to the external device identifier.

需要说明的是,本申请所涉及的用户信息(包括但不限于用户设备信息、用户个人信息等)和数据(包括但不限于用于分析的数据、存储的数据、展示的数据等),均为经用户授权或者经过各方充分授权的信息和数据,且相关数据的收集、使用和处理需要符合相关规定。It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-OnlyMemory,ROM)、磁带、软盘、闪存、光存储器、高密度嵌入式非易失性存储器、阻变存储器(ReRAM)、磁变存储器(Magnetoresistive Random Access Memory,MRAM)、铁电存储器(Ferroelectric Random Access Memory,FRAM)、相变存储器(Phase Change Memory,PCM)、石墨烯存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器等。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic RandomAccess Memory,DRAM)等。本申请所提供的各实施例中所涉及的数据库可包括关系型数据库和非关系型数据库中至少一种。非关系型数据库可包括基于区块链的分布式数据库等,不限于此。本申请所提供的各实施例中所涉及的处理器可为通用处理器、中央处理器、图形处理器、数字信号处理器、可编程逻辑器、基于量子计算的数据处理逻辑器等,不限于此。Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请的保护范围应以所附权利要求为准。The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims (16)

1.一种外部设备拓扑配置方法,其特征在于,所述方法应用于数据处理器,所述方法包括:1. A method for configuring external device topology, characterized in that the method is applied to a data processor, and the method comprises: 接收拓扑配置请求;receiving a topology configuration request; 根据所述拓扑配置请求生成拓扑配置文件;Generate a topology configuration file according to the topology configuration request; 根据所述拓扑配置文件,生成多个设备标识、以及所述设备标识对应的资源分配信息;Generate multiple device identifiers and resource allocation information corresponding to the device identifiers according to the topology configuration file; 根据所述设备标识和所述资源分配信息配置硬件资源,得到相应的外部设备拓扑。Hardware resources are configured according to the device identification and the resource allocation information to obtain a corresponding external device topology. 2.根据权利要求1所述的方法,其特征在于,所述方法还包括:2. The method according to claim 1, characterized in that the method further comprises: 截获包含有外部设备标识符的事务层数据包,所述外部设备标识符是装载有所述数据处理器的设备在对PCIE总线上连接的外部设备进行扫描时所获取到的;intercepting a transaction layer data packet containing an external device identifier, wherein the external device identifier is obtained when a device equipped with the data processor scans an external device connected to a PCIE bus; 将所述外部设备标识符与生成的设备标识进行绑定,得到映射信息;Binding the external device identifier with the generated device identifier to obtain mapping information; 根据所述映射信息对所述硬件资源进行更新。The hardware resources are updated according to the mapping information. 3.根据权利要求1所述的方法,其特征在于,所述根据所述拓扑配置请求生成拓扑配置文件,包括:3. The method according to claim 1, wherein generating a topology configuration file according to the topology configuration request comprises: 在预设拓扑资源库中存在拓扑模型与所述拓扑配置请求匹配的情况下,根据匹配的拓扑模型,生成拓扑配置文件。In the case that there is a topology model in the preset topology resource library that matches the topology configuration request, a topology configuration file is generated according to the matched topology model. 4.根据权利要求3所述的方法,其特征在于,所述方法还包括:4. The method according to claim 3, characterized in that the method further comprises: 在预设拓扑资源库中不存在拓扑模型与所述拓扑配置请求匹配的情况下,基于所述数据处理器的第一性能信息、装载有所述数据处理器的设备的第二性能信息以及所述拓扑配置请求进行分析,获得目标拓扑结构;If there is no topology model matching the topology configuration request in the preset topology resource library, analyzing based on the first performance information of the data processor, the second performance information of the device equipped with the data processor, and the topology configuration request to obtain a target topology structure; 根据所述目标拓扑结构生成拓扑配置文件。A topology configuration file is generated according to the target topology structure. 5.根据权利要求4所述的方法,其特征在于,所述基于所述数据处理器的第一性能信息、装载有所述数据处理器的设备的第二性能信息以及所述拓扑配置请求进行分析,获得目标拓扑结构,包括:5. The method according to claim 4, characterized in that the step of analyzing based on the first performance information of the data processor, the second performance information of the device equipped with the data processor, and the topology configuration request to obtain the target topology structure comprises: 在根据所述第一性能信息确定所述拓扑配置请求未超出第一资源限制、且根据所述第二性能信息确定所述拓扑配置请求未超出第二资源限制的情况下,根据所述拓扑配置请求生成目标拓扑结构。When it is determined according to the first performance information that the topology configuration request does not exceed the first resource limit, and when it is determined according to the second performance information that the topology configuration request does not exceed the second resource limit, a target topology structure is generated according to the topology configuration request. 6.根据权利要求2所述的方法,其特征在于,所述硬件资源包括寄存器资源、IO资源或者地址路由资源中的至少一项。6 . The method according to claim 2 , wherein the hardware resources include at least one of register resources, IO resources or address routing resources. 7.根据权利要求6所述的方法,其特征在于,所述截获包含有外部设备标识符的事务层数据包之后,所述方法还包括:7. The method according to claim 6, characterized in that after intercepting the transaction layer data packet containing the external device identifier, the method further comprises: 在基于所述地址路由资源确定所述事务层数据包用于访问配置空间的情况下,执行将所述外部设备标识符与生成的设备标识进行绑定,得到映射信息的步骤;In the case where it is determined based on the address routing resource that the transaction layer data packet is used to access the configuration space, performing a step of binding the external device identifier with the generated device identification to obtain mapping information; 在基于所述地址路由资源确定所述事务层数据包用于访问门铃地址的情况下,将装载有所述数据处理器的设备上所述事务层数据包相应的数据,搬移至目标IO队列中;所述目标IO队列为所述外部设备标识符相应的IO资源。When it is determined based on the address routing resource that the transaction layer data packet is used to access the doorbell address, data corresponding to the transaction layer data packet on the device equipped with the data processor is moved to a target IO queue; the target IO queue is an IO resource corresponding to the external device identifier. 8.一种数据处理器,其特征在于,所述数据处理器包括:8. A data processor, characterized in that the data processor comprises: 调度中心模块,用于接收拓扑配置请求;The scheduling center module is used to receive topology configuration requests; 拓扑生成模块,用于根据所述拓扑配置请求生成拓扑配置文件;A topology generation module, used to generate a topology configuration file according to the topology configuration request; 固件实现模块,用于根据所述拓扑配置文件,生成多个设备标识、以及所述设备标识对应的资源分配信息;根据所述设备标识和所述资源分配信息配置硬件资源,得到相应的外部设备拓扑。The firmware implementation module is used to generate multiple device identifiers and resource allocation information corresponding to the device identifiers according to the topology configuration file; configure hardware resources according to the device identifiers and the resource allocation information to obtain corresponding external device topology. 9.根据权利要求8所述的数据处理器,其特征在于,所述数据处理器还包括硬件实现模块;9. The data processor according to claim 8, characterized in that the data processor further comprises a hardware implementation module; 所述硬件实现模块,用于截获包含有外部设备标识符的事务层数据包,将所述事务层数据包转发至所述固件实现模块,所述外部设备标识符是装载有所述数据处理器的设备在对PCIE总线上连接的外部设备进行扫描时所获取到的;The hardware implementation module is used to intercept a transaction layer data packet containing an external device identifier, and forward the transaction layer data packet to the firmware implementation module, wherein the external device identifier is obtained when the device equipped with the data processor scans an external device connected to the PCIE bus; 所述固件实现模块,还用于将所述外部设备标识符与生成的设备标识进行绑定,得到映射信息;根据所述映射信息对所述硬件资源进行更新。The firmware implementation module is further used to bind the external device identifier with the generated device identification to obtain mapping information; and update the hardware resources according to the mapping information. 10.根据权利要求8所述的数据处理器,其特征在于,所述拓扑生成模块,具体用于在预设拓扑资源库中存在拓扑模型与所述拓扑配置请求匹配的情况下,根据匹配的拓扑模型,生成拓扑配置文件。10. The data processor according to claim 8 is characterized in that the topology generation module is specifically used to generate a topology configuration file according to the matching topology model when there is a topology model matching the topology configuration request in a preset topology resource library. 11.根据权利要求10所述的数据处理器,其特征在于,所述拓扑生成模块,具体用于在预设拓扑资源库中不存在拓扑模型与所述拓扑配置请求匹配的情况下,基于所述数据处理器的第一性能信息、装载有所述数据处理器的设备的第二性能信息以及所述拓扑配置请求进行分析,获得目标拓扑结构;根据所述目标拓扑结构生成拓扑配置文件。11. The data processor according to claim 10 is characterized in that the topology generation module is specifically used to obtain a target topology structure by analyzing based on the first performance information of the data processor, the second performance information of the device equipped with the data processor, and the topology configuration request when there is no topology model matching the topology configuration request in the preset topology resource library; and generate a topology configuration file according to the target topology structure. 12.根据权利要求11所述的数据处理器,其特征在于,所述拓扑生成模块,具体用于在根据所述第一性能信息确定所述拓扑配置请求未超出第一资源限制、且根据所述第二性能信息确定所述拓扑配置请求未超出第二资源限制的情况下,根据所述拓扑配置请求生成目标拓扑结构。12. The data processor according to claim 11 is characterized in that the topology generation module is specifically used to generate a target topology structure according to the topology configuration request when it is determined according to the first performance information that the topology configuration request does not exceed the first resource limit, and when it is determined according to the second performance information that the topology configuration request does not exceed the second resource limit. 13.根据权利要求9所述的数据处理器,其特征在于,所述硬件资源包括寄存器资源、IO资源或者地址路由资源中的至少一项。13 . The data processor according to claim 9 , wherein the hardware resources include at least one of register resources, IO resources, or address routing resources. 14.根据权利要求13所述的数据处理器,其特征在于,所述硬件实现模块,具体用于在基于所述地址路由资源确定所述事务层数据包用于访问配置空间的情况下,将所述事务层数据包转发至所述固件实现模块;在基于所述地址路由资源确定所述事务层数据包用于访问门铃地址的情况下,将装载有所述数据处理器的设备上所述事务层数据包相应的数据,搬移至目标IO队列中;所述目标IO队列为所述外部设备标识符相应的IO资源。14. The data processor according to claim 13 is characterized in that the hardware implementation module is specifically used to forward the transaction layer data packet to the firmware implementation module when it is determined based on the address routing resources that the transaction layer data packet is used to access the configuration space; when it is determined based on the address routing resources that the transaction layer data packet is used to access the doorbell address, move the data corresponding to the transaction layer data packet on the device loaded with the data processor to a target IO queue; the target IO queue is the IO resource corresponding to the external device identifier. 15.一种计算机设备,其特征在于,包括权利要求8至14中任一项所述的数据处理器。15. A computer device, comprising the data processor according to any one of claims 8 to 14. 16.一种计算机程序产品,包括计算机程序,其特征在于,该计算机程序被处理器执行时实现权利要求1至7中任一项所述的方法的步骤。16. A computer program product, comprising a computer program, characterized in that when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
CN202410468141.XA 2024-04-18 2024-04-18 External device topology configuration method, data processor, device and program product Active CN118069568B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410468141.XA CN118069568B (en) 2024-04-18 2024-04-18 External device topology configuration method, data processor, device and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410468141.XA CN118069568B (en) 2024-04-18 2024-04-18 External device topology configuration method, data processor, device and program product

Publications (2)

Publication Number Publication Date
CN118069568A true CN118069568A (en) 2024-05-24
CN118069568B CN118069568B (en) 2024-09-13

Family

ID=91111510

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410468141.XA Active CN118069568B (en) 2024-04-18 2024-04-18 External device topology configuration method, data processor, device and program product

Country Status (1)

Country Link
CN (1) CN118069568B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115904520A (en) * 2023-03-13 2023-04-04 珠海星云智联科技有限公司 Configuration storage method based on PCIE topological state change and related equipment
CN115905094A (en) * 2022-10-13 2023-04-04 超聚变数字技术有限公司 Electronic equipment and PCIe topology configuration method and device thereof
CN116755829A (en) * 2023-05-11 2023-09-15 阿里云计算有限公司 Method for generating host PCIe topological structure and method for distributing container resources
CN117687944A (en) * 2023-10-30 2024-03-12 超聚变数字技术有限公司 Topology generation method, expansion board card and server
CN117708029A (en) * 2023-10-30 2024-03-15 珠海星云智联科技有限公司 PCIE topology structure simulation method, device, equipment and medium
CN117834447A (en) * 2024-03-05 2024-04-05 北京数渡信息科技有限公司 Interconnection pooling system topology management device and method based on PCIe Switch

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115905094A (en) * 2022-10-13 2023-04-04 超聚变数字技术有限公司 Electronic equipment and PCIe topology configuration method and device thereof
CN115904520A (en) * 2023-03-13 2023-04-04 珠海星云智联科技有限公司 Configuration storage method based on PCIE topological state change and related equipment
CN116755829A (en) * 2023-05-11 2023-09-15 阿里云计算有限公司 Method for generating host PCIe topological structure and method for distributing container resources
CN117687944A (en) * 2023-10-30 2024-03-12 超聚变数字技术有限公司 Topology generation method, expansion board card and server
CN117708029A (en) * 2023-10-30 2024-03-15 珠海星云智联科技有限公司 PCIE topology structure simulation method, device, equipment and medium
CN117834447A (en) * 2024-03-05 2024-04-05 北京数渡信息科技有限公司 Interconnection pooling system topology management device and method based on PCIe Switch

Also Published As

Publication number Publication date
CN118069568B (en) 2024-09-13

Similar Documents

Publication Publication Date Title
JP2019153297A (en) New SSD basic structure for FPGA-based acceleration
US10445223B1 (en) Service virtualization platform
WO2019090993A1 (en) Deployment method and apparatus for monitoring system, computer device and storage medium
EP4052126B1 (en) Management of multiple physical function non-volatile memory devices
CN115657553B (en) PCIE topology and PCIE device simulation method, device, equipment and medium
CN113691575B (en) Communication method, device and system
CN110795343B (en) Test systems, test methods and computing equipment
CN112636992A (en) Dynamic routing method, device, equipment and storage medium
CN116028455A (en) A data processing method, device, storage medium and electronic equipment
CN109391508B (en) A computer-implemented method for automatically composing data center resources in a data center
CN119003097A (en) Method, computer equipment and medium for realizing important product data function by software
CN118069568B (en) External device topology configuration method, data processor, device and program product
CN115701077A (en) A method and device for connecting to a microservice grid
CN116719722A (en) Automatic testing method and related device for variable networking
CN118211256A (en) Rights management method, device, equipment and storage medium
CN115150268A (en) Network configuration method, device, and electronic device for Kubernetes cluster
CN115309491A (en) Logic algorithm of platform system
CN115269347A (en) A storage performance testing method, device, medium and electronic equipment
US7849164B2 (en) Configuring a device in a network via steps
CN112748981B (en) Processing method and device for software image of virtual network function
US12323487B2 (en) Implementing a target block command on an unstructured data storage node
CN114765579B (en) A data transmission method, device, related equipment and storage medium
CN117724857A (en) Nanotube method and device of heterogeneous virtualization platform, terminal equipment and storage medium
CN118012603A (en) Resource scheduling method and related equipment
CN118802510A (en) Information processing method, device, readable storage medium and network device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant