WO2023051504A1 - 应用升级方法、装置、网卡和设备 - Google Patents

应用升级方法、装置、网卡和设备 Download PDF

Info

Publication number
WO2023051504A1
WO2023051504A1 PCT/CN2022/121619 CN2022121619W WO2023051504A1 WO 2023051504 A1 WO2023051504 A1 WO 2023051504A1 CN 2022121619 W CN2022121619 W CN 2022121619W WO 2023051504 A1 WO2023051504 A1 WO 2023051504A1
Authority
WO
WIPO (PCT)
Prior art keywords
operator
application
physical address
mapping relationship
target
Prior art date
Application number
PCT/CN2022/121619
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 WO2023051504A1 publication Critical patent/WO2023051504A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • 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

Definitions

  • the present application relates to the communication field, and more specifically, relates to an application upgrading method, device, network card and equipment.
  • the current era has completed the transformation from computing-centric to data-centric. Many applications rely on big data, such as typical artificial intelligence applications. At the same time, when the amount of data becomes larger and larger, a faster network is required to transmit these data.
  • the applications offloaded to the smart network card need to be upgraded.
  • the traditional method is to upgrade the internal applications of the network card through cold upgrade.
  • the basic process of cold upgrade is that after the device to be upgraded (such as server/storage array) obtains the new application (or called new firmware), it transfers the new The firmware is sent to the network card in the device, and the network card writes the new firmware into the read-only memory (ROM) (such as flash memory (flash)), then restarts the network card, and runs the new firmware from the ROM to boot, so that the new firmware will take effect.
  • ROM read-only memory
  • flash flash memory
  • restarting the NIC will interrupt the service link, which in turn will cause service interruption.
  • the process of updating the network card application not only the network card needs to be restarted, but also the entire device needs to be restarted to make the new application take effect.
  • the embodiment of the present application provides an application upgrade method, which can upgrade the application of the network card without restarting the network card, thereby reducing the impact of the network card application upgrade on services, accelerating application calculation and transmission, and improving the performance of the whole machine.
  • the present application provides an application upgrade method, the method is applied to a network card device, and the method includes: acquiring application upgrade information, where the upgrade information includes a target operator and an operator of the target operator ID, the application ID of the application; acquire the physical address allocated for the target operator, where the physical address is the address of the storage space on the network card device;
  • the user can trigger an upgrade command for the application on the device where the network card is located, and then the device where the network card is located can generate application upgrade information. Perform cross-compilation to obtain the microcode operator package, and pass the upgrade information to the network card device.
  • the upgrade content may be added operators, replaced operators, and so on.
  • the target operator can be understood as the code corresponding to the function, and the function refers to a mapping rule from a function space to a function space.
  • the target operator can be a hash operation, a function interception operation, and so on.
  • the upgrade information can also be called a microcode operator package or a microcode package;
  • the operator ID of the target operator can be a function name or other information (such as a string) indicating the operator, and the operator ID can also be called an operator ID, a microcode ID, etc.
  • the sub-id can uniquely indicate the target operator.
  • the application identifier of the application may be an application name or other information (such as a character string) indicating the application.
  • the application identifier may also be called an application ID, and the application identifier may uniquely indicate the application;
  • the upgrade information further includes: a virtual address corresponding to the target operator; the network card device may map the virtual address to a corresponding physical address based on the virtual address.
  • the virtual address can be the address allocated by the host for the target operator (such as the address in dynamic random access memory (DRAM)), in order to store the target operator in its own storage space, the network card device needs Map a virtual address to a physical address in its own storage space.
  • DRAM dynamic random access memory
  • the storage space is the free storage space on the network card device.
  • the so-called free space can be understood as data that is not allocated and stored in the storage space, that is to say, the storage space can be the free space in the network card device cache.
  • Storage space the storage space can also be free storage space in the flash memory of the network card device;
  • the target operator in the storage space corresponding to the physical address, and constructing a first mapping relationship according to the operator identifier, the application identifier, and the physical address, the first mapping relationship indicating that the There is a mapping relationship among at least two of the operator identifier, the application identifier, and the physical address, and the first mapping relationship is used as routing information of the target operator when the application is running.
  • the target operator can be stored in the storage space corresponding to the physical address, for example, the target operator can be stored in the storage corresponding to the physical address in the cache space, or stored in the storage space corresponding to the physical address in the flash memory.
  • the network card device In order for the network card device to call the target operator when the application is running later, it is necessary to establish a mapping relationship table used as the routing information of the target operator (the embodiment of this application can be called the microcode operation management table, or the first mapping relationship), the first mapping relationship records the identifiers and physical addresses (or interface addresses) of each operator of the application, etc., when the application is running, the identifier of the operator to be called can be specified in the data packet, Furthermore, the network card device can determine the physical address stored by the operator based on the identifier of the operator and the first mapping relationship, and call and execute the operator based on the physical address.
  • a mapping relationship table used as the routing information of the target operator
  • the embodiment of this application can be called the microcode operation management table, or the first mapping relationship
  • the application when the application is upgraded, the entire application is not replaced, but only the upgraded operator is stored and the routing information is constructed for the upgraded operator, instead of inserting the target operator into the A certain position of the application will not affect the working process of other codes of the application.
  • the application When the application is running, it is only necessary to specify whether to call the target operator in the data packet, and it can be routed to the storage location of the target segment based on the first mapping relationship. , and call the target operator, and then, the application of the network card can be upgraded without restarting the network card. Since there is no need to restart the network card, the service link can be kept uninterrupted. Therefore, the technical solution provided by this embodiment can complete the application upgrade of the network card while maintaining the continuous business communication link, thereby reducing the impact of the network card application upgrade on the business, accelerating application calculation and transmission, and improving the performance of the whole machine .
  • each data packet can call its own application based on the indication of the operator ID. operator), that is, it can support multiple operators and multiple types of applications to uninstall operations at the same time, and they are isolated from each other without affecting each other.
  • the storage space is cache or flash memory.
  • unloading operators to the flash memory area of the network card can realize online upgrade and selective management of network card functions without interrupting the business flow of the network card, and after restarting the network card, it can be loaded from flash again Operators run in memory.
  • the upgrade information further includes a first invocation level of the target operator, the first invocation level is used to indicate the importance of the target operator, and the storage space includes The first subspace allocated by the operator of the first call level, the physical address is the address of the first subspace.
  • the degree of importance may be operator function, operator size, or call relationship of operators.
  • the first call level may indicate that the target operator can be called by operators at the second call level, and the The target operator can call an operator at a third invocation level, and the second invocation level is different from the third invocation level; in a possible implementation, the second invocation level is lower than the first invocation level , the third invocation level is higher than the first invocation level.
  • the second invocation level is lower than the first invocation level
  • the third invocation level is higher than the first invocation level.
  • the network card device may pre-allocate different storage spaces (that is, the subspaces described above) for operators of different importance levels (eg, different functions, different sizes, etc.).
  • the storage space may include a first subspace allocated for operators of the first call level, and the physical address is an address of the first subspace.
  • the storage space may further include a second subspace allocated for operators of the second call level, the first subspace is used to store operators of the first call level, and the second subspace is used for Operators of the second call level are stored.
  • the storage space is a first subspace allocated for operators at the first call level on the network card device, and the first subspace is used to store the first call Hierarchical operator.
  • the constructing the first mapping relationship according to the operator identifier, the application identifier, and the physical address includes: according to the operator identifier, the first call level, the The application identifier and the physical address are used to construct a first mapping relationship, and the first mapping relationship indicates that there is a mapping relationship between the operator identifier, the first call level, the application identifier, and the physical address.
  • the second mapping relationship may record relevant information (for example, including operator ID, virtual address, operator size, etc.) .
  • operators can be stored based on the call hierarchy of operators, where the call hierarchy here can be understood as the call relationship between operators, and operators with lower call levels can call call levels higher operator. Specifically, a certain storage space may be allocated for each call level, and operators may be stored in the storage space allocated by the call level to which they belong.
  • the second mapping relationship may include multiple call levels, subspaces allocated for each call level, and operator information stored in each subspace, and the operator information may be Including the virtual address of the operator and the identifier of the operator.
  • the second mapping relationship can be recorded as the information of the operators allocated in the storage space allocated by each call level, and then when assigning addresses to the target operators, the call level to which the target operator belongs can be firstly determined (for example, the target operator belongs to the first call level).
  • the upgrade information further includes the first invocation level of the target operator, that is, the invocation level of the operator may be included in the upgrade information.
  • the space allocated for the first invocation level may be determined based on the second mapping relationship (the first subspace, the first subspace is used to store the first An operator at the calling level), that is, according to the first calling level and the second mapping relationship, determine the first subspace allocated for the first calling level from the second mapping relationship, and then The physical address allocated for the target operator may be obtained from the first subspace.
  • the second mapping relationship may be stored in a cache or a flash memory.
  • the second mapping relationship may be stored in information such as a table or an array, and the data form of the second mapping relationship is not limited here.
  • the upgrade information may further include: the identifier of the operator to be replaced; the acquiring the physical address allocated for the target operator includes: determining the The physical address of the storage space where the operator to be replaced is stored.
  • the upgrade for an application may be to replace or add an operator of the application.
  • the upgrade information may indicate which operator to replace (operator to be replaced) and which operator to replace (target operator), and then the network card device can remove the operator to be replaced from the original storage location and store the target operator.
  • the target operator includes a first operator segment and a second operator segment, and the first operator segment and the second operator segment are respectively a part of the target operator , and the first operator section includes the entry function of the target operator;
  • the storing the target operator in the storage space corresponding to the physical address includes: The space is smaller than the storage space required for storing the target operator, and the available space of the first subspace is larger than the storage space required for storing the first operator segment, and the first operator segment is stored in the in the storage space corresponding to the physical address, and transfer the second operator segment to the host, so that the host can store the second operator segment.
  • the storage space of the network card device can be fully utilized.
  • the method further includes: receiving operator invocation information sent by the application runtime, the operator invocation information including the application identifier and the Operator identification, the operator call information is used to indicate the execution of the target operator; according to the operator call information and the first mapping relationship, the physical address is obtained; according to the physical address, the Target operator.
  • the information indicating the call target operator can be transmitted to the network card device, and the network card device can use the first mapping relationship, get the physical address where the target operator is stored, and obtain and execute the target operator from the physical address.
  • the operator calling information is also used to indicate the execution of a software program, where the software program includes a first code segment, a second code segment, and a code located between the first code segment and the second code segment.
  • a hook point between segments, the hook point is used to indicate whether to call the target operator, and the operator call information is specifically used to indicate that the target operator is called after the first code segment is executed;
  • the method further includes: executing the first code segment, executing the target operator, and executing the second code segment according to the operator call information.
  • the operator call information can indicate a certain program in the running application, and the program can be pre-configured with a hook point, which can indicate whether to call the target operator at the hook point, and the application can call the target operator at the hook point
  • the operator information (which can be carried in the data packet or QPC) is transmitted to the network card device, and then the network card device can call and execute the target operator at the hook point when running the program.
  • the present application provides an application upgrading device, the device is applied to a network card device, and the device includes:
  • An acquiring module configured to acquire upgrade information of an application, where the upgrade information includes a target operator, an operator identifier of the target operator, and an application identifier of the application;
  • An operator deployment module configured to store the target operator in the storage space corresponding to the physical address, and construct a first mapping relationship according to the operator identifier, the application identifier, and the physical address, so that The first mapping relationship indicates that there is a mapping relationship between the operator identifier, the application identifier, and the physical address, and the first mapping relationship is used as routing information of the target operator when the application is running.
  • the storage space is cache or flash memory.
  • the upgrade information further includes: a virtual address corresponding to the target operator;
  • the acquisition module is specifically used for:
  • the virtual address is mapped to a corresponding physical address.
  • the upgrade information further includes a first invocation level of the target operator, the first invocation level is used to indicate the importance of the target operator, and the storage space includes The first subspace allocated by the operator of the first call level, the physical address is the address of the first subspace.
  • the storage space further includes a second subspace allocated for operators at the second invocation level, and the first subspace is used to store operators at the first invocation level, so The second subspace is used to store operators of the second calling level.
  • the acquiring module is specifically used for:
  • the second mapping relationship includes a plurality of calling levels and a subspace allocated for each calling level
  • the first call level and the second mapping relationship determine the first subspace allocated for the first call level from the second mapping relationship
  • the upgrade information further includes: an identifier of the operator to be replaced;
  • the acquisition module is specifically used for:
  • the physical address of the storage space storing the operator to be replaced is determined.
  • the target operator includes a first operator segment and a second operator segment, and the first operator segment and the second operator segment are respectively a part of the target operator , and the first operator segment includes the entry function of the target operator;
  • the operator deployment module is specifically used for:
  • the operator deployment module is specifically used to:
  • the acquisition module is also used to:
  • the operator call information includes the application identifier and the operator identifier, and the operator call information is used to instruct execution of the target operator;
  • the operator calling information is also used to indicate the execution of a software program, where the software program includes a first code segment, a second code segment, and a code located between the first code segment and the second code segment.
  • a hook point between segments, the hook point is used to indicate whether to call the target operator, and the operator call information is specifically used to indicate that the target operator is called after the first code segment is executed;
  • the device also includes:
  • a program execution module configured to execute the first code segment, execute the target operator, and execute the second code segment according to the operator call information.
  • an embodiment of the present application provides a computer-readable storage medium, which is characterized by including computer-readable instructions, and when the computer-readable instructions are run on a computer device, the computer device is made to execute the above-mentioned first aspect. and any of its optional methods.
  • an embodiment of the present application provides a computer program product, which is characterized by including computer-readable instructions, and when the computer-readable instructions are run on a computer device, the computer device is made to execute the above-mentioned first aspect and its Either method is optional.
  • the present application provides a chip system, which includes a processor, configured to support an execution device or a training device to implement the functions involved in the above aspect, for example, send or process the data involved in the above method; or, information.
  • the system-on-a-chip further includes a memory, and the memory is used for storing necessary program instructions and data of the execution device or the training device.
  • the system-on-a-chip may consist of chips, or may include chips and other discrete devices.
  • a device includes a network card, and the network card is configured to execute the operation steps of the method in the foregoing first aspect or any possible implementation manner of the first aspect.
  • An embodiment of the present application provides an application upgrade method, the method is applied to a network card device, and the method includes: acquiring application upgrade information, where the upgrade information includes a target operator, an operator identifier of the target operator, The application identification of the application; obtaining the physical address allocated for the target operator, the physical address being the address of the storage space on the network card device; storing the target operator in the storage space corresponding to the physical address , and according to the operator identifier, the application identifier, and the physical address, construct a first mapping relationship, the first mapping relationship indicates that there is a mapping between the operator identifier, the application identifier, and the physical address relationship, the first mapping relationship is used as the routing information of the target operator when the application is running.
  • the technical solution provided by this embodiment can complete the application upgrade of the network card while maintaining the continuous business communication link, thereby reducing the impact of the network card application upgrade on the business, accelerating application calculation and transmission, and improving the performance of the whole machine .
  • FIG. 1 is a schematic diagram of the application architecture provided by the embodiment of the present application.
  • FIG. 2 is a schematic flowchart of an application upgrading method provided in an embodiment of the present application
  • FIG. 3 is a schematic flowchart of an application upgrading method provided in an embodiment of the present application.
  • FIG. 4 is a schematic diagram of the loading management table provided by the embodiment of the present application.
  • FIG. 5 is a schematic diagram of the operation management table provided by the embodiment of the present application.
  • FIG. 6 is a schematic flowchart of an application upgrading method provided in an embodiment of the present application.
  • FIG. 7 is a schematic diagram of the application architecture provided by the embodiment of the present application.
  • FIG. 8 is a schematic flowchart of an application upgrade method provided in an embodiment of the present application.
  • FIG. 9 is a schematic flowchart of an application upgrading method provided in an embodiment of the present application.
  • FIG. 10 is a schematic flowchart of an application upgrade method provided in an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of an application upgrading device provided by an embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of a network card provided in an embodiment of the present application.
  • FIG. 13 is a schematic structural diagram of a device provided by an embodiment of the present application.
  • the first device includes a processor and a network card.
  • the first device performs network communication with the second device through the network card.
  • the second device may be a remote network node.
  • the network card is connected to the processor of the first device through a high-speed serial computer expansion bus standard (peripheral component interconnect express, PCIe) bus.
  • PCIe peripheral component interconnect express
  • the network card is connected to the second device through Ethernet (ethernet, ETH)/fibre channel (fibre channel, FC). It should be understood that there is also a corresponding network card (not shown in FIG. 1 ) on the second device.
  • the first device may be a server or a storage array.
  • the second device can also be a server or a storage array.
  • the network card is an interface between the device in the local area network that is connected to the network card of the application to be upgraded (such as the first device in Figure 1) and the remote device (such as the second device in Figure 1), and their transmission media can be as shown in Figure 1
  • the ETH/FC in the network can not only realize the physical connection and electrical signal matching with the LAN transmission medium, but also involve frame sending and receiving, frame encapsulation and unpacking, media access control, data encoding and decoding, and data caching functions etc.
  • Fig. 1 is only an example rather than a limitation.
  • the architecture of the network card application upgrade scenario can also be a multi-host sharing network card scenario, that is, multiple hosts share one network card.
  • processors of multiple devices whose applications are to be upgraded are respectively connected to the same network card through multiple PCIe buses.
  • the host mentioned herein may correspond to the first device shown in FIG. 1 .
  • multiple first devices as shown in FIG. 1 are included, but these multiple first devices share one network card. It is connected to the same network card through the PCIe bus.
  • the processor shown in FIG. 1 is the processor of the first device, not the processor of the network card.
  • the processor (or processor unit) of the network card will be involved.
  • the processor in the device where the network card is located is recorded as the host processor. That is to say, the processors mentioned in the following embodiments except the host processor, unless otherwise specified, all refer to the processor (processor unit) of the network card.
  • the existing network card application upgrade method is to run the new firmware of the network card by restarting the network card.
  • the network card is powered off, resulting in interruption of service links.
  • the time to restart the network card is generally tens of seconds
  • upgrade the network card firmware on a host that supports network card hot-swapping the service link will be interrupted for tens of seconds.
  • both the NIC and the host need to be restarted to restore the service link.
  • restarting the host usually takes a few minutes, therefore, when the NIC hot-swap is not supported
  • the firmware of the NIC is upgraded on the plugged-in host, the service link will be interrupted for several minutes.
  • restarting the network card due to cold upgrade will cause multiple hosts to restart, and the recovery cost is high.
  • the network link between the network card and the remote device (such as the second device in Figure 1) is also interrupted, and the link between the network card and the remote device needs to be re-established, and the remote device needs to be reconfigured. Terminal equipment, maintenance costs are also high.
  • the existing network card application upgrade solution has the following disadvantages: the service link is interrupted due to power failure of the network card, and the network maintenance cost is relatively high.
  • the embodiment of the present application proposes an application upgrade method, device, network card and equipment, which can maintain uninterrupted service links and reduce network maintenance costs during the process of upgrading applications on the network card.
  • the network card includes a processor and a memory.
  • the processor in the network card can be a central processing unit (central processing unit, CPU), or other microprocessors, or can also be a field-programmable gate array (field-programmable gate a array, FPGA).
  • the memory in the network card includes ROM (or flash memory (flash)) and internal memory. Specifically, the memory storage is a random-access memory (random-access memory, RAM).
  • ROM or flash memory (flash)
  • RAM random-access memory
  • the firmware on the network card is stored in the ROM, and when the network card is working, the firmware in the ROM is loaded into the RAM area for execution.
  • FIG. 2 is a schematic flowchart of an application upgrade method provided by an embodiment of the present application. The method includes the following steps.
  • the network card device acquires application upgrade information, where the upgrade information includes a target operator, an operator identifier of the target operator, and an application identifier of the application.
  • the user can trigger an upgrade command for the application on the device where the network card is located, and then the device where the network card is located can generate application upgrade information. Perform cross-compilation to obtain the microcode operator package, and pass the upgrade information to the network card device.
  • the upgrade information can indicate that some operators are added to the application or the original operators are replaced, so as to realize the update and upgrade of the application.
  • the upgrade content may be added operators, replaced operators, and so on.
  • the target operator can be understood as the code corresponding to the function, and the function refers to a mapping rule from a function space to a function space.
  • the target operator can be a hash operation, a function interception operation, and so on.
  • the upgrade information can also be called microcode operator package or microcode package;
  • the network card may obtain application upgrade information from a device where the network card is located, and the device where the network card is located may be a computer, a server, or a storage array.
  • the device where the network card is located is referred to as a host hereinafter, and correspondingly, the processor of the device where the network card is located is referred to as a host processor.
  • the host processor may deliver the application upgrade information to the network card through the bus, and correspondingly, the network card device may receive the application-specific upgrade information delivered by the host processor through the bus.
  • the bus for communication between the host processor and the network card may be a PCIe bus, or may also be a non-PCIe bus.
  • the non-PCIe bus can be a system management bus (system management bus, SMBus), an integrated circuit bus (inter-integrated circuit, I2C), a serial peripheral interface (serial peripheral interface, SPI) bus, or a universal asynchronous transceiver transmitter (universal asynchronous receiver/transmitter, UART), etc.
  • the upgrade information may include information about at least one operator. Taking at least one operator including a target operator as an example, the upgrade information may include the target operator itself, the operator ID of the target operator, the target operator The virtual address of the operator (optional) and the application ID of the application.
  • the operator ID of the target operator can be a function name or other information (such as a string) indicating the operator.
  • the operator ID can also be called operator ID, microcode ID, etc.
  • the operator ID can uniquely indicate the target operator.
  • the application identifier of the application may be an application name or other information (such as a character string) indicating the application.
  • the application identifier may also be called an application ID, and the application identifier may uniquely indicate the application.
  • the network card device can obtain the upgrade information and store operators related to the upgrade information.
  • the processor in the network card device can run a microcode to dynamically load the management
  • the loading management module can perform actions related to processing upgrade information.
  • the upgrade information may also include: the identification of the operator to be replaced; wherein, the upgrade for the application may be to replace or add the operator of the application, and when replacing the operator,
  • the upgrade information may indicate which operator to replace (operator to be replaced) and which operator to replace (target operator), and then the network card device may delete the operator to be replaced from the original storage location and store the target operator.
  • the network card device acquires a physical address allocated to the target operator, where the physical address is an address of a storage space on the network card device.
  • the storage space is a cache.
  • the cache may include a data cache and an instruction cache, and the storage space here may be a data cache.
  • the storage space is flash memory. Since the flash memory is a non-volatile memory, the data will not be lost even if the power is turned off. After restarting the network card device, the operator can be loaded from the flash to the memory again to run.
  • the storage space is the free storage space on the network card device.
  • the so-called free space can be understood as data that is not allocated and stored in the storage space. That is to say, the storage space can be the free storage space in the cache of the network card device. Free storage space in the flash memory of the network card device can be used.
  • the upgrade information may include a virtual address corresponding to the target operator; the network card device may map the virtual address to a corresponding physical address based on the virtual address.
  • the virtual address can be the address allocated by the host for the target operator (such as the address in dynamic random access memory (DRAM)), in order to store the target operator in its own storage space, the network card device needs Map a virtual address to a physical address in its own storage space.
  • DRAM dynamic random access memory
  • the network card device can allocate free instruction space (that is, the address of the storage space) for the target operator, adjust the call address (that is, map the virtual address to the corresponding physical address), and write the target operator to In the allocated instruction space, the network card device can allocate free instruction space according to the real-time state of the instruction space and the size requirement of the target operator.
  • the network card device can maintain a table (this table can be called the microcode loading management table, or the second mapping relationship, as shown in Figure 3 and Figure 4 for details ).
  • this table can be called the microcode loading management table, or the second mapping relationship, as shown in Figure 3 and Figure 4 for details ).
  • the second mapping relationship is described:
  • the second mapping relationship can record the relevant information (for example, including operator identifier, virtual address (optional), child size, etc.).
  • the operator can be stored based on the call hierarchy of the operator, where the call hierarchy can be understood as the importance of the target operator; where the importance can be the operator function, operator
  • the size or call relationship of operators for example, the first call level can indicate that the target operator can be called by operators at the second call level, and the target operator can call operators at the third call level , the second invocation level is different from the third invocation level; in a possible implementation, the second invocation level is lower than the first invocation level, and the third invocation level is higher than the first invocation level
  • One call level when assigning physical addresses to operators, operators at different call levels are assigned different areas. Based on the division of call levels, operators at the lower call level can call operators at the higher call level. The number of operators can be reduced.
  • the network card device may pre-allocate different storage spaces (that is, the subspaces described above) for operators of different importance levels (eg, different functions, different sizes, etc.).
  • the storage space may include a first subspace allocated for operators of the first call level, and the physical address is an address of the first subspace.
  • the storage space may further include a second subspace allocated for operators of the second call level, the first subspace is used to store operators of the first call level, and the second subspace is used for Operators of the second call level are stored.
  • the storage space is a first subspace allocated for operators at the first call level on the network card device, and the first subspace is used to store the first call Hierarchical operator.
  • the upgrade information further includes the first invocation level of the target operator, that is, the invocation level of the operator may be included in the upgrade information.
  • the second mapping relationship may include multiple call levels, subspaces allocated for each call level, and operator information stored in each subspace, and the operator information may be Including the virtual address of the operator and the identifier of the operator.
  • the second mapping relationship can be recorded as the information of the operators allocated in the storage space allocated by each call level, and then when assigning addresses to the target operators, the call level to which the target operator belongs can be firstly determined (for example, the target operator belongs to the first call level).
  • the second mapping relationship may include multiple call levels, subspaces allocated for each call level, and operator information stored in each subspace, and the operator information may be Including the virtual address of the operator and the identifier of the operator.
  • the second mapping relationship can be recorded as the information of the operators allocated in the storage space allocated by each call level, and then when assigning addresses to the target operators, the call level to which the target operator belongs can be firstly determined (for example, the target operator belongs to the first call level).
  • the space allocated for the first invocation level may be determined based on the second mapping relationship (the first subspace, the first subspace is used to store the first An operator at the calling level), that is, according to the first calling level and the second mapping relationship, determine the first subspace allocated for the first calling level from the second mapping relationship, and then The physical address allocated for the target operator may be obtained from the first subspace.
  • the second mapping relationship may be stored in a cache or a flash memory.
  • the second mapping relationship may be stored in information such as a table or an array, and the data form of the second mapping relationship is not limited here.
  • the second mapping relationship can be updated based on the information of the target operator, for example, the mapping relationship between the operator identifier of the target operator, the first call level, and the virtual address of the target operator can be constructed, and The above-mentioned mapping relationship is added to the second mapping relationship, so as to realize the updating of the second mapping relationship.
  • the network card device stores the target operator in the storage space corresponding to the physical address, and constructs a first mapping relationship according to the operator identifier, the application identifier, and the physical address, and the first The mapping relationship indicates that there is a mapping relationship between at least two of the operator identifier, the application identifier, and the physical address, and the first mapping relationship is used as the target operator when the application is running. routing information.
  • the target operator can be stored in the storage space corresponding to the physical address, for example, the target operator can be stored in the cache stored in the storage space corresponding to the physical address, or stored in the storage space corresponding to the physical address in the flash memory.
  • the network card device In order for the network card device to call the target operator when the application is running later, it is necessary to establish a mapping relationship table used as the routing information of the target operator (the embodiment of this application can be called the microcode operation management table, or the first mapping relationship, as shown in Figure 3 and Figure 5), in the first mapping relationship, the identifiers and physical addresses (or interface addresses) of each operator of the application are recorded, and when the application is running, the Specify the identifier of the operator to be called in , and then the network card device can determine the physical address stored by the operator based on the identifier of the operator and the first mapping relationship, and call and execute the operator based on the physical address.
  • the mapping relationship table used as the routing information of the target operator
  • the embodiment of this application can be called the microcode operation management table, or the first mapping relationship, as shown in Figure 3 and Figure 5
  • the first mapping relationship the identifiers and physical addresses (or interface addresses) of each operator of the application are recorded, and when the application is running, the Specify
  • the first mapping relationship can be updated based on the relevant information of the target operator, and the first mapping relationship can be used as routing information when the target operator is called subsequently.
  • the first call level, the application identifier, and the physical address are used to construct a first mapping relationship, and the first mapping relationship indicates the operator identifier, the first call level, the application identifier, and the physical address. There is a mapping relationship between addresses.
  • the first mapping relationship may be stored in a cache or a flash memory.
  • first mapping relationship may be stored in information such as a table or an array, and the data form of the first mapping relationship is not limited here.
  • the target operator includes a first operator segment and a second operator segment, and the first operator segment and the second operator segment are respectively a part of the target operator , and the first operator section includes the entry function of the target operator;
  • the storing the target operator in the storage space corresponding to the physical address includes: The space is smaller than the storage space required for storing the target operator, and the available space of the first subspace is larger than the storage space required for storing the first operator segment, and the first operator segment is stored in the in the storage space corresponding to the physical address, and transfer the second operator segment to the host, so that the host can store the second operator segment.
  • the storage space of the network card device can be fully utilized.
  • the network card device may receive operator call information sent by the application run, where the operator call information includes the application identifier and the operator identifier, and the operator
  • the sub-call information is used to indicate to execute the target operator; the physical address is obtained according to the operator call information and the first mapping relationship; and the target operator is obtained according to the physical address.
  • the information indicating the call target operator can be transmitted to the network card device, and the network card device can use the first mapping relationship, get the physical address where the target operator is stored, and obtain and execute the target operator from the physical address.
  • FIG. 6 is a schematic diagram of a data flow when an application is running.
  • the operator call information is also used to indicate the execution of a software program
  • the software program includes a first code segment, a second code segment, and a code located between the first code segment and the A hook hook point between the second code segments, the hook point is used to indicate whether to call the target operator, and the operator call information is specifically used to indicate that the target operator is called after the first code segment is executed
  • the method further includes: executing the first code segment, executing the target operator, and executing the second code segment according to the operator call information.
  • the operator call information can indicate a certain program in the running application, and the program can be pre-configured with a hook point, which can indicate whether to call the target operator at the hook point, and the application can call the target operator at the hook point
  • the operator information (which can be carried in the data packet or QPC) is transmitted to the network card device, and then the network card device can call and execute the target operator at the hook point when running the program.
  • the smart memory cache can be queried through the handler table The code address of the unloaded isolation space, query the data needed to execute the data package through the context table, and process the data package according to the unloaded instructions, including but not limited to the matching execution logic of the data package.
  • the network card may have a first processor unit and a second processor unit, wherein the first processor unit is used for processing data functions, and the second processor unit is used for processing control functions.
  • the processor of the network card may be a single-core processor or a multi-core processor.
  • the above-mentioned first processor unit and the second processor unit may be two single-core processors, or the above-mentioned first processor unit and the second processor unit may be two processor cores of the same multi-core processor.
  • An embodiment of the present application provides an application upgrade method, the method is applied to a network card device, and the method includes: acquiring application upgrade information, where the upgrade information includes a target operator, an operator identifier of the target operator, The application identification of the application; obtaining the physical address allocated for the target operator, the physical address being the address of the storage space on the network card device; storing the target operator in the storage space corresponding to the physical address , and according to the operator identifier, the application identifier, and the physical address, construct a first mapping relationship, the first mapping relationship indicates that there is a mapping between the operator identifier, the application identifier, and the physical address relationship, the first mapping relationship is used as the routing information of the target operator when the application is running.
  • the application when the application is upgraded, the entire application is not replaced, but only the upgraded operator is stored and the routing information is constructed for the upgraded operator, instead of inserting the target operator into the A certain position of the application will not affect the working process of other codes of the application.
  • the application When the application is running, it is only necessary to specify whether to call the target operator in the data packet, and it can be routed to the storage location of the target segment based on the first mapping relationship. , and call the target operator, and then, the application of the network card can be upgraded without restarting the network card. Since there is no need to restart the network card, the service link can be kept uninterrupted. Therefore, the technical solution provided by this embodiment can complete the application upgrade of the network card while maintaining the continuous business communication link, thereby reducing the impact of the network card application upgrade on the business, accelerating application calculation and transmission, and improving the performance of the whole machine .
  • each data packet can call its own application based on the indication of the operator ID. operator), that is, it can support multiple operators and multiple types of applications to uninstall operations at the same time, and they are isolated from each other without affecting each other.
  • this embodiment does not require data packet modification, does not need to modify the data packet format of the data layer, only needs to modify the matching rules issued by the control channel to distinguish different data packets, and has stronger scalability.
  • unloading the operator to the flash memory area of the network card can realize the online upgrade and selective management of the network card function, and after restarting the network card, the operator can be loaded from the flash to the memory to run again .
  • operators at different call levels are allocated different areas. Based on the division of call levels, operators at low-level call levels can call operators at high-level call levels, reducing the The number of operators.
  • the application upgrade solution provided by the embodiment of the present application can also be applied to Ethernet (ethernet) interface, Fiber Channel (FC) interface, SAS/SATA interface, disk array (redundant arrays of independent disks, RAID), host bus adapter (host bus adapter, HBA), and can also be used for IO interface card devices of other forms of network hosts (computing nodes, storage nodes).
  • SoC system.on.achip
  • SoC refers to the technology of integrating a complete system on a single chip and grouping all or part of the necessary electronic circuits.
  • the so-called complete system generally includes a central processing unit (CPU), memory, and peripheral circuits.
  • FIG. 7 shows a schematic diagram of an online network processing (ONP) framework.
  • ONP is a dynamic programmable acceleration framework.
  • FIG. 7 shows multiple application offload acceleration scenarios, including dynamic Multi-congestion protocols, atomic read and write of stored transactions, KVS, collective communication, and discrete data transmission of HPC, each of these scenarios has different application logic.
  • the goal of ONP is to use a unified programmable framework to dynamically support these different application acceleration. need.
  • ONP provides a unified programmable interface and application logic development process, and then dynamically selects and runs the application offload logic through the ONP management component. At the same time, it supports the self-developed network card architecture downwards and provides a unified programming model upwards.
  • the online computing programming interface can provide users with a unified network card programming interface, which is convenient for users to program. It includes a control channel interface, which is convenient for users to issue control commands and uninstall microcode operators; it includes a data channel interface, which is convenient for users to call to realize data transmission.
  • a control channel interface which is convenient for users to issue control commands and uninstall microcode operators
  • a data channel interface which is convenient for users to call to realize data transmission.
  • APP verbs such as KV store, RPC serialized custom acceleration interface.
  • the online computing management framework is a software system framework for real-time scheduling, compilation and unloading, which abstracts the computing, storage and hardware resources of the network card for users to use and manages them for users.
  • the operator microcode uninstalled by the user is extracted and compiled in the management framework, and distributed to the network card or other hardware devices for execution.
  • the orchestration and execution of online computing is a framework for orchestrating and executing microcode operators in the network card, providing different operators with the ability to communicate and call each other.
  • Fig. 8 and Fig. 9 it can be seen that the congestion control algorithm operation process when the embodiment of the present application is not used, as shown in Fig. 8, when the microcode is running statically, (1) the microcode receives data such as CNP/ACK/RTT (2) Enter different processing procedures according to different events; (3) Call the microcode of the common smart memory cache to perform data packet operations. Utilizing the dynamic congestion control algorithm flow of the embodiment of the present application, the microcode adds the hook point to dynamically call the code of the floating address space issued by the application.
  • microcode congestion control When the microcode congestion control is called dynamically, 1) add a hook point in the microcode process; 2) judge whether the data packet needs to be processed by the unloaded code at the hook point; 3) query the address of the unloaded code in the isolation space of the smart memory cache through the Handler table , query the data needed to execute the data package through the context table. 4) Process the data packet according to the offloaded instruction, including but not limited to the matching execution logic of the data packet.
  • a call point is added to the existing data stream processing flow, and the congestion control operator is dynamically unloaded at the call point.
  • the specific algorithm operation process is as follows:
  • events such as CNP/ACK/NACK/RTT can be generated
  • the user can customize the congestion control algorithm, call the offload interface, and dynamically deliver the RDMA congestion control algorithm to the network card.
  • the dynamic unloading congestion control algorithm can be realized without interrupting the service data flow.
  • the benefits of microcode dynamic calling can include: 1. The efficiency of dynamic loading is higher. 2. Storage resources are isolated, providing cache hit rate and reducing content switching. 3. Flexible interface calls.
  • an embodiment of the present application provides a schematic structural diagram of an application upgrading device, the device is applied to a network card device, and the device 1100 may include:
  • An acquisition module 1101 configured to acquire upgrade information of an application, where the upgrade information includes a target operator, an operator identifier of the target operator, and an application identifier of the application;
  • step 201 and step 202 which will not be repeated here.
  • the operator deployment module 1102 is configured to store the target operator in the storage space corresponding to the physical address, and construct a first mapping relationship according to the operator identifier, the application identifier, and the physical address,
  • the first mapping relationship indicates that there is a mapping relationship between the operator identifier, the application identifier, and the physical address, and the first mapping relationship is used as routing information of the target operator when the application is running.
  • step 203 for the specific description of the operator deployment module 1102, reference may be made to the description of step 203, which will not be repeated here.
  • the storage space is cache or flash memory.
  • the upgrade information further includes: a virtual address corresponding to the target operator;
  • the acquisition module is specifically used for:
  • the virtual address is mapped to a corresponding physical address.
  • the upgrade information further includes a first invocation level of the target operator, the first invocation level is used to indicate the importance of the target operator, and the storage space includes The first subspace allocated by the operator of the first call level, the physical address is the address of the first subspace.
  • the storage space further includes a second subspace allocated for operators at the second invocation level, and the first subspace is used to store operators at the first invocation level, so The second subspace is used to store operators of the second calling level.
  • the acquiring module is specifically used for:
  • the second mapping relationship includes a plurality of calling levels and a subspace allocated for each calling level
  • the first call level and the second mapping relationship determine the first subspace allocated for the first call level from the second mapping relationship
  • the upgrade information further includes: an identifier of the operator to be replaced;
  • the acquisition module is specifically used for:
  • the physical address of the storage space storing the operator to be replaced is determined.
  • the target operator includes a first operator segment and a second operator segment, and the first operator segment and the second operator segment are respectively a part of the target operator , and the first operator segment includes the entry function of the target operator;
  • the operator deployment module is specifically used for:
  • the operator deployment module is specifically used to:
  • the acquisition module is also used to:
  • the operator call information includes the application identifier and the operator identifier, and the operator call information is used to instruct execution of the target operator;
  • the operator calling information is also used to indicate the execution of a software program, where the software program includes a first code segment, a second code segment, and a code located between the first code segment and the second code segment.
  • a hook point between segments, the hook point is used to indicate whether to call the target operator, and the operator call information is specifically used to indicate that the target operator is called after the first code segment is executed;
  • the device also includes:
  • a program execution module configured to execute the first code segment, execute the target operator, and execute the second code segment according to the operator call information.
  • the embodiment of the present application further provides a network card, which includes a processor 1110 , a memory 1120 , a bus 1130 , an input interface 1140 and an output interface 1150 .
  • the processor 1110 , the memory 1120 , the input interface 1140 and the output interface 1150 are communicatively connected through the bus 1130 .
  • the memory 1120 is used to store instructions, and the processor 1110 is used to execute the instructions stored in the memory 1130, and the execution of the instructions stored in the memory 1130 makes the processor 1110 used to execute the operations performed by the network card in the method embodiments above. action.
  • the embodiment of the present application further provides a chip, the chip includes a processing unit and a communication interface, the processing unit is used to execute the operations performed by the chip device in the method embodiment above, and the communication interface is used to communicate with the outside.
  • the chip may further include a storage unit, the storage unit stores instructions, the processing unit is used to execute the instructions stored in the storage unit, and when the instructions are executed, the processing unit is used to execute the above method embodiment The operation performed by the network card in the .
  • the embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method performed by the network card in the above method embodiment can be implemented.
  • the embodiment of the present application also provides a computer program product including an instruction, and when the instruction is executed by a computer, the network card execution method in the above method embodiment can be implemented.
  • the embodiment of the present application also provides a device, which includes a processor 1210 , a communication interface 1220 , a bus 1230 and a network card 1240 , wherein the communication interface 1220 and the network card 1240 are connected through the bus 1230 for communication.
  • the processor 1210 corresponds to the host processor mentioned in the above embodiments.
  • the network card 1240 corresponds to the network card in the above embodiments.
  • the server may correspond to the host mentioned in the above embodiments.
  • the bus 1130 may be a PCIe bus, or may also be a non-PCIe bus.
  • the non-PCIe bus may be SMBus, I2C, SPI bus, or UART.
  • the network card in the device may correspond to the network card shown in Figure 12 in the embodiment of the present application, and may correspond to the execution of the method for implementing network card application upgrade in Figure 2 according to the embodiment of the present application
  • the above-mentioned and other operations and/or functions of the main body and each module in the device are respectively for realizing the corresponding flow of the method in FIG. 2 , and for the sake of brevity, details are not repeated here.
  • the network card in this embodiment has a processor and a memory.
  • the memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory can be read-only memory (read-only memory, ROM), programmable read-only memory (programmable ROM, PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically programmable Erases programmable read-only memory (electrically EPROM, EEPROM) or flash memory.
  • Volatile memory can be random access memory (RAM), which acts as external cache memory.
  • RAM random access memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • DRAM synchronous dynamic random access memory
  • SDRAM double data rate synchronous dynamic random access memory
  • ESDRAM enhanced synchronous dynamic random access memory
  • SLDRAM synchronous connection dynamic random access memory
  • direct rambus RAM direct rambus RAM
  • the device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physically separated.
  • a unit can be located in one place, or it can be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • the connection relationship between the modules indicates that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines.
  • the essence of the technical solution of this application or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product is stored in a readable storage medium, such as a computer floppy disk , U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., including several instructions to make a computer device (which can be a personal computer, training device, or network device, etc.) execute the method of each embodiment of the present application .
  • a computer device which can be a personal computer, training device, or network device, etc.
  • all or part of them may be implemented by software, hardware, firmware or any combination thereof.
  • software When implemented using software, it may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be passed from a website site, computer, training device, or data center Wired (eg, coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.) transmission to another website site, computer, training device, or data center.
  • Wired eg, coaxial cable, fiber optic, digital subscriber line (DSL)
  • wireless eg, infrared, wireless, microwave, etc.
  • the computer-readable storage medium may be any available medium that can be stored by a computer, or a data storage device such as a training device or a data center integrated with one or more available media.
  • the available medium may be a magnetic medium (such as a floppy disk, a hard disk, or a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (Solid State Disk, SSD)), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Stored Programmes (AREA)

Abstract

本申请实施例公开了一种应用升级方法,方法包括:获取应用的升级信息,升级信息包括目标算子、目标算子的算子标识、应用的应用标识,基于虚拟地址,获取为目标算子分配的物理地址,物理地址为网卡设备上存储空间的地址;将目标算子存储至物理地址对应的存储空间中,并根据算子标识、应用标识以及物理地址,构建第一映射关系,第一映射关系用于在应用运行时作为目标算子的路由信息。本申请在对应用进行升级时,可以在无需重启网卡的情况下,升级网卡的应用,从而可以降低网卡应用升级对业务的影响,加速应用计算和传输,提高了整机的性能。

Description

应用升级方法、装置、网卡和设备
本申请要求于2021年9月29日提交中国专利局、申请号为202111155642.5、发明名称为“应用升级方法、装置、网卡和设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信领域,更具体地,涉及一种应用升级方法、装置、网卡和设备。
背景技术
当前的时代已经完成从计算为中心到以数据为中心的转变,很多的应用都是依赖大数据,例如典型的人工智能应用。与此同时,当数据量越来越大之后,就需要有更快的网络来传输这些数据。
随着网络技术的高速发展,不同设备之间可以使用不同网络协议传输数据。相应地,设备中网卡的种类也越来越多,除了传统的以太网卡外,还出现了智能网卡(本申请中可以简称为网卡或网卡设备),配置智能网卡的不同设备之间可以使用高速网络传输协议传输报文,提升网络传输速率。为了帮助应用更好的传输通信和计算,提高整机或者整套集群的通信和计算性能,可以利用智能网卡做通信和计算的卸载,也就是将主机上的应用相关的运算卸载到智能网卡上执行。
在一些场景中,需要对卸载到智能网卡上的应用进行升级,传统的方式是采用冷升级的方式升级网卡内部的应用。冷升级的基本过程为,待升级的设备(例如服务器/存储器阵列)获取新应用(或者称之为新固件)后,通过高速串行计算机扩展总线标准(peripheral component interconnect express,PCIe)总线将新固件发送给设备中的网卡,网卡将新固件写入只读存储器(read-only memory,ROM)(例如闪存(flash))里,然后重启网卡,且从ROM中运行新固件引导启动,这样新固件才会生效。但是重启网卡会导致业务链路中断,进而导致业务发生中断。此外,在不支持网卡热插拔的设备上,在更新网卡应用的过程中,不仅需要重启网卡,还需要重启整个设备,才能使新应用生效。
因此,当前升级网卡应用的方法,会导致业务链路中断,影响业务运行。
发明内容
本申请实施例提供了一种应用升级方法,可以在无需重启网卡的情况下,升级网卡的应用,从而可以降低网卡应用升级对业务的影响,加速应用计算和传输,提高了整机的性能。
第一方面,本申请提供了一种应用升级方法,所述方法应用于网卡设备,所述方法包括:获取应用的升级信息,所述升级信息包括目标算子、所述目标算子的算子标识、所述应用的应用标识;获取为所述目标算子分配的物理地址,所述物理地址为所述网卡设备上存储空间的地址;
在一种可能的实现中,用户可以在网卡所在的设备上触发针对应用的升级指令,进而 网卡所在的设备可以生成应用的升级信息,该升级信息可以为对升级内容(例如至少一个算子)进行交叉编译得到的微码算子包,并将升级信息传递至网卡设备。其中,升级内容可以为增加的算子、替换的算子等等。
在一种可能的实现中,目标算子可以理解为函数对应的代码,函数是指一个函数空间到函数空间上的映射规则,例如,目标算子可以为哈希运算、函数截取运算等等。
在一种可能的实现中,升级信息也可以称之为微码算子包或者微码包;
在一种可能的实现中,目标算子的算子标识可以为函数名或者其他指示算子的信息(例如字符串),算子标识也可以称之为算子ID、微码ID等,算子标识可以唯一指示目标算子。
在一种可能的实现中,应用的应用标识可以为应用名或者其他指示应用的信息(例如字符串),应用标识也可以称之为应用ID,应用标识可以唯一指示应用;
在一种可能的实现中,所述升级信息还包括:所述目标算子对应的虚拟地址;网卡设备可以基于所述虚拟地址,将所述虚拟地址映射到对应的物理地址。
其中,虚拟地址可以为主机为目标算子所分配的地址(例如动态随机存储器(dynamic random access memory,DRAM)中的地址),为了能将目标算子存储至自身的存储空间中,网卡设备需要将虚拟地址映射到自身存储空间的物理地址。
在一种可能的实现中,存储空间为网卡设备上空闲的存储空间,所谓空闲,可以理解为在存储空间上没有分配并存储的数据,也就是说,存储空间可以为网卡设备缓存中空闲的存储空间,存储空间还可以为网卡设备闪存中空闲的存储空间;
将所述目标算子存储至所述物理地址对应的存储空间中,并根据所述算子标识、所述应用标识以及所述物理地址,构建第一映射关系,所述第一映射关系指示所述算子标识、所述应用标识以及所述物理地址中的至少两个之间存在映射关系,所述第一映射关系用于在所述应用运行时作为所述目标算子的路由信息。
在确定出目标算子对应的物理地址后,可以将所述目标算子存储至所述物理地址对应的存储空间中,例如可以将所述目标算子存储至缓存中所述物理地址对应的存储空间中,或者是存储至闪存中所述物理地址对应的存储空间中。
而为了之后应用在运行时,网卡设备可以调用到目标算子,需要建立用于作为目标算子路由信息的映射关系表(本申请实施例可以称之为微码运行管理表,或者第一映射关系),在第一映射关系中记载了应用的各个算子的标识、物理地址(或者称之为接口地址)等,在应用运行时,可以在数据包中指定需要调用的算子的标识,进而网卡设备可以基于算子的标识以及第一映射关系,确定出算子所存储的物理地址,并基于物理地址调用并执行算子。
现有的实现中,在升级网卡上的应用时,为了在代码中增加算子,需要在算子的插入位置编写算子,由于插入算子时会对整体的应用造成影响(例如插入算子A和算子B时,当插入了算子A而还未插入算子B时,此时应用的运行是存在错误的),则必须关闭网页的业务通信(也就是不处理数据包),并将已经完成算子插入的升级后的应用整体写入网卡并重启生效。而本实施例中,在对应用进行升级时,不对应用整体进行替换,而是只对升级的算子进行存储以及针对于升级的算子进行路由信息的构建,并不是将目标算子插入到 应用的某一位置,并不会影响应用的其他代码的工作过程,在应用运行时,只需要在数据包中指定是否调用目标算子,基于第一映射关系就可以路由到目标段子的存储位置,并调用目标算子,进而,可以在无需重启网卡的情况下,升级网卡的应用,由于无需重启网卡,因此可以保持业务链路不中断。因此,本实施例提供的技术上方案可以在保持业务通信链接不断的情况下,完成网卡的应用升级,从而可以降低网卡应用升级对业务的影响,加速应用计算和传输,提高了整机的性能。
此外,针对于不同的应用,可以配置不同的应用标识,由于应用标识的不同,可以保证应用之间的隔离(在处理数据包时,各个数据包可以基于算子标识的指示,来调用自身应用的算子),也就是可以支持多算子多类型应用同时卸载操作,相互隔离互不影响。
在一种可能的实现中,所述存储空间为缓存或闪存。
其中,存储空间为闪存时,在不中断网卡业务流量的情况下,卸载算子到网卡的闪存flash区域,可以实现网卡功能的在线升级和选择性管理,并且重启网卡之后,可以再次从flash加载算子到内存中运行。
在一种可能的实现中,所述升级信息还包括所述目标算子的第一调用层级,所述第一调用层级用于指示所述目标算子的重要程度,所述存储空间包括为所述第一调用层级的算子所分配的第一子空间,所述物理地址为所述第一子空间的地址。
其中,重要程度可以为算子功能、算子大小或者是算子的调用关系,例如,所述第一调用层级可以指示所述目标算子可被第二调用层级的算子调用、以及所述目标算子可调用第三调用层级的算子,所述第二调用等级和所述第三调用等级不同;在一种可能的实现中,所述第二调用层级低于所述第一调用层级,所述第三调用层级高于所述第一调用层级,在对算子进行物理地址的分配时,对不同调用层级的算子分配了不同的区域,基于调用层级的划分可以让低层调用层级的算子可以调用高层调用层级的算子,可以降低算子的数量。
其中,网卡设备可以预先为不同重要程度(例如不同功能,不同大小等)的算子分配不同的存储空间(即上述描述的子空间)。
其中,所述存储空间可以包括为所述第一调用层级的算子所分配的第一子空间,所述物理地址为所述第一子空间的地址。所述存储空间还可以包括为第二调用层级的算子所分配的第二子空间,所述第一子空间用于存储所述第一调用层级的算子,所述第二子空间用于存储所述第二调用层级的算子。
在一种可能的实现中,所述存储空间为所述网卡设备上为所述第一调用层级的算子所分配的第一子空间,所述第一子空间用于存储所述第一调用层级的算子。
在对算子进行物理地址的分配时,对不同调用层级的算子分配了不同的存储区域,其中,第一子空间用于存储第一调用等级的算子,而不存储其他调用等级的算子。
在一种可能的实现中,所述根据所述算子标识、所述应用标识以及所述物理地址,构建第一映射关系,包括:根据所述算子标识、所述第一调用层级、所述应用标识以及所述 物理地址,构建第一映射关系,所述第一映射关系指示所述算子标识、所述第一调用层级、所述应用标识以及所述物理地址存在映射关系。
在一种可能的实现中,所述第二映射关系可以记载当前各个应用(包括应用)已经分配好物理地址的算子的相关信息(例如包括算子标识、虚拟地址、算子大小等等)。
在一种可能的实现中,可以基于算子的调用层级关系进行算子的存储,其中,这里的调用层级可以理解为算子之间的调用关系,调用层级较低的算子可以调用调用层级较高的算子。具体的,可以为各个调用层次分别分配一定的存储空间,算子可以存储在所属的调用层级分配的存储空间中。
在一种可能的实现中,所述第二映射关系可以包括多个调用层级、为每个所述调用层级分配的子空间以及每个子空间存储的算子的信息,所述算子的信息可以包括所述算子的虚拟地址、算子的标识。
其中,第二映射关系可以记载为各个调用层级分配的存储空间中已分配的算子的信息,进而在为目标算子分配地址时,可以首先确定目标算子所属的调用层级(例如目标算子属于第一调用层级)。
在一种可能的实现中,所述升级信息还包括所述目标算子的第一调用层级,也就是说,算子的调用层级可以包括在升级信息中。
在确定出目标算子所属的调用层级为第一调用层级之后,可以基于第二映射关系确定为第一调用层级分配的空间(第一子空间,所述第一子空间用于存储所述第一调用层级的算子),也就是根据所述第一调用层级以及所述第二映射关系,从所述第二映射关系中确定为所述第一调用层级所分配的第一子空间,进而可以从所述第一子空间中获取为所述目标算子分配的物理地址。
应理解,第二映射关系可以存储在缓存或者闪存中。
应理解,第二映射关系可以以表格、数组等信息存储,这里并不限定第二映射关系的数据形式。
在一种可能的实现中,所述升级信息还可以包括:待替换算子的标识;所述获取为所述目标算子分配的物理地址,包括:根据所述待替换算子的标识,确定出存储所述待替换算子的存储空间的物理地址。
其中,针对于应用的升级可以是对应用的算子进行替换或者增加,在对算子进行替换时,升级信息可以指示要替换哪个算子(待替换算子)以及替换成哪个算子(目标算子),进而网卡设备可以将待替换算子从原本的存储位置剔除并存储目标算子。
在一种可能的实现中,所述目标算子包括第一算子段以及第二算子段,所述第一算子段以及所述第二算子段分别为所述目标算子的一部分,且所述第一算子段包括所述目标算子的入口函数;所述将所述目标算子存储至所述物理地址对应的存储空间中,包括:基于所述第一子空间可用的空间小于存储所述目标算子所需的存储空间,且所述第一子空间可用的空间大于存储所述第一算子段所需的存储空间,将所述第一算子段存储至所述物理地 址对应的存储空间中,并将所述第二算子段传递至主机,以便所述主机存储所述第二算子段。
其中,当第一子空间中可用的存储空间不足以存储完整的目标算子,而仅可以存储部分目标算子时,可以仅将目标算子的部分算子存储至第一子空间,然后将剩余的算子存储至主机,且存储至第一子空间的部分算子可以包括入口函数。通过上述方式,可以充分利用网卡设备的存储空间。
在一种可能的实现中,所述构建第一映射关系之后,所述方法还包括:接收所述应用运行时发送的算子调用信息,所述算子调用信息包括所述应用标识和所述算子标识,所述算子调用信息用于指示执行所述目标算子;根据所述算子调用信息以及所述第一映射关系,得到所述物理地址;根据所述物理地址,获取所述目标算子。
其中,在实际运行升级后的应用时,若应用需要调用目标算子,则可以将指示调用目标算子的信息(包括算子标识以及应用标识)传递至网卡设备,网卡设备可以基于第一映射关系,得到存储目标算子的物理地址,并从物理地址中获取目标算子并执行。
在一种可能的实现中,所述算子调用信息还用于指示执行软件程序,所述软件程序包括第一代码段、第二代码段以及位于所述第一代码段和所述第二代码段之间的钩子hook点,所述hook点用于指示是否调用所述目标算子,所述算子调用信息具体用于指示在执行所述第一代码段之后调用所述目标算子;所述方法还包括:根据所述算子调用信息,执行所述第一代码段,执行所述目标算子,以及执行所述第二代码段。
其中,算子调用信息可以指示运行应用中的某一段程序,该程序中可以预先配置有hook点,在该hook点可以指示是否调用所述目标算子,应用可以将在该hook点需要调用目标算子的信息(可以承载在数据包或者QPC中)传递至网卡设备,进而网卡设备可以在运行程序时在该hook点处调用并执行目标算子。
第二方面,本申请提供了一种应用升级装置,所述装置应用于网卡设备,所述装置包括:
获取模块,用于获取应用的升级信息,所述升级信息包括目标算子、所述目标算子的算子标识、所述应用的应用标识;
获取为所述目标算子分配的物理地址,所述物理地址为所述网卡设备上存储空间的地址;
算子部署模块,用于将所述目标算子存储至所述物理地址对应的存储空间中,并根据所述算子标识、所述应用标识以及所述物理地址,构建第一映射关系,所述第一映射关系指示所述算子标识、所述应用标识以及所述物理地址存在映射关系,所述第一映射关系用于在所述应用运行时作为所述目标算子的路由信息。
在一种可能的实现中,所述存储空间为缓存或闪存。
在一种可能的实现中,所述升级信息还包括:所述目标算子对应的虚拟地址;
所述获取模块,具体用于:
基于所述虚拟地址,将所述虚拟地址映射到对应的物理地址。
在一种可能的实现中,所述升级信息还包括所述目标算子的第一调用层级,所述第一调用层级用于指示所述目标算子的重要程度,所述存储空间包括为所述第一调用层级的算子所分配的第一子空间,所述物理地址为所述第一子空间的地址。
在一种可能的实现中,所述存储空间还包括为第二调用层级的算子所分配的第二子空间,所述第一子空间用于存储所述第一调用层级的算子,所述第二子空间用于存储所述第二调用层级的算子。
在一种可能的实现中,所述获取模块,具体用于:
获取第二映射关系,所述第二映射关系包括多个调用层级、为每个所述调用层级分配的子空间;
根据所述第一调用层级以及所述第二映射关系,从所述第二映射关系中确定为所述第一调用层级所分配的第一子空间;
从所述第一子空间中获取为所述目标算子分配的物理地址。
在一种可能的实现中,所述升级信息还包括:待替换算子的标识;
所述获取模块,具体用于:
根据所述待替换算子的标识,确定出存储所述待替换算子的存储空间的物理地址。
在一种可能的实现中,所述目标算子包括第一算子段以及第二算子段,所述第一算子段以及所述第二算子段分别为所述目标算子的一部分,且所述第一算子段包括所述目标算子的入口函数;
所述算子部署模块,具体用于:
基于所述第一子空间可用的空间小于存储所述目标算子所需的存储空间,且所述第一子空间可用的空间大于存储所述第一算子段所需的存储空间,将所述第一算子段存储至所述物理地址对应的存储空间中,并将所述第二算子段传递至主机,以便所述主机存储所述第二算子段。
在一种可能的实现中,所述算子部署模块,具体用于:
根据所述算子标识、所述第一调用层级、所述应用标识以及所述物理地址,构建第一映射关系,所述第一映射关系指示所述算子标识、所述第一调用层级、所述应用标识以及所述物理地址存在映射关系。
在一种可能的实现中,所述获取模块,还用于:
接收所述应用运行时发送的算子调用信息,所述算子调用信息包括所述应用标识和所述算子标识,所述算子调用信息用于指示执行所述目标算子;
根据所述算子调用信息以及所述第一映射关系,得到所述物理地址;
根据所述物理地址,获取所述目标算子。
在一种可能的实现中,所述算子调用信息还用于指示执行软件程序,所述软件程序包括第一代码段、第二代码段以及位于所述第一代码段和所述第二代码段之间的钩子hook点,所述hook点用于指示是否调用所述目标算子,所述算子调用信息具体用于指示在执行所述第一代码段之后调用所述目标算子;
所述装置还包括:
程序执行模块,用于根据所述算子调用信息,执行所述第一代码段,执行所述目标算子,以及执行所述第二代码段。
第三方面,本申请实施例提供了一种计算机可读存储介质,其特征在于,包括计算机可读指令,当该计算机可读指令在计算机设备上运行时,使得该计算机设备执行上述第一方面及其任一可选的方法。
第四方面,本申请实施例提供了一种计算机程序产品,其特征在于,包括计算机可读指令,当该计算机可读指令在计算机设备上运行时,使得该计算机设备执行上述第一方面及其任一可选的方法。
第五方面,本申请提供了一种芯片系统,该芯片系统包括处理器,用于支持执行设备或训练设备实现上述方面中所涉及的功能,例如,发送或处理上述方法中所涉及的数据;或,信息。在一种可能的设计中,该芯片系统还包括存储器,该存储器,用于保存执行设备或训练设备必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包括芯片和其他分立器件。
第六方面,提供一种设备,该设备包括网卡,该网卡用于执行上述第一方面或第一方面的任一可能的实现方式中的方法的操作步骤。
本申请在上述各方面提供的实现方式的基础上,还可以进行进一步组合以提供更多实现方式。
本申请实施例提供了一种应用升级方法,所述方法应用于网卡设备,所述方法包括:获取应用的升级信息,所述升级信息包括目标算子、所述目标算子的算子标识、所述应用的应用标识;获取为所述目标算子分配的物理地址,所述物理地址为所述网卡设备上存储空间的地址;将所述目标算子存储至所述物理地址对应的存储空间中,并根据所述算子标识、所述应用标识以及所述物理地址,构建第一映射关系,所述第一映射关系指示所述算子标识、所述应用标识以及所述物理地址存在映射关系,所述第一映射关系用于在所述应 用运行时作为所述目标算子的路由信息。
在对应用进行升级时,无需对应用整体进行替换,而是只对升级的算子进行存储以及针对于升级的算子进行路由信息的构建,可以在无需重启网卡的情况下,升级网卡的应用,由于无需重启网卡,因此可以保持业务链路不中断。因此,本实施例提供的技术上方案可以在保持业务通信链接不断的情况下,完成网卡的应用升级,从而可以降低网卡应用升级对业务的影响,加速应用计算和传输,提高了整机的性能。
附图说明
图1为本申请实施例提供的应用架构示意;
图2为本申请实施例提供的应用升级方法的流程示意;
图3为本申请实施例提供的应用升级方法的流程示意;
图4为本申请实施例提供的加载管理表的示意;
图5为本申请实施例提供的运行管理表的示意;
图6为本申请实施例提供的应用升级方法的流程示意;
图7为本申请实施例提供的应用架构示意;
图8为本申请实施例提供的应用升级方法的流程示意;
图9为本申请实施例提供的应用升级方法的流程示意;
图10为本申请实施例提供的应用升级方法的流程示意;
图11为本申请实施例提供的应用升级装置的结构示意;
图12为本申请实施例提供的网卡的一种结构示意图;
图13为本申请实施例提供的设备的一种结构示意图。
具体实施方式
下面结合本申请实施例中的附图对本申请实施例进行描述。本申请的实施方式部分使用的术语仅用于对本申请的具体实施例进行解释,而非旨在限定本申请。
本申请的说明书和权利要求书及上述附图中的术语“第一”、第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的术语在适当情况下可以互换,这仅仅是描述本申请的实施例中对相同属性的对象在描述时所采用的区分方式。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,以便包含一系列单元的过程、方法、系统、产品或设备不必限于那些单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它单元。
为了便于理解本申请实施例,下文首先结合图1描述网卡中应用升级场景的典型架构。
如图1所示,第一设备包括处理器与网卡。第一设备通过网卡与第二设备进行网络通信。第二设备可以为远端网络节点。网卡与第一设备的处理器通过高速串行计算机扩展总线标准(peripheral component interconnect express,PCIe)总线相连。网卡通过以太网(ethernet,ETH)/光纤通道(fibre channel,FC)与第二设备相连。应理解,在第二设备上也相应有网卡(图1未画出)。
具体地,第一设备可以为服务器或存储阵列。第二设备也可以为服务器或存储阵列。
应理解,网卡是局域网中连接待升级应用的网卡所在设备(如图1中的第一设备)和远端设备(如图1中的第二设备)的接口,它们的传输介质可以为图1中的ETH/FC,不仅能实现与局域网传输介质之间的物理连接和电信号匹配,还涉及帧的发送与接收、帧的封装与拆封、介质访问控制、数据的编码与解码以及数据缓存的功能等。
还应理解,图1仅为示例而非限定。实际应用中,网卡的应用升级场景的架构还可以为多主机共享网卡场景,即多个主机共用一个网卡。具体地,多个待升级应用的设备的处理器分别通过多根PCIe总线与同一个网卡相连。
需要说明的是,本文中提及的主机可以对应于图1中所示的第一设备。例如,在多主机共享网卡场景中,包括多个如图1中所示的第一设备,但是这多个第一设备共享一个网卡,换句话说,这多个第一设备各自的处理器分别通过PCIe总线与同一个网卡相连。
还需要说明的是,图1中所示的处理器为第一设备的处理器,而非网卡的处理器。下文实施例中会涉及网卡的处理器(或处理器单元),为了区分而非限定,在下文实施例中,将网卡所在的设备中的处理器记为主机处理器。也就是说,下文实施例中提及的除了主机处理器之外所提及的处理器,除非特别说明,均表示网卡的处理器(处理器单元)。
在现有的应用升级方法中,需要根据升级后的应用重新编译网卡中的微码,然后中断网卡的业务(即中断网络运行程序),然后替换网卡上的微码固件。
上文已述,现有的网卡应用升级方法是通过重启网卡来运行网卡的新固件。但是,由于重启网卡,导致网卡掉电,从而导致业务链路中断。例如,在支持网卡热插拔的主机上升级网卡固件时,需要重启网卡才能恢复业务链路,由于重启网卡的时间一般在几十秒,因此,在支持网卡热插拔的主机上升级网卡固件时,业务链路会中断数十秒。再例如,在不支持网卡热插拔的主机上升级网卡的应用时,既需要重启网卡,又需要重启主机,才能恢复业务链路,由于重启主机一般在数分钟,因此,在不支持网卡热插拔的主机上升级网卡固件时,业务链路会中断数分钟。对于网络要求高的业务(如部署金融、医疗相关应用的设备),对于数十秒乃至数分钟的业务网络连接中断是不能接受的。此外,对于不支持热插拔的多主机共享网卡场景,因应用冷升级重启网卡,会造成多个主机重启,恢复代价较大。此外,由于网卡重启,网卡与远端设备(如图1中的第二设备)之间的网络链路也中断,需要重新建立网卡与远端设备之间的链路,同时也需要重新配置远端设备,维护成本也较高。
总之,现有的网卡应用升级方案,存在如下弊端:网卡掉电导致业务链路中断,网络维护成本较高。
针对上述问题,本申请实施例提出一种应用升级方法、装置、网卡和设备,可以在升级网卡上的应用的过程中,维持业务链路不中断,同时也可以降低网络维护成本。
应理解,网卡内包括处理器和存储器。网卡内的处理器可以是中央处理器(central processing unit,CPU),或者是其他微处理器,或者还可以是现场可编程门阵列(field-prog ramma ble ga te a rray,FPGA)。网卡内的存储器包括ROM(或者是闪存(flash))和内存存储器。具体地,内存存储器为随机存取存储器(random-access memory,RAM)。通常网卡上的固件存储在ROM中,当网卡工作时,将ROM中的固件加载到RAM区域去执行。
下面结合本申请实施例中的附图对本申请实施例进行描述。本申请的实施方式部分使用的术语仅用于对本申请的具体实施例进行解释,而非旨在限定本申请。
图2为本申请实施例提供的应用升级方法的示意性流程图。该方法包括如下步骤。
201,网卡设备获取应用的升级信息,所述升级信息包括目标算子、所述目标算子的算子标识、所述应用的应用标识。
在一种可能的实现中,用户可以在网卡所在的设备上触发针对应用的升级指令,进而网卡所在的设备可以生成应用的升级信息,该升级信息可以为对升级内容(例如至少一个算子)进行交叉编译得到的微码算子包,并将升级信息传递至网卡设备。升级信息可以指示对应用新增一些算子或者对原有的算子进行替换,进而实现应用的更新和升级。
其中,升级内容可以为增加的算子、替换的算子等等。
其中,目标算子可以理解为函数对应的代码,函数是指一个函数空间到函数空间上的映射规则,例如,目标算子可以为哈希运算、函数截取运算等等。
其中,升级信息也可以称之为微码算子包或者微码包;
在一种可能的实现中,网卡可以从网卡所在的设备上获取应用的升级信息,该网卡所在设备可以是计算机、服务器或存储阵列。为了便于描述,下文中将网卡所在的设备称为主机,对应地,将网卡所在设备的处理器称为主机处理器。
在步骤201中,具体地,主机处理器可以通过总线向网卡下发该应用的升级信息,相应地,网卡设备可以通过该总线接收主机处理器下发的针对于应用的升级信息。
主机处理器与网卡之间进行通信的总线可以是PCIe总线,或者也可以是非PCIe总线。其中,非PCIe总线可以为系统管理总线(system management bus,SMBus)、集成电路总线(inter-integrated circuit,I2C)、串行外设接口(serial peripheral interface,SPI)总线、或通用异步收发传输器(universal asynchronous receiver/transmitter,UART)等。
在一种可能的实现中,升级信息可以包括至少一个算子的相关信息,以至少一个算子包括目标算子为例,升级信息可以包括目标算子本身、目标算子的算子标识、目标算子的虚拟地址(可选的)以及应用的应用标识。
其中,目标算子的算子标识可以为函数名或者其他指示算子的信息(例如字符串),算子标识也可以称之为算子ID、微码ID等,算子标识可以唯一指示目标算子。
其中,应用的应用标识可以为应用名或者其他指示应用的信息(例如字符串),应用标识也可以称之为应用ID,应用标识可以唯一指示应用。
在一种可能的实现中,网卡设备可以获取到升级信息,并保存升级信息相关的算子,其中,参照图3,网卡设备中的处理器可以运行微码动态加载管理模块,该微码动态加载管理模块可以进行与处理升级信息相关的行为。
在一种可能的实现中,所述升级信息还可以包括:待替换算子的标识;其中,针对于应用的升级可以是对应用的算子进行替换或者增加,在对算子进行替换时,升级信息可以指示要替换哪个算子(待替换算子)以及替换成哪个算子(目标算子),进而网卡设备可以将待替换算子从原本的存储位置剔除并存储目标算子。
202、网卡设备获取为所述目标算子分配的物理地址,所述物理地址为所述网卡设备上存储空间的地址。
在一种可能的实现中,所述存储空间为缓存cache。其中,缓存可以包括数据缓存以及指令缓存,这里的存储空间可以为数据缓存。
在一种可能的实现中,所述存储空间为闪存flash。由于闪存是一种非易失性存储器,即断电数据也不会丢失,在重启网卡设备之后,可以再次从flash加载算子到内存中运行。
其中,存储空间为网卡设备上空闲的存储空间,所谓空闲,可以理解为在存储空间上没有分配并存储的数据,也就是说,存储空间可以为网卡设备缓存中空闲的存储空间,存储空间还可以为网卡设备闪存中空闲的存储空间。
在一种可能的实现中,所述升级信息可以包括所述目标算子对应的虚拟地址;网卡设备可以基于所述虚拟地址,将所述虚拟地址映射到对应的物理地址。
其中,虚拟地址可以为主机为目标算子所分配的地址(例如动态随机存储器(dynamic random access memory,DRAM)中的地址),为了能将目标算子存储至自身的存储空间中,网卡设备需要将虚拟地址映射到自身存储空间的物理地址。
本申请实施例中,网卡设备可以为目标算子分配空闲的指令空间(即存储空间的地址),调整调用地址(即将所述虚拟地址映射到对应的物理地址),并将目标算子写入分配的指令空间中,其中,网卡设备可以根据指令空间的实时状态和目标算子的大小需求,分配空闲的指令空间。
为了知晓网卡设备中哪些存储资源是空闲的,网卡设备可以维护一个表(该表可以称之为微码加载管理表,或者称之为第二映射关系,具体可以参照图3和图4所示)。接下来对第二映射关系进行描述:
在一种可能的实现中,所述第二映射关系可以记载当前各个应用(包括应用)已经分配好物理地址的算子的相关信息(例如包括算子标识、虚拟地址(可选的)、算子大小等等)。
在一种可能的实现中,可以基于算子的调用层级关系进行算子的存储,其中,这里的调用层级可以理解为目标算子的重要程度;其中,重要程度可以为算子功能、算子大小或者是算子的调用关系,例如,所述第一调用层级可以指示所述目标算子可被第二调用层级的算子调用、以及所述目标算子可调用第三调用层级的算子,所述第二调用等级和所述第三调用等级不同;在一种可能的实现中,所述第二调用层级低于所述第一调用层级,所述第三调用层级高于所述第一调用层级,在对算子进行物理地址的分配时,对不同调用层级的算子分配了不同的区域,基于调用层级的划分可以让低层调用层级的算子可以调用高层调用层级的算子,可以降低算子的数量。
其中,网卡设备可以预先为不同重要程度(例如不同功能,不同大小等)的算子分配不同的存储空间(即上述描述的子空间)。
其中,所述存储空间可以包括为所述第一调用层级的算子所分配的第一子空间,所述物理地址为所述第一子空间的地址。所述存储空间还可以包括为第二调用层级的算子所分配的第二子空间,所述第一子空间用于存储所述第一调用层级的算子,所述第二子空间用 于存储所述第二调用层级的算子。
在一种可能的实现中,所述存储空间为所述网卡设备上为所述第一调用层级的算子所分配的第一子空间,所述第一子空间用于存储所述第一调用层级的算子。
在对算子进行物理地址的分配时,对不同调用层级的算子分配了不同的存储区域,其中,第一子空间用于存储第一调用等级的算子,而不存储其他调用等级的算子。
在一种可能的实现中,所述升级信息还包括所述目标算子的第一调用层级,也就是说,算子的调用层级可以包括在升级信息中。
在一种可能的实现中,所述第二映射关系可以包括多个调用层级、为每个所述调用层级分配的子空间以及每个子空间存储的算子的信息,所述算子的信息可以包括所述算子的虚拟地址、算子的标识。
其中,第二映射关系可以记载为各个调用层级分配的存储空间中已分配的算子的信息,进而在为目标算子分配地址时,可以首先确定目标算子所属的调用层级(例如目标算子属于第一调用层级)。
在一种可能的实现中,所述第二映射关系可以包括多个调用层级、为每个所述调用层级分配的子空间以及每个子空间存储的算子的信息,所述算子的信息可以包括所述算子的虚拟地址、算子的标识。
其中,第二映射关系可以记载为各个调用层级分配的存储空间中已分配的算子的信息,进而在为目标算子分配地址时,可以首先确定目标算子所属的调用层级(例如目标算子属于第一调用层级)。
在确定出目标算子所属的调用层级为第一调用层级之后,可以基于第二映射关系确定为第一调用层级分配的空间(第一子空间,所述第一子空间用于存储所述第一调用层级的算子),也就是根据所述第一调用层级以及所述第二映射关系,从所述第二映射关系中确定为所述第一调用层级所分配的第一子空间,进而可以从所述第一子空间中获取为所述目标算子分配的物理地址。
应理解,第二映射关系可以存储在缓存或者闪存中。
应理解,第二映射关系可以以表格、数组等信息存储,这里并不限定第二映射关系的数据形式。
本申请实施例中,可以基于目标算子的信息更新第二映射关系,例如可以构建目标算子的算子标识、第一调用层级、目标算子的虚拟地址等信息之间的映射关系,并将上述映射关系添加进第二映射关系中,以此实现对第二映射关系的更新。
203、网卡设备将所述目标算子存储至所述物理地址对应的存储空间中,并根据所述算子标识、所述应用标识以及所述物理地址,构建第一映射关系,所述第一映射关系指示所述算子标识、所述应用标识以及所述物理地址中的至少两个之间存在映射关系,所述第一映射关系用于在所述应用运行时作为所述目标算子的路由信息。
本申请实施例中,在确定出目标算子对应的物理地址后,可以将所述目标算子存储至所述物理地址对应的存储空间中,例如可以将所述目标算子存储至缓存中所述物理地址对 应的存储空间中,或者是存储至闪存中所述物理地址对应的存储空间中。
而为了之后应用在运行时,网卡设备可以调用到目标算子,需要建立用于作为目标算子路由信息的映射关系表(本申请实施例可以称之为微码运行管理表,或者第一映射关系,可以参照图3和图5所示),在第一映射关系中记载了应用的各个算子的标识、物理地址(或者称之为接口地址)等,在应用运行时,可以在数据包中指定需要调用的算子的标识,进而网卡设备可以基于算子的标识以及第一映射关系,确定出算子所存储的物理地址,并基于物理地址调用并执行算子。
本申请实施例中,可以基于目标算子的相关信息更新第一映射关系,第一映射关系可以在后续调用目标算子时作为路由信息被使用,具体的,可以根据所述算子标识、所述第一调用层级、所述应用标识以及所述物理地址,构建第一映射关系,所述第一映射关系指示所述算子标识、所述第一调用层级、所述应用标识以及所述物理地址存在映射关系。
应理解,第一映射关系可以存储在缓存或者闪存中。
应理解,第一映射关系可以以表格、数组等信息存储,这里并不限定第一映射关系的数据形式。
在一种可能的实现中,所述目标算子包括第一算子段以及第二算子段,所述第一算子段以及所述第二算子段分别为所述目标算子的一部分,且所述第一算子段包括所述目标算子的入口函数;所述将所述目标算子存储至所述物理地址对应的存储空间中,包括:基于所述第一子空间可用的空间小于存储所述目标算子所需的存储空间,且所述第一子空间可用的空间大于存储所述第一算子段所需的存储空间,将所述第一算子段存储至所述物理地址对应的存储空间中,并将所述第二算子段传递至主机,以便所述主机存储所述第二算子段。
其中,当第一子空间中可用的存储空间不足以存储完整的目标算子,而仅可以存储部分目标算子时,可以仅将目标算子的部分算子存储至第一子空间,然后将剩余的算子存储至主机,且存储至第一子空间的部分算子可以包括入口函数。通过上述方式,可以充分利用网卡设备的存储空间。
在一种可能的实现中,在应用运行时,网卡设备可以接收所述应用运行时发送的算子调用信息,所述算子调用信息包括所述应用标识和所述算子标识,所述算子调用信息用于指示执行所述目标算子;根据所述算子调用信息以及所述第一映射关系,得到所述物理地址;根据所述物理地址,获取所述目标算子。
其中,在实际运行升级后的应用时,若应用需要调用目标算子,则可以将指示调用目标算子的信息(包括算子标识以及应用标识)传递至网卡设备,网卡设备可以基于第一映射关系,得到存储目标算子的物理地址,并从物理地址中获取目标算子并执行。
参照图6,图6为一种应用运行时的数据流示意。
具体的,在一种可能的实现中,所述算子调用信息还用于指示执行软件程序,所述软件程序包括第一代码段、第二代码段以及位于所述第一代码段和所述第二代码段之间的钩子hook点,所述hook点用于指示是否调用所述目标算子,所述算子调用信息具体用于指示在执行所述第一代码段之后调用所述目标算子;所述方法还包括:根据所述算子调用信 息,执行所述第一代码段,执行所述目标算子,以及执行所述第二代码段。
其中,算子调用信息可以指示运行应用中的某一段程序,该程序中可以预先配置有hook点,在该hook点可以指示是否调用所述目标算子,应用可以将在该hook点需要调用目标算子的信息(可以承载在数据包或者QPC中)传递至网卡设备,进而网卡设备可以在运行程序时在该hook点处调用并执行目标算子。
也就是说,当网卡设备执行到hook点处,需要判断数据包是否需要用卸载的算子(例如目标算子)处理,可选的,可以通过处理程序表handler table查询智能内存缓存smart memory cache的隔离空间卸载的代码地址,通过context table查询执行数据包需要的数据,并根据卸载的指令处理数据包,包括但不仅限于数据包的匹配执行逻辑。
应理解,上述应用升级的过程可以包括分为数据部分的执行和控制部分的执行,数据部分用于获取算子、存储算子等等,控制部分用于构建第一映射关系、第二映射关系等等,网卡可以具有第一处理器单元与第二处理器单元,其中,第一处理器单元用于处理数据功能,第二处理器单元用于处理控制功能。网卡的处理器可以是单核处理器,或者是多核处理器。上述的第一处理器单元与第二处理器单元可以是两个单核处理器,或者上述的第一处理器单元与第二处理器单元为同一个多核处理器的两个处理器核。
本申请实施例提供了一种应用升级方法,所述方法应用于网卡设备,所述方法包括:获取应用的升级信息,所述升级信息包括目标算子、所述目标算子的算子标识、所述应用的应用标识;获取为所述目标算子分配的物理地址,所述物理地址为所述网卡设备上存储空间的地址;将所述目标算子存储至所述物理地址对应的存储空间中,并根据所述算子标识、所述应用标识以及所述物理地址,构建第一映射关系,所述第一映射关系指示所述算子标识、所述应用标识以及所述物理地址存在映射关系,所述第一映射关系用于在所述应用运行时作为所述目标算子的路由信息。现有的实现中,在升级网卡上的应用时,为了在代码中增加算子,需要在算子的插入位置编写算子,由于插入算子时会对整体的应用造成影响(例如插入算子A和算子B时,当插入了算子A而还未插入算子B时,此时应用的运行是存在错误的),则必须关闭网页的业务通信(也就是不处理数据包),并将已经完成算子插入的升级后的应用整体写入网卡并重启生效。而本实施例中,在对应用进行升级时,不对应用整体进行替换,而是只对升级的算子进行存储以及针对于升级的算子进行路由信息的构建,并不是将目标算子插入到应用的某一位置,并不会影响应用的其他代码的工作过程,在应用运行时,只需要在数据包中指定是否调用目标算子,基于第一映射关系就可以路由到目标段子的存储位置,并调用目标算子,进而,可以在无需重启网卡的情况下,升级网卡的应用,由于无需重启网卡,因此可以保持业务链路不中断。因此,本实施例提供的技术上方案可以在保持业务通信链接不断的情况下,完成网卡的应用升级,从而可以降低网卡应用升级对业务的影响,加速应用计算和传输,提高了整机的性能。
此外,针对于不同的应用,可以配置不同的应用标识,由于应用标识的不同,可以保证应用之间的隔离(在处理数据包时,各个数据包可以基于算子标识的指示,来调用自身应用的算子),也就是可以支持多算子多类型应用同时卸载操作,相互隔离互不影响。
此外,本实施例不需要数据包修改,不需要修改数据层的数据包格式,只需要修改控 制通道的下发匹配规则,区分不同的数据包,可扩展性更强。
此外,针对于不同的应用,可以配置不同的应用标识,并基于和图2所示的应用升级方法相同的方式进行应用升级,由于应用标识的不同,可以保证应用之间的隔离(在处理数据包时,各个数据包可以基于算子标识的指示,来调用自身应用的算子),也就是可以支持多算子多类型应用同时卸载操作,相互隔离互不影响。
此外,在不中断网卡业务流量的情况下,卸载算子到网卡的闪存flash区域,可以实现网卡功能的在线升级和选择性管理,并且重启网卡之后,可以再次从flash加载算子到内存中运行。
此外,在对算子进行物理地址的分配时,对不同调用层级的算子分配了不同的区域,基于调用层级的划分可以让低层调用层级的算子可以调用高层调用层级的算子,降低了算子的数量。
上文虽然以网卡为对象,描述了其应用升级的方法。但是,本申请实施例提供的应用升级的方案还可以应用于以太网(ethernet)接口、光纤通道(FC)接口、SAS/SATA接口,磁盘阵列(redundant arrays of independent disks,RAID)、主机总线适配器(host bus adapter,HBA),也可用于其它形态的网络主机(计算节点、存储节点)的IO接口卡设备。
本申请实施例提供的应用升级的方案还可以应用于一些片上系统(system.on.achip,SoC)。SoC指的是在单个芯片上集成一个完整的系统,对所有或部分必要的电子电路进行包分组的技术。所谓完整的系统一般包括中央处理器(CPU)、存储器、以及外围电路等。
接下来给出一个本申请实施例中网卡设备的系统框架示意:
参照图7,图7示出了一个在网计算(online network processing,ONP)的框架示意,ONP是一个动态可编程加速框架,图7示出了多个应用卸载加速的场景,包括网络的动态多拥塞协议,存储的事务原子读写,kvs,集合通信,以及HPC的离散数据传输,这些场景各自有不同的应用逻辑,ONP的目标就是用一个统一的可编程框架动态支撑这些不同的应用加速需求。为了实现这样的目标,ONP提供了统一的可编程接口以及应用逻辑开发流程,然后通过ONP管理组件动态地选择运行应用卸载逻辑。同时,向下支持自研的网卡架构,向上提供统一的编程模型。
如图7所示,其包含在网计算编程接口,并新增了在网计算管理框架和在网计算编排执行模块。在网计算编程接口可以给用户提供统一的网卡可编程接口,方便用户编程。其中包括控制通道接口,方便用户下发控制命令和卸载微码算子;包括数据通道接口,方便用户调用实现数据传送。其次,还有一些定制的APP verbs,比如KV store、RPC序列化的定制加速接口。在网计算管理框架是一个实时调度、编译卸载的软件系统框架,抽象网卡的计算、存储和硬件资源给用户使用,并且替用户管理。用户卸载的算子微码,在管理框架中被提取编译,分发到网卡或者其他硬件设备上面执行。在网计算编排执行是微码算子在网卡中编排执行的框架,给不同算子提供通信和相互调用的能力。
互联网公司在搭建自己的数据中心和计算中心时,为了避免vender inlock,所有的网卡不会购买同一家公司的,会按照一定比例购买多家公司的智能网卡,但是基于RDMA的 智能网卡大部分都是设备厂商自研的拥塞控制协议,这样一来如果混合部署的情况下,不仅会出现通信性能下降,甚至会出现连通性问题。多种拥塞控制机制有各自不同的协议流程,报文格式,如何融合到统一的RDMA报文处理流程中,支持不同场景下的互通,在融合的流程中保持互通的同时,继续实现PFC free的拥塞控制策略。为了支持拥塞控制机制的可扩展和动态更新,我们利用本专利提供的技术,实现了动态多拥塞控制DCC,支持多种拥塞控制机制,LDCP,DCQCN,PCC-LDCP。实现动态配置拥塞模式,统一拥塞控制可编程接口,多拥塞控制算法的共存和动态切换。
根据图8和图9,可以看到没有利用本申请实施例时的拥塞控制算法运行流程,如图8所示,微码静态运行时,(1)微码收到CNP/ACK/RTT等数据包;(2)根据不同的事件进入不同的处理流程;(3)调用公用的smart memory cache的微码执行数据包操作。利用本申请实施例的动态拥塞控制算法流程,微码增加hook点动态调用应用下发的浮动地址空间的代码。微码拥塞控制动态调用时,1)微码流程里增加hook点;2)在hook点判断数据包是否需要用卸载的code处理;3)通过Handler table查询smart memory cache的隔离空间卸载的代码地址,通过context table查询执行数据包需要的数据。4)根据卸载的指令处理数据包,包括但不仅限于数据包的匹配执行逻辑。
参照图10,现有数据流处理流程中添加调用点,在调用点处动态卸载拥塞控制算子。具体算法运行流程如下:
1、在初始化阶段,可以产生new flow事件;
2、在收包阶段,可以产生CNP/ACK/NACK/RTT等事件;
3、在发送阶段,可以发送一定量的数据后通知CC算法(TX事件);
4、用户CC算子由事件驱动;
5.拥有20B的空间存储状态,将结果写入rate;
6.发送阶段读取rate,按照rate发送数据;
通过本申请实施例,用户可以自定义拥塞控制算法,调用卸载接口,可以动态下发RDMA拥塞控制算法到网卡上面。可以在不中断业务数据流的情况下实现动态卸载拥塞控制算法。微码动态调用收益可以包括:1、动态加载效率更高。2、存储资源隔离,提供cache命中率,减少content切换。3、接口调用灵活。
上文描述本申请的方法实施例,下文描述本申请的装置实施例。装置实施例中相关内容的解释及有益效果均可参考上文提供的对应的方法实施例,此处不再赘述。
参照图11,本申请实施例提供了一种应用升级装置的结构示意,所述装置应用于网卡设备,所述装置1100可以包括:
获取模块1101,用于获取应用的升级信息,所述升级信息包括目标算子、所述目标算子的算子标识、所述应用的应用标识;
获取为所述目标算子分配的物理地址,所述物理地址为所述网卡设备上存储空间的地址;
其中,关于获取模块1101的具体描述可以参照步骤201和步骤202的描述,这里不再赘述。
算子部署模块1102,用于将所述目标算子存储至所述物理地址对应的存储空间中,并根据所述算子标识、所述应用标识以及所述物理地址,构建第一映射关系,所述第一映射关系指示所述算子标识、所述应用标识以及所述物理地址存在映射关系,所述第一映射关系用于在所述应用运行时作为所述目标算子的路由信息。
其中,关于算子部署模块1102的具体描述可以参照步骤203的描述,这里不再赘述。
在一种可能的实现中,所述存储空间为缓存或闪存。
在一种可能的实现中,所述升级信息还包括:所述目标算子对应的虚拟地址;
所述获取模块,具体用于:
基于所述虚拟地址,将所述虚拟地址映射到对应的物理地址。
在一种可能的实现中,所述升级信息还包括所述目标算子的第一调用层级,所述第一调用层级用于指示所述目标算子的重要程度,所述存储空间包括为所述第一调用层级的算子所分配的第一子空间,所述物理地址为所述第一子空间的地址。
在一种可能的实现中,所述存储空间还包括为第二调用层级的算子所分配的第二子空间,所述第一子空间用于存储所述第一调用层级的算子,所述第二子空间用于存储所述第二调用层级的算子。
在一种可能的实现中,所述获取模块,具体用于:
获取第二映射关系,所述第二映射关系包括多个调用层级、为每个所述调用层级分配的子空间;
根据所述第一调用层级以及所述第二映射关系,从所述第二映射关系中确定为所述第一调用层级所分配的第一子空间;
从所述第一子空间中获取为所述目标算子分配的物理地址。
在一种可能的实现中,所述升级信息还包括:待替换算子的标识;
所述获取模块,具体用于:
根据所述待替换算子的标识,确定出存储所述待替换算子的存储空间的物理地址。
在一种可能的实现中,所述目标算子包括第一算子段以及第二算子段,所述第一算子段以及所述第二算子段分别为所述目标算子的一部分,且所述第一算子段包括所述目标算子的入口函数;
所述算子部署模块,具体用于:
基于所述第一子空间可用的空间小于存储所述目标算子所需的存储空间,且所述第一子空间可用的空间大于存储所述第一算子段所需的存储空间,将所述第一算子段存储至所述物理地址对应的存储空间中,并将所述第二算子段传递至主机,以便所述主机存储所述第二算子段。
在一种可能的实现中,所述算子部署模块,具体用于:
根据所述算子标识、所述第一调用层级、所述应用标识以及所述物理地址,构建第一映射关系,所述第一映射关系指示所述算子标识、所述第一调用层级、所述应用标识以及所述物理地址存在映射关系。
在一种可能的实现中,所述获取模块,还用于:
接收所述应用运行时发送的算子调用信息,所述算子调用信息包括所述应用标识和所述算子标识,所述算子调用信息用于指示执行所述目标算子;
根据所述算子调用信息以及所述第一映射关系,得到所述物理地址;
根据所述物理地址,获取所述目标算子。
在一种可能的实现中,所述算子调用信息还用于指示执行软件程序,所述软件程序包括第一代码段、第二代码段以及位于所述第一代码段和所述第二代码段之间的钩子hook点,所述hook点用于指示是否调用所述目标算子,所述算子调用信息具体用于指示在执行所述第一代码段之后调用所述目标算子;
所述装置还包括:
程序执行模块,用于根据所述算子调用信息,执行所述第一代码段,执行所述目标算子,以及执行所述第二代码段。
如图12,本申请实施例还提供一种网卡,该网卡包括处理器1110,存储器1120,总线1130,输入接口1140和输出接口1150。处理器1110、存储器1120、输入接口1140和输出接口1150通过总线1130通信连接。存储器1120用于存储指令,该处理器1110用于执行该存储器1130存储的指令,并且对该存储器1130中存储的指令的执行使得,该处理器1110用于执行上文方法实施例中网卡执行的动作。
本申请实施例还提供一种芯片,该芯片包括处理单元与通信接口,该处理单元用于执行上述方法实施例中的芯片设备执行的操作,该通信接口用于与外部进行通信。
可选地,该芯片还可以包括存储单元,该存储单元中存储有指令,该处理单元用于执行上述存储单元中存储的指令,当该指令执行时,述处理单元用于执行上述方法实施例中的网卡执行的操作。
本申请实施例还提供一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时可以实现上述方法实施例中网卡执行的方法。
本申请实施例还提供一种包括指令的计算机程序产品,该指令被计算机执行时可以实现上述方法实施例中网卡执行方法。
如图13所示,本申请实施例还提供一种设备,该设备包括处理器1210,通信接口1220,总线1230和网卡1240,其中,通信接口1220和网卡1240通过总线1230通信连接。处理器1210的对应于上文实施例中提到的主机处理器。网卡1240对应于上文实施例中的网卡。该服务器可以对应于上文实施例中提及的主机。
可选地,该总线1130可以为PCIe总线,或者也可以是非PCIe总线。其中,非PCIe总线可以为SMBus、I2C、SPI总线、或UART等。
应理解,根据本发明实施例的设备中的网卡可对应于本申请实施例中图12所示的网卡,并可以对应于执行根据本申请实施例图2中实现网卡应用升级的方法中的执行主体,并且设备中的各个模块的上述和其它操作和/或功能分别为了实现图2的方法的相应流程,为了简洁,在此不再赘述。
应理解,本实施例中的网卡具有处理器与存储器。其中,该存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可 以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。应注意,本文描述的存储器旨在包括但不限于这些和任意其它适合类型的存储器。
另外需说明的是,以上所描述的装置实施例仅仅是示意性的,其中该作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。另外,本申请提供的装置实施例附图中,模块之间的连接关系表示它们之间具有通信连接,具体可以实现为一条或多条通信总线或信号线。
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件的方式来实现,当然也可以通过专用硬件包括专用集成电路、专用CPU、专用存储器、专用元器件等来实现。一般情况下,凡由计算机程序完成的功能都可以很容易地用相应的硬件来实现,而且,用来实现同一功能的具体硬件结构也可以是多种多样的,例如模拟电路、数字电路或专用电路等。但是,对本申请而言更多情况下软件程序实现是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在可读取的存储介质中,如计算机的软盘、U盘、移动硬盘、ROM、RAM、磁碟或者光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,训练设备,或者网络设备等)执行本申请各个实施例该的方法。
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。
该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行该计算机程序指令时,全部或部分地产生按照本申请实施例该的流程或功能。该计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。该计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,该计算机指令可以从一个网站站点、计算机、训练设备或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、训练设备或数据中心进行传输。该计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的训练设备、数据中心等数据存储设备。该可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、 或者半导体介质(例如固态硬盘(Solid State Disk,SSD))等。

