WO2023179714A1 - 数据传输方法、系统、装置、设备及计算机可读存储介质 - Google Patents

数据传输方法、系统、装置、设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2023179714A1
WO2023179714A1 PCT/CN2023/083385 CN2023083385W WO2023179714A1 WO 2023179714 A1 WO2023179714 A1 WO 2023179714A1 CN 2023083385 W CN2023083385 W CN 2023083385W WO 2023179714 A1 WO2023179714 A1 WO 2023179714A1
Authority
WO
WIPO (PCT)
Prior art keywords
configuration table
target
transmission
control command
initial configuration
Prior art date
Application number
PCT/CN2023/083385
Other languages
English (en)
French (fr)
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 WO2023179714A1 publication Critical patent/WO2023179714A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0806Configuration setting for initial configuration or provisioning, e.g. plug-and-play
    • 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/4204Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus
    • G06F13/4221Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus being an input/output bus, e.g. ISA bus, EISA bus, PCI bus, SCSI bus
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40006Architecture of a communication node
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/084Configuration by using pre-existing information, e.g. using templates or copying from other elements
    • H04L41/0846Configuration by using pre-existing information, e.g. using templates or copying from other elements based on copy from other elements
    • 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/0024Peripheral component interconnect [PCI]
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present application relates to the field of equipment communication, and in particular to a data transmission method, system, device, equipment and computer-readable storage medium.
  • PCIe bus system Peripheral component interconnect express, high-speed serial computer expansion bus standard
  • data transmission between endpoint devices (EP, Endpoint) on the bus can usually be carried out under the control of the host device CPU, such as traditional PCIe point-to-point Data transfer (PCIe P2P) allows two endpoint devices to transfer data under the control of the host device, and the host device handles operations such as interruptions during the data transfer.
  • PCIe P2P PCIe point-to-point Data transfer
  • PCIe P2P PCIe point-to-point Data transfer
  • the above-mentioned PCIe point-to-point data transmission process easily increases the data transmission delay between endpoint devices.
  • this process also requires the host device to install supporting transmission software, which easily increases the maintenance cost of the PCIe bus system.
  • the purpose of this application is to provide a data transmission method, system, device, equipment and computer-readable storage medium, which can be used by the host device to help the transmission initiating device configure the target device to ensure that the PCIe device can realize autonomous point-to-point transmission between devices.
  • this application provides a data transmission method, which is applied to a data transmission system.
  • the data transmission system includes a host device, a device to be transmitted, and a transmission initiating device.
  • the device to be transmitted and the transmission initiating device are both PCIe devices.
  • the method includes :
  • the host device sends the initial configuration table of the device to be transmitted to the transmission initiating device;
  • the initial configuration table contains the device information of the device to be transmitted;
  • the transmission initiating device determines the target device among the devices to be transmitted based on the device information, fills in the transmission configuration information in the initial configuration table of the target device to obtain a complete configuration table, and sends the complete configuration table to the host device;
  • the host device configures the target device according to the transmission configuration information, updates the preset configuration status bit in the complete configuration table to the success status, and sends the updated complete configuration table to the transmission initiating device;
  • the transmission initiating device determines that the configuration status bit is in the successful state, it uses the complete configuration table to perform PCIe point-to-point data transmission with the target device.
  • the transmission configuration information is filled in the initial configuration table of the target device to obtain a complete configuration table, including:
  • the transmission initiating device determines whether the target device needs to be enabled based on the initial configuration table of the target device;
  • the target interrupt type is MSI interrupt
  • the interrupt configuration information includes MSI interrupt address, interrupt data and number of interrupts
  • the host device configures the target device according to the transmission configuration information, including:
  • the host device reads the enable flag bit, target interrupt type and interrupt configuration information from the transmission configuration information
  • target interrupt type is an MSI interrupt
  • the method before the host device sends the initial configuration table of the device to be transmitted to the transmission initiating device, the method further includes:
  • the host device extracts device information from the configuration space of the device to be transferred and uses the device information to create an initial configuration table.
  • the host device sends the initial configuration table of the device to be transmitted to the transmission initiating device, including:
  • the host device constructs a first control command, sends the first control command to the control command submission queue, and updates the status of the doorbell register;
  • the first control command includes the storage address of the initial configuration table in the memory of the host device;
  • the transmission initiating device When the transmission initiating device detects the occurrence status update of the doorbell register, it extracts the first control command from the control command submission queue and obtains the initial configuration table from the memory according to the storage address;
  • send the complete configuration form to the host device including:
  • the host device constructs a second control command, sends the second control command to the control command submission queue, and updates the status of the doorbell register; the second control command contains the target write address of the complete configuration table in the memory;
  • the transmission initiating device When the transmission initiating device detects a state change of the doorbell register, it extracts the second control command from the control command submission queue and writes the complete configuration table into the memory according to the target write address.
  • the first control command is a feature setting command, which obtains the initial configuration table from the memory according to the storage address, including:
  • the transmission initiating device determines whether the function identifier in the feature setting command is the first preset value
  • the second control command is a feature acquisition command, which writes the complete configuration table into the memory according to the target write address, including:
  • the transmission initiating device determines whether the function identifier in the characteristic acquisition command is the second preset value
  • the target write address is read from the data pointer of the characteristic acquisition command, and the complete configuration table is written into the memory according to the target write address.
  • the initial configuration table after obtaining the initial configuration table from the memory according to the storage address, it also includes:
  • the transmission initiating device sends the first execution result of the execution characteristic setting command to the host device through the control command response queue;
  • the transmission initiating device sends the second execution result of the execution characteristic acquisition command to the host device through the control command response queue. Prepare.
  • This application also provides a data processing method, which is applied to the host device in the data transmission system.
  • the data transmission system includes the host device, the device to be transmitted, and the transmission initiating device.
  • the method includes:
  • the initial configuration table contains the device information of the device to be transmitted;
  • the complete configuration table is obtained by the transmission initiating device determining the target device among the devices to be transmitted based on the device information, and filling in the transmission configuration information in the initial configuration table of the target device;
  • Configure the target device according to the transmission configuration information, update the preset configuration status bit in the complete configuration table to the success status, and send the updated complete configuration table to the transmission initiating device, so that the transmission initiating device determines that the configuration status bit is in the success status.
  • complete configuration table for PCIe point-to-point data transfer with the target device.
  • configuring the target device according to the transmission configuration information includes:
  • target interrupt type is an MSI interrupt
  • the method before sending the initial configuration table of the device to be transmitted to the transmission initiating device, the method further includes:
  • sending the initial configuration table of the device to be transmitted to the transmission initiating device includes:
  • the first control command includes the storage address of the initial configuration table in the memory of the host device;
  • Construct a second control command send the second control command to the control command submission queue, and update the status of the doorbell register; the second control command contains the target write address of the complete configuration table in the memory.
  • the data transmission system includes a host device, a device to be transmitted, and a transmission initiating device.
  • the method includes:
  • the initial configuration table contains the device information of the device to be transmitted;
  • the update of the complete configuration table is performed by the host device to configure the target device according to the transmitted configuration information, and update the preset configuration status bit in the complete configuration table to the successful status;
  • the complete configuration table is used to perform PCIe point-to-point data transmission with the target device.
  • the transmission configuration information is filled in the initial configuration table of the target device to obtain a complete configuration table, including:
  • the target interrupt type is MSI interrupt
  • the interrupt configuration information includes MSI interrupt address, interrupt data and number of interrupts
  • obtaining the initial configuration table of the device to be transmitted sent by the host device includes:
  • the first control command is extracted from the control command submission queue.
  • the first control command is sent by the host device to the control command submission queue, and the first control command includes an initial configuration table in the host device. Storage address in memory;
  • send the complete configuration form to the host device including:
  • a second control command is extracted from the control command submission queue.
  • the second control command is sent by the host device to the control command submission queue, and the second control command contains the complete configuration table in the memory.
  • the first control command is a feature setting command, which obtains the initial configuration table from the memory according to the storage address, including:
  • the second control command is a feature acquisition command, which writes the complete configuration table into the memory according to the target write address, including:
  • the target write address is read from the data pointer of the characteristic acquisition command, and the complete configuration table is written into the memory according to the target write address.
  • the method further includes:
  • the second execution result of the execution characteristic acquisition command is sent to the host device through the control command response queue.
  • This application also provides a data transmission system, including a host device, a device to be transmitted, and a transmission initiating device.
  • the device to be transmitted and the transmission initiating device are both PCIe devices, wherein:
  • the host device is used to send the initial configuration table of the device to be transmitted to the transmission initiating device;
  • the initial configuration table contains the device information of the device to be transmitted; configure the target device according to the transmission configuration information in the complete configuration table returned by the transmission initiating device, and
  • the preset configuration status bits in the complete configuration table are updated to the success status, and the updated complete configuration table is sent to the transmission initiating device;
  • the transmission initiating device is used to determine the target device among the devices to be transmitted based on the device information in the initial configuration table, fill in the transmission configuration information in the initial configuration table of the target device to obtain a complete configuration table, and send the complete configuration table to the host device; When it is determined that the configuration status bit in the complete configuration table is in a successful state, use the complete configuration table to perform PCIe point-to-point data transmission with the target device;
  • the device to be transmitted is used for PCIe point-to-point data transmission with the transmission initiating device after being configured by the host device.
  • the transmission initiating device is also used to determine whether the target device is based on the initial configuration table of the target device. Needs to be enabled; if the target device needs to be enabled, update the preset enable flag in the initial configuration table to the required enable state; read the interrupt types supported by the target device from the initial configuration table and select from the interrupt type Target interrupt type, and fill in the target interrupt type in the initial configuration table; if the target interrupt type is MSI interrupt, fill in the preset interrupt configuration information in the initial configuration table; the interrupt configuration information includes MSI interrupt address, interrupt data and interrupt individual number; set the completed initial configuration form as the complete configuration form.
  • the data transmission system includes a host device, a device to be transmitted, and a transmission initiating device.
  • the device includes:
  • the initial configuration table sending module is used to send the initial configuration table of the device to be transmitted to the transmission initiating device; the initial configuration table contains the device information of the device to be transmitted;
  • the complete configuration table acquisition module is used to obtain the complete configuration table sent by the transmission initiating device.
  • the complete configuration table is obtained by the transmission initiating device determining the target device among the devices to be transmitted based on the device information, and filling in the transmission configuration information in the initial configuration table of the target device. ;
  • the update configuration table sending module is used to configure the target device according to the transmission configuration information, update the preset configuration status bit in the complete configuration table to the success status, and send the updated complete configuration table to the transmission initiating device, so that the transmission initiating device When it is determined that the configuration status bit is in a successful state, the complete configuration table is used to perform PCIe point-to-point data transmission with the target device.
  • the update configuration table sending module includes:
  • the first information reading module is used to read the enable flag bit, target interrupt type and interrupt configuration information from the transmission configuration information
  • the first processing module is used to configure the command register in the configuration space of the target device to enable the memory space bit and the bus master control bit if the enable flag bit needs to be enabled;
  • the second processing module is used to configure the MSI function register of the target device using the interrupt configuration information if the target interrupt type is an MSI interrupt.
  • the device further includes:
  • the initial configuration table creation module is used to extract device information from the configuration space of the device to be transmitted, and use the device information to create an initial configuration table.
  • the initial configuration table sending module includes:
  • the first control command construction module is used to construct the first control command, send the first control command to the control command submission queue, and update the status of the doorbell register; the first control command includes the initial configuration table in the memory of the host device storage address;
  • the complete configuration table acquisition module includes:
  • the second control command construction module is used to construct the second control command, send the second control command to the control command submission queue, and update the status of the doorbell register; the second control command includes the target writing of the complete configuration table in the memory address.
  • This application also provides a data transmission device, which is used as a transmission initiating device in a data transmission system.
  • the data transmission system includes a host device, a device to be transmitted, and a transmission initiating device.
  • the device includes:
  • the initial configuration table acquisition module is used to obtain the initial configuration table of the device to be transmitted sent by the host device; the initial configuration table contains the device information of the device to be transmitted;
  • the complete configuration table sending module is used to determine the target device in the device to be transmitted based on the device information, fill in the transmission configuration information in the initial configuration table of the target device to obtain a complete configuration table, and send the complete configuration table to the host device;
  • the update configuration table acquisition module is used to obtain the updated complete configuration table sent by the host device.
  • the host device configures the target device according to the transmission configuration information and updates the preset configuration status bit in the complete configuration table to success. state;
  • the data transmission module is used to use the complete configuration table to perform PCIe point-to-point data transmission with the target device when the configuration status bit is determined to be in a successful state.
  • the complete configuration table sending module includes:
  • the first update processing module is used to determine whether the target device needs to be enabled according to the initial configuration table of the target device; when the target device needs to be enabled, update the preset enable flag bit in the initial configuration table to the required enable state;
  • the second update processing module is used to read the interrupt types supported by the target device from the initial configuration table, select the target interrupt type from the interrupt types, and fill in the target interrupt type into the initial configuration table;
  • the third update processing module is used to fill in the preset interrupt configuration information into the initial configuration table if the target interrupt type is an MSI interrupt; the interrupt configuration information includes MSI interrupt address, interrupt data and interrupt number;
  • the fourth update processing module is used to set the completed initial configuration form as a complete configuration form.
  • the initial configuration table acquisition module includes:
  • the first control command extraction module is configured to extract the first control command from the control command submission queue when an occurrence status update of the doorbell register is detected.
  • the first control command is sent by the host device to the control command submission queue, and the first control command Contains the storage address of the initial configuration table in the memory of the host device;
  • the acquisition module is used to obtain the initial configuration table from the memory according to the storage address
  • the complete configuration table is sent to the module, including:
  • the second control command extraction module is configured to extract the second control command from the control command submission queue when a state change of the doorbell register is detected.
  • the second control command is sent by the host device to the control command submission queue, and the second control command contains the target write address of the complete configuration table in memory;
  • the first control command is a feature setting command
  • the acquisition module is used to determine whether the function identifier in the feature setting command is the first preset value; if the function identifier in the feature setting command is the first preset value, If the value is set, the storage address is read from the data pointer of the feature setting command, and the initial configuration table is obtained from the memory based on the storage address;
  • the writing module is used to determine whether the function identifier in the characteristic acquisition command is the second preset value; if the function identifier in the characteristic acquisition command is the second preset value, then the data pointer of the characteristic acquisition command is obtained. Read the target write address in the target write address, and write the complete configuration table into the memory according to the target write address.
  • the acquisition module is further configured to send the first execution result of the execution characteristic setting command to the host device through the control command response queue;
  • the writing module is also configured to send the second execution result of the execution characteristic acquisition command to the host device through the control command response queue.
  • This application also provides an electronic device, including:
  • Memory used to store computer programs
  • a processor is used to execute a computer program to implement the above data transmission method.
  • This application also provides a non-volatile computer-readable storage medium.
  • a computer program is stored in the non-volatile computer-readable storage medium.
  • the computer program is loaded and executed by the processor, the above-mentioned data transmission method is implemented.
  • This application provides a data transmission method, which is applied to a data transmission system.
  • the data transmission system includes a host device, a standby device, and a host device.
  • the transmission device and the transmission initiating device, the device to be transmitted and the transmission initiating device are both PCIe devices.
  • the method includes: the host device sends an initial configuration table of the device to be transmitted to the transmission initiating device; the initial configuration table contains the device information of the device to be transmitted; The transmission initiating device determines the target device among the devices to be transmitted based on the device information, fills in the transmission configuration information in the initial configuration table of the target device to obtain a complete configuration table, and sends the complete configuration table to the host device; the host device configures the target according to the transmission configuration information The device updates the preset configuration status bit in the complete configuration table to the success status, and sends the updated complete configuration table to the transmission initiating device; when the transmission initiating device determines that the configuration status bit is the success status, it uses the complete configuration table and The target device performs PCIe point-to-point data transfer.
  • the device information of the device to be transmitted can be held by the host device and saved in the corresponding initial configuration table.
  • the host device can send the initial configuration table to the transmission initiating device, and the transmission initiating device can configure the configuration table according to the table.
  • the device information in the device is used to determine the target device among the devices to be transmitted, which not only facilitates the transmission initiating device to locate the target device, but also effectively solves the problem that the transmission initiating device cannot obtain the device information of the target device; after the target device is determined, the transmission initiating device can Continue to fill in the transmission configuration information necessary for PCIe point-to-point data transmission in the initial configuration table of the target device to obtain a complete configuration table, and send the complete configuration table back to the host device, which will then use the transmission configuration information in the complete configuration table.
  • Configuring the target device can effectively solve the problem of the transmission initiating device being unable to configure the target device; finally, after completing the configuration, the host device can update the preset configuration status bit in the complete configuration table to the success status, so that the transmission initiating device Initiate PCIe point-to-point data transmission with the target device, which can lay the foundation for autonomous data transmission between the transmission initiating device and the target device.
  • the present application also provides a data processing method executed by a host device, a data processing method executed by a transmission initiating device, a data transmission system, a device and an electronic device and a non-volatile computer-readable storage medium, which have the above beneficial effects.
  • Figure 1 is a flow chart of a data transmission method provided by an embodiment of the present application.
  • Figure 2 is a schematic diagram of a complete configuration table provided by the embodiment of the present application.
  • Figure 3 is a structural block diagram of a data transmission system provided by an embodiment of the present application.
  • Figure 4 is a structural block diagram of a data transmission device provided by an embodiment of the present application.
  • FIG. 5 is a structural block diagram of another data transmission device provided by an embodiment of the present application.
  • Figure 6 is a structural block diagram of an electronic device provided by an embodiment of the present application.
  • Figure 7 is a structural block diagram of a non-volatile computer-readable storage medium provided by an embodiment of the present application.
  • this application provides a data transmission method that allows the host device to help the transmission initiating device configure the target device to ensure that the PCIe device can Realize autonomous point-to-point transmission between devices.
  • Figure 1 is provided in the embodiment of this application.
  • a flow chart of a data transmission method provided. The method is applied to a data transmission system, which includes a host device, a device to be transmitted, and a transmission initiating device. It should be pointed out that both the device to be transmitted and the device initiating transmission are PCIe devices.
  • the embodiments of this application are not limited to specific PCIe devices, and reference may be made to related technologies of PCIe devices.
  • This method may include:
  • the host device sends the initial configuration table of the device to be transmitted to the transmission initiating device; the initial configuration table contains the device information of the device to be transmitted.
  • the host device can hold an initial configuration table containing device information of the device to be transmitted, and can send these configuration tables to the transmission initiating device, so that the latter can use the table to select the target device and perform related configuration operations.
  • the device information contained in the initial configuration table is the information required to establish PCIe point-to-point transmission with the device to be transmitted. For example, it can include the location information of the device to be transmitted on the PCIe bus (PCI bus number, device number and device function number), PCI ID Information (Vendor ID, Device ID, Revision ID, Class Code), base address register value (BAR, Base Address Register), supported interrupt information, etc. can be set according to actual application requirements. .
  • the embodiment of the present application does not limit the organizational form of the device information in the initial configuration table, which can be set according to actual application requirements.
  • the embodiment of the present application does not limit the number of initial configuration tables that the host device can hold. It can be understood that this number is the same as the number of PCIe devices connected to the host device.
  • the embodiments of this application do not limit the specific method of setting the initial configuration table. For example, it can be set manually and then written into the host device, or the host device can automatically extract the above device information from the configuration space of the device to be transmitted, and use this information to Automatically generate initial configuration table.
  • the table in order to improve the accuracy and convenience of generating the initial configuration table, the table can be automatically generated by the host device using the device information extracted from the device configuration space to be transmitted.
  • the host device before the host device sends the initial configuration table of the device to be transmitted to the transmission initiating device, it may also include:
  • Step 11 The host device extracts device information from the configuration space of the device to be transferred, and uses the device information to create an initial configuration table.
  • the embodiments of the present application do not limit the specific method of transmitting data between the host device and the transmission initiating device.
  • the two devices can communicate through the PCIe device host interface customized by the manufacturer; they can also communicate with a certain standard
  • the PCIe host interface can be expanded, for example, the NVMe interface (Non-volatile Memory Express, non-volatile memory host controller interface specification) or the VirtIO interface (paravirtualized IO interface) can be expanded so that the two devices can pass the expanded Standard PCIe interface for communication, which can be set according to actual application requirements.
  • NVMe interface Non-volatile Memory Express, non-volatile memory host controller interface specification
  • VirtIO interface paravirtualized IO interface
  • the transmission initiating device determines the target device among the devices to be transmitted based on the device information, fills in the transmission configuration information in the initial configuration table of the target device to obtain a complete configuration table, and sends the complete configuration table to the host device.
  • the transmission initiating device can obtain the device information of the device to be transmitted through the initial configuration table, and select the target device and complete the configuration table based on this information. That is, the embodiment of the present application can solve the problem of transmission initiating device through the delivery method of the host device. The problem of being unable to obtain the device information of the device to be transferred. It should be noted that the embodiments of the present application do not limit how the transmission initiating device uses device information to filter target devices, and can be set according to actual application requirements.
  • the transmission initiating device also needs to complete the initial configuration table of the target device based on the device information. Specifically, only after the command register of the device to be transmitted is enabled and configured, and the interrupt configuration information that the device needs to use during the transmission process is configured, the device can perform data transmission with the transmission initiating device; in addition, the device to be transmitted can perform data transmission.
  • the device information of the transmission device usually includes information about whether it needs to be enabled and the interrupt types it can support. Therefore, the transmission initiating device can fill in the corresponding enabling configuration information in the initial configuration table based on the device information of the target device. and interrupt configuration information.
  • the initial configuration table can contain A preset enable flag bit.
  • the transmission initiating device When the transmission initiating device determines that the target device needs to be enabled, it can update the flag bit to the required enable state.
  • the initial configuration table can further include the target interrupt type. and interrupt configuration information, so that the transmission initiating device can fill in the required interrupt type and interrupt configuration information into the initial configuration table.
  • the embodiments of the present application do not limit the types of interrupts that can be supported by the device to be transmitted. For example, they can be MSI interrupts (Message Signal Interrupt, message signal interrupt), MSI-X interrupts (MSI enhanced interrupts), or The above two interrupts can be included at the same time; the embodiment of the present application does not limit the specific interrupt configuration information. You can refer to the related technologies of interrupts.
  • the interrupt configuration information can be the MSI interrupt address, interrupt data, and the number of interrupts. .
  • fill in the transmission configuration information in the initial configuration table of the target device to obtain a complete configuration table which may include:
  • Step 21 The transmission initiating device determines whether the target device needs to be enabled according to the initial configuration table of the target device; if the target device needs to be enabled, go to step 22; if the target device does not need to be enabled, go to step 23;
  • Step 22 Update the preset enable flag in the initial configuration table to the required enable state
  • Step 23 Read the interrupt types supported by the target device from the initial configuration table, select the target interrupt type from the interrupt type, and fill in the target interrupt type into the initial configuration table;
  • Step 24 If the target interrupt type is MSI interrupt, fill in the preset interrupt configuration information into the initial configuration table; the interrupt configuration information includes MSI interrupt address, interrupt data and number of interrupts;
  • Step 25 Set the completed initial configuration form as a complete configuration form.
  • the host device configures the target device according to the transmission configuration information, updates the preset configuration status bit in the complete configuration table to the success status, and sends the updated complete configuration table to the transmission initiating device.
  • the host device after receiving the complete configuration table returned by the transmission initiating device, the host device initializes the configuration of the target device according to the enable flag bit, target interrupt type and interrupt configuration information in the table. It should be noted that the embodiments of the present application do not limit the specific interaction process between the host device and the target device configuration space. Reference may be made to PCIe related technologies.
  • the host device configures the target device according to the transmission configuration information, which may include:
  • Step 31 The host device reads the enable flag bit, target interrupt type and interrupt configuration information from the transmission configuration information
  • Step 32 If the enable flag bit needs to be enabled, configure the command register in the configuration space of the target device to enable the memory space bit and bus master control bit;
  • Step 33 If the target interrupt type is an MSI interrupt, use the interrupt configuration information to configure the MSI function register of the target device.
  • command register Command register
  • memory space bit Memory Space
  • bus master control bit Bus Master
  • MSI function register MSI Capability structure
  • the embodiment of the present application After completing the configuration, in order to facilitate the host device to return the configured information to the transmission initiating device, the embodiment of the present application also presets a configuration status bit in the initial configuration table. After the host device completes the initialization configuration, it can update the status bit to the success status, so that the transmission initiating device can determine the initialization status of the target device according to the specific status information of the status bit.
  • Figure 2 is a schematic diagram of a complete configuration table provided by an embodiment of the present application.
  • the configuration table contains the following information:
  • PCI Bus PCI Bus number
  • Device device number
  • Function device function number
  • PCI ID of the device to be transferred including Vendor ID, Device ID, Revision ID, and Class Code. These ID information can be used by the transmission initiating device to determine whether the device to be transmitted is the required target device type.
  • Interrupt type support information of the device to be transmitted including MSI and MSI-X compatible information data structures (MSI Capability and MSI-X Capability) defined by the PCI device standard.
  • the 6 BAR register values in the configuration space of the device to be transmitted From the register, you can obtain the mapping address of the target device's BAR space on the system bus and the attributes of the BAR space, such as whether it is 64bit and whether it is a Memory space.
  • PCIe's P2P transmission only supports Memory (memory) space and does not support IO (Input and Output) space.
  • Configuration status bit used by the host to notify the transmission initiating device whether the target device is configured successfully.
  • the enable flag bit of the device to be transmitted is used by the transmission initiating device to tell the host whether the target device needs to be enabled.
  • Interrupt enable type which is used by the transmission initiating device to tell the host whether the target device enables interrupts and the enabled interrupt type.
  • MSI interrupt information used to transmit the specific information of the MSI interrupt configuration of the initiating device to the host and the target device.
  • items 1 to 6 are set by the P2P configuration software in the host device, while items 7 to 9 are set by the transmission initiating device.
  • the transmission initiating device determines that the configuration status bit is in the successful state, it uses the complete configuration table to perform PCIe point-to-point data transmission with the target device.
  • the transmission initiating device determines that the configuration status bit is in the successful state, it can use the complete configuration table to perform PCIe point-to-point data transmission with the target device. It should be noted that the embodiments of the present application do not limit the specific process of PCIe point-to-point data transmission. Reference may be made to related technologies of PCIe point-to-point data transmission.
  • the device information of the device to be transmitted can be held by the host device and saved in the corresponding initial configuration table.
  • the host device can send the initial configuration table to the transmission initiating device, and the transmission initiating device can Determining the target device among the devices to be transmitted based on the device information in the table not only facilitates the transmission initiating device to locate the target device, but also effectively solves the problem that the transmission initiating device cannot obtain the device information of the target device; after determining the target device, the transmission The initiating device can continue to fill in the necessary transmission configuration information for PCIe point-to-point data transmission in the initial configuration table of the target device to obtain a complete configuration table, and send the complete configuration table back to the host device, which will then pass the complete configuration table back to the host device.
  • Transmitting configuration information to configure the target device can effectively solve the problem of the transmission initiating device being unable to configure the target device; finally, after completing the configuration, the host device can update the preset configuration status bit in the complete configuration table to the successful status, so that The transmission initiating device initiates PCIe point-to-point data transmission with the target device, which can lay the foundation for autonomous data transmission between the transmission initiating device and the target device.
  • the communication process between the host device and the transmission initiating device is introduced in detail below.
  • the host device sends the initial configuration table of the device to be transmitted to the transmission initiating device, which may include:
  • the host device constructs a first control command, sends the first control command to the control command submission queue, and updates the status of the doorbell register; the first control command includes the storage address of the initial configuration table in the memory of the host device.
  • the embodiment of the present application uses an NVMe interface and a preset control command (Admin command) to process the communication between the host device and the transmission initiating device.
  • the first control command is used to notify the transmission initiating device to retrieve all the data from the memory of the host device.
  • the initial configuration table specifically includes the storage address of the configuration table in memory. After receiving the first control command, the transmission initiating device can go to the host device to retrieve the initial configuration table according to the storage address contained therein. It should be noted that the embodiment of the present application does not limit the form of the first control command.
  • the command may be Admin defined in the NVMe standard.
  • the command obtained by extending the command can also be a manufacturer-defined Admin command.
  • the embodiment of this application will extend the Admin command defined by the NVMe standard to obtain the control command used in this method.
  • the first control command can be extended from the feature setting command (Set Feature).
  • the extension method can be: setting the feature identifier (Feature Identifier) of the feature setting command to a preset value so that the transmission initiating device can recognize the command. ;At the same time, change the PRP pointer of the feature setting command to the above storage address so that the transmission initiating device can extract the storage address information.
  • the host device and the transmission initiating device should comply with the communication methods specified by the NVMe protocol. Specifically, the host device should send the first control command to the control command submission queue (Admin SQ queue) and update the status value of the doorbell register (Doorbell); when the transmission initiating device detects a status update in the doorbell register, it will Automatically extract the first control command from the control command submission queue.
  • the embodiments of the present application do not limit the specific form of the control command submission queue, and reference may be made to NVMe related technologies.
  • the transmission initiating device detects the occurrence status update of the doorbell register, it extracts the first control command from the control command submission queue, and obtains the initial configuration table from the memory according to the storage address.
  • the transmission initiating device can also identify and extract information from the received first control command according to the specific expansion method.
  • the first control command is a feature setting command, which obtains the initial configuration table from the memory according to the storage address, including:
  • Step 41 The transmission initiating device determines whether the function identifier in the characteristic setting command is the first preset value; if the function identifier in the characteristic setting command is the first preset value, then proceed to step 42; if the function identifier in the characteristic setting command is the first preset value, If the function identifier is not the first preset value, the feature setting command is discarded;
  • Step 42 Read the storage address from the data pointer of the feature setting command, and obtain the initial configuration table from the memory based on the storage address.
  • the transmission initiating device can also return the execution result to the host device to notify the host device to perform subsequent operations. Specifically, the transmission initiating device can return the execution result of the feature setting command to the host device through the control command response queue (Admin CQ queue).
  • the control command response queue (Admin CQ queue).
  • Step 51 The transmission initiating device sends the first execution result of the execution characteristic setting command to the host device through the control command response queue.
  • a complete configuration form is sent to the host device, which may include:
  • the host device constructs a second control command, sends the second control command to the control command submission queue, and updates the status of the doorbell register; the second control command includes the target write address of the complete configuration table in the memory.
  • the second control command is used to notify the transmission initiating device to write the completed configuration table into the memory of the host device, specifically including the target writing address of the configuration table in the memory.
  • the limited description of the specific form of the second control command is the same as the relevant description of the first control command, and will not be described again here.
  • the second control command can be extended by the feature acquisition command (Get Feature), and the extension method can be: setting the function identifier (Feature Identifier) of the feature acquisition command to a default value so that the transmission initiating device can recognize the command; At the same time, change the PRP pointer of the characteristic acquisition command to the above target write address so that the transmission initiating device can extract the target write address information.
  • the host device and the transmission initiating device when transmitting the second control command, must also comply with the regulations of the NVMe standard. Certainly.
  • the transmission initiating device detects a state change of the doorbell register, it extracts the second control command from the control command submission queue, and writes the complete configuration table into the memory according to the target write address.
  • the transmission initiating device can also identify and extract information from the received second control command according to the specific expansion method.
  • the second control command is a feature acquisition command, which writes the complete configuration table into the memory according to the target write address, which may include:
  • Step 61 The transmission initiating device determines whether the function identifier in the characteristic acquisition command is the second preset value; if the function identifier in the characteristic acquisition command is the second preset value, then proceed to step 62; if the function identifier in the characteristic acquisition command is the second preset value, If the function identifier is not the second default value, the feature acquisition command is discarded;
  • Step 62 Read the target write address from the data pointer of the feature acquisition command, and write the complete configuration table into the memory according to the target write address.
  • the transmission initiating device can also return the execution result to the host device to notify the host device to perform subsequent operations.
  • Step 71 The transmission initiating device sends the second execution result of the execution characteristic acquisition command to the host device through the control command response queue.
  • this application can use the NVMe interface and customized control commands to handle the communication between the host device and the transmission initiating device to ensure the effective transmission of the initial configuration table and the complete configuration table.
  • Figure 3 is a structural block diagram of a data transmission system provided by an embodiment of the present application.
  • the system may include: a host device 301, a device to be transmitted 302 and a transmission initiating device 303.
  • Devices 303 are all PCIe devices, including:
  • the host device 301 is used to send the initial configuration table of the device 302 to be transmitted to the transmission initiating device 303;
  • the initial configuration table contains the device information of the device 302 to be transmitted; according to the transmission configuration information in the complete configuration table returned by the transmission initiating device 303 Configure the target device, update the preset configuration status bit in the complete configuration table to the success status, and send the updated complete configuration table to the transmission initiating device 303;
  • the transmission initiating device 303 is used to determine the target device in the device to be transmitted 302 according to the device information in the initial configuration table, fill in the transmission configuration information in the initial configuration table of the target device to obtain a complete configuration table, and send the complete configuration table to the host Device 301; when determining that the configuration status bit in the complete configuration table is in a successful state, use the complete configuration table to perform PCIe point-to-point data transmission with the target device;
  • the device to be transmitted 302 is configured to perform PCIe point-to-point data transmission with the transmission initiating device 303 after being configured by the host device 301 .
  • the transmission initiating device 303 is also used to determine whether the target device needs to be enabled according to the initial configuration table of the target device; if the target device needs to be enabled, update the preset enable flag bit in the initial configuration table. It needs to be enabled; read the interrupt type supported by the target device from the initial configuration table, select the target interrupt type from the interrupt type, and fill in the target interrupt type into the initial configuration table; if the target interrupt type is MSI interrupt, then Default interrupt configuration information Fill in the initial configuration table; interrupt configuration information includes MSI interrupt address, interrupt data and number of interrupts; set the completed initial configuration table as a complete configuration table.
  • the host device 301 is also used to read the enable flag bit, target interrupt type and interrupt configuration information from the transmission configuration information; if the enable flag bit needs to be enabled, configure the target device
  • the command register in the space is configured to enable the memory space bit and bus master control bit; if the target interrupt type is an MSI interrupt, use the interrupt configuration information to configure the MSI function register of the target device.
  • the host device 301 is also used to extract device information from the configuration space of the device 302 to be transmitted, and use the device information to create an initial configuration table.
  • the host device 301 is also used to construct a first control command, send the first control command to the control command submission queue, and update the status of the doorbell register;
  • the first control command includes an initial configuration table in the host device The storage address of 301 in memory;
  • the transmission initiating device 303 is also used to extract the first control command from the control command submission queue when detecting the occurrence status update of the doorbell register, and obtain the initial configuration table from the memory according to the storage address;
  • the host device 301 is also used to construct a second control command, send the second control command to the control command submission queue, and update the status of the doorbell register;
  • the second control command includes the target write of the complete configuration table in the memory. Enter address;
  • the transmission initiating device 303 is also configured to extract the second control command from the control command submission queue when detecting a state change of the doorbell register, and write the complete configuration table into the memory according to the target write address.
  • the transmission initiating device 303 is also used to determine whether the function identifier in the characteristic setting command is the first preset value; if the function identifier in the characteristic setting command is the first preset value, then the function identifier in the characteristic setting command is the first preset value. Read the storage address from the data pointer of the setting command, and obtain the initial configuration table from the memory based on the storage address;
  • the transmission initiating device 303 is also used to determine whether the function identifier in the characteristic acquisition command is the second preset value; if the function identifier in the characteristic acquisition command is the second preset value, then obtain the function identifier from the characteristic acquisition command.
  • the target write address is read from the data pointer, and the complete configuration table is written into the memory according to the target write address.
  • the transmission initiating device 303 is also configured to send the first execution result of the execution characteristic setting command to the host device 301 through the control command response queue;
  • the transmission initiating device 303 is also configured to send the second execution result of the execution characteristic acquisition command to the host device 301 through the control command response queue.
  • an embodiment of the present application also provides a data transmission device, which is applied to a host device in a data transmission system.
  • the data transmission system includes a host device, a device to be transmitted, and a transmission initiating device.
  • the device may include:
  • the initial configuration table sending module 401 is used to send the initial configuration table of the device to be transmitted to the transmission initiating device; the initial configuration table contains the device information of the device to be transmitted;
  • the complete configuration table acquisition module 402 is used to obtain the complete configuration table sent by the transmission initiating device.
  • the complete configuration table is determined by the transmission initiating device in the device to be transmitted based on the device information, and the transmission configuration information is filled in the initial configuration table of the target device. get;
  • the update configuration table sending module 403 is used to configure the target device according to the transmission configuration information, update the preset configuration status bit in the complete configuration table to the success status, and send the updated complete configuration table to the transmission initiating device to initiate the transmission.
  • the device determines that the configuration status bit is in a successful state, it uses the complete configuration table to perform PCIe point-to-point data transmission with the target device.
  • the update configuration table sending module 403 may include:
  • the first information reading module is used to read the enable flag bit, target interrupt type and interrupt configuration information from the transmission configuration information
  • the first processing module is used to configure the command register in the configuration space of the target device to enable the memory space bit and the bus master control bit if the enable flag bit needs to be enabled;
  • the second processing module is used to configure the MSI function register of the target device using the interrupt configuration information if the target interrupt type is an MSI interrupt.
  • the device may further include:
  • the initial configuration table creation module is used to extract device information from the configuration space of the device to be transmitted, and use the device information to create an initial configuration table.
  • the initial configuration table sending module 401 may include:
  • the first control command construction module is used to construct the first control command, send the first control command to the control command submission queue, and update the status of the doorbell register; the first control command includes the initial configuration table in the memory of the host device storage address;
  • the complete configuration table acquisition module 402 may include:
  • the second control command construction module is used to construct the second control command, send the second control command to the control command submission queue, and update the status of the doorbell register; the second control command includes the target writing of the complete configuration table in the memory address.
  • an embodiment of the present application also provides a data transmission device, which is applied to a transmission initiating device in a data transmission system.
  • the data transmission system includes a host device, a device to be transmitted, and a transmission initiating device.
  • the device may include:
  • the initial configuration table acquisition module 501 is used to obtain the initial configuration table of the device to be transmitted sent by the host device; the initial configuration table contains device information of the device to be transmitted;
  • the complete configuration table sending module 502 is used to determine the target device in the device to be transmitted based on the device information, fill in the transmission configuration information in the initial configuration table of the target device to obtain a complete configuration table, and send the complete configuration table to the host device;
  • the updated configuration table acquisition module 503 is used to obtain the updated complete configuration table sent by the host device.
  • the update of the complete configuration table is performed by the host device configuring the target device according to the transmission configuration information, and updating the preset configuration status bit in the complete configuration table to success status;
  • the data transmission module 504 is configured to use the complete configuration table to perform PCIe point-to-point data transmission with the target device when it is determined that the configuration status bit is in a successful state.
  • the complete configuration table sending module 502 may include:
  • the first update processing module is used to determine whether the target device needs to be enabled according to the initial configuration table of the target device; when the target device needs to be enabled, update the preset enable flag bit in the initial configuration table to the required enable state;
  • the second update processing module is used to read the interrupt types supported by the target device from the initial configuration table, select the target interrupt type from the interrupt types, and fill in the target interrupt type into the initial configuration table;
  • the third update processing module is used to fill in the preset interrupt configuration information into the initial configuration table if the target interrupt type is an MSI interrupt; the interrupt configuration information includes MSI interrupt address, interrupt data and interrupt number;
  • the fourth update processing module is used to set the completed initial configuration form as a complete configuration form.
  • the initial configuration table acquisition module 501 may include:
  • the first control command extraction module is used to submit the control command from the control command when detecting the status update of the doorbell register.
  • the queue extracts the first control command, which is sent by the host device to the control command submission queue, and the first control command includes the storage address of the initial configuration table in the memory of the host device;
  • the acquisition module is used to obtain the initial configuration table from the memory according to the storage address
  • the complete configuration table sending module 502 may include:
  • the second control command extraction module is configured to extract the second control command from the control command submission queue when a state change of the doorbell register is detected.
  • the second control command is sent by the host device to the control command submission queue, and the second control command contains the target write address of the complete configuration table in memory;
  • the first control command is a feature setting command
  • the acquisition module can be used to determine whether the function identifier in the feature setting command is the first preset value; if the function identifier in the feature setting command is the first If the default value is set, the storage address is read from the data pointer of the feature setting command, and the initial configuration table is obtained from the memory based on the storage address;
  • the writing module can be used to determine whether the function identifier in the characteristic acquisition command is the second preset value; if the function identifier in the characteristic acquisition command is the second preset value, obtain the data from the characteristic acquisition command.
  • the target write address is read from the pointer, and the complete configuration table is written into the memory according to the target write address.
  • the acquisition module may also be configured to send the first execution result of the execution characteristic setting command to the host device through the control command response queue;
  • the writing module may also be configured to send the second execution result of the execution characteristic acquisition command to the host device through the control command response queue.
  • an embodiment of the present application also provides an electronic device, including: a memory 601 for storing a computer program; a processor 602 for executing the computer program to implement the steps of the data transmission method of any of the above embodiments.
  • the embodiment of the present application also provides a non-volatile computer-readable storage medium 7.
  • a computer program 701 is stored on the non-volatile computer-readable storage medium 7.
  • the computer program 701 is executed by the processor, the above is implemented.
  • the embodiments of the non-volatile computer-readable storage medium part correspond to the embodiments of the data transmission method part, please refer to the description of the embodiments of the data transmission method part for the embodiments of the non-volatile computer-readable storage medium part. , we will not go into details here.
  • RAM random access memory
  • ROM read-only memory
  • electrically programmable ROM electrically erasable programmable ROM
  • registers hard disks, removable disks, CD-ROMs, or anywhere in the field of technology. any other known form of storage media.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Systems (AREA)

