WO2016150098A1 - Pcie apparatus and pcie bus management method and device - Google Patents

Pcie apparatus and pcie bus management method and device Download PDF

Info

Publication number
WO2016150098A1
WO2016150098A1 PCT/CN2015/088177 CN2015088177W WO2016150098A1 WO 2016150098 A1 WO2016150098 A1 WO 2016150098A1 CN 2015088177 W CN2015088177 W CN 2015088177W WO 2016150098 A1 WO2016150098 A1 WO 2016150098A1
Authority
WO
WIPO (PCT)
Prior art keywords
pcie
pcie device
enumeration
scan
function
Prior art date
Application number
PCT/CN2015/088177
Other languages
French (fr)
Chinese (zh)
Inventor
蒋习旺
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016150098A1 publication Critical patent/WO2016150098A1/en

Links

Images

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/10Program control for peripheral devices

Definitions

  • the present invention relates to the field of communications, and in particular to a method and apparatus for managing a PCIe device and a PCIe bus of the latest peripheral component expansion interface.
  • PCIe Peripheral Component Interconnect Express
  • PCIe Peripheral Component Interconnect Express
  • PCIe bus Interconnection between multiple processors or interconnection between a processor and a device controller can be implemented.
  • the implementation of the PCIe architecture is slightly different in different processor architectures. However, in most processor systems, the basic modules of RC, Switch, and PCIe-to-PCI bridges are used to connect PCIe and PCI devices.
  • PCIe initialization is usually in the firmware Fireware phase or the Linux system initialization phase. Its main job is to traverse all PCIe devices in the current processor system and initialize them. In the traversal process, the Depth First Search (DFS) algorithm is usually used to perform traversal search on the PCIe bus tree, and allocate the relevant bus number and address resource of the bus.
  • DFS Depth First Search
  • the PCIe initialization mechanism in the Linux kernel is not perfect. It contains a lot of redundant code and extra steps. This affects the efficiency of Linux PCIe initialization.
  • the PCIe initialization scan is static. After the system is powered on, only the PCIe bus tree is initialized and scanned. If you need to scan again, you must reload the Linux system. Of course, this approach is understandable, especially when the Linux operating system is in a stable application phase.
  • the main purpose of the embodiments of the present invention is to provide a PCIe device and a PCIe bus management method and apparatus, so as to at least solve the problem that the initialization scan of PCIe in the related art is static.
  • a method for managing a peripheral component expansion interface PCIe device and a PCIe bus including: performing an enumeration scan operation on a PCIe device tree of a latest peripheral component extension interface, and according to the PCIe The location of the device in the PCIe bus generates a structure corresponding to the scanned PCEe device; adding the structure to the linked list of the PCIe device; and exporting the PCIe device control file according to the linked list and the specified file system And managing the dynamic enumeration scan of the PCIe device and the PCIe bus, wherein the control file is used to indicate the PCIe device resource information.
  • the managing the dynamic scanning of the PCIe device and the PCIe bus according to the linked list and the PCIe device control file exported by the specified file system comprises: the PCIe device file exported according to the linked list and the specified file system to the PCIe Performing a write operation on the bus for performing a dynamic enumeration scan on the PCIe bus; performing a read operation on the PCIe device according to the linked list and a PCIe device control file exported by the specified file system, for acquiring the PCIe device Resource information.
  • the method includes: when the specified file system is initialized, and Establishing a control file under the specified file system, wherein the control file is provided with a first function and a second function, where the first function is used to indicate how to operate the control file to complete dynamics on the PCIe bus Enumeration scan, the second function is for indicating a start position of performing an enumeration scan; performing a dynamic enumeration scan on the PCIe device bus according to the first function and the second function.
  • performing an enumeration scan operation on the PCIe device tree includes performing an enumeration scan on the entire PCIe device tree from the PCIe controller according to a depth-first algorithm.
  • the method before performing the enumeration scan operation on the PCIe device tree, includes: turning off an enumeration scan operation function carried by the self, and triggering an operation of performing an enumeration scan on the PCIe device tree according to the depth priority algorithm.
  • a management device for a recent peripheral component expansion interface PCIe device and a PCIe bus comprising: an execution module configured to perform an enumeration scan operation on a PCIe device tree of a latest peripheral component extension interface And generating, according to the location of the PCIe device in the PCIe bus, a structure corresponding to the scanned PCEe device; adding a module, being configured to add the structure to a linked list of the PCIe device; and managing a module, And managing the dynamic enumeration scan of the PCIe device and the PCIe bus according to the linked list and the PCIe device control file exported by the specified file system, wherein the control file is used to indicate the PCIe device resource information.
  • the management module includes: a scanning unit configured to perform a write operation on the PCIe bus according to the linked list and a PCIe device file exported by the specified file system, to perform dynamic enumeration scanning on the PCIe bus
  • the obtaining unit is configured to perform a read operation on the PCIe according to the PCIe device control file that is exported according to the linked list and the specified file system, and is used to acquire resource information of the PCIe device.
  • the device before the managing the dynamic scanning of the PCIe device and the PCIe bus according to the linked list and the PCIe device file exported by the specified file system, the device further includes: an establishing module, configured to be in the specified file system And performing a initialization, and establishing a control file under the specified file system, wherein the control file is provided with a first function and a second function, where the first function is used to indicate how to operate the control file to complete the a dynamic enumeration scan of the PCIe bus, the second function is for indicating a start position of performing an enumeration scan; and the scan module is configured to perform dynamic on the PCIe device bus according to the first function and the second function Enumeration scan.
  • an establishing module configured to be in the specified file system And performing a initialization, and establishing a control file under the specified file system, wherein the control file is provided with a first function and a second function, where the first function is used to indicate how to operate the control file to complete the a dynamic en
  • the execution module is further configured to perform an enumeration scan on the entire PCIe device tree from the PCIe controller according to a depth-first algorithm.
  • the device before performing the enumeration scan operation on the PCIe device tree, the device further includes: a shutdown module, configured to disable the enumeration scan operation function carried by itself, triggering the PCIe device according to the depth priority algorithm The tree performs an enumeration scan operation.
  • a shutdown module configured to disable the enumeration scan operation function carried by itself, triggering the PCIe device according to the depth priority algorithm The tree performs an enumeration scan operation.
  • the scanned PCEe device when the PCIe device tree is subjected to the enumeration scan, the scanned PCEe device generates a corresponding structure according to the location of the PCEe device in the PCIe bus, and adds the structure to the linked list.
  • the dynamic enumeration scan management of the PCIe device and the PCIe bus is further performed according to the linked list and the PCIe device file exported by the specified file system.
  • the invention realizes the dynamic scanning of PCIe, and solves the problem that the initial scanning of PCIe in the related art is static, and achieves the effect of improving the debugging efficiency of the system.
  • FIG. 1 is a flowchart of a method for managing a PCIe device and a PCIe bus according to an embodiment of the present invention
  • FIG. 2 is a structural block diagram of a management apparatus of a PCIe device and a PCIe bus according to an embodiment of the present invention
  • FIG. 3 is a block diagram 1 of an optional structure of a management device for a PCIe device and a PCIe bus according to an embodiment of the present invention
  • FIG. 4 is a block diagram 2 of an optional structure of a management device for a PCIe device and a PCIe bus according to an embodiment of the present invention
  • FIG. 5 is a block diagram 3 of an optional structure of a management device for a PCIe device and a PCIe bus according to an embodiment of the present invention
  • FIG. 6 is a flow chart of a dynamic enumeration scan PCIe device and management method in accordance with an alternative embodiment of the present invention.
  • FIG. 1 is a flowchart of a PCIe device and a PCIe bus management method according to an embodiment of the present invention. As shown in FIG. 1, the process includes the following steps:
  • Step S102 Perform an enumeration scan operation on the PCIe device tree, and generate a structure corresponding to the scanned PCEe device according to the location of the PCIe device in the PCIe bus;
  • Step S104 adding the structure to the linked list of the PCIe device
  • Step S106 Perform dynamic enumeration scan management on the PCIe device and the PCIe bus according to the linked list and the PCIe device file exported by the specified file system;
  • the file is used to indicate PCIe device resource information.
  • the scanned PCEe device when performing an enumeration scan on the PCIe device tree, the scanned PCEe device generates a corresponding structure according to the location of the PCEe device in the PCIe bus, and adds the structure to the linked list; Management of dynamic enumeration scans of PCIe devices and PCIe buses based on the linked list and PCIe device files exported by the specified file system.
  • the dynamic scanning of the PCIe is implemented by the embodiment, and the initialization scan of the PCIe in the related art is solved statically, and the effect of improving the debugging efficiency of the system is achieved.
  • the sys file system may be used, and the embodiment will be correspondingly described below through the sys file system;
  • the manner of managing the dynamic scanning of the PCIe device and the PCIe bus according to the PCIe device control file exported by the linked list and the specified file system in the foregoing step S106 may be as follows: Way to achieve:
  • Manner 1 Perform a write operation on the PCIe bus according to the linked list and the PCIe device control file exported by the specified file system, for performing dynamic enumeration scan on the PCIe bus;
  • Method 2 Perform a read operation on the PCIe device according to the linked list and the PCIe device control file exported by the specified file system, and obtain the resource information of the PCIe device.
  • control file write operation under the sys file system can complete the dynamic enumeration scan of the PCIe bus, and the PCIe device file can be obtained when the PCIe device file under the sys file system is read. Resource information.
  • the method in this embodiment may further include:
  • Step S11 When the specified file system is initialized, and the control file is established under the specified file system, wherein the control file is provided with a first function and a second function, and the first function is used to indicate how to operate the control file to complete the PCIe bus. Dynamic enumeration scan, the second function is used to indicate the start position of the execution of the enumeration scan;
  • Step S12 Perform a dynamic enumeration scan on the PCIe device bus according to the first function and the second function.
  • the PCIe device bus is configured to perform dynamic enumeration scanning by setting the first function and the second function in the control file.
  • the first function may be a show.
  • the second function can be a store function, that is, when reading the control file, the system will call the show function to display some strings, which are used to explain how to operate the control file to complete the dynamic enumeration scan of the PCIe device tree;
  • the implementation of the show function is a kind of illustrative use, can not afford the function; when writing the control file, the system will call the store function.
  • the entire PCIe device tree is enumerated and scanned from the PCIe controller according to the depth-first algorithm.
  • the enumeration scan operation function carried by the self needs to be turned off, and the operation of enumerating the PCIe device tree according to the depth-first algorithm is triggered. In other words, the initialization of the PCIe device is not required by the built-in enumeration scanning process.
  • a management device for the PCIe device and the PCIe bus is provided, and the device is used to implement the foregoing embodiments and preferred embodiments, and details are not described herein.
  • the term “module” "unit” may implement a combination of software and/or hardware of a predetermined function.
  • the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
  • the apparatus includes an execution module 22 configured to perform an enumerated scan operation on the latest peripheral component expansion interface PCIe device tree, and generate a structure corresponding to the scanned PCEe device according to the location of the PCIe device in the PCIe bus.
  • the adding module 24 is coupled to the execution module 22 and configured to add the structure to the linked list of the PCIe device.
  • the management module 26 is coupled to the adding module 24 and configured to be a PCIe device file pair exported according to the linked list and the specified file system.
  • the PCIe device and the PCIe bus perform dynamic enumeration scan management, wherein files are used to indicate PCIe device resource information.
  • the execution module is further configured to perform an enumeration scan of the entire PCIe device tree from the PCIe controller according to the depth first algorithm.
  • FIG. 3 is a block diagram of an optional structure of a PCIe device and a PCIe bus management device according to an embodiment of the present invention.
  • the management module 26 includes: a scanning unit 32 configured to export PCIe according to a linked list and a specified file system.
  • the device file performs a write operation on the PCIe device file, and is used to perform a dynamic enumeration scan on the PCIe bus;
  • the obtaining unit 34 is configured to perform a read operation on the PCIe device file according to the linked list and the PCIe device file information exported by the specified file system, Obtain the resource information of the PCIe device.
  • FIG. 4 is a block diagram 2 of an optional structure of a PCIe device and a PCIe bus management device according to an embodiment of the present invention. As shown in FIG. 4, a PCIe device and a PCIe bus are dynamically scanned according to a PCIe device file exported according to a linked list and a specified file system.
  • the device further includes: an establishing module 42 coupled to the adding module 24, configured to establish a control file under the specified file system when the specified file system is initialized, wherein the control file is provided with the first function and a second function, the first function is used to indicate how to operate the control file to complete the dynamic enumeration scan of the PCIe bus, the second function is used to indicate the start position of the enumeration scan, and the scan module 44 is coupled to the setup module 42 to set A dynamic enumeration scan is performed on the PCIe device bus in accordance with the first function and the second function.
  • an establishing module 42 coupled to the adding module 24, configured to establish a control file under the specified file system when the specified file system is initialized, wherein the control file is provided with the first function and a second function, the first function is used to indicate how to operate the control file to complete the dynamic enumeration scan of the PCIe bus, the second function is used to indicate the start position of the enumeration scan, and the scan module 44 is coupled to
  • the device before performing an enumeration scan operation on a PCIe device tree, the device further includes: a shutdown module 52, The method is coupled to the execution module 22, and is configured to disable the enumeration scan operation function carried by the self-execution module, and trigger an operation of enumerating and scanning the PCIe device tree according to the depth-first algorithm.
  • This alternative embodiment provides a method for dynamically enumerating scans and managing PCIe devices.
  • the Linux operating system is taken as an example. After the Linux operating system is started, the user can rescan the entire PCIe as needed.
  • the device tree allocates resources such as bus number and storage space for devices on each PCIe bus tree.
  • the optional embodiment can also perform recursive scanning from a certain PCIe port and allocate resources for devices under the port.
  • the so-called enumeration scan PCIe device tree refers to enumerating the entire PCIe device tree from the PCIe controller; when a device is found, it generates a device structure for it, and according to the location of the PCIe bus where the device is located, the device structure The body is added to the PCIe device list.
  • the tree structure traversal algorithm is roughly divided into Breadth-First-Search (abbreviated as BFS) and Depth First Search (DFS).
  • BFS Breadth-First-Search
  • DFS Depth First Search
  • a depth-first algorithm is used for the enumeration scan of the PCIe device tree.
  • the algorithm is based on two aspects. First, the DFS algorithm is used to complete the enumeration scan of the PCIe device tree to help understand the topology of the PCIe. Second, the enumeration scan implementation that comes with Linux can be used as a reference for this alternative embodiment. And draw on.
  • the optional embodiment manages the PCIe bus and devices through files exported under the sys file system; and writes control files to the sys file system.
  • the dynamic enumeration scan of the PCIe bus can be completed; and the information of the PCIe device can be obtained when the PCIe device file under the sys file system is read.
  • FIG. 6 is a flowchart of a dynamic enumeration scanning PCIe device and a management method according to an alternative embodiment of the present invention. As shown in FIG. 6, the steps of the method include:
  • Step S602 Start executing the Linux kernel
  • Step S604 Initializing the Linux kernel
  • Step S606 dynamic enumeration scan initialization
  • Step S608 Perform a dynamic enumeration scan by using a sys file interface operation
  • Step S610 Start a dynamic enumeration scan
  • Step S612 The dynamic enumeration scan ends.
  • the structure In addition to the basic information of the device, such as busID, devID, vendorID, functionID, and the base address of various storage resources, the structure also includes the pointers needed to maintain the PCIe device tree list, and manages the sys file data structure.
  • a processor system begins with firmware and starts booting the Linux kernel with Firmware. After the boot process, the system will jump to the first head.s file in Linux, and then jump to the start_kernel function of the ./init/main.c file from the head.s file. Start the PCIe initialization journey from here.
  • the firmware used by different systems is also different.
  • the x86 system uses the BIOS, while the Powerpc system uses U-Boot.
  • Enumeration initialization of PCIe devices is usually done in the Firmware phase, where each device in the PCIe device tree is assigned resources such as busID, devID, functionID, and so on.
  • the initialization process of the PCIe device is not required in the Linux kernel, so the CONFIG_PCI_DIRECT option should be closed when compiling the kernel. It also ensures that the dynamic management enumeration process implemented by this alternative embodiment is completed before the Linux kernel initializes the PCIe device tree. Therefore, the implementation in this alternative embodiment is performed by placing the initialization interface function start_pcie of the dynamic enumeration scan at the beginning of the do_basic_setup function.
  • the dynamic enumeration scan is implemented by the function pci_scan_device(struct bsp_pci_device*parent, int domain, int bus, int device, int func).
  • This function uses the DFB algorithm to recursively scan and allocate resources to the PCIe device tree under the parent node parent. After discovering a new PCIe device, the device is first allocated corresponding resources, and then a struct bsp_pci_device structure is generated to save the device information, and the structure is added to the linked list of the PCIe device; when the function is executed, All PCIe devices under parent will be initialized, and the generated device structure will be added to the PCIe device list. This will be convenient. Management of PCIe devices.
  • A Define the files of the dynamic enumeration scan interface and the corresponding operations
  • the system In order to complete the dynamic enumeration scan by operating the files under the sys file system, the system needs to establish the corresponding directory and control file under /sys, and define the show and store operations for the control file.
  • the initialization interface function start_pcie of the dynamic enumeration scan is the most suitable place to implement PCIe sys file initialization.
  • the sysfs_create_file function provided by the Linux kernel is called in start_pcie to establish the PCIe dynamic enumeration scan control file pci_control.
  • the show and store functions of this file need to be implemented.
  • the system will call the show function to display some strings. These strings are used to illustrate how to manipulate the pci_control file to perform a dynamic enumeration scan of the PCIe device tree.
  • the implementation of the show function is essentially a declarative use and does not function.
  • the store function is called. In this function, the written string needs to be parsed, and based on the parsed content, it is determined at which position in the PCIe device tree the enumeration scan needs to be started.
  • the store function After parsing this information, the store function will call the above mentioned pci_scan_device function to perform an enumeration scan on the specified port of the device tree. If the entire PCIe device tree needs to be scanned, the location information of the PCIe controller is written into the pci_control file.
  • the system assigns a device structure struct bsp_pci_device to it, and uses this structure to record and represent a PCIe device.
  • the scanned device needs to be exported to the /sys file system during scanning, and a device file ww:xx.yy.zz is generated under the file system. (Wh, ww indicates the domain where the device is located, xx is the bus number of the device, yy is the device number, and zz is the function number).
  • the Linux kernel will apply the appropriate action to the PCIe device.
  • the system calls the show function of the device file. This function is implemented in this alternative embodiment as the operation of printing the corresponding PCIe device configuration space.
  • Linux will call the store function implemented in the patent to complete the write operation of the PCIe device's configuration space.
  • the PCIe dynamic enumeration scan management function is directly compiled into the kernel. Therefore, after the Linux system is powered on, the function is completely initialized.
  • the initialization mainly includes two aspects: one is to enumerate and scan the PCIe device tree. And establishing a corresponding data structure for the enumerated PCIe device to form a linked list of device trees; second, establishing a display and management interface of the PCIe device in the sys file system according to the enumerated scan result.
  • the method of the alternative embodiment can improve the efficiency of PCIe debugging and reduce the complexity of PCIe debugging.
  • the scanned PCEe device when performing an enumeration scan on the PCIe device tree, the scanned PCEe device generates a corresponding structure according to the location of the PCEe device in the PCIe bus, and adds the structure to the linked list; Management of dynamic enumeration scans of PCIe devices and PCIe buses based on the linked list and PCIe device files exported by the specified file system.
  • the invention realizes the dynamic scanning of PCIe, and solves the problem that the initial scanning of PCIe in the related art is static, and achieves the effect of improving the debugging efficiency of the system.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)
  • Stored Programmes (AREA)