Claims (26)

  1. 一种应用升级方法,其特征在于,所述方法应用于网卡设备,所述方法包括:
    获取应用的升级信息,所述升级信息包括目标算子、所述目标算子的算子标识、所述应用的应用标识;
    获取为所述目标算子分配的物理地址,所述物理地址为所述网卡设备上存储空间的地址;
    将所述目标算子存储至所述物理地址对应的存储空间中,并根据所述算子标识、所述应用标识以及所述物理地址,构建第一映射关系,所述第一映射关系指示所述算子标识、所述应用标识以及所述物理地址存在映射关系,所述第一映射关系用于在所述应用运行时作为所述目标算子的路由信息。
  2. 根据权利要求1所述的方法,其特征在于,所述存储空间为缓存或闪存。
  3. 根据权利要求1或2所述的方法,其特征在于,所述升级信息还包括:所述目标算子对应的虚拟地址;
    所述获取为所述目标算子分配的物理地址,包括:
    基于所述虚拟地址,将所述虚拟地址映射到对应的物理地址。
  4. 根据权利要求1至3任一所述的方法,其特征在于,所述升级信息还包括所述目标算子的第一调用层级,所述第一调用层级用于指示所述目标算子的重要程度,所述存储空间包括为所述第一调用层级的算子所分配的第一子空间,所述物理地址为所述第一子空间的地址。
  5. 根据权利要求4所述的方法,其特征在于,所述存储空间还包括为第二调用层级的算子所分配的第二子空间,所述第一子空间用于存储所述第一调用层级的算子,所述第二子空间用于存储所述第二调用层级的算子。
  6. 根据权利要求4或5所述的方法,其特征在于,所述获取为所述目标算子分配的物理地址,包括:
    获取第二映射关系,所述第二映射关系包括多个调用层级、为每个所述调用层级分配的子空间;
    根据所述第一调用层级以及所述第二映射关系,从所述第二映射关系中确定为所述第一调用层级所分配的第一子空间;
    从所述第一子空间中获取为所述目标算子分配的物理地址。
  7. 根据权利要求1至6任一所述的方法,其特征在于,所述升级信息还包括:待替换算子的标识;
    所述获取为所述目标算子分配的物理地址,包括:
    根据所述待替换算子的标识,确定出存储所述待替换算子的存储空间的物理地址。
  8. 根据权利要求4至7任一所述的方法,其特征在于,所述目标算子包括第一算子段以及第二算子段,所述第一算子段以及所述第二算子段分别为所述目标算子的一部分,且所述第一算子段包括所述目标算子的入口函数;
    所述将所述目标算子存储至所述物理地址对应的存储空间中,包括:
    基于所述第一子空间可用的空间小于存储所述目标算子所需的存储空间,且所述第一子空间可用的空间大于存储所述第一算子段所需的存储空间,将所述第一算子段存储至所述物理地址对应的存储空间中,并将所述第二算子段传递至主机,以便所述主机存储所述第二算子段。
  9. 根据权利要求4至8任一所述的方法,其特征在于,所述根据所述算子标识、所述应用标识以及所述物理地址,构建第一映射关系,包括:
    根据所述算子标识、所述第一调用层级、所述应用标识以及所述物理地址,构建第一映射关系,所述第一映射关系指示所述算子标识、所述第一调用层级、所述应用标识以及所述物理地址存在映射关系。
  10. 根据权利要求1至9任一所述的方法,其特征在于,所述构建第一映射关系之后,所述方法还包括:
    接收所述应用运行时发送的算子调用信息,所述算子调用信息包括所述应用标识和所述算子标识,所述算子调用信息用于指示执行所述目标算子;
    根据所述算子调用信息以及所述第一映射关系,得到所述物理地址;
    根据所述物理地址,获取所述目标算子。
  11. 根据权利要求10所述的方法,其特征在于,所述算子调用信息还用于指示执行软件程序,所述软件程序包括第一代码段、第二代码段以及位于所述第一代码段和所述第二代码段之间的钩子hook点,所述hook点用于指示是否调用所述目标算子,所述算子调用信息具体用于指示在执行所述第一代码段之后调用所述目标算子;
    所述方法还包括:
    根据所述算子调用信息,执行所述第一代码段,执行所述目标算子,以及执行所述第二代码段。
  12. 一种应用升级装置,其特征在于,所述装置应用于网卡设备,所述装置包括:
    获取模块,用于获取应用的升级信息,所述升级信息包括目标算子、所述目标算子的算子标识、所述应用的应用标识;
    获取为所述目标算子分配的物理地址,所述物理地址为所述网卡设备上存储空间的地 址;
    算子部署模块,用于将所述目标算子存储至所述物理地址对应的存储空间中,并根据所述算子标识、所述应用标识以及所述物理地址,构建第一映射关系,所述第一映射关系指示所述算子标识、所述应用标识以及所述物理地址存在映射关系,所述第一映射关系用于在所述应用运行时作为所述目标算子的路由信息。
  13. 根据权利要求12所述的装置,其特征在于,所述存储空间为缓存或闪存。
  14. 根据权利要求12或13所述的装置,其特征在于,所述升级信息还包括:所述目标算子对应的虚拟地址;
    所述获取模块,具体用于:
    基于所述虚拟地址,将所述虚拟地址映射到对应的物理地址。
  15. 根据权利要求12至14任一所述的装置,其特征在于,所述升级信息还包括所述目标算子的第一调用层级,所述第一调用层级用于指示所述目标算子的重要程度,所述存储空间包括为所述第一调用层级的算子所分配的第一子空间,所述物理地址为所述第一子空间的地址。
  16. 根据权利要求15所述的装置,其特征在于,所述存储空间还包括为第二调用层级的算子所分配的第二子空间,所述第一子空间用于存储所述第一调用层级的算子,所述第二子空间用于存储所述第二调用层级的算子。
  17. 根据权利要求15或16所述的装置,其特征在于,所述获取模块,具体用于:
    获取第二映射关系,所述第二映射关系包括多个调用层级、为每个所述调用层级分配的子空间;
    根据所述第一调用层级以及所述第二映射关系,从所述第二映射关系中确定为所述第一调用层级所分配的第一子空间;
    从所述第一子空间中获取为所述目标算子分配的物理地址。
  18. 根据权利要求12至17任一所述的装置,其特征在于,所述升级信息还包括:待替换算子的标识;
    所述获取模块,具体用于:
    根据所述待替换算子的标识,确定出存储所述待替换算子的存储空间的物理地址。
  19. 根据权利要求15至18任一所述的装置,其特征在于,所述目标算子包括第一算子段以及第二算子段,所述第一算子段以及所述第二算子段分别为所述目标算子的一部分,且所述第一算子段包括所述目标算子的入口函数;
    所述算子部署模块,具体用于:
    基于所述第一子空间可用的空间小于存储所述目标算子所需的存储空间,且所述第一子空间可用的空间大于存储所述第一算子段所需的存储空间,将所述第一算子段存储至所述物理地址对应的存储空间中,并将所述第二算子段传递至主机,以便所述主机存储所述第二算子段。
  20. 根据权利要求15至19任一所述的装置,其特征在于,所述算子部署模块,具体用于:
    根据所述算子标识、所述第一调用层级、所述应用标识以及所述物理地址,构建第一映射关系,所述第一映射关系指示所述算子标识、所述第一调用层级、所述应用标识以及所述物理地址存在映射关系。
  21. 根据权利要求12至20任一所述的装置,其特征在于,所述获取模块,还用于:
    接收所述应用运行时发送的算子调用信息,所述算子调用信息包括所述应用标识和所述算子标识,所述算子调用信息用于指示执行所述目标算子;
    根据所述算子调用信息以及所述第一映射关系,得到所述物理地址;
    根据所述物理地址,获取所述目标算子。
  22. 根据权利要求21所述的装置,其特征在于,所述算子调用信息还用于指示执行软件程序,所述软件程序包括第一代码段、第二代码段以及位于所述第一代码段和所述第二代码段之间的钩子hook点,所述hook点用于指示是否调用所述目标算子,所述算子调用信息具体用于指示在执行所述第一代码段之后调用所述目标算子;
    所述装置还包括:
    程序执行模块,用于根据所述算子调用信息,执行所述第一代码段,执行所述目标算子,以及执行所述第二代码段。
  23. 一种网卡设备,其特征在于,包括存储器与处理器,所述存储器用于存储指令,所述处理器用于执行所述存储器存储的指令,并且对所述存储器中存储的指令的执行使得,所述处理器用于执行如权利要求1至11中任一项所述方法中的操作步骤。
  24. 一种设备,其特征在于,所述设备包括网卡,所述网卡包括存储器与处理器,所述存储器用于存储指令,所述处理器用于执行所述存储器存储的指令,并且对所述存储器中存储的指令的执行使得,所述处理器用于执行如权利要求1至11中任一项所述方法中的操作步骤。
  25. 一种计算机可读存储介质,其特征在于,包括计算机可读指令,当所述计算机可读指令在计算机设备上运行时,使得所述计算机设备执行权利要求1至11任一项所述的方法。
  26. 一种计算机程序产品,其特征在于,包括计算机可读指令,当所述计算机可读指令在计算机设备上运行时,使得所述计算机设备执行如权利要求1至11任一所述的方法。