Abstract

本申请提供一种数据传输方法、系统、装置、设备及计算机可读存储介质,方法应用于数据传输系统,系统包括主机设备、待传输设备和传输发起设备,其中,主机设备可持有包含待传输设备的设备信息的初始配置表,并将该表发送至传输发起设备进行选择和完善;传输发起设备则会根据自身需求,在目标设备的初始配置表中填写建立传输的必要信息,并将得到的完整配置表返回给主机设备;主机设备进而会利用完整信息表对目标设备进行配置,并在完成配置后向传输发起设备返回完整信息表,以使传输发起设备自主地与目标设备进行PCIe点对点传输;可由主机设备帮助传输发起设备配置目标设备,以确保PCIe设备可实现设备间自主的点对点传输。

Description

数据传输方法、系统、装置、设备及计算机可读存储介质
相关申请的交叉引用
本申请要求于2022年03月24日提交中国专利局,申请号为202210292391.3,申请名称为“数据传输方法、系统及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及设备通信领域,特别涉及一种数据传输方法、系统、装置、设备及计算机可读存储介质。
背景技术
在PCIe总线系统(Peripheral component interconnect express,高速串行计算机扩展总线标准)中,总线上的端点设备(EP,Endpoint)之间通常可在主机设备CPU的控制下进行数据传输,例如传统的PCIe点对点数据传输(PCIe P2P)允许两个端点设备在主机设备的控制下进行数据传输,并由主机设备处理数据传输过程中的中断等操作。但是上述PCIe点对点数据传输过程容易增加端点设备之间的数据传输时延,同时该过程还需要主机设备安装配套的传输软件,容易增加PCIe总线系统的维护成本。因此,可以考虑将数据传输过程直接迁移至端点设备,让传输控制逻辑完全由端点设备本身完成。然而迁移带来了新的问题,即需要发起传输的端点设备若要与目标端点设备进行数据通信,则需在目标端点设备的配置空间(Configuration Space)中获取相关的设备信息并进行相关配置,但端点设备实际无法访问另一端点设备的配置空间,而这导致传输发起设备无法获取目标端点设备的设备信息并进行配置,进而也无法开展后续的PCIe点对点数据传输过程。
发明内容
本申请的目的是提供一种数据传输方法、系统、装置、设备及计算机可读存储介质,可由主机设备帮助传输发起设备配置目标设备,以确保PCIe设备可实现设备间自主的点对点传输。
为解决上述技术问题,本申请提供一种数据传输方法,应用于数据传输系统,数据传输系统包括主机设备、待传输设备和传输发起设备,待传输设备和传输发起设备均为PCIe设备,方法包括:
主机设备将待传输设备的初始配置表发送至传输发起设备;初始配置表中包含待传输设备的设备信息;
传输发起设备根据设备信息在待传输设备中确定目标设备,在目标设备的初始配置表中填写传输配置信息得到完整配置表,并将完整配置表发送至主机设备;
主机设备根据传输配置信息配置目标设备,将完整配置表中预设的配置状态位更新为成功状态,并将更新后的完整配置表发送至传输发起设备;
传输发起设备在确定配置状态位为成功状态时,利用完整配置表与目标设备进行PCIe点对点数据传输。
在一些实施例中,在目标设备的初始配置表中填写传输配置信息得到完整配置表,包括:
传输发起设备根据目标设备的初始配置表判断目标设备是否需要使能;
若目标设备需要使能,则将初始配置表中预设的使能标志位更新为需要使能状态;
从初始配置表中读取目标设备支持的中断类型,从中断类型中选择目标中断类型,并将目标中断类型填写至初始配置表;
若目标中断类型为MSI中断,则将预设的中断配置信息填写至初始配置表;中断配置信息包括MSI中断地址、中断数据和中断个数;
将完成填写的初始配置表设置为完整配置表。
在一些实施例中,主机设备根据传输配置信息配置目标设备,包括:
主机设备从传输配置信息中读取使能标志位、目标中断类型及中断配置信息;
若使能标志位为需要使能状态,则对目标设备的配置空间中的命令寄存器进行配置,以使能内存空间位和总线主控位;
若目标中断类型为MSI中断,则利用中断配置信息配置目标设备的MSI功能寄存器。
在一些实施例中,在主机设备将待传输设备的初始配置表发送至传输发起设备之前,还包括:
主机设备从待传输设备的配置空间中提取设备信息,并利用设备信息创建初始配置表。
在一些实施例中,主机设备将待传输设备的初始配置表发送至传输发起设备,包括:
主机设备构造第一控制命令,将第一控制命令发送至控制命令提交队列,并更新门铃寄存器的状态;第一控制命令中包含初始配置表在主机设备的内存中的存放地址;
传输发起设备在检测到门铃寄存器的发生状态更新时,从控制命令提交队列提取第一控制命令,并根据存放地址从内存中获取初始配置表;
相应的,将完整配置表发送至主机设备,包括:
主机设备构造第二控制命令,将第二控制命令发送至控制命令提交队列,并更新门铃寄存器的状态;第二控制命令中包含完整配置表在内存中的目标写入地址;
传输发起设备在检测到门铃寄存器的发生状态变化时,从控制命令提交队列提取第二控制命令,并根据目标写入地址将完整配置表写入内存。
在一些实施例中,第一控制命令为特性设置命令,根据存放地址从内存中获取初始配置表,包括:
传输发起设备判断特性设置命令中的功能标识符是否为第一预设值;
若特性设置命令中的功能标识符为第一预设值,则从特性设置命令的数据指针中读取存放地址,并根据存放地址从内存中获取初始配置表;
相应的,第二控制命令为特性获取命令,根据目标写入地址将完整配置表写入内存,包括:
传输发起设备判断特性获取命令中的功能标识符是否为第二预设值;
若特性获取命令中的功能标识符为第二预设值,则从特性获取命令的数据指针中读取目标写入地址,并根据目标写入地址将完整配置表写入内存。
在一些实施例中,在根据存放地址从内存中获取初始配置表之后,还包括:
传输发起设备通过控制命令响应队列将执行特性设置命令的第一执行结果发送至主机设备;
相应的,在根据目标写入地址将完整配置表写入内存之后,还包括:
传输发起设备通过控制命令响应队列将执行特性获取命令的第二执行结果发送至主机设 备。
本申请还提供一种数据处理方法,应用于数据传输系统中的主机设备,数据传输系统包括主机设备、待传输设备和传输发起设备,方法包括:
将待传输设备的初始配置表发送至传输发起设备;初始配置表中包含待传输设备的设备信息;
获取传输发起设备发送的完整配置表,完整配置表由传输发起设备根据设备信息在待传输设备中确定目标设备,在目标设备的初始配置表中填写传输配置信息得到;
根据传输配置信息配置目标设备,将完整配置表中预设的配置状态位更新为成功状态,并将更新后的完整配置表发送至传输发起设备,使传输发起设备在确定配置状态位为成功状态时,利用完整配置表与目标设备进行PCIe点对点数据传输。
在一些实施例中,根据传输配置信息配置目标设备,包括:
从传输配置信息中读取使能标志位、目标中断类型及中断配置信息;
若使能标志位为需要使能状态,则对目标设备的配置空间中的命令寄存器进行配置,以使能内存空间位和总线主控位;
若目标中断类型为MSI中断,则利用中断配置信息配置目标设备的MSI功能寄存器。
在一些实施例中,在将待传输设备的初始配置表发送至传输发起设备之前,还包括:
从待传输设备的配置空间中提取设备信息,并利用设备信息创建初始配置表。
在一些实施例中,将待传输设备的初始配置表发送至传输发起设备,包括:
构造第一控制命令,将第一控制命令发送至控制命令提交队列,并更新门铃寄存器的状态;第一控制命令中包含初始配置表在主机设备的内存中的存放地址;
相应的,获取传输发起设备发送的完整配置表,包括:
构造第二控制命令,将第二控制命令发送至控制命令提交队列,并更新门铃寄存器的状态;第二控制命令中包含完整配置表在内存中的目标写入地址。
本申请还提供一种数据处理方法,应用于数据传输系统中的传输发起设备,数据传输系统包括主机设备、待传输设备和传输发起设备,方法包括:
获取主机设备发送的、待传输设备的初始配置表;初始配置表中包含待传输设备的设备信息;
根据设备信息在待传输设备中确定目标设备,在目标设备的初始配置表中填写传输配置信息得到完整配置表,并将完整配置表发送至主机设备;
获取主机设备发送的更新后的完整配置表,完整配置表的更新由主机设备根据传输配置信息配置目标设备,将完整配置表中预设的配置状态位更新为成功状态;
在确定配置状态位为成功状态时,利用完整配置表与目标设备进行PCIe点对点数据传输。
在一些实施例中,在目标设备的初始配置表中填写传输配置信息得到完整配置表,包括:
根据目标设备的初始配置表判断目标设备是否需要使能;
若目标设备需要使能,则将初始配置表中预设的使能标志位更新为需要使能状态;
从初始配置表中读取目标设备支持的中断类型,从中断类型中选择目标中断类型,并将目标中断类型填写至初始配置表;
若目标中断类型为MSI中断,则将预设的中断配置信息填写至初始配置表;中断配置信息包括MSI中断地址、中断数据和中断个数;
将完成填写的初始配置表设置为完整配置表。
在一些实施例中,获取主机设备发送的、待传输设备的初始配置表,包括:
在检测到门铃寄存器的发生状态更新时,从控制命令提交队列提取第一控制命令,第一控制命令由主机设备发送至控制命令提交队列,且第一控制命令中包含初始配置表在主机设备的内存中的存放地址;
根据存放地址从内存中获取初始配置表;
相应的,将完整配置表发送至主机设备,包括:
在检测到门铃寄存器的发生状态变化时,从控制命令提交队列提取第二控制命令,第二控制命令由主机设备发送至控制命令提交队列,且第二控制命令中包含完整配置表在内存中的目标写入地址;
根据目标写入地址将完整配置表写入内存。
在一些实施例中,第一控制命令为特性设置命令,根据存放地址从内存中获取初始配置表,包括:
判断特性设置命令中的功能标识符是否为第一预设值;
若特性设置命令中的功能标识符为第一预设值,则从特性设置命令的数据指针中读取存放地址,并根据存放地址从内存中获取初始配置表;
相应的,第二控制命令为特性获取命令,根据目标写入地址将完整配置表写入内存,包括:
判断特性获取命令中的功能标识符是否为第二预设值;
若特性获取命令中的功能标识符为第二预设值,则从特性获取命令的数据指针中读取目标写入地址,并根据目标写入地址将完整配置表写入内存。
在一些实施例中,在根据存放地址从内存中获取初始配置表之后,方法还包括:
通过控制命令响应队列将执行特性设置命令的第一执行结果发送至主机设备;
相应的,在根据目标写入地址将完整配置表写入内存之后,还包括:
通过控制命令响应队列将执行特性获取命令的第二执行结果发送至主机设备。
本申请还提供一种数据传输系统,包括主机设备、待传输设备和传输发起设备,待传输设备和传输发起设备均为PCIe设备,其中:
主机设备,用于将待传输设备的初始配置表发送至传输发起设备;初始配置表中包含待传输设备的设备信息;根据传输发起设备返回的完整配置表中的传输配置信息配置目标设备,将完整配置表中预设的配置状态位更新为成功状态,并将更新后的完整配置表发送至传输发起设备;
传输发起设备,用于根据初始配置表中的设备信息在待传输设备中确定目标设备,在目标设备的初始配置表中填写传输配置信息得到完整配置表,并将完整配置表发送至主机设备;在确定完整配置表中的配置状态位为成功状态时,利用完整配置表与目标设备进行PCIe点对点数据传输;
待传输设备,用于在被主机设备配置后,与传输发起设备进行PCIe点对点数据传输。
在一些实施例中,传输发起设备,还用于根据目标设备的初始配置表判断目标设备是否 需要使能;若目标设备需要使能,则将初始配置表中预设的使能标志位更新为需要使能状态;从初始配置表中读取目标设备支持的中断类型,从中断类型中选择目标中断类型,并将目标中断类型填写至初始配置表;若目标中断类型为MSI中断,则将预设的中断配置信息填写至初始配置表;中断配置信息包括MSI中断地址、中断数据和中断个数;将完成填写的初始配置表设置为完整配置表。
本申请还提供一种数据传输装置,应用于数据传输系统中的主机设备,数据传输系统包括主机设备、待传输设备和传输发起设备,该装置包括:
初始配置表发送模块,用于将待传输设备的初始配置表发送至传输发起设备;初始配置表中包含待传输设备的设备信息;
完整配置表获取模块,用于获取传输发起设备发送的完整配置表,完整配置表由传输发起设备根据设备信息在待传输设备中确定目标设备,在目标设备的初始配置表中填写传输配置信息得到;
更新配置表发送模块,用于根据传输配置信息配置目标设备,将完整配置表中预设的配置状态位更新为成功状态,并将更新后的完整配置表发送至传输发起设备,使传输发起设备在确定配置状态位为成功状态时,利用完整配置表与目标设备进行PCIe点对点数据传输。
在一些实施例中,更新配置表发送模块,包括:
第一信息读取模块,用于从传输配置信息中读取使能标志位、目标中断类型及中断配置信息;
第一处理模块,用于若使能标志位为需要使能状态,则对目标设备的配置空间中的命令寄存器进行配置,以使能内存空间位和总线主控位;
第二处理模块,用于若目标中断类型为MSI中断,则利用中断配置信息配置目标设备的MSI功能寄存器。
在一些实施例中,该装置还包括:
初始配置表创建模块,用于从待传输设备的配置空间中提取设备信息,并利用设备信息创建初始配置表。
在一些实施例中,初始配置表发送模块,包括:
第一控制命令构造模块,用于构造第一控制命令,将第一控制命令发送至控制命令提交队列,并更新门铃寄存器的状态;第一控制命令中包含初始配置表在主机设备的内存中的存放地址;
相应的,完整配置表获取模块,包括:
第二控制命令构造模块,用于构造第二控制命令,将第二控制命令发送至控制命令提交队列,并更新门铃寄存器的状态;第二控制命令中包含完整配置表在内存中的目标写入地址。
本申请还提供一种数据传输装置,应用于数据传输系统中的传输发起设备,数据传输系统包括主机设备、待传输设备和传输发起设备,该装置包括:
初始配置表获取模块,用于获取主机设备发送的、待传输设备的初始配置表;初始配置表中包含待传输设备的设备信息;
完整配置表发送模块,用于根据设备信息在待传输设备中确定目标设备,在目标设备的初始配置表中填写传输配置信息得到完整配置表,并将完整配置表发送至主机设备;
更新配置表获取模块,用于获取主机设备发送的更新后的完整配置表,完整配置表的更新由主机设备根据传输配置信息配置目标设备,将完整配置表中预设的配置状态位更新为成功状态;
数据传输模块,用于在确定配置状态位为成功状态时,利用完整配置表与目标设备进行PCIe点对点数据传输。
在一些实施例中,完整配置表发送模块,包括:
第一更新处理模块,用于根据目标设备的初始配置表判断目标设备是否需要使能;当目标设备需要使能时,将初始配置表中预设的使能标志位更新为需要使能状态;
第二更新处理模块,用于从初始配置表中读取目标设备支持的中断类型,从中断类型中选择目标中断类型,并将目标中断类型填写至初始配置表;
第三更新处理模块,用于若目标中断类型为MSI中断,则将预设的中断配置信息填写至初始配置表;中断配置信息包括MSI中断地址、中断数据和中断个数;
第四更新处理模块,用于将完成填写的初始配置表设置为完整配置表。
在一些实施例中,初始配置表获取模块,包括:
第一控制命令提取模块,用于在检测到门铃寄存器的发生状态更新时,从控制命令提交队列提取第一控制命令,第一控制命令由主机设备发送至控制命令提交队列,且第一控制命令中包含初始配置表在主机设备的内存中的存放地址;
获取模块,用于根据存放地址从内存中获取初始配置表;
相应的,完整配置表发送模块,包括:
第二控制命令提取模块,用于在检测到门铃寄存器的发生状态变化时,从控制命令提交队列提取第二控制命令,第二控制命令由主机设备发送至控制命令提交队列,且第二控制命令中包含完整配置表在内存中的目标写入地址;
写入模块,用于根据目标写入地址将完整配置表写入内存。
在一些实施例中,第一控制命令为特性设置命令,获取模块,用于判断特性设置命令中的功能标识符是否为第一预设值;若特性设置命令中的功能标识符为第一预设值,则从特性设置命令的数据指针中读取存放地址,并根据存放地址从内存中获取初始配置表;
相应的,写入模块,用于判断特性获取命令中的功能标识符是否为第二预设值;若特性获取命令中的功能标识符为第二预设值,则从特性获取命令的数据指针中读取目标写入地址,并根据目标写入地址将完整配置表写入内存。
在一些实施例中,获取模块还用于通过控制命令响应队列将执行特性设置命令的第一执行结果发送至主机设备;
相应的,写入模块还用于通过控制命令响应队列将执行特性获取命令的第二执行结果发送至主机设备。
本申请还提供一种电子设备,包括:
存储器,用于存储计算机程序;
处理器,用于执行计算机程序,以实现如上述的数据传输方法。
本申请还提供一种非易失性计算机可读存储介质,非易失性计算机可读存储介质中存储有计算机程序,计算机程序被处理器加载并执行时,实现如上述的数据传输方法。
本申请提供一种数据传输方法,应用于数据传输系统,数据传输系统包括主机设备、待 传输设备和传输发起设备,待传输设备和传输发起设备均为PCIe设备,方法包括:主机设备将待传输设备的初始配置表发送至传输发起设备;初始配置表中包含待传输设备的设备信息;传输发起设备根据设备信息在待传输设备中确定目标设备,在目标设备的初始配置表中填写传输配置信息得到完整配置表,并将完整配置表发送至主机设备;主机设备根据传输配置信息配置目标设备,将完整配置表中预设的配置状态位更新为成功状态,并将更新后的完整配置表发送至传输发起设备;传输发起设备在确定配置状态位为成功状态时,利用完整配置表与目标设备进行PCIe点对点数据传输。
可见,在本申请中,待传输设备的设备信息可由主机设备持有,并保存在对应的初始配置表中,主机设备可将初始配置表发送至传输发起设备,并由传输发起设备根据该表中的设备信息在待传输设备中确定目标设备,不仅便于传输发起设备定位目标设备,同时还可有效解决传输发起设备无法获取目标设备的设备信息的问题;在确定目标设备之后,传输发起设备可在目标设备的初始配置表中继续填写进行PCIe点对点数据传输所必要的传输配置信息,得到完整配置表,并将完整配置表回传至主机设备,由主机设备根据完整配置表中的传输配置信息配置目标设备,可有效解决传输发起设备无法对目标设备进行配置的问题;最后,主机设备在完成配置后,可将完整配置表中预设的配置状态位更新为成功状态,以使传输发起设备启动与目标设备的PCIe点对点数据传输,进而可为实现传输发起设备与目标设备之间的自主数据传输打下基础。本申请还提供一种由主机设备执行的数据处理方法、由传输发起设备执行的数据处理方法、数据传输系统、装置及电子设备和非易失性计算机可读存储介质,具有上述有益效果。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。
图1为本申请实施例所提供的一种数据传输方法的流程图;
图2为本申请实施例所提供的一种完整配置表的示意图;
图3为本申请实施例所提供的一种数据传输系统的结构框图;
图4为本申请实施例所提供的一种数据传输装置的结构框图;
图5为本申请实施例所提供的另一种数据传输装置的结构框图;
图6为本申请实施例所提供的一种电子设备的结构框图;
图7为本申请实施例所提供的一种非易失性计算机可读存储介质的结构框图。
具体实施方式
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
为有效配置目标端点设备,以确保传输发起设备能够自主地与目标端点设备进行PCIe点对点数据传输,本申请提供一种数据传输方法,可由主机设备帮助传输发起设备配置目标设备,以确保PCIe设备可实现设备间自主的点对点传输。请参考图1,图1为本申请实施例所提 供的一种数据传输方法的流程图。该方法应用于数据传输系统,其中包括主机设备、待传输设备和传输发起设备。需要指出的是,待传输设备和传输发起设备均为PCIe设备。本申请实施例并不限定具体的PCIe设备,可参考PCIe设备的相关技术。本方法可以包括:
S101、主机设备将待传输设备的初始配置表发送至传输发起设备;初始配置表中包含待传输设备的设备信息。
在本申请实施例中,主机设备可持有包含待传输设备的设备信息的初始配置表,并可将这些配置表发送至传输发起设备,以便后者利用该表选择目标设备以及进行相关配置操作。初始配置表中包含的设备信息为与待传输设备建立PCIe点对点传输所需的信息,例如可包含待传输设备在PCIe总线上的位置信息(PCI总线号、设备号和设备功能号)、PCI ID信息(Vendor ID厂商标识,Device ID设备标识,Revision ID版本标识,Class Code类型代码)、基地址寄存器值(BAR,Base Address Register)、可支持的中断信息等,可根据实际应用需求进行设定。需要说明的是,本申请实施例并不限定设备信息在初始配置表中的组织形式,可根据实际应用需求进行设定。本申请实施例也不限定主机设备可持有初始配置表的数量,可以理解的是该数量与接入主机设备的PCIe设备的数量相同。本申请实施例也不限定设置初始配置表的具体方式,例如可人工设置后写入到主机设备中,也可以由主机设备自动到待传输设备的配置空间中提取上述设备信息,并根据这些信息自动生成初始配置表。在本申请实施例中,为提高初始配置表的准确性及生成便捷性,该表可由主机设备利用从待传输设备配置空间中提取得到的设备信息自动生成。
在一种可能的情况中,在主机设备将待传输设备的初始配置表发送至传输发起设备之前,还可以包括:
步骤11:主机设备从待传输设备的配置空间中提取设备信息,并利用设备信息创建初始配置表。
进一步,需要说明的是,本申请实施例并不限定主机设备与传输发起设备之间传递数据的具体方式,例如两设备可通过厂商自定义的PCIe设备主机接口进行通信;也可以对某种标准的PCIe主机接口进行扩展,例如可对NVMe接口(Non-volatile Memory Express,非易失性内存主机控制器接口规范)或VirtIO接口(半虚拟化IO接口)进行扩展,以便两设备通过扩展后的标准PCIe接口进行通信,具体可根据实际应用需求进行设定。
S102、传输发起设备根据设备信息在待传输设备中确定目标设备,在目标设备的初始配置表中填写传输配置信息得到完整配置表,并将完整配置表发送至主机设备。
显然,传输发起设备可通过初始配置表获取到待传输设备的设备信息,并根据该信息进行目标设备选择及配置表完善,即本申请实施例可通过主机设备的传递方式,可解决传输发起设备无法获取待传输设备的设备信息的问题。需要说明的是,本申请实施例并不限定传输发起设备如何利用设备信息筛选目标设备,可根据实际应用需求进行设定。
进一步,为便于主机设备对目标设备进行传输初始化配置,传输发起设备还需根据设备信息对目标设备的初始配置表进行完善。具体的,只有在对待传输设备的命令寄存器进行使能配置,以及对该设备在传输过程中所需使用的中断配置信息进行配置后,该设备才可与传输发起设备进行数据传输;此外,待传输设备的设备信息中通常包含其是否需要被使能的信息,以及其可支持的中断类型信息,因此传输发起设备可根据目标设备的设备信息,在初始配置表中填写对应的使能配置信息及中断配置信息。为便于识别解析,初始配置表中可包含 一个预设的使能标志位,传输发起设备在确定目标设备需要使能时,便可将该标志位更新为需要使能状态;而对于中断配置信息,初始配置表中可进一步包含目标中断类型和中断配置信息,以便传输发起设备将所需要的中断类型及中断配置信息填入初始配置表。需要说明的是,本申请实施例并不限定待传输设备可支持的中断类型,例如可以为MSI中断(Message Signal Interrupt,消息信号中断),也可以为MSI-X中断(MSI增强中断),也可以同时包含上述两种中断;本申请实施例也不限定具体的中断配置信息,可参考中断的相关技术,例如对于MSI中断而言,中断配置信息可以为MSI中断地址、中断数据及中断个数。
在一种可能的情况中,在目标设备的初始配置表中填写传输配置信息得到完整配置表,可以包括:
步骤21:传输发起设备根据目标设备的初始配置表判断目标设备是否需要使能;若目标设备需要使能,则进入步骤22;若目标设备不需要使能,则进入步骤23;
步骤22:将初始配置表中预设的使能标志位更新为需要使能状态;
步骤23:从初始配置表中读取目标设备支持的中断类型,从中断类型中选择目标中断类型,并将目标中断类型填写至初始配置表;
步骤24:若目标中断类型为MSI中断,则将预设的中断配置信息填写至初始配置表;中断配置信息包括MSI中断地址、中断数据和中断个数;
步骤25:将完成填写的初始配置表设置为完整配置表。
S103、主机设备根据传输配置信息配置目标设备,将完整配置表中预设的配置状态位更新为成功状态,并将更新后的完整配置表发送至传输发起设备。
相应的,主机设备在接收到传输发起设备返回的完整配置表后,便依照该表中的使能标志位、目标中断类型及中断配置信息对目标设备进行初始化配置。需要说明的是,本申请实施例并不限定主机设备与目标设备配置空间之间具体的交互过程,可参考PCIe的相关技术。
在一种可能的情况中,主机设备根据传输配置信息配置目标设备,可以包括:
步骤31:主机设备从传输配置信息中读取使能标志位、目标中断类型及中断配置信息;
步骤32:若使能标志位为需要使能状态,则对目标设备的配置空间中的命令寄存器进行配置,以使能内存空间位和总线主控位;
步骤33:若目标中断类型为MSI中断,则利用中断配置信息配置目标设备的MSI功能寄存器。
关于命令寄存器(Command寄存器)、内存空间位(Memory Space)、总线主控位(Bus Master)及MSI功能寄存器(MSI Capability结构体)的具体内容及具体设置方法,请参考PCIe设备配置空间的相关技术。
在完成配置之后,为便于主机设备向传输发起设备回传配置完毕的信息,本申请实施例还在初始配置表中预设了一个配置状态位。主机设备在完成初始化配置后,便可将该状态位更新为成功状态,以便传输发起设备依照该状态位的具体状态信息确定目标设备的初始化状态。
为便于理解,请参考图2,图2为本申请实施例所提供的一种完整配置表的示意图,该配置表中包含如下信息:
1、待传输设备在主机PCIe总线上的位置,包括PCI总线号(PCI Bus),设备号(Device)和设备功能号(Function)。该项信息作为待传输设备的标识符,用于区分各个 目标设备。
2、待传输设备的PCI ID,包括Vendor ID,Device ID,Revision ID,Class Code。这些ID信息可被传输发起设备用于判断待传输设备是否为所需的目标设备类型。
3、待传输设备的中断类型支持信息,包括PCI设备标准所定义的MSI、MSI-X兼容信息数据结构(MSI Capability和MSI-X Capability)。
4、待传输设备配置空间上的6个BAR寄存器值。从寄存器中可以获取目标设备的BAR空间在系统总线上的映射地址和BAR空间的属性,例如是否为64bit,是否为Memory空间。PCIe的P2P传输仅支持Memory(内存)空间,不支持IO(输入输出)空间。
5、待传输设备每个BAR空间的长度。
6、配置状态位,用于主机通知传输发起设备目标设备是否配置成功。
7、待传输设备使能标志位,用于传输发起设备告诉主机该目标设备是否需要使能。
8、中断使能类型,用于传输发起设备告诉主机目标设备是否使能中断和使能的中断类型。
9、MSI中断信息,用于传输发起设备告诉主机目标设备MSI中断配置的具体信息。
上述内容中,1~6项由主机设备中的P2P配置软件设置,而7~9向由传输发起设备设置。
S104、传输发起设备在确定配置状态位为成功状态时,利用完整配置表与目标设备进行PCIe点对点数据传输。
相应的,传输发起设备在确定配置状态位为成功状态时,便可利用完整配置表与目标设备进行PCIe点对点数据传输。需要说明的是,本申请实施例并不限定PCIe点对点数据传输的具体过程,可参考PCIe点对点数据传输的相关技术。
基于上述实施例,在本申请中,待传输设备的设备信息可由主机设备持有,并保存在对应的初始配置表中,主机设备可将初始配置表发送至传输发起设备,并由传输发起设备根据该表中的设备信息在待传输设备中确定目标设备,不仅便于传输发起设备定位目标设备,同时还可有效解决传输发起设备无法获取目标设备的设备信息的问题;在确定目标设备之后,传输发起设备可在目标设备的初始配置表中继续填写进行PCIe点对点数据传输所必要的传输配置信息,得到完整配置表,并将完整配置表回传至主机设备,由主机设备根据完整配置表中的传输配置信息配置目标设备,可有效解决传输发起设备无法对目标设备进行配置的问题;最后,主机设备在完成配置后,可将完整配置表中预设的配置状态位更新为成功状态,以使传输发起设备启动与目标设备的PCIe点对点数据传输,进而可为实现传输发起设备与目标设备之间的自主数据传输打下基础。
基于上述实施例,下面对主机设备与传输发起设备之间的通信过程进行详细介绍。在一种可能的情况中,主机设备将待传输设备的初始配置表发送至传输发起设备,可以包括:
S201、主机设备构造第一控制命令,将第一控制命令发送至控制命令提交队列,并更新门铃寄存器的状态;第一控制命令中包含初始配置表在主机设备的内存中的存放地址。
本申请实施例采用NVMe接口及预设的控制命令(Admin命令)来处理主机设备与传输发起设备之间的通信,其中第一控制命令用于通知传输发起设备到主机设备的内存中提取所有的初始配置表,具体包含了该配置表在内存中的存放地址。传输发起设备在接收到第一控制命令之后,便可根据其中包含的存放地址前往主机设备提取初始配置表。需要说明的是,本申请实施例并不限定第一控制命令的形式,该命令既可以是在NVMe标准所定义的Admin 命令的基础上扩展得到的命令,也可以是厂商自定义的Admin命令。为方便设置,本申请实施例将对NVMe标准所定义的Admin命令进行扩展,已得到本方法中所使用的控制命令。具体的,第一控制命令可以由特性设置命令(Set Feature)扩展而来,扩展方式可以为:将特性设置命令的功能标识符(Feature Identifier)设置为预设值,以便传输发起设备识别该命令;同时,将特性设置命令的PRP指针更改为上述存放地址,以便传输发起设备提取存放地址信息。
进一步,由于采用NVMe接口进行数据传输,因此主机设备与传输发起设备应当遵守NVMe协议所规定的通信方式。具体的,主机设备应当将第一控制命令发送到控制命令提交队列(Admin SQ队列),并更新门铃寄存器(Doorbell)的状态值;而传输发起设备在检测到门铃寄存器发生状态更新时,便会自动从控制命令提交队列中提取第一控制命令。需要说明的是,本申请实施例并不限定控制命令提交队列的具体形式,可参考NVMe的相关技术。
S202、传输发起设备在检测到门铃寄存器的发生状态更新时,从控制命令提交队列提取第一控制命令,并根据存放地址从内存中获取初始配置表。
由于第一控制命令基于特性设置命令扩展而来,因此传输发起设备也可根据具体的扩展方式对接收到的第一控制命令进行识别及信息提取。
在一种可能的情况中,第一控制命令为特性设置命令,根据存放地址从内存中获取初始配置表,包括:
步骤41:传输发起设备判断特性设置命令中的功能标识符是否为第一预设值;若特性设置命令中的功能标识符为第一预设值,则进入步骤42;若特性设置命令中的功能标识符不为第一预设值,则丢弃该特性设置命令;
步骤42:从特性设置命令的数据指针中读取存放地址,并根据存放地址从内存中获取初始配置表。
当然,在完成初始配置表的获取之后,传输发起设备还可将执行结果返回给主机设备,以通知主机设备执行后续操作。具体的,传输发起设备可通过控制命令响应队列(Admin CQ队列)将特性设置命令的执行结果返回给主机设备。需要说明的是,本申请实施例并不限定控制命令响应队列的具体形式,可参考NVMe的相关技术。
在一种可能的情况中,在根据存放地址从内存中获取初始配置表之后,还包括:
步骤51:传输发起设备通过控制命令响应队列将执行特性设置命令的第一执行结果发送至主机设备。
相应的,将完整配置表发送至主机设备,可以包括:
S301、主机设备构造第二控制命令,将第二控制命令发送至控制命令提交队列,并更新门铃寄存器的状态;第二控制命令中包含完整配置表在内存中的目标写入地址。
第二控制命令在本申请实施例中用于通知传输发起设备将已经完成填写的完整配置表写入主机设备的内存,具体包含该配置表在内存中的目标写入地址。关于第二控制命令具体形式的限定描述与第一控制命令的相关描述相同,此处不再赘述。具体的,第二控制命令可由特性获取命令(Get Feature)扩展而来,扩展方式可以为:将特性获取命令的功能标识符(Feature Identifier)设置为预设值,以便传输发起设备识别该命令;同时,将特性获取命令的PRP指针更改为上述目标写入地址,以便传输发起设备提取目标写入地址信息。
同样,在传输第二控制命令时,主机设备与传输发起设备同样要遵守NVMe标准的规 定。
S302、传输发起设备在检测到门铃寄存器的发生状态变化时,从控制命令提交队列提取第二控制命令,并根据目标写入地址将完整配置表写入内存。
由于第二控制命令基于特性获取命令扩展而来,因此传输发起设备也可根据具体的扩展方式对接收到的第二控制命令进行识别及信息提取。
在一种可能的情况中,第二控制命令为特性获取命令,根据目标写入地址将完整配置表写入内存,可以包括:
步骤61:传输发起设备判断特性获取命令中的功能标识符是否为第二预设值;若特性获取命令中的功能标识符为第二预设值,则进入步骤62;若特性获取命令中的功能标识符不为第二预设值,则丢弃该特性获取命令;
步骤62:从特性获取命令的数据指针中读取目标写入地址,并根据目标写入地址将完整配置表写入内存。
当然,在完成完整配置表的写入之后,传输发起设备还可将执行结果返回给主机设备,以通知主机设备执行后续操作。
在一种可能的情况中,在根据目标写入地址将完整配置表写入内存之后,还可以包括:
步骤71:传输发起设备通过控制命令响应队列将执行特性获取命令的第二执行结果发送至主机设备。
基于上述实施例,本申请可采用NVMe接口及自定义的控制命令来处理主机设备与传输发起设备之间的通信,以保障初始配置表及完整配置表的有效传递。
下面对本申请实施例提供的一种数据传输系统、装置及电子设备和非易失性计算机可读存储介质进行介绍,下文描述的数据传输系统、装置及电子设备和非易失性计算机可读存储介质与上文描述的数据传输方法可相互对应参照。
请参考图3,图3为本申请实施例所提供的一种数据传输系统的结构框图,该系统可以包括:主机设备301、待传输设备302和传输发起设备303,待传输设备302和传输发起设备303均为PCIe设备,其中:
主机设备301,用于将待传输设备302的初始配置表发送至传输发起设备303;初始配置表中包含待传输设备302的设备信息;根据传输发起设备303返回的完整配置表中的传输配置信息配置目标设备,将完整配置表中预设的配置状态位更新为成功状态,并将更新后的完整配置表发送至传输发起设备303;
传输发起设备303,用于根据初始配置表中的设备信息在待传输设备302中确定目标设备,在目标设备的初始配置表中填写传输配置信息得到完整配置表,并将完整配置表发送至主机设备301;在确定完整配置表中的配置状态位为成功状态时,利用完整配置表与目标设备进行PCIe点对点数据传输;
待传输设备302,用于在被主机设备301配置后,与传输发起设备303进行PCIe点对点数据传输。
在一些实施例中,传输发起设备303,还用于根据目标设备的初始配置表判断目标设备是否需要使能;若目标设备需要使能,则将初始配置表中预设的使能标志位更新为需要使能状态;从初始配置表中读取目标设备支持的中断类型,从中断类型中选择目标中断类型,并将目标中断类型填写至初始配置表;若目标中断类型为MSI中断,则将预设的中断配置信息 填写至初始配置表;中断配置信息包括MSI中断地址、中断数据和中断个数;将完成填写的初始配置表设置为完整配置表。
在一些实施例中,主机设备301,还用于从传输配置信息中读取使能标志位、目标中断类型及中断配置信息;若使能标志位为需要使能状态,则对目标设备的配置空间中的命令寄存器进行配置,以使能内存空间位和总线主控位;若目标中断类型为MSI中断,则利用中断配置信息配置目标设备的MSI功能寄存器。
在一些实施例中,主机设备301,还用于从待传输设备302的配置空间中提取设备信息,并利用设备信息创建初始配置表。
在一些实施例中,主机设备301,还用于构造第一控制命令,将第一控制命令发送至控制命令提交队列,并更新门铃寄存器的状态;第一控制命令中包含初始配置表在主机设备301的内存中的存放地址;
传输发起设备303,还用于在检测到门铃寄存器的发生状态更新时,从控制命令提交队列提取第一控制命令,并根据存放地址从内存中获取初始配置表;
相应的,主机设备301,还用于构造第二控制命令,将第二控制命令发送至控制命令提交队列,并更新门铃寄存器的状态;第二控制命令中包含完整配置表在内存中的目标写入地址;
传输发起设备303,还用于在检测到门铃寄存器的发生状态变化时,从控制命令提交队列提取第二控制命令,并根据目标写入地址将完整配置表写入内存。
在一些实施例中,传输发起设备303,还用于判断特性设置命令中的功能标识符是否为第一预设值;若特性设置命令中的功能标识符为第一预设值,则从特性设置命令的数据指针中读取存放地址,并根据存放地址从内存中获取初始配置表;
相应的,传输发起设备303,还用于判断特性获取命令中的功能标识符是否为第二预设值;若特性获取命令中的功能标识符为第二预设值,则从特性获取命令的数据指针中读取目标写入地址,并根据目标写入地址将完整配置表写入内存。
在一些实施例中,传输发起设备303,还用于通过控制命令响应队列将执行特性设置命令的第一执行结果发送至主机设备301;
相应的,传输发起设备303,还用于通过控制命令响应队列将执行特性获取命令的第二执行结果发送至主机设备301。
参见图4,本申请实施例还提供一种数据传输装置,应用于数据传输系统中的主机设备,数据传输系统包括主机设备、待传输设备和传输发起设备,该装置可以包括:
初始配置表发送模块401,用于将待传输设备的初始配置表发送至传输发起设备;初始配置表中包含待传输设备的设备信息;
完整配置表获取模块402,用于获取传输发起设备发送的完整配置表,完整配置表由传输发起设备根据设备信息在待传输设备中确定目标设备,在目标设备的初始配置表中填写传输配置信息得到;
更新配置表发送模块403,用于根据传输配置信息配置目标设备,将完整配置表中预设的配置状态位更新为成功状态,并将更新后的完整配置表发送至传输发起设备,使传输发起设备在确定配置状态位为成功状态时,利用完整配置表与目标设备进行PCIe点对点数据传输。
在一些实施例中,更新配置表发送模块403,可以包括:
第一信息读取模块,用于从传输配置信息中读取使能标志位、目标中断类型及中断配置信息;
第一处理模块,用于若使能标志位为需要使能状态,则对目标设备的配置空间中的命令寄存器进行配置,以使能内存空间位和总线主控位;
第二处理模块,用于若目标中断类型为MSI中断,则利用中断配置信息配置目标设备的MSI功能寄存器。
在一些实施例中,该装置还可以包括:
初始配置表创建模块,用于从待传输设备的配置空间中提取设备信息,并利用设备信息创建初始配置表。
在一些实施例中,初始配置表发送模块401,可以包括:
第一控制命令构造模块,用于构造第一控制命令,将第一控制命令发送至控制命令提交队列,并更新门铃寄存器的状态;第一控制命令中包含初始配置表在主机设备的内存中的存放地址;
相应的,完整配置表获取模块402,可以包括:
第二控制命令构造模块,用于构造第二控制命令,将第二控制命令发送至控制命令提交队列,并更新门铃寄存器的状态;第二控制命令中包含完整配置表在内存中的目标写入地址。
参见图5,本申请实施例还提供一种数据传输装置,应用于数据传输系统中的传输发起设备,数据传输系统包括主机设备、待传输设备和传输发起设备,该装置可以包括:
初始配置表获取模块501,用于获取主机设备发送的、待传输设备的初始配置表;初始配置表中包含待传输设备的设备信息;
完整配置表发送模块502,用于根据设备信息在待传输设备中确定目标设备,在目标设备的初始配置表中填写传输配置信息得到完整配置表,并将完整配置表发送至主机设备;
更新配置表获取模块503,用于获取主机设备发送的更新后的完整配置表,完整配置表的更新由主机设备根据传输配置信息配置目标设备,将完整配置表中预设的配置状态位更新为成功状态;
数据传输模块504,用于在确定配置状态位为成功状态时,利用完整配置表与目标设备进行PCIe点对点数据传输。
在一些实施例中,完整配置表发送模块502,可以包括:
第一更新处理模块,用于根据目标设备的初始配置表判断目标设备是否需要使能;当目标设备需要使能时,将初始配置表中预设的使能标志位更新为需要使能状态;
第二更新处理模块,用于从初始配置表中读取目标设备支持的中断类型,从中断类型中选择目标中断类型,并将目标中断类型填写至初始配置表;
第三更新处理模块,用于若目标中断类型为MSI中断,则将预设的中断配置信息填写至初始配置表;中断配置信息包括MSI中断地址、中断数据和中断个数;
第四更新处理模块,用于将完成填写的初始配置表设置为完整配置表。
在一些实施例中,初始配置表获取模块501,可以包括:
第一控制命令提取模块,用于在检测到门铃寄存器的发生状态更新时,从控制命令提交 队列提取第一控制命令,第一控制命令由主机设备发送至控制命令提交队列,且第一控制命令中包含初始配置表在主机设备的内存中的存放地址;
获取模块,用于根据存放地址从内存中获取初始配置表;
相应的,完整配置表发送模块502,可以包括:
第二控制命令提取模块,用于在检测到门铃寄存器的发生状态变化时,从控制命令提交队列提取第二控制命令,第二控制命令由主机设备发送至控制命令提交队列,且第二控制命令中包含完整配置表在内存中的目标写入地址;
写入模块,用于根据目标写入地址将完整配置表写入内存。
在一些实施例中,第一控制命令为特性设置命令,获取模块,可以用于判断特性设置命令中的功能标识符是否为第一预设值;若特性设置命令中的功能标识符为第一预设值,则从特性设置命令的数据指针中读取存放地址,并根据存放地址从内存中获取初始配置表;
相应的,写入模块,可以用于判断特性获取命令中的功能标识符是否为第二预设值;若特性获取命令中的功能标识符为第二预设值,则从特性获取命令的数据指针中读取目标写入地址,并根据目标写入地址将完整配置表写入内存。
在一些实施例中,获取模块还可以用于通过控制命令响应队列将执行特性设置命令的第一执行结果发送至主机设备;
相应的,写入模块还可以用于通过控制命令响应队列将执行特性获取命令的第二执行结果发送至主机设备。
参见图6,本申请实施例还提供一种电子设备,包括:存储器601,用于存储计算机程序;处理器602,用于执行计算机程序,以实现上述任意实施例的数据传输方法的步骤。
参见图7,本申请实施例还提供一种非易失性计算机可读存储介质7,非易失性计算机可读存储介质7上存储有计算机程序701,计算机程序701被处理器执行时实现上述任意实施例的数据传输方法的步骤。
由于非易失性计算机可读存储介质部分的实施例与数据传输方法部分的实施例相互对应,因此非易失性计算机可读存储介质部分的实施例请参见数据传输方法部分的实施例的描述,这里暂不赘述。
说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。
专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。
以上对本申请所提供的一种数据传输方法、系统、装置、设备及非易失性计算机可读存储介质进行了详细介绍。本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想。应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以对本申请进行若干改进和修饰,这些改进和修饰也落入本申请权利要求的保护范围内。