Abstract

A latest peripheral component interconnect express (PCIe) apparatus and PCIe bus management method and device. The method comprises: scanning and enumerating a latest PCIe apparatus tree to obtain a scanned PCIe apparatus, generating, according to a location of the PCIe apparatus in a PCIe bus, a structure corresponding to the scanned PCIe apparatus (S102); adding the structure to a PCIe apparatus linked list (S104); managing a dynamic enumeration scan on the PCIe apparatus and the PCIe bus according to the linked list and a PCIe apparatus control file exported by a specified file system (S106), wherein the control file is used to indicate resource information of the PCIe apparatus. The present invention addresses the problem in the related art in which a PCIe initialization scan are all static, resulting in an increase in a system debugging efficiency.

Description

PCIe设备和PCIe总线的管理方法及装置PCIe device and PCIe bus management method and device 技术领域Technical field
本发明涉及通信领域,具体而言,涉及一种最新周边元件扩展接口PCIe设备和PCIe总线的管理方法及装置。The present invention relates to the field of communications, and in particular to a method and apparatus for managing a PCIe device and a PCIe bus of the latest peripheral component expansion interface.
背景技术Background technique
最新周边元件扩展接口(Peripheral Component Interconnect Express,简称为PCIe)总线作为计算机系统中的一种局部总线,它和PCI总线作用是相似,其主要目的是为了连接处理器和外部设备,当然PCIe总线也可以实现多个处理器之间的互联或是处理器和设备控制器之间的互联。在不同的处理器架构中,PCIe体系结构的实现方法略有不同。但是在大多数处理器系统中,都使用了RC、Switch和PCIe-to-PCI桥这些基本模块连接PCIe和PCI设备。The latest Peripheral Component Interconnect Express (PCIe) bus is a local bus in a computer system. It is similar to the PCI bus. Its main purpose is to connect the processor and external devices. Of course, the PCIe bus also Interconnection between multiple processors or interconnection between a processor and a device controller can be implemented. The implementation of the PCIe architecture is slightly different in different processor architectures. However, in most processor systems, the basic modules of RC, Switch, and PCIe-to-PCI bridges are used to connect PCIe and PCI devices.
PCIe的初始化通常是放到固件Fireware阶段或是Linux系统初始化阶段,它主要工作是遍历当前处理器系统中的所有PCIe设备,并对这些设备进行初始化配置。在遍历过程中,通常使用了深度优先(Depth First Search,简称为DFS)算法对PCIe总线树进行遍历查找,并分配相关的总线号和总线的地址资源。PCIe initialization is usually in the firmware Fireware phase or the Linux system initialization phase. Its main job is to traverse all PCIe devices in the current processor system and initialize them. In the traversal process, the Depth First Search (DFS) algorithm is usually used to perform traversal search on the PCIe bus tree, and allocate the relevant bus number and address resource of the bus.
从处理器系统的角度来讲,Linux内核中的PCIe初始化机制并不是非常完美。其中包含了很多冗余代码和多余的步骤。从而影响了Linux PCIe的初始化的效率。另外,无论是在Fireware阶段还是在Linux启动阶段,PCIe的初始化扫描都是静态的,既系统上电后只对PCIe总线树进行一次初始化扫描,如需再次扫描,就要重新加载Linux系统。当然,这种做法是无可厚非的,尤其是当Linux操作系统处于稳定的应用阶段。From a processor system perspective, the PCIe initialization mechanism in the Linux kernel is not perfect. It contains a lot of redundant code and extra steps. This affects the efficiency of Linux PCIe initialization. In addition, whether in the Fireware stage or the Linux boot stage, the PCIe initialization scan is static. After the system is powered on, only the PCIe bus tree is initialized and scanned. If you need to scan again, you must reload the Linux system. Of course, this approach is understandable, especially when the Linux operating system is in a stable application phase.
但当整个软/硬件系统处于开发、验证阶段,就很有可能会涉及到一些PCIe设备的功能、性能的调试。在对PCIe设备调整后,如果需要重新扫描PCIe设备树,必须复位整个系统,重新加载Linux。这种方式虽然在实施层面上来讲是可行的,但就操作层面上来看却显得十分繁琐。例如,调试挂在PCIe Switch下的EP设备的信号质量,就需要通过其他总线(如I2c)不断的修改EP设备的预加重和负载均衡。每次调整新参数后都需重新上电、重新加载Linux系统。这样做,无疑会降低调试的效率并增加调试的复杂程度。However, when the entire software/hardware system is in the development and verification phase, it is likely to involve the debugging of the functions and performance of some PCIe devices. After adjusting the PCIe device, if you need to rescan the PCIe device tree, you must reset the entire system and reload Linux. Although this method is feasible at the implementation level, it is very cumbersome at the operational level. For example, to debug the signal quality of an EP device hanging under the PCIe Switch, it is necessary to continuously modify the pre-emphasis and load balancing of the EP device through other buses (such as I2c). Re-power and reload the Linux system after each new parameter adjustment. Doing so will undoubtedly reduce the efficiency of debugging and increase the complexity of debugging.
针对相关技术中PCIe的初始化扫描都是静态的问题,目前尚未提出有效的解决方案。 The initialization scan of PCIe in the related art is a static problem, and an effective solution has not been proposed yet.
发明内容Summary of the invention
本发明实施例的主要目的在于提供一种PCIe设备和PCIe总线的管理方法及装置,以至少解决相关技术中PCIe的初始化扫描都是静态的问题。The main purpose of the embodiments of the present invention is to provide a PCIe device and a PCIe bus management method and apparatus, so as to at least solve the problem that the initialization scan of PCIe in the related art is static.
根据本发明实施例的一个方面,提供了一种最新周边元件扩展接口PCIe设备和PCIe总线的管理方法,包括:执行对最新周边元件扩展接口PCIe设备树的枚举扫描操作,并依据所述PCIe设备在PCIe总线中的位置生成与扫描到的所述PCEe设备对应的结构体;将所述结构体添加到所述PCIe设备的链表中;依据所述链表与指定文件系统导出的PCIe设备控制文件对所述PCIe设备和PCIe总线进行动态枚举扫描的管理,其中,所述控制文件用于指示所述PCIe设备资源信息。According to an aspect of an embodiment of the present invention, a method for managing a peripheral component expansion interface PCIe device and a PCIe bus is provided, including: performing an enumeration scan operation on a PCIe device tree of a latest peripheral component extension interface, and according to the PCIe The location of the device in the PCIe bus generates a structure corresponding to the scanned PCEe device; adding the structure to the linked list of the PCIe device; and exporting the PCIe device control file according to the linked list and the specified file system And managing the dynamic enumeration scan of the PCIe device and the PCIe bus, wherein the control file is used to indicate the PCIe device resource information.
可选地,依据所述链表与指定文件系统导出的PCIe设备控制文件对所述PCIe设备和PCIe总线进行动态扫描的管理包括:依据所述链表与指定文件系统导出的PCIe设备文件对所述PCIe总线执行写操作,用于执行对所述PCIe总线的动态枚举扫描;依据所述链表与指定文件系统导出的PCIe设备控制文件对所述PCIe设备执行读操作,用于获取所述PCIe设备的资源信息。Optionally, the managing the dynamic scanning of the PCIe device and the PCIe bus according to the linked list and the PCIe device control file exported by the specified file system comprises: the PCIe device file exported according to the linked list and the specified file system to the PCIe Performing a write operation on the bus for performing a dynamic enumeration scan on the PCIe bus; performing a read operation on the PCIe device according to the linked list and a PCIe device control file exported by the specified file system, for acquiring the PCIe device Resource information.
可选地,在依据所述链表与指定文件系统导出的PCIe设备控制文件对所述PCIe设备和PCIe总线进行动态扫描的管理之前,所述方法包括:在所述指定文件系统进行初始化时,并在所述指定文件系统下建立控制文件,其中,所述控制文件中设置有第一函数和第二函数,所述第一函数用于指示如何操作所述控制文件完成对所述PCIe总线的动态枚举扫描,所述第二函数用于指示执行枚举扫描的开始位置;依据所述第一函数和所述第二函数对所述PCIe设备总线执行动态枚举扫描。Optionally, before the dynamic scanning of the PCIe device and the PCIe bus is performed according to the linked list and the PCIe device control file exported by the specified file system, the method includes: when the specified file system is initialized, and Establishing a control file under the specified file system, wherein the control file is provided with a first function and a second function, where the first function is used to indicate how to operate the control file to complete dynamics on the PCIe bus Enumeration scan, the second function is for indicating a start position of performing an enumeration scan; performing a dynamic enumeration scan on the PCIe device bus according to the first function and the second function.
可选地,执行对PCIe设备树的枚举扫描操作包括:根据深度优先算法从PCIe控制器开始对整个所述PCIe设备树进行枚举扫描。Optionally, performing an enumeration scan operation on the PCIe device tree includes performing an enumeration scan on the entire PCIe device tree from the PCIe controller according to a depth-first algorithm.
可选地,在执行对PCIe设备树的枚举扫描操作之前包括:关闭自身携带的枚举扫描操作功能,触发依据所述深度优先算法对所述PCIe设备树进行枚举扫描的操作。Optionally, before performing the enumeration scan operation on the PCIe device tree, the method includes: turning off an enumeration scan operation function carried by the self, and triggering an operation of performing an enumeration scan on the PCIe device tree according to the depth priority algorithm.
根据本发明实施例的另一个方面,提供了一种最新周边元件扩展接口PCIe设备和PCIe总线的管理装置,包括:执行模块,设置为执行对最新周边元件扩展接口PCIe设备树的枚举扫描操作,并依据所述PCIe设备在PCIe总线中的位置生成与扫描到的所述PCEe设备对应的结构体;添加模块,设置为将所述结构体添加到所述PCIe设备的链表中;管理模块,设置为依据所述链表与指定文件系统导出的PCIe设备控制文件对所述PCIe设备和PCIe总线进行动态枚举扫描的管理,其中,所述控制文件用于指示所述PCIe设备资源信息。 According to another aspect of the present invention, there is provided a management device for a recent peripheral component expansion interface PCIe device and a PCIe bus, comprising: an execution module configured to perform an enumeration scan operation on a PCIe device tree of a latest peripheral component extension interface And generating, according to the location of the PCIe device in the PCIe bus, a structure corresponding to the scanned PCEe device; adding a module, being configured to add the structure to a linked list of the PCIe device; and managing a module, And managing the dynamic enumeration scan of the PCIe device and the PCIe bus according to the linked list and the PCIe device control file exported by the specified file system, wherein the control file is used to indicate the PCIe device resource information.
可选地,所述管理模块包括:扫描单元,设置为依据所述链表与指定文件系统导出的PCIe设备文件对所述PCIe总线执行写操作,用于执行对所述PCIe总线的动态枚举扫描;获取单元,设置为依据所述链表与指定文件系统导出的PCIe设备控制文件对所述PCIe执行读操作,用于获取所述PCIe设备的资源信息。Optionally, the management module includes: a scanning unit configured to perform a write operation on the PCIe bus according to the linked list and a PCIe device file exported by the specified file system, to perform dynamic enumeration scanning on the PCIe bus The obtaining unit is configured to perform a read operation on the PCIe according to the PCIe device control file that is exported according to the linked list and the specified file system, and is used to acquire resource information of the PCIe device.
可选地,在依据所述链表与指定文件系统导出的PCIe设备文件对所述PCIe设备和PCIe总线进行动态扫描的管理之前,所述装置还包括:建立模块,设置为在所述指定文件系统进行初始化时,并在所述指定文件系统下建立控制文件,其中,所述控制文件中设置有第一函数和第二函数,所述第一函数用于指示如何操作所述控制文件完成对所述PCIe总线的动态枚举扫描,所述第二函数用于指示执行枚举扫描的开始位置;扫描模块,设置为依据所述第一函数和所述第二函数对所述PCIe设备总线执行动态枚举扫描。Optionally, before the managing the dynamic scanning of the PCIe device and the PCIe bus according to the linked list and the PCIe device file exported by the specified file system, the device further includes: an establishing module, configured to be in the specified file system And performing a initialization, and establishing a control file under the specified file system, wherein the control file is provided with a first function and a second function, where the first function is used to indicate how to operate the control file to complete the a dynamic enumeration scan of the PCIe bus, the second function is for indicating a start position of performing an enumeration scan; and the scan module is configured to perform dynamic on the PCIe device bus according to the first function and the second function Enumeration scan.
可选地,所述执行模块,还设置为根据深度优先算法从PCIe控制器开始对整个所述PCIe设备树进行枚举扫描。Optionally, the execution module is further configured to perform an enumeration scan on the entire PCIe device tree from the PCIe controller according to a depth-first algorithm.
可选地,在执行对PCIe设备树的枚举扫描操作之前,所述装置还包括:关闭模块,设置为关闭自身携带的枚举扫描操作功能,触发依据所述深度优先算法对所述PCIe设备树进行枚举扫描的操作。Optionally, before performing the enumeration scan operation on the PCIe device tree, the device further includes: a shutdown module, configured to disable the enumeration scan operation function carried by itself, triggering the PCIe device according to the depth priority algorithm The tree performs an enumeration scan operation.
通过本发明实施例,采用在对PCIe设备树进行枚举扫描时,将扫描到的PCEe设备依据该PCEe设备在PCIe总线中的位置生成对应的结构体,并将该结构体添加到链表中;进而依据该链表以及指定文件系统导出的PCIe设备文件对PCIe设备和PCIe总线进行动态枚举扫描的管理。通过本发明实现了PCIe的动态扫描,解决了相关技术中PCIe的初始化扫描都是静态的问题,达到了提高系统调试效率的效果。According to the embodiment of the present invention, when the PCIe device tree is subjected to the enumeration scan, the scanned PCEe device generates a corresponding structure according to the location of the PCEe device in the PCIe bus, and adds the structure to the linked list. The dynamic enumeration scan management of the PCIe device and the PCIe bus is further performed according to the linked list and the PCIe device file exported by the specified file system. The invention realizes the dynamic scanning of PCIe, and solves the problem that the initial scanning of PCIe in the related art is static, and achieves the effect of improving the debugging efficiency of the system.
附图说明DRAWINGS
此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The drawings described herein are intended to provide a further understanding of the invention, and are intended to be a part of the invention. In the drawing:
图1是根据本发明实施例的PCIe设备和PCIe总线的管理方法的流程图;1 is a flowchart of a method for managing a PCIe device and a PCIe bus according to an embodiment of the present invention;
图2是根据本发明实施例的PCIe设备和PCIe总线的管理装置结构框图;2 is a structural block diagram of a management apparatus of a PCIe device and a PCIe bus according to an embodiment of the present invention;
图3是根据本发明实施例的PCIe设备和PCIe总线的管理装置可选结构框图一;3 is a block diagram 1 of an optional structure of a management device for a PCIe device and a PCIe bus according to an embodiment of the present invention;
图4是根据本发明实施例的PCIe设备和PCIe总线的管理装置可选结构框图二;4 is a block diagram 2 of an optional structure of a management device for a PCIe device and a PCIe bus according to an embodiment of the present invention;
图5是根据本发明实施例的PCIe设备和PCIe总线的管理装置可选结构框图三; 5 is a block diagram 3 of an optional structure of a management device for a PCIe device and a PCIe bus according to an embodiment of the present invention;
图6是根据本发明可选实施例的动态枚举扫描PCIe设备及管理方法流程图。6 is a flow chart of a dynamic enumeration scan PCIe device and management method in accordance with an alternative embodiment of the present invention.
具体实施方式detailed description
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本发明。It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict. The invention will be described in detail below with reference to the drawings in conjunction with the embodiments.
在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。The steps illustrated in the flowchart of the figures may be performed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, may differ from this The steps shown are performed in the order shown or described.
本实施例提供了一种PCIe设备和PCIe总线的管理方法,图1是根据本发明实施例的PCIe设备和PCIe总线的管理方法的流程图,如图1所示,该流程包括以下步骤:This embodiment provides a PCIe device and a PCIe bus management method. FIG. 1 is a flowchart of a PCIe device and a PCIe bus management method according to an embodiment of the present invention. As shown in FIG. 1, the process includes the following steps:
步骤S102:执行对PCIe设备树的枚举扫描操作,并依据PCIe设备在PCIe总线中的位置生成与扫描到的PCEe设备对应的结构体;Step S102: Perform an enumeration scan operation on the PCIe device tree, and generate a structure corresponding to the scanned PCEe device according to the location of the PCIe device in the PCIe bus;
步骤S104:将结构体添加到PCIe设备的链表中;Step S104: adding the structure to the linked list of the PCIe device;
步骤S106:依据链表与指定文件系统导出的PCIe设备文件对PCIe设备和PCIe总线进行动态枚举扫描的管理;Step S106: Perform dynamic enumeration scan management on the PCIe device and the PCIe bus according to the linked list and the PCIe device file exported by the specified file system;
其中,文件用于指示PCIe设备资源信息。The file is used to indicate PCIe device resource information.
通过本实施例,采用在对PCIe设备树进行枚举扫描时,将扫描到的PCEe设备依据该PCEe设备在PCIe总线中的位置生成对应的结构体,并将该结构体添加到链表中;进而依据该链表以及指定文件系统导出的PCIe设备文件对PCIe设备和PCIe总线进行动态枚举扫描的管理。通过本实施例实现了PCIe的动态扫描,解决了相关技术中PCIe的初始化扫描都是静态的问题,达到了提高系统调试效率的效果。In this embodiment, when performing an enumeration scan on the PCIe device tree, the scanned PCEe device generates a corresponding structure according to the location of the PCEe device in the PCIe bus, and adds the structure to the linked list; Management of dynamic enumeration scans of PCIe devices and PCIe buses based on the linked list and PCIe device files exported by the specified file system. The dynamic scanning of the PCIe is implemented by the embodiment, and the initialization scan of the PCIe in the related art is solved statically, and the effect of improving the debugging efficiency of the system is achieved.
需要说明的是,对于上述实施例中涉及到的指定文件系统,在本实施例的可选实施方式中可以是sys文件系统,而且下面也将通过该sys文件系统对本实施例进行相应的说明;It should be noted that, for the specified file system involved in the foregoing embodiment, in the optional implementation manner of this embodiment, the sys file system may be used, and the embodiment will be correspondingly described below through the sys file system;
基于上述sys文件系统,在本实施例的一个可选实施方式中,上述步骤S106中依据链表与指定文件系统导出的PCIe设备控制文件对PCIe设备和PCIe总线进行动态扫描的管理的方式可以通过如下方式来实现:Based on the above sys file system, in an optional implementation manner of this embodiment, the manner of managing the dynamic scanning of the PCIe device and the PCIe bus according to the PCIe device control file exported by the linked list and the specified file system in the foregoing step S106 may be as follows: Way to achieve:
方式一:依据链表与指定文件系统导出的PCIe设备控制文件对PCIe总线执行写操作,用于执行对PCIe总线的动态枚举扫描; Manner 1: Perform a write operation on the PCIe bus according to the linked list and the PCIe device control file exported by the specified file system, for performing dynamic enumeration scan on the PCIe bus;
方式二:依据链表与指定文件系统导出的PCIe设备控制文件对PCIe设备执行读操作,用于获取PCIe设备的资源信息。Method 2: Perform a read operation on the PCIe device according to the linked list and the PCIe device control file exported by the specified file system, and obtain the resource information of the PCIe device.
也就是说,通过上述方式一和方式二,对sys文件系统下的控制文件写入操作可以完成PCIe总线的动态枚举扫描,对sys文件系统下的PCIe设备文件读时可获取该PCIe设备的资源信息。That is to say, through the above manners 1 and 2, the control file write operation under the sys file system can complete the dynamic enumeration scan of the PCIe bus, and the PCIe device file can be obtained when the PCIe device file under the sys file system is read. Resource information.
而在步骤S106中依据链表与指定文件系统导出的PCIe设备文件对PCIe设备和PCIe总线进行动态扫描的管理之前,本实施例的方法还可以包括:Before the management of the dynamic scanning of the PCIe device and the PCIe bus by the PCIe device file exported by the linked file and the specified file system in the step S106, the method in this embodiment may further include:
步骤S11:在指定文件系统进行初始化时,并在指定文件系统下建立控制文件,其中,控制文件中设置有第一函数和第二函数,第一函数用于指示如何操作控制文件完成对PCIe总线的动态枚举扫描,第二函数用于指示执行枚举扫描的开始位置;Step S11: When the specified file system is initialized, and the control file is established under the specified file system, wherein the control file is provided with a first function and a second function, and the first function is used to indicate how to operate the control file to complete the PCIe bus. Dynamic enumeration scan, the second function is used to indicate the start position of the execution of the enumeration scan;
步骤S12:依据第一函数和第二函数对PCIe设备总线执行动态枚举扫描。Step S12: Perform a dynamic enumeration scan on the PCIe device bus according to the first function and the second function.
通过上述步骤S11和步骤S12中,采用在控制文件中设置第一函数和第二函数来实现PCIe设备总线执行动态枚举扫描,在本实施例的可选实施方式中改第一函数可以是show函数,该第二函数可以是store函数,即当读取控制文件时,系统会调用show函数显示一些字符串,这些字符串用来说明如何操作控制文件以完成PCIe设备树的动态枚举扫描;而show函数的实现本质是一种说明的用途,不起功能性作用;当写入控制文件时,系统会调用store函数。在这个函数中需要解析写入的字符串,根据解析出的内容确定需要在PCIe设备树的哪个位置开始枚举扫描;解析这些信息后,store函数会调用枚举扫描函数,对设备树的指定端口进行枚举扫描,如需扫描整个的PCIe设备树则将PCIe控制器的位置信息写入控制文件中。Through the above steps S11 and S12, the PCIe device bus is configured to perform dynamic enumeration scanning by setting the first function and the second function in the control file. In the optional implementation manner of this embodiment, the first function may be a show. Function, the second function can be a store function, that is, when reading the control file, the system will call the show function to display some strings, which are used to explain how to operate the control file to complete the dynamic enumeration scan of the PCIe device tree; The implementation of the show function is a kind of illustrative use, can not afford the function; when writing the control file, the system will call the store function. In this function, you need to parse the written string, and determine where to start the enumeration scan in the PCIe device tree based on the parsed content; after parsing the information, the store function will call the enumeration scan function to specify the device tree. The port performs an enumeration scan. If the entire PCIe device tree needs to be scanned, the location information of the PCIe controller is written into the control file.
对于本实施例涉及到的执行对PCIe设备树的枚举扫描操作方式,可选地,在本实施例中根据深度优先算法从PCIe控制器开始对整个PCIe设备树进行枚举扫描。For the manner of performing the enumeration scan operation on the PCIe device tree involved in this embodiment, optionally, in the embodiment, the entire PCIe device tree is enumerated and scanned from the PCIe controller according to the depth-first algorithm.
而对于执行枚举扫描之前,在本实施例中需要关闭自身携带的枚举扫描操作功能,触发依据深度优先算法对PCIe设备树进行枚举扫描的操作。也就是说,并不需要自带的枚举扫描流程实现PCIe设备的初始化。Before performing the enumeration scan, in this embodiment, the enumeration scan operation function carried by the self needs to be turned off, and the operation of enumerating the PCIe device tree according to the depth-first algorithm is triggered. In other words, the initialization of the PCIe device is not required by the built-in enumeration scanning process.
在本实施例中还提供了一种PCIe设备和PCIe总线的管理装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”“单元”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。In the embodiment, a management device for the PCIe device and the PCIe bus is provided, and the device is used to implement the foregoing embodiments and preferred embodiments, and details are not described herein. As used below, the term "module" "unit" may implement a combination of software and/or hardware of a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and contemplated.
图2是根据本发明实施例的PCIe设备和PCIe总线的管理装置结构框图,如图2 所示,该装置包括:执行模块22,设置为执行对最新周边元件扩展接口PCIe设备树的枚举扫描操作,并依据PCIe设备在PCIe总线中的位置生成与扫描到的PCEe设备对应的结构体;添加模块24,与执行模块22耦合连接,设置为将结构体添加到PCIe设备的链表中;管理模块26,与添加模块24耦合连接,设置为依据链表与指定文件系统导出的PCIe设备文件对PCIe设备和PCIe总线进行动态枚举扫描的管理,其中,文件用于指示PCIe设备资源信息。2 is a structural block diagram of a PCIe device and a PCIe bus management device according to an embodiment of the present invention, as shown in FIG. 2 As shown, the apparatus includes an execution module 22 configured to perform an enumerated scan operation on the latest peripheral component expansion interface PCIe device tree, and generate a structure corresponding to the scanned PCEe device according to the location of the PCIe device in the PCIe bus. The adding module 24 is coupled to the execution module 22 and configured to add the structure to the linked list of the PCIe device. The management module 26 is coupled to the adding module 24 and configured to be a PCIe device file pair exported according to the linked list and the specified file system. The PCIe device and the PCIe bus perform dynamic enumeration scan management, wherein files are used to indicate PCIe device resource information.
可选地,执行模块,还设置为根据深度优先算法从PCIe控制器开始对整个PCIe设备树进行枚举扫描。Optionally, the execution module is further configured to perform an enumeration scan of the entire PCIe device tree from the PCIe controller according to the depth first algorithm.
图3是根据本发明实施例的PCIe设备和PCIe总线的管理装置可选结构框图一,如图3所示,该管理模块26包括:扫描单元32,设置为依据链表与指定文件系统导出的PCIe设备文件对PCIe设备文件执行写操作,用于执行对PCIe总线的动态枚举扫描;获取单元34,设置为依据链表与指定文件系统导出的PCIe设备文件信息对PCIe设备文件执行读操作,用于获取PCIe设备的资源信息。FIG. 3 is a block diagram of an optional structure of a PCIe device and a PCIe bus management device according to an embodiment of the present invention. As shown in FIG. 3, the management module 26 includes: a scanning unit 32 configured to export PCIe according to a linked list and a specified file system. The device file performs a write operation on the PCIe device file, and is used to perform a dynamic enumeration scan on the PCIe bus; the obtaining unit 34 is configured to perform a read operation on the PCIe device file according to the linked list and the PCIe device file information exported by the specified file system, Obtain the resource information of the PCIe device.
图4是根据本发明实施例的PCIe设备和PCIe总线的管理装置可选结构框图二,如图4所示,在依据链表与指定文件系统导出的PCIe设备文件对PCIe设备和PCIe总线进行动态扫描的管理之前,装置还包括:建立模块42,与添加模块24耦合连接,用于在指定文件系统进行初始化时,并在指定文件系统下建立控制文件,其中,控制文件中设置有第一函数和第二函数,第一函数用于指示如何操作控制文件完成对PCIe总线的动态枚举扫描,第二函数用于指示执行枚举扫描的开始位置;扫描模块44,与建立模块42耦合连接,设置为依据第一函数和第二函数对PCIe设备总线执行动态枚举扫描。4 is a block diagram 2 of an optional structure of a PCIe device and a PCIe bus management device according to an embodiment of the present invention. As shown in FIG. 4, a PCIe device and a PCIe bus are dynamically scanned according to a PCIe device file exported according to a linked list and a specified file system. Before the management, the device further includes: an establishing module 42 coupled to the adding module 24, configured to establish a control file under the specified file system when the specified file system is initialized, wherein the control file is provided with the first function and a second function, the first function is used to indicate how to operate the control file to complete the dynamic enumeration scan of the PCIe bus, the second function is used to indicate the start position of the enumeration scan, and the scan module 44 is coupled to the setup module 42 to set A dynamic enumeration scan is performed on the PCIe device bus in accordance with the first function and the second function.
图5是根据本发明实施例的PCIe设备和PCIe总线的管理装置可选结构框图三,如图5所示,在执行对PCIe设备树的枚举扫描操作之前,装置还包括:关闭模块52,与执行模块22耦合连接,设置为关闭自身携带的枚举扫描操作功能,触发依据深度优先算法对PCIe设备树进行枚举扫描的操作。5 is a block diagram 3 of an optional structure of a management device for a PCIe device and a PCIe bus according to an embodiment of the present invention. As shown in FIG. 5, before performing an enumeration scan operation on a PCIe device tree, the device further includes: a shutdown module 52, The method is coupled to the execution module 22, and is configured to disable the enumeration scan operation function carried by the self-execution module, and trigger an operation of enumerating and scanning the PCIe device tree according to the depth-first algorithm.
下面结合本发明实施例的可选实施例对本发明进行举例说明;The present invention is exemplified in the following with reference to an optional embodiment of the embodiments of the present invention;
本可选实施例提供了种能动态枚举扫描和管理PCIe设备的方法,在本可选实施例中以Linux操作系统为例,即在Linux操作系统启动后,用户可根据需要重新扫描整个PCIe设备树,为每个PCIe总线树上的设备分配bus号和存储空间等资源。本可选实施例也可以实现从某一个PCIe端口进行递归扫描,并为该端口下的设备分配资源。This alternative embodiment provides a method for dynamically enumerating scans and managing PCIe devices. In this alternative embodiment, the Linux operating system is taken as an example. After the Linux operating system is started, the user can rescan the entire PCIe as needed. The device tree allocates resources such as bus number and storage space for devices on each PCIe bus tree. The optional embodiment can also perform recursive scanning from a certain PCIe port and allocate resources for devices under the port.
本可选实施例可以从如下几个方面来实现:This alternative embodiment can be implemented from the following aspects:
(1)PCIe设备的维护和表示 (1) Maintenance and representation of PCIe equipment
Linux操作系统自带的数据结构实现方式给了很多借鉴。在本可选实施例的实现过程中,依然采用c语言中定义结构方式表示一个已扫描到的设备,并使用链表的方法将各个设备结构体组组织在一起,从而方便后续扫描算法的实现和动态扫描功能的完成。The implementation of the data structure that comes with the Linux operating system has given a lot of reference. In the implementation process of the optional embodiment, a scanned device is still used to represent a scanned device, and each device structure group is organized by using a linked list method, thereby facilitating the implementation of the subsequent scanning algorithm. The completion of the dynamic scanning function.
(2)采用传统DFS算法进行枚举扫描(2) Enumeration scan using traditional DFS algorithm
所谓枚举扫描PCIe设备树,就是指从PCIe控制器开始枚举遍历整个PCIe设备树;当发现一个设备便为其生成一个设备结构体,并根据设备所处PCIe总线的位置,将该设备结构体添加到PCIe设备链表中。The so-called enumeration scan PCIe device tree refers to enumerating the entire PCIe device tree from the PCIe controller; when a device is found, it generates a device structure for it, and according to the location of the PCIe bus where the device is located, the device structure The body is added to the PCIe device list.
树形结构的遍历算法大致分为广度优(Breadth-First-Search,简称为BFS)和深度优先(Depth First Search简称为DFS)两种。在本可选实施例中对PCIe设备树的枚举扫描使用的是深度优先算法。使用该算法是基于两方面考虑,一是应用DFS算法完成PCIe设备树的枚举扫描有助于理解PCIe的拓扑结构,二是Linux自带的枚举扫描实现可以作为本可选实施例的参考和借鉴。The tree structure traversal algorithm is roughly divided into Breadth-First-Search (abbreviated as BFS) and Depth First Search (DFS). In this alternative embodiment, a depth-first algorithm is used for the enumeration scan of the PCIe device tree. The algorithm is based on two aspects. First, the DFS algorithm is used to complete the enumeration scan of the PCIe device tree to help understand the topology of the PCIe. Second, the enumeration scan implementation that comes with Linux can be used as a reference for this alternative embodiment. And draw on.
(3)动态枚举扫描的管理(3) Management of dynamic enumeration scan
为了提升调试和定位故障的效率,实现PCIe设备树的动态枚举扫描,本可选实施例通过sys文件系统下导出的文件来管理PCIe总线和设备;对sys文件系统下的控制文件写入操作可以完成PCIe总线的动态枚举扫描;而对sys文件系统下的PCIe设备文件读时可获取将该PCIe设备的信息。In order to improve the efficiency of debugging and locating faults, and implement dynamic enumeration scanning of the PCIe device tree, the optional embodiment manages the PCIe bus and devices through files exported under the sys file system; and writes control files to the sys file system. The dynamic enumeration scan of the PCIe bus can be completed; and the information of the PCIe device can be obtained when the PCIe device file under the sys file system is read.
下面结合附图对本可选实施例进行详细说明;The present optional embodiment will be described in detail below with reference to the accompanying drawings;
图6是根据本发明可选实施例的动态枚举扫描PCIe设备及管理方法流程图,如图6所示,该方法的步骤包括:FIG. 6 is a flowchart of a dynamic enumeration scanning PCIe device and a management method according to an alternative embodiment of the present invention. As shown in FIG. 6, the steps of the method include:
步骤S602:开始执行Linux内核;Step S602: Start executing the Linux kernel;
步骤S604:Linux内核初始化;Step S604: Initializing the Linux kernel;
步骤S606:动态枚举扫描初始化;Step S606: dynamic enumeration scan initialization;
步骤S608:通过sys文件接口操作执行动态枚举扫描;Step S608: Perform a dynamic enumeration scan by using a sys file interface operation;
步骤S610:开始动态枚举扫描;Step S610: Start a dynamic enumeration scan;
步骤S612:动态枚举扫描结束。Step S612: The dynamic enumeration scan ends.
(1)数据结构及接口设计:(1) Data structure and interface design:
为保存和表示已枚举扫描的PCIe设备,需要在Linux系统中定义一个数据结构来 描述具体的设备。Linux内核中本身存在这样的结构体,但为了能做到功能上的独立,可选实施例重新实现了PCIe的设备结构体。To save and represent the PCIe device that has been enumerated for scanning, you need to define a data structure in the Linux system. Describe the specific equipment. Such a structure exists in the Linux kernel itself, but in order to be functionally independent, the optional embodiment re-implements the PCIe device structure.
结构体中除了包含设备的基本信息,如busID,devID,vendorID,functionID,各种存储资源的基地址等,还包括了维护PCIe设备树链表所需要的指针,和管理sys文件数据结构。In addition to the basic information of the device, such as busID, devID, vendorID, functionID, and the base address of various storage resources, the structure also includes the pointers needed to maintain the PCIe device tree list, and manages the sys file data structure.
(2)深度优先遍历描PCIe设备树的实现:(2) Depth-first traversal implementation of the PCIe device tree:
A:关闭Linux操作系统自带的枚举、开启动态枚举。A: Turn off the enumeration that comes with the Linux operating system and enable dynamic enumeration.
一个处理器系统首先从Firmware开始执行,由Firmware开始引导Linux内核。引导过程结束之后,系统将会跳转到Linux的第一个head.s文件中,之后再由head.s文件跳转到./init/main.c文件的start_kernel函数。从这里内核开始PCIe初始化之旅。A processor system begins with firmware and starts booting the Linux kernel with Firmware. After the boot process, the system will jump to the first head.s file in Linux, and then jump to the start_kernel function of the ./init/main.c file from the head.s file. Start the PCIe initialization journey from here.
不同的系统使用的Firmware也并不相同,x86系统使用BIOS,而Powerpc系统使用U-Boot。PCIe设备的枚举初始化通常会在Firmware阶段完成,在这个阶段会为PCIe设备树中的每个设备分配busID,devID,functionID等资源。The firmware used by different systems is also different. The x86 system uses the BIOS, while the Powerpc system uses U-Boot. Enumeration initialization of PCIe devices is usually done in the Firmware phase, where each device in the PCIe device tree is assigned resources such as busID, devID, functionID, and so on.
Linux内核阶段,会根据编译时的不同选项完成不同的PCIe初始化枚举扫描操作。当在编译Linux内核过程中配置了CONFIG_PCI_BOIS选项,Linux内核中的PCIe初始化流程只不过是根据Firmware枚举的结果建立内核的PCIe相关的数据结构,将PCIe设备的维护添加到设备管理模型中。这个过程并不会为PCIe设备分配busID,devID,functionID和存储空间等资源。相反,如果内核在编译时配置了CONFIG_PCI_DIRECT选项,Linux系统启动后将重新枚举PCIe总线上的设备,并为它们分配所需的资源。In the Linux kernel phase, different PCIe initialization enumeration scan operations are performed according to different options at compile time. When the CONFIG_PCI_BOIS option is configured during Linux kernel compilation, the PCIe initialization process in the Linux kernel is simply based on the result of the firmware enumeration to establish the PCIe-related data structure of the kernel, adding the maintenance of the PCIe device to the device management model. This process does not allocate resources such as busID, devID, functionID, and storage space for PCIe devices. Conversely, if the kernel is configured with the CONFIG_PCI_DIRECT option at compile time, the Linux system will re-enumerate the devices on the PCIe bus and allocate the required resources to them.
在可选实施例的实现的方法中,并不需要Linux内核中自带的枚举扫描流程实现PCIe设备的初始化,所以在编译内核的时应闭掉CONFIG_PCI_DIRECT选项。并且还保证本可选实施例实现的动态管理的枚举过程要在Linux内核初始化PCIe设备树之前完成。因此本可选实施例中的实现是将动态枚举扫描的初始化接口函数start_pcie放在do_basic_setup函数最开始的位置来执行。In the method of implementing the optional embodiment, the initialization process of the PCIe device is not required in the Linux kernel, so the CONFIG_PCI_DIRECT option should be closed when compiling the kernel. It also ensures that the dynamic management enumeration process implemented by this alternative embodiment is completed before the Linux kernel initializes the PCIe device tree. Therefore, the implementation in this alternative embodiment is performed by placing the initialization interface function start_pcie of the dynamic enumeration scan at the beginning of the do_basic_setup function.
B:动态枚举扫描函数的实现B: Implementation of dynamic enumeration scan function
动态枚举扫描是通过函数pci_scan_device(struct bsp_pci_device*parent,int domain,int bus,int device,int func)这个函数来实现的。这个函数使用DFB算法对父节点parent下的PCIe设备树进行递归扫描、分配资源。当发现新的PCIe设备后,首先会为该设备分配相应的资源,再生成一个struct bsp_pci_device结构体来保存设备的信息,并将该结构体添加到PCIe设备的链表中;当该函数执行完毕后parent下的所有PCIe设备将被初始化,所产生的设备结构体也会全部添加到PCIe设备链表中;这样做会便于 PCIe设备的管理。The dynamic enumeration scan is implemented by the function pci_scan_device(struct bsp_pci_device*parent, int domain, int bus, int device, int func). This function uses the DFB algorithm to recursively scan and allocate resources to the PCIe device tree under the parent node parent. After discovering a new PCIe device, the device is first allocated corresponding resources, and then a struct bsp_pci_device structure is generated to save the device information, and the structure is added to the linked list of the PCIe device; when the function is executed, All PCIe devices under parent will be initialized, and the generated device structure will be added to the PCIe device list. This will be convenient. Management of PCIe devices.
(3)支持动态枚举扫描的sys文件接口:(3) sys file interface supporting dynamic enumeration scanning:
A:定义动态枚举扫描接口的文件及相应操作A: Define the files of the dynamic enumeration scan interface and the corresponding operations
为了完成通过操作sys文件系统下的文件来实现动态枚举扫描,系统初始化时需在/sys下建立相应目录和控制文件,并为控制文件定义show和store的操作。In order to complete the dynamic enumeration scan by operating the files under the sys file system, the system needs to establish the corresponding directory and control file under /sys, and define the show and store operations for the control file.
动态枚举扫描的初始化接口函数start_pcie是实现PCIe的sys文件初始化的最合适的地方。在start_pcie中调用Linux内核提供的sysfs_create_file函数来建立PCIe动态枚举扫描控制文件pci_control。The initialization interface function start_pcie of the dynamic enumeration scan is the most suitable place to implement PCIe sys file initialization. The sysfs_create_file function provided by the Linux kernel is called in start_pcie to establish the PCIe dynamic enumeration scan control file pci_control.
为了能真正通过pci_control文件实现PCIe设备树的动态扫描,需要实现这个文件的show和store函数。当读取pci_control文件时,系统会调用show函数显示一些字符串。这些字符串用来说明如何操作pci_control文件以完成PCIe设备树的动态枚举扫描。show函数的实现本质是一种说明的用途,不起功能性作用。当写入pci_control文件时,系统会调用store函数。在这个函数中需要解析写入的字符串,根据解析出的内容确定需要在PCIe设备树的哪个位置开始枚举扫描。解析这些信息后,store函数会调用上面提到的pci_scan_device函数,对设备树的指定端口进行枚举扫描,如需扫描整个的PCIe设备树则将PCIe控制器的位置信息写入pci_control文件中。In order to actually implement dynamic scanning of the PCIe device tree through the pci_control file, the show and store functions of this file need to be implemented. When reading the pci_control file, the system will call the show function to display some strings. These strings are used to illustrate how to manipulate the pci_control file to perform a dynamic enumeration scan of the PCIe device tree. The implementation of the show function is essentially a declarative use and does not function. When the pci_control file is written, the store function is called. In this function, the written string needs to be parsed, and based on the parsed content, it is determined at which position in the PCIe device tree the enumeration scan needs to be started. After parsing this information, the store function will call the above mentioned pci_scan_device function to perform an enumeration scan on the specified port of the device tree. If the entire PCIe device tree needs to be scanned, the location information of the PCIe controller is written into the pci_control file.
B:实现PCIe设备文件及相应操作:B: Implement PCIe device files and corresponding operations:
如前,当调用动态枚举扫描函数pci_scan_device扫描到了一个PCIe设备后,系统会为其分配一个设备结构体struct bsp_pci_device,并使用这个结构体来记录和表示一个PCIe设备。而为实现显示和控制PCIe设备,在扫描时也需要将扫描到的设备导出到/sys文件系统下,在该文件系统下生成一个设备文件ww:xx.yy.zz。(其中,ww表示该设备所在域,xx为设备的总线号,yy为设备号,zz为function号)。当读/写操作该文件时,Linux内核会施予相应的动作到PCIe设备上。As before, when the dynamic enumeration scan function pci_scan_device is called to scan a PCIe device, the system assigns a device structure struct bsp_pci_device to it, and uses this structure to record and represent a PCIe device. In order to display and control the PCIe device, the scanned device needs to be exported to the /sys file system during scanning, and a device file ww:xx.yy.zz is generated under the file system. (Wh, ww indicates the domain where the device is located, xx is the bus number of the device, yy is the device number, and zz is the function number). When the file is read/written, the Linux kernel will apply the appropriate action to the PCIe device.
当读取设备文件ww:xx.yy.zz时,系统调用设备文件的show函数。这个函数在本可选实施例中实现为打印对应的PCIe设备配置空间的操作。当向设备文件写入值时,Linux会调用专利中实现的store函数完成PCIe设备的配置空间的写入操作。When the device file ww:xx.yy.zz is read, the system calls the show function of the device file. This function is implemented in this alternative embodiment as the operation of printing the corresponding PCIe device configuration space. When writing a value to a device file, Linux will call the store function implemented in the patent to complete the write operation of the PCIe device's configuration space.
在本实施例中将PCIe动态枚举扫描管理功能直接编译到内核中,因此在Linux系统上电后会对该功能进行一次完整的初始化;初始化主要包括两方面:一是枚举扫描PCIe设备树,并为枚举扫描到的PCIe设备建立相应的数据结构,形成设备树的链表;二是根据枚举扫描结果在sys文件系统中建立PCIe设备的显示和管理接口。通过本可选实施例的方法可以提高PCIe调试的效率,降低PCIe调试的复杂度。 In this embodiment, the PCIe dynamic enumeration scan management function is directly compiled into the kernel. Therefore, after the Linux system is powered on, the function is completely initialized. The initialization mainly includes two aspects: one is to enumerate and scan the PCIe device tree. And establishing a corresponding data structure for the enumerated PCIe device to form a linked list of device trees; second, establishing a display and management interface of the PCIe device in the sys file system according to the enumerated scan result. The method of the alternative embodiment can improve the efficiency of PCIe debugging and reduce the complexity of PCIe debugging.
以上仅为本发明的可选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above is only an alternative embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.
工业实用性Industrial applicability
在本发明中,采用在对PCIe设备树进行枚举扫描时,将扫描到的PCEe设备依据该PCEe设备在PCIe总线中的位置生成对应的结构体,并将该结构体添加到链表中;进而依据该链表以及指定文件系统导出的PCIe设备文件对PCIe设备和PCIe总线进行动态枚举扫描的管理。通过本发明实现了PCIe的动态扫描,解决了相关技术中PCIe的初始化扫描都是静态的问题,达到了提高系统调试效率的效果。 In the present invention, when performing an enumeration scan on the PCIe device tree, the scanned PCEe device generates a corresponding structure according to the location of the PCEe device in the PCIe bus, and adds the structure to the linked list; Management of dynamic enumeration scans of PCIe devices and PCIe buses based on the linked list and PCIe device files exported by the specified file system. The invention realizes the dynamic scanning of PCIe, and solves the problem that the initial scanning of PCIe in the related art is static, and achieves the effect of improving the debugging efficiency of the system.