PCT/CN2022/121619 2021-09-29 2022-09-27 应用升级方法、装置、网卡和设备 WO2023051504A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111155642.5A CN115878140A (zh) 2021-09-29 2021-09-29 应用升级方法、装置、网卡和设备
CN202111155642.5 2021-09-29

Publications (1)

Publication Number Publication Date
WO2023051504A1 true WO2023051504A1 (zh) 2023-04-06

Family

ID=85756536

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/121619 WO2023051504A1 (zh) 2021-09-29 2022-09-27 应用升级方法、装置、网卡和设备

Country Status (2)

Country Link
CN (1) CN115878140A (zh)
WO (1) WO2023051504A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1781075A (zh) * 2002-11-18 2006-05-31 创道软件有限公司 电子文件更新期间的设备存储器管理
US20130086571A1 (en) * 2011-09-30 2013-04-04 International Business Machines Corporation Dynamically Updating Firmware In A Computing System
CN103530420A (zh) * 2013-10-30 2014-01-22 北京奇虎科技有限公司 数据文件的动态更新方法及装置
CN109857416A (zh) * 2018-11-08 2019-06-07 深圳壹账通智能科技有限公司 一种应用升级方法、装置、设备及存储介质
CN113110865A (zh) * 2021-04-21 2021-07-13 北京字跳网络技术有限公司 一种服务器热更新方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1781075A (zh) * 2002-11-18 2006-05-31 创道软件有限公司 电子文件更新期间的设备存储器管理
US20130086571A1 (en) * 2011-09-30 2013-04-04 International Business Machines Corporation Dynamically Updating Firmware In A Computing System
CN103530420A (zh) * 2013-10-30 2014-01-22 北京奇虎科技有限公司 数据文件的动态更新方法及装置
CN109857416A (zh) * 2018-11-08 2019-06-07 深圳壹账通智能科技有限公司 一种应用升级方法、装置、设备及存储介质
CN113110865A (zh) * 2021-04-21 2021-07-13 北京字跳网络技术有限公司 一种服务器热更新方法及装置