Claims (27)

  1. 一种数据传输方法,其特征在于,应用于数据传输系统,所述数据传输系统包括主机设备、待传输设备和传输发起设备,所述待传输设备和所述传输发起设备均为PCIe设备,所述方法包括:
    所述主机设备将所述待传输设备的初始配置表发送至所述传输发起设备;所述初始配置表中包含所述待传输设备的设备信息;
    所述传输发起设备根据所述设备信息在所述待传输设备中确定目标设备,在所述目标设备的初始配置表中填写传输配置信息得到完整配置表,并将所述完整配置表发送至所述主机设备;
    所述主机设备根据所述传输配置信息配置所述目标设备,将所述完整配置表中预设的配置状态位更新为成功状态,并将更新后的完整配置表发送至所述传输发起设备;
    所述传输发起设备在确定所述配置状态位为所述成功状态时,利用所述完整配置表与所述目标设备进行PCIe点对点数据传输。
  2. 根据权利要求1所述的数据传输方法,其特征在于,所述在所述目标设备的初始配置表中填写传输配置信息得到完整配置表,包括:
    所述传输发起设备根据所述目标设备的初始配置表判断所述目标设备是否需要使能;
    若所述目标设备需要使能,则将所述初始配置表中预设的使能标志位更新为需要使能状态;
    从所述初始配置表中读取所述目标设备支持的中断类型,从所述中断类型中选择目标中断类型,并将所述目标中断类型填写至所述初始配置表;
    若所述目标中断类型为MSI中断,则将预设的中断配置信息填写至所述初始配置表;所述中断配置信息包括MSI中断地址、中断数据和中断个数;
    将完成填写的初始配置表设置为所述完整配置表。
  3. 根据权利要求2所述的数据传输方法,其特征在于,所述主机设备根据所述传输配置信息配置所述目标设备,包括:
    所述主机设备从所述传输配置信息中读取所述使能标志位、所述目标中断类型及所述中断配置信息;
    若所述使能标志位为所述需要使能状态,则对所述目标设备的配置空间中的命令寄存器进行配置,以使能内存空间位和总线主控位;
    若所述目标中断类型为所述MSI中断,则利用所述中断配置信息配置所述目标设备的MSI功能寄存器。
  4. 根据权利要求1所述的数据传输方法,其特征在于,在所述主机设备将所述待传输设备的初始配置表发送至所述传输发起设备之前,还包括:
    所述主机设备从所述待传输设备的配置空间中提取所述设备信息,并利用所述设备信息创建所述初始配置表。
  5. 根据权利要求1至4任一项所述的数据传输方法,其特征在于,所述主机设备将所述待传输设备的初始配置表发送至所述传输发起设备,包括:
    所述主机设备构造第一控制命令,将所述第一控制命令发送至控制命令提交队列,并更新门铃寄存器的状态;所述第一控制命令中包含所述初始配置表在所述主机设备的 内存中的存放地址;
    所述传输发起设备在检测到所述门铃寄存器的发生状态更新时,从所述控制命令提交队列提取所述第一控制命令,并根据所述存放地址从所述内存中获取所述初始配置表;
    相应的,所述将所述完整配置表发送至所述主机设备,包括:
    所述主机设备构造第二控制命令,将所述第二控制命令发送至所述控制命令提交队列,并更新所述门铃寄存器的状态;所述第二控制命令中包含所述完整配置表在所述内存中的目标写入地址;
    所述传输发起设备在检测到所述门铃寄存器的发生状态变化时,从所述控制命令提交队列提取所述第二控制命令,并根据所述目标写入地址将所述完整配置表写入所述内存。
  6. 根据权利要求5所述的数据传输方法,其特征在于,所述第一控制命令为特性设置命令,所述根据所述存放地址从所述内存中获取所述初始配置表,包括:
    所述传输发起设备判断所述特性设置命令中的功能标识符是否为第一预设值;
    若所述特性设置命令中的功能标识符为第一预设值,则从所述特性设置命令的数据指针中读取所述存放地址,并根据所述存放地址从所述内存中获取所述初始配置表;
    相应的,所述第二控制命令为特性获取命令,所述根据所述目标写入地址将所述完整配置表写入所述内存,包括:
    所述传输发起设备判断所述特性获取命令中的功能标识符是否为第二预设值;
    若所述特性获取命令中的功能标识符为第二预设值,则从所述特性获取命令的数据指针中读取所述目标写入地址,并根据所述目标写入地址将所述完整配置表写入所述内存。
  7. 根据权利要求6所述的数据传输方法,其特征在于,在根据所述存放地址从所述内存中获取所述初始配置表之后,还包括:
    所述传输发起设备通过控制命令响应队列将执行所述特性设置命令的第一执行结果发送至所述主机设备;
    相应的,在根据所述目标写入地址将所述完整配置表写入所述内存之后,还包括:
    所述传输发起设备通过所述控制命令响应队列将执行所述特性获取命令的第二执行结果发送至所述主机设备。
  8. 一种数据传输方法,其特征在于,应用于数据传输系统中的主机设备,所述数据传输系统包括主机设备、待传输设备和传输发起设备,所述方法包括:
    将所述待传输设备的初始配置表发送至所述传输发起设备;所述初始配置表中包含所述待传输设备的设备信息;
    获取所述传输发起设备发送的完整配置表,所述完整配置表由所述传输发起设备根据所述设备信息在所述待传输设备中确定目标设备,在所述目标设备的初始配置表中填写传输配置信息得到;
    根据所述传输配置信息配置所述目标设备,将所述完整配置表中预设的配置状态位更新为成功状态,并将更新后的完整配置表发送至所述传输发起设备,使所述传输发起设备在确定所述配置状态位为所述成功状态时,利用所述完整配置表与所述目标设备进行PCIe点对点数据传输。
  9. 根据权利要求8所述的方法,其特征在于,所述根据所述传输配置信息配置所述目标设备,包括:
    从所述传输配置信息中读取使能标志位、目标中断类型及中断配置信息;
    若所述使能标志位为需要使能状态,则对所述目标设备的配置空间中的命令寄存器进行配置,以使能内存空间位和总线主控位;
    若所述目标中断类型为MSI中断,则利用所述中断配置信息配置所述目标设备的MSI功能寄存器。
  10. 根据权利要求8所述的方法,其特征在于,在所述将所述待传输设备的初始配置表发送至所述传输发起设备之前,还包括:
    从所述待传输设备的配置空间中提取所述设备信息,并利用所述设备信息创建所述初始配置表。
  11. 根据权利要求8至10任一项所述的方法,其特征在于,所述将所述待传输设备的初始配置表发送至所述传输发起设备,包括:
    构造第一控制命令,将所述第一控制命令发送至控制命令提交队列,并更新门铃寄存器的状态;所述第一控制命令中包含所述初始配置表在所述主机设备的内存中的存放地址;
    相应的,所述获取所述传输发起设备发送的完整配置表,包括:
    构造第二控制命令,将所述第二控制命令发送至所述控制命令提交队列,并更新所述门铃寄存器的状态;所述第二控制命令中包含所述完整配置表在所述内存中的目标写入地址。
  12. 一种数据传输方法,其特征在于,应用于数据传输系统中的传输发起设备,所述数据传输系统包括主机设备、待传输设备和传输发起设备,所述方法包括:
    获取所述主机设备发送的、所述待传输设备的初始配置表;所述初始配置表中包含所述待传输设备的设备信息;
    根据所述设备信息在所述待传输设备中确定目标设备,在所述目标设备的初始配置表中填写传输配置信息得到完整配置表,并将所述完整配置表发送至所述主机设备;
    获取所述主机设备发送的更新后的完整配置表,所述完整配置表的更新由所述主机设备根据所述传输配置信息配置所述目标设备,将所述完整配置表中预设的配置状态位更新为成功状态;
    在确定所述配置状态位为所述成功状态时,利用所述完整配置表与所述目标设备进行PCIe点对点数据传输。
  13. 根据权利要求12所述的方法,其特征在于,所述在所述目标设备的初始配置表中填写传输配置信息得到完整配置表,包括:
    根据所述目标设备的初始配置表判断所述目标设备是否需要使能;
    若所述目标设备需要使能,则将所述初始配置表中预设的使能标志位更新为需要使能状态;
    从所述初始配置表中读取所述目标设备支持的中断类型,从所述中断类型中选择目标中断类型,并将所述目标中断类型填写至所述初始配置表;
    若所述目标中断类型为MSI中断,则将预设的中断配置信息填写至所述初始配置表;所述中断配置信息包括MSI中断地址、中断数据和中断个数;
    将完成填写的初始配置表设置为所述完整配置表。
  14. 根据权利要求12或13所述的方法,其特征在于,所述获取所述主机设备发送的、所述待传输设备的初始配置表,包括:
    在检测到门铃寄存器的发生状态更新时,从控制命令提交队列提取第一控制命令,所述第一控制命令由所述主机设备发送至所述控制命令提交队列,且所述第一控制命令中包含初始配置表在所述主机设备的内存中的存放地址;
    根据所述存放地址从所述内存中获取所述初始配置表;
    相应的,所述将所述完整配置表发送至所述主机设备,包括:
    在检测到所述门铃寄存器的发生状态变化时,从所述控制命令提交队列提取第二控制命令,所述第二控制命令由所述主机设备发送至所述控制命令提交队列,且所述第二控制命令中包含所述完整配置表在所述内存中的目标写入地址;
    根据所述目标写入地址将所述完整配置表写入所述内存。
  15. 根据权利要求14所述的方法,其特征在于,所述第一控制命令为特性设置命令,所述根据所述存放地址从所述内存中获取所述初始配置表,包括:
    判断所述特性设置命令中的功能标识符是否为第一预设值;
    若所述特性设置命令中的功能标识符为第一预设值,则从所述特性设置命令的数据指针中读取所述存放地址,并根据所述存放地址从所述内存中获取所述初始配置表;
    相应的,所述第二控制命令为特性获取命令,所述根据所述目标写入地址将所述完整配置表写入所述内存,包括:
    判断所述特性获取命令中的功能标识符是否为第二预设值;
    若所述特性获取命令中的功能标识符为第二预设值,则从所述特性获取命令的数据指针中读取所述目标写入地址,并根据所述目标写入地址将所述完整配置表写入所述内存。
  16. 根据权利要求15所述的方法,其特征在于,在所述根据所述存放地址从所述内存中获取所述初始配置表之后,所述方法还包括:
    通过控制命令响应队列将执行所述特性设置命令的第一执行结果发送至所述主机设备;
    相应的,在所述根据所述目标写入地址将所述完整配置表写入所述内存之后,还包括:
    通过所述控制命令响应队列将执行所述特性获取命令的第二执行结果发送至所述主机设备。
  17. 一种数据传输系统,其特征在于,包括主机设备、待传输设备和传输发起设备,所述待传输设备和所述传输发起设备均为PCIe设备,其中:
    所述主机设备,用于将所述待传输设备的初始配置表发送至所述传输发起设备;所述初始配置表中包含所述待传输设备的设备信息;根据所述传输发起设备返回的完整配置表中的传输配置信息配置目标设备,将所述完整配置表中预设的配置状态位更新为成功状态,并将更新后的完整配置表发送至所述传输发起设备;
    所述传输发起设备,用于根据所述初始配置表中的设备信息在所述待传输设备中确定所述目标设备,在所述目标设备的初始配置表中填写传输配置信息得到所述完整配置表,并将所述完整配置表发送至所述主机设备;在确定所述完整配置表中的所述配置状 态位为所述成功状态时,利用所述完整配置表与所述目标设备进行PCIe点对点数据传输;
    所述待传输设备,用于在被所述主机设备配置后,与所述传输发起设备进行所述PCIe点对点数据传输。
  18. 根据权利要求17所述的数据传输系统,其特征在于,
    所述传输发起设备,还用于根据所述目标设备的初始配置表判断所述目标设备是否需要使能;若所述目标设备需要使能,则将所述初始配置表中预设的使能标志位更新为需要使能状态;从所述初始配置表中读取所述目标设备支持的中断类型,从所述中断类型中选择目标中断类型,并将所述目标中断类型填写至所述初始配置表;若所述目标中断类型为MSI中断,则将预设的中断配置信息填写至所述初始配置表;所述中断配置信息包括MSI中断地址、中断数据和中断个数;将完成填写的初始配置表设置为所述完整配置表。
  19. 根据权利要求18所述的数据传输系统,其特征在于,
    所述主机设备,还用于从所述传输配置信息中读取所述使能标志位、所述目标中断类型及所述中断配置信息;若所述使能标志位为所述需要使能状态,则对所述目标设备的配置空间中的命令寄存器进行配置,以使能内存空间位和总线主控位;若所述目标中断类型为所述MSI中断,则利用所述中断配置信息配置所述目标设备的MSI功能寄存器。
  20. 根据权利要求17所述的数据传输系统,其特征在于,
    所述主机设备,还用于从所述待传输设备的配置空间中提取所述设备信息,并利用所述设备信息创建所述初始配置表。
  21. 根据权利要求17至20任一项所述的数据传输系统,其特征在于,
    所述主机设备,还用于构造第一控制命令,将所述第一控制命令发送至控制命令提交队列,并更新门铃寄存器的状态;所述第一控制命令中包含所述初始配置表在所述主机设备的内存中的存放地址;
    所述传输发起设备,还用于在检测到所述门铃寄存器的发生状态更新时,从所述控制命令提交队列提取所述第一控制命令,并根据所述存放地址从所述内存中获取所述初始配置表;
    相应的,所述主机设备,还用于构造第二控制命令,将所述第二控制命令发送至所述控制命令提交队列,并更新所述门铃寄存器的状态;所述第二控制命令中包含所述完整配置表在所述内存中的目标写入地址;
    所述传输发起设备,还用于在检测到所述门铃寄存器的发生状态变化时,从所述控制命令提交队列提取所述第二控制命令,并根据所述目标写入地址将所述完整配置表写入所述内存。
  22. 根据权利要求21所述的数据传输系统,其特征在于,
    所述传输发起设备,还用于判断所述特性设置命令中的功能标识符是否为第一预设值;若所述特性设置命令中的功能标识符为第一预设值,则从所述特性设置命令的数据指针中读取所述存放地址,并根据所述存放地址从所述内存中获取所述初始配置表;
    相应的,所述传输发起设备,还用于判断所述特性获取命令中的功能标识符是否为第二预设值;若所述特性获取命令中的功能标识符为第二预设值,则从所述特性获取命令的数据指针中读取所述目标写入地址,并根据所述目标写入地址将所述完整配置表写 入所述内存。
  23. 根据权利要求22所述的数据传输系统,其特征在于,
    所述传输发起设备,还用于通过控制命令响应队列将执行所述特性设置命令的第一执行结果发送至所述主机设备;
    相应的,所述传输发起设备,还用于通过所述控制命令响应队列将执行所述特性获取命令的第二执行结果发送至所述主机设备。
  24. 一种数据传输装置,其特征在于,应用于数据传输系统中的主机设备,所述数据传输系统包括主机设备、待传输设备和传输发起设备,所述装置包括:
    初始配置表发送模块,用于将所述待传输设备的初始配置表发送至所述传输发起设备;所述初始配置表中包含所述待传输设备的设备信息;
    完整配置表获取模块,用于获取所述传输发起设备发送的完整配置表,所述完整配置表由所述传输发起设备根据所述设备信息在所述待传输设备中确定目标设备,在所述目标设备的初始配置表中填写传输配置信息得到;
    更新配置表发送模块,用于根据所述传输配置信息配置所述目标设备,将所述完整配置表中预设的配置状态位更新为成功状态,并将更新后的完整配置表发送至所述传输发起设备,使所述传输发起设备在确定所述配置状态位为所述成功状态时,利用所述完整配置表与所述目标设备进行PCIe点对点数据传输。
  25. 一种数据传输装置,其特征在于,应用于数据传输系统中的传输发起设备,所述数据传输系统包括主机设备、待传输设备和传输发起设备,所述装置包括:
    初始配置表获取模块,用于获取所述主机设备发送的、所述待传输设备的初始配置表;所述初始配置表中包含所述待传输设备的设备信息;
    完整配置表发送模块,用于根据所述设备信息在所述待传输设备中确定目标设备,在所述目标设备的初始配置表中填写传输配置信息得到完整配置表,并将所述完整配置表发送至所述主机设备;
    更新配置表获取模块,用于获取所述主机设备发送的更新后的完整配置表,所述完整配置表的更新由所述主机设备根据所述传输配置信息配置所述目标设备,将所述完整配置表中预设的配置状态位更新为成功状态;
    数据传输模块,用于在确定所述配置状态位为所述成功状态时,利用所述完整配置表与所述目标设备进行PCIe点对点数据传输。
  26. 一种电子设备,其特征在于,包括:
    存储器,用于存储计算机程序;
    处理器,用于执行所述计算机程序,以实现如权利要求8至16任一项所述的数据传输方法。
  27. 一种非易失性计算机可读存储介质,其特征在于,所述非易失性计算机可读存储介质中存储有计算机程序,所述计算机程序被处理器加载并执行时,实现如权利要求1至16任一项所述的数据传输方法。