Claims (10)

  1. 一种最新周边元件扩展接口PCIe设备和PCIe总线的管理方法,包括:A new peripheral component expansion interface PCIe device and PCIe bus management method, including:
    执行对最新周边元件扩展接口PCIe设备树的枚举扫描操作,并依据所述PCIe设备在PCIe总线中的位置生成与扫描到的所述PCEe设备对应的结构体;Performing an enumeration scan operation on the latest peripheral component expansion interface PCIe device tree, and generating a structure corresponding to the scanned PCEe device according to the location of the PCIe device in the PCIe bus;
    将所述结构体添加到所述PCIe设备的链表中;Adding the structure to a linked list of the PCIe device;
    依据所述链表与指定文件系统导出的PCIe设备控制文件对所述PCIe设备和PCIe总线进行动态枚举扫描的管理,其中,所述控制文件用于指示所述PCIe设备资源信息。And managing the dynamic enumeration scan of the PCIe device and the PCIe bus according to the linked list and the PCIe device control file exported by the specified file system, where the control file is used to indicate the PCIe device resource information.
  2. 根据权利要求1所述的方法,其中,依据所述链表与指定文件系统导出的PCIe设备控制文件对所述PCIe设备和PCIe总线进行动态扫描的管理包括:The method of claim 1, wherein the managing the dynamic scanning of the PCIe device and the PCIe bus according to the linked list and the PCIe device control file exported by the specified file system comprises:
    依据所述链表与指定文件系统导出的PCIe设备文件对所述PCIe总线执行写操作,用于执行对所述PCIe总线的动态枚举扫描;Performing a write operation on the PCIe bus according to the linked list and a PCIe device file exported by the specified file system, for performing dynamic enumeration scan on the PCIe bus;
    依据所述链表与指定文件系统导出的PCIe设备控制文件对所述PCIe设备执行读操作,用于获取所述PCIe设备的资源信息。And performing a read operation on the PCIe device according to the linked list and the PCIe device control file that is specified by the specified file system, and configured to acquire resource information of the PCIe device.
  3. 根据权利要求1所述的方法,其中,在依据所述链表与指定文件系统导出的PCIe设备控制文件对所述PCIe设备和PCIe总线进行动态扫描的管理之前,所述方法包括:The method of claim 1, wherein before the managing the dynamic scanning of the PCIe device and the PCIe bus according to the linked list and the PCIe device control file exported by the specified file system, the method comprises:
    在所述指定文件系统进行初始化时,并在所述指定文件系统下建立控制文件,其中,所述控制文件中设置有第一函数和第二函数,所述第一函数用于指示如何操作所述控制文件完成对所述PCIe总线的动态枚举扫描,所述第二函数用于指示执行枚举扫描的开始位置;And when the specified file system is initialized, and the control file is established under the specified file system, wherein the control file is provided with a first function and a second function, where the first function is used to indicate how to operate The control file completes a dynamic enumeration scan of the PCIe bus, and the second function is used to indicate a start position of performing an enumeration scan;
    依据所述第一函数和所述第二函数对所述PCIe设备总线执行动态枚举扫描。Performing a dynamic enumeration scan on the PCIe device bus in accordance with the first function and the second function.
  4. 根据权利要求1所述的方法,其中,执行对PCIe设备树的枚举扫描操作包括:The method of claim 1 wherein performing an enumeration scan operation on the PCIe device tree comprises:
    根据深度优先算法从PCIe控制器开始对整个所述PCIe设备树进行枚举扫描。An enumeration scan of the entire PCIe device tree is started from the PCIe controller according to a depth-first algorithm.
  5. 根据权利要求4所述的方法,其中,在执行对PCIe设备树的枚举扫描操作之前包括:The method of claim 4 wherein prior to performing an enumeration scan operation on the PCIe device tree comprises:
    关闭自身携带的枚举扫描操作功能,触发依据所述深度优先算法对所述PCIe设备树进行枚举扫描的操作。The enumeration scan operation function carried by the user is turned off, and the operation of enumerating the PCIe device tree according to the depth-first algorithm is triggered.
  6. 一种最新周边元件扩展接口PCIe设备和PCIe总线的管理装置,包括: A new peripheral component expansion interface PCIe device and PCIe bus management device, including:
    执行模块,设置为执行对最新周边元件扩展接口PCIe设备树的枚举扫描操作,并依据所述PCIe设备在PCIe总线中的位置生成与扫描到的所述PCEe设备对应的结构体;An execution module, configured to perform an enumeration scan operation on the latest peripheral component expansion interface PCIe device tree, and generate a structure corresponding to the scanned PCEe device according to the location of the PCIe device in the PCIe bus;
    添加模块,设置为将所述结构体添加到所述PCIe设备的链表中;Adding a module, configured to add the structure to a linked list of the PCIe device;
    管理模块,设置为依据所述链表与指定文件系统导出的PCIe设备控制文件对所述PCIe设备和PCIe总线进行动态枚举扫描的管理,其中,所述控制文件用于指示所述PCIe设备资源信息。a management module, configured to perform dynamic enumeration scan management on the PCIe device and the PCIe bus according to the linked list and the PCIe device control file exported by the specified file system, where the control file is used to indicate the PCIe device resource information .
  7. 根据权利要求6所述的装置,其中,所述管理模块包括:The apparatus of claim 6 wherein said management module comprises:
    扫描单元,设置为依据所述链表与指定文件系统导出的PCIe设备文件对所述PCIe总线执行写操作,用于执行对所述PCIe总线的动态枚举扫描;a scanning unit, configured to perform a write operation on the PCIe bus according to the linked list and a PCIe device file exported by the specified file system, to perform dynamic enumeration scanning on the PCIe bus;
    获取单元,设置为依据所述链表与指定文件系统导出的PCIe设备控制文件对所述PCIe执行读操作,用于获取所述PCIe设备的资源信息。The obtaining unit is configured to perform a read operation on the PCIe according to the PCIe device control file that is exported according to the linked list and the specified file system, and is used to acquire resource information of the PCIe device.
  8. 根据权利要求6所述的装置,其中,在依据所述链表与指定文件系统导出的PCIe设备文件对所述PCIe设备和PCIe总线进行动态扫描的管理之前,所述装置还包括:The apparatus of claim 6, wherein the apparatus further comprises: before managing the dynamic scanning of the PCIe device and the PCIe bus according to the linked list and the PCIe device file exported by the specified file system, the apparatus further comprising:
    建立模块,设置为在所述指定文件系统进行初始化时,并在所述指定文件系统下建立控制文件,其中,所述控制文件中设置有第一函数和第二函数,所述第一函数用于指示如何操作所述控制文件完成对所述PCIe总线的动态枚举扫描,所述第二函数用于指示执行枚举扫描的开始位置;Establishing a module, configured to establish a control file under the specified file system when the specified file system is initialized, wherein the control file is provided with a first function and a second function, where the first function is used Performing a dynamic enumeration scan of the PCIe bus for indicating how to operate the control file, the second function for indicating a start position of performing an enumeration scan;
    扫描模块,设置为依据所述第一函数和所述第二函数对所述PCIe设备总线执行动态枚举扫描。A scanning module is configured to perform a dynamic enumeration scan on the PCIe device bus in accordance with the first function and the second function.
  9. 根据权利要求6所述的装置,其中,The apparatus according to claim 6, wherein
    所述执行模块,还设置为根据深度优先算法从PCIe控制器开始对整个所述PCIe设备树进行枚举扫描。The execution module is further configured to perform an enumeration scan on the entire PCIe device tree from the PCIe controller according to a depth-first algorithm.
  10. 根据权利要求9所述的装置,其中,在执行对PCIe设备树的枚举扫描操作之前,所述装置还包括:The apparatus of claim 9, wherein before performing the enumeration scan operation on the PCIe device tree, the apparatus further comprises:
    关闭模块,设置为关闭自身携带的枚举扫描操作功能,触发依据所述深度优先算法对所述PCIe设备树进行枚举扫描的操作。 The module is closed, and is configured to disable the enumeration scan operation function carried by the module, and trigger an enumeration scan operation on the PCIe device tree according to the depth-first algorithm.