Also Published As

Publication number Publication date
CN115878140A (zh) 2023-03-31

Similar Documents

Publication Publication Date Title
US11748278B2 (en) Multi-protocol support for transactions
US20220350483A1 (en) Method and apparatus to enable individual non volatile memory express (nvme) input/output (io) queues on differing network addresses of an nvme controller
US20210232528A1 (en) Configurable device interface
CN108616382B (zh) 升级网卡固件的方法、装置、网卡和设备
US11507426B2 (en) Resource pool management method and apparatus, resource pool control unit, and communications device
CN109445905B (zh) 虚拟机数据通信方法和系统以及虚拟机配置方法和装置
US9092426B1 (en) Zero-copy direct memory access (DMA) network-attached storage (NAS) file system block writing
WO2017066944A1 (zh) 一种存储设备访问方法、装置和系统
CN103843302A (zh) 有状态环境中的网络适配器硬件状态迁移发现
WO2019084916A1 (zh) 恢复fpga芯片中的逻辑的方法、系统和fpga设备
JP2017076398A (ja) インタフェイス制御メカニズムを有する電子システム及びその動作方法
CN114902177A (zh) 引导代码处理程序的更新
US8635632B2 (en) High performance and resource efficient communications between partitions in a logically partitioned system
CN110119304B (zh) 一种中断处理方法、装置及服务器
US20210326270A1 (en) Address translation at a target network interface device
WO2023174146A1 (zh) 卸载卡命名空间管理、输入输出请求处理系统和方法
WO2023093418A1 (zh) 数据迁移方法、装置及电子设备
WO2022108619A1 (en) Peer storage device messaging over control bus
CN110837488A (zh) 报文传输方法和装置
US11132215B2 (en) Techniques to facilitate out of band management in a virtualization environment
US7552232B2 (en) Speculative method and system for rapid data communications
CN112148336A (zh) 计算系统固件的安全更新
US10642667B1 (en) Apparatus, system, and method for efficiently sharing data between processes
CN114925012A (zh) 一种以太网帧的下发方法、上传方法及相关装置
US11544205B2 (en) Peer storage devices sharing host control data

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

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2022874889

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2022874889

Country of ref document: EP

Effective date: 20240328