PCT/CN2023/083385 2022-03-24 2023-03-23 数据传输方法、系统、装置、设备及计算机可读存储介质 WO2023179714A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210292391.3 2022-03-24
CN202210292391.3A CN114389947B (zh) 2022-03-24 2022-03-24 数据传输方法、系统及计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2023179714A1 true WO2023179714A1 (zh) 2023-09-28

Family

ID=81206226

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/083385 WO2023179714A1 (zh) 2022-03-24 2023-03-23 数据传输方法、系统、装置、设备及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN114389947B (zh)
WO (1) WO2023179714A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114389947B (zh) * 2022-03-24 2022-05-27 苏州浪潮智能科技有限公司 数据传输方法、系统及计算机可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105068953A (zh) * 2014-05-07 2015-11-18 Hgst荷兰公司 用于对等高速外围组件互联存储传输的系统和方法
CN106027423A (zh) * 2016-05-20 2016-10-12 北京百度网讯科技有限公司 PCIe设备共享网络及其数据传输方法
JP2017097638A (ja) * 2015-11-25 2017-06-01 キヤノン株式会社 PCIeデバイス及びそれを有する情報処理装置の制御方法
CN114138702A (zh) * 2022-01-29 2022-03-04 阿里云计算有限公司 计算系统、pci设备管理器及其初始化方法
CN114389947A (zh) * 2022-03-24 2022-04-22 苏州浪潮智能科技有限公司 数据传输方法、系统及计算机可读存储介质

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11238030A (ja) * 1998-02-20 1999-08-31 Mitsubishi Electric Corp Pci−pciブリッジおよびそのための先入れ先出しメモリ
CN102123049B (zh) * 2011-02-25 2013-03-06 北京理工大学 一种基于MAC地址传输的Cache同步方法
CN105721357B (zh) * 2016-01-13 2019-09-03 华为技术有限公司 交换设备、外围部件互连高速系统及其初始化方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105068953A (zh) * 2014-05-07 2015-11-18 Hgst荷兰公司 用于对等高速外围组件互联存储传输的系统和方法
JP2017097638A (ja) * 2015-11-25 2017-06-01 キヤノン株式会社 PCIeデバイス及びそれを有する情報処理装置の制御方法
CN106027423A (zh) * 2016-05-20 2016-10-12 北京百度网讯科技有限公司 PCIe设备共享网络及其数据传输方法
CN114138702A (zh) * 2022-01-29 2022-03-04 阿里云计算有限公司 计算系统、pci设备管理器及其初始化方法
CN114389947A (zh) * 2022-03-24 2022-04-22 苏州浪潮智能科技有限公司 数据传输方法、系统及计算机可读存储介质