PCT/CN2015/088177 2015-03-20 2015-08-26 Pcie apparatus and pcie bus management method and device WO2016150098A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510127980.6 2015-03-20
CN201510127980.6A CN106033399B (en) 2015-03-20 2015-03-20 PCIe equipment and PCIe bus management method and device

Publications (1)

Publication Number Publication Date
WO2016150098A1 true WO2016150098A1 (en) 2016-09-29

Family

ID=56976943

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/088177 WO2016150098A1 (en) 2015-03-20 2015-08-26 Pcie apparatus and pcie bus management method and device

Country Status (2)

Country Link
CN (1) CN106033399B (en)
WO (1) WO2016150098A1 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109324899A (en) * 2018-09-10 2019-02-12 中国电子科技集团公司电子科学研究院 Addressing method, device and main controlled node based on the pond PCIe hardware resource
CN112835839A (en) * 2021-02-04 2021-05-25 深圳市广和通无线股份有限公司 PCIe interface device enumeration method, PCIe interface device enumeration apparatus, PCIe interface device and PCIe interface storage medium
CN114338475A (en) * 2021-12-30 2022-04-12 北京天融信网络安全技术有限公司 Link rate abnormity detection method and device, electronic equipment and storage medium
CN114546500A (en) * 2022-01-28 2022-05-27 郑州信大捷安信息技术股份有限公司 Method and system for realizing password card drive supporting multiple devices
CN114840465A (en) * 2022-05-06 2022-08-02 深圳星云智联科技有限公司 Method, device, equipment and storage medium for improving compatibility of PCIe card
US11836059B1 (en) 2020-12-14 2023-12-05 Sanblaze Technology, Inc. System and method for testing non-volatile memory express storage devices

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107357408B (en) * 2017-06-30 2020-02-04 郑州云海信息技术有限公司 NVMe JBOF energy-saving method and system and data center
CN108287804B (en) * 2018-01-25 2021-12-28 郑州云海信息技术有限公司 I2C controller driving method and system
CN110134446B (en) * 2019-04-18 2022-04-15 深圳市广和通无线股份有限公司 Method for starting PCIE equipment scanning
CN114003170B (en) * 2021-09-17 2024-03-19 方一信息科技(上海)有限公司 FPGA-based Raid card driving method
CN114706602B (en) * 2022-04-01 2023-03-24 珠海读书郎软件科技有限公司 Android-based method for updating parameters of touch screen through app

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101206629A (en) * 2006-12-19 2008-06-25 国际商业机器公司 System and method for hot-plug/remove of a new component in a running PCIe fabric
CN101739379A (en) * 2010-01-21 2010-06-16 山东高效能服务器和存储研究院 Server-based method for designing hot-swappable PCIE equipment box
US20120221764A1 (en) * 2011-02-25 2012-08-30 International Business Machines Corporation Low latency precedence ordering in a pci express multiple root i/o virtualization environment
CN102722414A (en) * 2012-05-22 2012-10-10 中国科学院计算技术研究所 Input/output (I/O) resource management method for multi-root I/O virtualization sharing system
CN103246545A (en) * 2013-05-07 2013-08-14 中国人民解放军国防科学技术大学 Multi-virtual-domain-facing customized PCIe (peripheral component interface express) periphery equipment tree generating method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662458B (en) * 2012-04-18 2015-07-08 华为技术有限公司 Dynamic energy-saving method and device for PCIE equipment and communication system of PCIE equipment
CN103763129B (en) * 2013-12-31 2018-05-25 华为技术有限公司 A kind of PCIe equipment management method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101206629A (en) * 2006-12-19 2008-06-25 国际商业机器公司 System and method for hot-plug/remove of a new component in a running PCIe fabric
CN101739379A (en) * 2010-01-21 2010-06-16 山东高效能服务器和存储研究院 Server-based method for designing hot-swappable PCIE equipment box
US20120221764A1 (en) * 2011-02-25 2012-08-30 International Business Machines Corporation Low latency precedence ordering in a pci express multiple root i/o virtualization environment
CN102722414A (en) * 2012-05-22 2012-10-10 中国科学院计算技术研究所 Input/output (I/O) resource management method for multi-root I/O virtualization sharing system
CN103246545A (en) * 2013-05-07 2013-08-14 中国人民解放军国防科学技术大学 Multi-virtual-domain-facing customized PCIe (peripheral component interface express) periphery equipment tree generating method

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109324899A (en) * 2018-09-10 2019-02-12 中国电子科技集团公司电子科学研究院 Addressing method, device and main controlled node based on the pond PCIe hardware resource
CN109324899B (en) * 2018-09-10 2022-05-20 中国电子科技集团公司电子科学研究院 Addressing method and device based on PCIe (peripheral component interface express) pooled hardware resources and master control node
US11836059B1 (en) 2020-12-14 2023-12-05 Sanblaze Technology, Inc. System and method for testing non-volatile memory express storage devices
CN112835839A (en) * 2021-02-04 2021-05-25 深圳市广和通无线股份有限公司 PCIe interface device enumeration method, PCIe interface device enumeration apparatus, PCIe interface device and PCIe interface storage medium
CN114338475A (en) * 2021-12-30 2022-04-12 北京天融信网络安全技术有限公司 Link rate abnormity detection method and device, electronic equipment and storage medium
CN114338475B (en) * 2021-12-30 2023-12-01 北京天融信网络安全技术有限公司 Link rate abnormality detection method and device, electronic equipment and storage medium
CN114546500A (en) * 2022-01-28 2022-05-27 郑州信大捷安信息技术股份有限公司 Method and system for realizing password card drive supporting multiple devices
CN114840465A (en) * 2022-05-06 2022-08-02 深圳星云智联科技有限公司 Method, device, equipment and storage medium for improving compatibility of PCIe card
CN114840465B (en) * 2022-05-06 2023-08-18 深圳星云智联科技有限公司 Method, device, equipment and storage medium for improving PCIe card compatibility

Also Published As

Publication number Publication date
CN106033399A (en) 2016-10-19
CN106033399B (en) 2020-05-15

Similar Documents

Publication Publication Date Title
WO2016150098A1 (en) Pcie apparatus and pcie bus management method and device
Olivier et al. A binary-compatible unikernel
US9501289B2 (en) Method of a UEFI firmware and computer system thereof
US9612846B2 (en) Out-of-band (OOB) real-time inventory and configuration of original equipment manufacturer (OEM) devices using advanced configuration and power interface (ACPI) and unified extensible firmware interface (UEFI) services
US7421620B2 (en) Configuration proxy service for the extended firmware interface environment
US11645068B2 (en) Method for implementing function jump, apparatus, and computer storage medium
US9965288B2 (en) Preconfiguring hardware and speeding up server discovery prior to bios boot
US10489582B1 (en) Firmware security vulnerability verification service
JP2016509714A (en) Software interface for hardware devices
Hale et al. Electrical Engineering and Computer Science Department
US10866881B1 (en) Firmware debug trace capture
CN103842980B (en) Mthods, systems and devices for protocol-neutral fabric
CN115291946A (en) Hongmong system transplanting method, device, electronic equipment and readable medium
US20160378696A1 (en) Exposing memory-mapped io devices to drivers by emulating pci bus and pci device configuration space
RU2634171C1 (en) Method of code execution by interpreter
US20180329729A1 (en) Software-defined microservices
JP2023547070A (en) Reloading updated shared libraries without stopping application execution
US20230259444A1 (en) Setting breakpoints for source code segments enclosed by macros
US11182182B2 (en) Calling arbitrary functions in the kernel via a probe script
JP2023538812A (en) Hybrid binary with codestream folding
Thiruvathukal Gentoo linux: the next generation of linux
CN109918125B (en) GPU configuration method and device based on OpenPOWER architecture
Gediya et al. Open-Source Software
Kristiansen PCIe Device Lending
US8555046B2 (en) Computer system and its HW abstraction method

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15886027

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15886027

Country of ref document: EP

Kind code of ref document: A1