Also Published As

Publication number Publication date
CN114389947A (zh) 2022-04-22
CN114389947B (zh) 2022-05-27

Similar Documents

Publication Publication Date Title
EP2176772B1 (en) Processing of data to monitor input/output operations
US8196149B2 (en) Processing of data to determine compatability in an input/output processing system
US8214562B2 (en) Processing of data to perform system changes in an input/output processing system
US7840718B2 (en) Processing of data to suspend operations in an input/output processing log-out system
CN105224480B (zh) 一种用于响应于读取要求的存取存储器装置的方法和装置
CN106681953B (zh) 使用i2c总线与主机连接的从机及其通信方法
WO2023179714A1 (zh) 数据传输方法、系统、装置、设备及计算机可读存储介质
US8990439B2 (en) Transport mode data transfer between a channel subsystem and input/output devices
EP3296836B1 (en) Computer device and data read-write method for computer device
US20190155765A1 (en) Operation method of host system including storage device and operation method of storage device controller
TW201914260A (zh) 擴展塢裝置、電子裝置及mac位址複製方法
WO2023202297A1 (zh) 一种数据读取方法、装置、设备及存储介质
JP2018116648A (ja) 情報処理装置、その制御方法、及びプログラム
JP2016041470A (ja) 印刷装置、印刷装置に接続されたストレージの制御装置、印刷装置の制御方法及びプログラム
US8918542B2 (en) Facilitating transport mode data transfer between a channel subsystem and input/output devices
TW434491B (en) Increasing I/O performance through storage of packetized operational information in local memory
CN110874297B (zh) 数据访问方法、装置和主机
JP5129691B2 (ja) メモリカード、並びにメモリカード制御装置およびメモリカード制御方法
TWI703446B (zh) 介面轉接電路
JP5010065B2 (ja) マイクロコンピュータ
JP6965943B2 (ja) 構成管理装置、構成管理システム、構成管理方法、および、構成管理プログラム
CN110955435A (zh) FPGA加速卡板载flash的烧写方法及相关组件
JP4793798B2 (ja) マイクロコンピュータ
CN108810087B (zh) 一种存储服务器的连接方法、系统及设备
CN106951287B (zh) 一种软件的配置方法、装置及系统

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: 23773960

Country of ref document: EP

Kind code of ref document: A1