A data transmission method, device, apparatus, computer storage medium and computer program product
Patent Information
- Application Number
- CN202510346307.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2026-09-22
AI Technical Summary
[0004]为解决上述技术问题,本申请实施例提供一种数据传输方法、装置、设备、计算机存储介质和计算机程序产品,解决了相关技术中在进行数据传输时存在的VF接口的工作状态受网口的工作状态影响的问题,进而提高了数据的传输效率
[0038]本申请的实施例所提供的数据传输方法、装置、设备、计算机可读存储介质和计算机程序产品,可以通过网卡的与网口不具有对应关系的第一物理功能设备对应的多个虚拟功能接口,来获取待传输数据,并基于与所述待传输数据相关的基本信息,从所述网卡的第二物理功能设备对应的多个网口中确定目标网口,进而通过所述目标网口发送所述待传输数据至目标设备;如此,由于网卡的网口与第一物理功能PF设备不具有对应关系,那网口的工作状态就只会影响对应的第二物理功能PF设备,而不会影响第一物理功能PF设备,那就更不会影响第一物理功能PF设备对应的多个虚拟功能VF接口,也就是说,即使某一网口出现故障,虚拟功能VF接口仍可以正常工作以获取待传输数据并通过其他网口进行数据的转发,而不是如相关技术中那样只要网口出现故障,相应的VF接口也无法正常工作,解决了相关技术中在进行数据传输时存在的VF接口的工作状态受网口的工作状态影响的问题,进而提高了数据的传输效率。
Smart Images

Figure CN122802372A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network cloud technology, and in particular to a data transmission method, apparatus, device, computer storage medium, and computer program product. Background Technology
[0002] In a cloud network scenario, the physical function (PF) device of the network interface card (NIC) typically creates multiple virtual function (VF) interfaces. The data to be transmitted is then obtained from the virtual machine through the multiple VF interfaces and forwarded through the network port corresponding to the PF device. Furthermore, if a network port fails, the obtained data can be sent from other working network ports through the NIC bonding mechanism.
[0003] However, in related technologies, if a network port fails, the corresponding PF device will also be affected. This will cause the VF interface created by the PF device to also be affected and unable to work properly. In other words, if a network port fails, although data can continue to be sent through other working network ports, the VF interface corresponding to the failed network port can no longer obtain the data to be transmitted from the virtual machine. This will cause the data to be unable to be transmitted normally through other network ports, resulting in poor data transmission efficiency. Summary of the Invention
[0004] To address the aforementioned technical problems, embodiments of this application provide a data transmission method, apparatus, device, computer storage medium, and computer program product, which solves the problem in related technologies where the working state of the VF interface is affected by the working state of the network port during data transmission, thereby improving data transmission efficiency.
[0005] To achieve the above objectives, the technical solution of this application embodiment is implemented as follows:
[0006] A data transmission method, the method comprising:
[0007] The data to be transmitted is obtained through multiple virtual function interfaces corresponding to the first physical function device of the network card;
[0008] Based on basic information related to the data to be transmitted, a target network port is determined from multiple network ports corresponding to the second physical function device of the network card; wherein, the first physical function device and the network port of the network card do not have a corresponding relationship.
[0009] The data to be transmitted is sent to the target device through the target network port.
[0010] In the above scheme, obtaining the data to be transmitted through multiple virtual function interfaces corresponding to the first physical function device of the network card includes:
[0011] Obtain the target address of the virtual machine's target storage region;
[0012] The data to be transmitted is obtained from the virtual machine based on the target address through the multiple virtual function interfaces.
[0013] In the above scheme, determining the target network port from multiple network ports corresponding to the second physical function device of the network card based on basic information related to the data to be transmitted includes:
[0014] Based on the data processing strategy in the target flow table and the basic information, candidate network interfaces are determined from the multiple network interfaces;
[0015] Determine the working status of the candidate network ports;
[0016] Based on the operating status, the target network port is determined from the plurality of network ports.
[0017] In the above scheme, determining the target network port from the plurality of network ports based on the working state includes:
[0018] If the working status is normal, the candidate network port is determined to be the target network port;
[0019] If the working status is abnormal, the target network port is determined from the network ports other than the candidate network ports among the plurality of network ports.
[0020] The method in the above scheme further includes:
[0021] Establish a mapping relationship between the second physical functional device and the multiple network ports;
[0022] A target instruction carrying the first device identifier of the second physical function device and the mapping relationship is sent to the first server, so that the first server configures the parameters of the target logical interfaces corresponding to the multiple network ports based on the target instruction and the interface configuration information input by the user, and configures the parameters of the second physical function device based on the parameters of the target logical interfaces.
[0023] The method in the above scheme further includes:
[0024] Obtain user-inputted instruction information; wherein, the instruction information carries a second device identifier of the first physical functional device;
[0025] The first physical functional device generates the plurality of virtual functional interfaces based on the instruction information.
[0026] The method in the above scheme further includes:
[0027] Send the configuration information of the multiple virtual function interfaces to the first server;
[0028] The target flow table is received by the first server through the target forwarding plane; wherein the target flow table is obtained by the first server after converting the initial flow table sent by the second server; the initial flow table is determined by the second server based on the configuration information sent by the first server.
[0029] A data transmission apparatus, the apparatus comprising:
[0030] The acquisition unit is used to acquire data to be transmitted through multiple virtual function interfaces corresponding to the first physical function device of the network card.
[0031] The determining unit is configured to determine a target network port from multiple network ports corresponding to the second physical function device of the network card based on basic information related to the data to be transmitted; wherein the first physical function device does not have a corresponding relationship with the network port of the network card;
[0032] The sending unit is used to send the data to be transmitted to the target device through the target network port.
[0033] A network interface card (NIC) includes: a processor, a memory, and a communication bus;
[0034] The communication bus is used to realize the communication connection between the processor and the memory;
[0035] The processor is used to execute the data transfer program in the memory to implement the steps of the data transfer method described above.
[0036] A computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the steps of the above-described data transmission method.
[0037] A computer program product comprising a computer program that, when executed by a processor, implements the above-described method.
[0038] The data transmission method, apparatus, device, computer-readable storage medium, and computer program product provided in the embodiments of this application can acquire data to be transmitted through multiple virtual function interfaces corresponding to a first physical function device of a network card that does not correspond to a network port. Based on basic information related to the data to be transmitted, a target network port is determined from multiple network ports corresponding to a second physical function device of the network card, and then the data to be transmitted is sent to the target device through the target network port. In this way, since the network port of the network card does not correspond to the first physical function PF device, the working state of the network port will only affect the corresponding second physical function PF device, and will not affect the first physical function PF device. Therefore, it will not affect the multiple virtual function VF interfaces corresponding to the first physical function PF device. That is to say, even if a network port fails, the virtual function VF interface can still work normally to acquire the data to be transmitted and forward the data through other network ports, instead of the VF interface failing to work normally as in related technologies when a network port fails. This solves the problem in related technologies where the working state of the VF interface is affected by the working state of the network port during data transmission, thereby improving the data transmission efficiency. Attached Figure Description
[0039] Figure 1 A schematic flowchart illustrating a data transmission method provided for an embodiment of this application;
[0040] Figure 2 A flowchart illustrating another data transmission method provided for an embodiment of this application;
[0041] Figure 3 A schematic diagram of device interaction corresponding to a data transmission method provided in an embodiment of this application;
[0042] Figure 4 A schematic diagram of another device interaction corresponding to a data transmission method provided in an embodiment of this application;
[0043] Figure 5 A flowchart illustrating a data transmission method according to another embodiment of this application;
[0044] Figure 6 This is a schematic diagram of the structure of a data transmission device provided in an embodiment of this application;
[0045] Figure 7 This is a schematic diagram of the structure of a network interface card (NIC) provided in an embodiment of this application. Detailed Implementation
[0046] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0047] It should be understood that the phrases "embodiments of this application" or "foreign embodiments" throughout the specification mean that a specific feature, structure, or characteristic related to an embodiment is included in at least one embodiment of this application. Therefore, "embodiments of this application" or "in the foreign embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0048] Unless otherwise specified, any step in the embodiments of this application performed by the electronic device may be executed by the processor of the electronic device. It is also worth noting that the embodiments of this application do not limit the order in which the electronic device performs the following steps. Furthermore, the methods used to process data in different embodiments may be the same or different methods. It should also be noted that any step in the embodiments of this application can be executed independently by the electronic device; that is, when the electronic device performs any step in the following embodiments, it may not depend on the execution of other steps.
[0049] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application.
[0050] This application provides a data transmission method, referring to... Figure 1 As shown, the method may include the following steps:
[0051] Step 101: Obtain the data to be transmitted through multiple virtual function interfaces corresponding to the first physical function device of the network card.
[0052] In this embodiment, the network interface card (NIC) may refer to a smart NIC; the first physical functional device (PF) may refer to a first physical function device (PF); and the virtual functional interface (VF) may refer to a VF interface, which is created based on the first PF. The NIC may have multiple PF devices, and each PF device is a pre-configured logical object.
[0053] In this embodiment of the application, the data to be transmitted can be obtained from the target storage area of the virtual machine through multiple VF interfaces corresponding to the first PF device.
[0054] Step 102: Based on the basic information related to the data to be transmitted, determine the target network port from the multiple network ports corresponding to the second physical function device of the network card.
[0055] Among them, the first physical functional device does not have a corresponding relationship with the network interface card's network port.
[0056] In the embodiments of this application, basic information may refer to the header information of the data to be transmitted. Specifically, the header information may include the source address, destination address, protocol type used to send the data, and data identifier, etc.; the second physical function device may refer to the second PF device, and preferably, one second PF device corresponds to all network ports of the network card; the target network port may refer to the network port used for data forwarding.
[0057] In this embodiment of the application, candidate network ports can be determined from multiple network ports of the network card based on basic information, and then target network ports can be determined from the candidate network ports based on the working status of the candidate network ports.
[0058] Step 103: Send the data to be transmitted to the target device through the target network port.
[0059] In this embodiment, the target device can refer to any external device. Specifically, the data to be transmitted can first be sent to the target network port via the forwarding plane of the virtual switch, and then sent to the corresponding external device through the target network port.
[0060] The data transmission method provided in the embodiments of this application ensures that the working state of the network port only affects the corresponding second physical function (PF) device, and does not affect the first physical function (PF) device that does not have a corresponding relationship with it. Therefore, it will not affect the multiple virtual function (VF) interfaces corresponding to the first physical function (PF) device. In other words, even if a network port fails, the virtual function (VF) interface can still work normally to obtain the data to be transmitted and forward the data through other network ports. This is unlike the related technologies where the corresponding VF interface cannot work normally as long as the network port fails. This solves the problem in the related technologies where the working state of the VF interface is affected by the working state of the network port during data transmission, thereby improving the data transmission efficiency.
[0061] This application provides a data transmission method, which can be applied to a network interface card (NIC). (Refer to...) Figure 2 As shown, the method may include the following steps:
[0062] Step 201: The network card obtains the target address of the virtual machine's target storage area.
[0063] In this embodiment, the virtual machine may be an operating system running on the host machine (hereinafter referred to as: Host OS); the target storage area is the storage area in the virtual machine used to store the data to be transmitted. The network interface card (NIC) may refer to a smart NIC that has a connection to the server.
[0064] In this embodiment, the target address of the target storage area can be obtained through a smart network interface card (NIC). It should be noted that the target address is determined based on the configuration information of the virtual machine's virtual network interface card (VNIC) and the interface information of the smart NIC's VF interface.
[0065] Step 202: The network card obtains the data to be transmitted from the virtual machine based on the target address through multiple virtual function interfaces corresponding to the first physical function device of the network card.
[0066] In the embodiments of this application, such as Figure 3 As shown, the first physical functional device is the PFy device; VF1 to VFn are virtual functional interfaces generated based on the PFy device; Host is the host machine running virtual machines; VM1 and VM2 are two virtual machines. Specifically, the VF1 to VFn interfaces can obtain the corresponding data to be transmitted from the virtual machine's storage area through the virtual machine's virtual network card according to the obtained target address.
[0067] It should be noted that there is only one first physical functional device, namely the PFy device, and it does not correspond to the network port of the network card.
[0068] Step 203: Based on the data processing strategy and basic information in the target flow table, the network card determines candidate network ports from multiple network ports corresponding to the second physical function device of the network card.
[0069] In this embodiment, the target flow table can refer to the fast path flow table, located in the forwarding plane of the virtual switch (vSwitch); the data processing policy can refer to the flow table entries stored in the fast path flow table. The data processing policy (i.e., the flow table entry) can refer to the rules for data forwarding, including data matching rules, processing instructions, and actions.
[0070] In this embodiment of the application, after obtaining the data to be transmitted through the VF interface, the flow table entries (i.e., data processing strategies) in the target flow table of the vSwitch forwarding plane can be matched with the basic information of the data to be transmitted, and candidate network ports can be determined from multiple network ports of the smart network card based on the matching results.
[0071] In the embodiments of this application, there may be only one or more second physical functional devices. For example... Figure 3 As shown, the second PF device can refer to a PFx device, and there is only one PFx device, that is, all the network ports of the network card corresponding to the PFx device.
[0072] Step 204: The network card determines the working status of the candidate network ports.
[0073] In this embodiment, the working state can include a normal state and a fault state. Specifically, after determining the candidate network interface, the Link Aggregation Control Protocol (LACP) can be used to determine whether the candidate network interface is currently in a normal working state or a fault state. There can be only one candidate network interface or multiple candidate network interfaces.
[0074] It should be noted that if there are multiple candidate network ports, the working status of each candidate network port needs to be determined.
[0075] Step 205: Based on its working status, the network card determines the target network port from multiple network ports.
[0076] In this embodiment of the application, the target network port can be determined from multiple network ports based on whether the candidate network port is currently in a normal working state.
[0077] In the embodiments of this application, step 205 can be implemented by step 205a or 205b.
[0078] Step 205a: If the working status is normal, the network card determines the candidate network port as the target network port.
[0079] In one feasible approach, if there is only one candidate network port and the candidate network port is functioning normally, then the candidate network port can be directly identified as the target network port.
[0080] In another possible approach, if there are multiple candidate network interfaces and all of them are in normal working condition, then any candidate network interface can be selected as the target network interface; if there are multiple candidate network interfaces and some of them are in a faulty state, then one of the candidate network interfaces that are in normal working condition can be selected as the target interface.
[0081] Step 205b: If the working status is abnormal, the network card determines the target network port from the network ports other than the candidate network ports.
[0082] In this embodiment of the application, if the working status of the only candidate network interface or all candidate network interfaces is in a fault state, the working status of other network interfaces besides the candidate network interface can be determined by the LACP protocol, and the target network interface can be determined from the other network interfaces based on the working status of the other network interfaces according to the Bond mode of the network card.
[0083] The Bond mode of a network interface card can include round-robin mode, primary / backup mode, and adaptive load balancing mode.
[0084] It should be noted that even if one of the network ports fails, the second PF device will remain available.
[0085] Step 206: The network card sends the data to be transmitted to the target device through the target network port.
[0086] In this embodiment of the application, after determining the target network port, such as Figure 3 As shown, the data to be transmitted can be transmitted to the target network port via the second PF device (i.e., the PFy device), and then the data to be transmitted can be sent to an external device through the target network port.
[0087] In this embodiment of the application, even if a certain network port of the network card (e.g., network port 1) fails, such as Figure 3 As shown, it will not affect PFy, which does not have a corresponding relationship with the network port, and therefore will not affect the VF interface (VF1~VFn) corresponding to PFy. That is, the VF interface is always in a normal working state, instead of as in related technologies, such as Figure 4 As shown in the existing transmission scheme, in the relevant technology, when the network port 0 fails, the corresponding PF0 will also become faulty. Then, the VF0-1 to VF0-2 corresponding to PF0 will also be affected and unable to work properly.
[0088] The data transmission method provided in the embodiments of this application ensures that the working state of the network port only affects the corresponding second physical function (PF) device, and does not affect the first physical function (PF) device that does not have a corresponding relationship with it. Therefore, it will not affect the multiple virtual function (VF) interfaces corresponding to the first physical function (PF) device. In other words, even if a network port fails, the virtual function (VF) interface can still work normally to obtain the data to be transmitted and forward the data through other network ports. This is unlike the related technologies where the corresponding VF interface cannot work normally as long as the network port fails. This solves the problem in the related technologies where the working state of the VF interface is affected by the working state of the network port during data transmission, thereby improving the data transmission efficiency.
[0089] This application provides a data transmission method, referring to... Figure 5 As shown, the method may include the following steps:
[0090] Step 301: The second server sends the first instruction to the first server.
[0091] In this embodiment of the application, the first server is determined from a plurality of servers in a distributed file system, each server being a computing node in the distributed file system; the first instruction is used to instruct the first server to deploy a virtual machine on the running operating system.
[0092] In this embodiment of the application, the first server may be determined in the following manner.
[0093] a1. The second server sends installation instructions to multiple servers.
[0094] In this embodiment, the installation instructions are used to instruct the server to install the scheduling component on the running operating system. It should be noted that the operating system can be either Linux or Windows; the scheduling component can refer to the SchedulerAgent component, which is used to handle scheduling tasks and resource allocation, and is a necessary component when configuring compute nodes.
[0095] In this embodiment of the application, installation instructions can be sent to multiple servers through the Vim editor in the second server or the Software Defined Network Control (SDNC).
[0096] a2. The server receives the installation instructions sent by the second server and installs the scheduling component based on the installation instructions.
[0097] In this embodiment of the application, after receiving the installation instruction, each server will install the scheduling component, namely the SchedulerAgent component, on its own operating system (hereinafter referred to as: Host OS) in accordance with the installation instruction.
[0098] a3. The second server determines the first server from multiple servers through the scheduling component.
[0099] In this embodiment, the second server can determine the final first server from multiple servers through a scheduling component, namely the SchedulerAgent component. It should be noted that there is only one first server.
[0100] Step 302: The first server receives the first instruction and creates a virtual machine based on the first instruction.
[0101] In this embodiment of the application, after receiving the first instruction, the first server will deploy a corresponding virtual machine in the running operating system.
[0102] Step 303: Establish a mapping relationship between the second physical function device and the network ports of multiple network cards.
[0103] In this embodiment, the number of second PF devices can be determined first based on the attribute information of the network interface card (NIC). Specifically, the number of network tracks (i.e., transmission links) corresponding to multiple network ports can be determined based on the attribute information of each network port. Then, the number of second PF devices is determined based on the number of network tracks. Preferably, the number of network tracks is the same as the number of second PF devices, i.e., one network track corresponds to one second PF device.
[0104] For example, if the network card has 4 network ports and all 4 network ports are on the same network track, then the number of second PF devices can be determined to be 1; if the 4 network ports correspond to two network tracks, then the number of second PF devices can be determined to be 2.
[0105] Subsequently, if there is only one second PF device (i.e., the number of network tracks is 1), the mapping relationship between the second PF device and all the network ports of the network card can be directly established; correspondingly, if there are multiple second PF devices (i.e., the number of network tracks is multiple), the mapping relationship between each second PF device and the corresponding network port can be established, that is, the mapping relationship between the network port corresponding to one network track and one second PF device can be established.
[0106] Step 304: The network card sends a target instruction carrying the first device identifier and mapping relationship of the second physical functional device to the first server.
[0107] In this embodiment, the target instruction is used to instruct the Host OS side of the first server to configure parameters of the logical interfaces corresponding to multiple network ports. Specifically, after establishing the mapping relationship between the second PF device and the network port, the mapping relationship and the first device identifier of the second physical function device can be carried in the target instruction and sent to the first server.
[0108] Step 305: Based on the received target instructions and the interface configuration information input by the user, the first server configures the parameters of the target logical interfaces corresponding to multiple network ports, and configures the parameters of the second physical function device based on the parameters of the target logical interfaces.
[0109] In this embodiment, the target logical interface can refer to the Bond interface, which is a virtual interface; the interface configuration information can refer to the information required to configure the Bond interface. Specifically, after receiving the target instruction, the first server can configure the parameters of the Bond interface on the Host OS side according to the first device identifier of the second PF device in the target instruction, the mapping relationship between the second PF device and the network interface, and the interface configuration information input by the user. The parameters of the Bond interface may include the interface address, network mask, Bond mode, and link detection interval, etc.
[0110] For example, the code for configuring the parameters of the Bond interface can be shown below:
[0111] auto bond0 / / Set the target logical interface bond0
[0112] iface bond0 inet static
[0113] address xxx.xxx.x.xxx / / address
[0114] netmask xxx.xxx.xxx.X / / Network mask
[0115] gateway xxx.xxx.xx
[0116] DNS NameServers xxxx xxxx
[0117] slaves eth0 eth1
[0118] bond-mode 4 / / Bond mode
[0119] bond-miimon 100 / / Link detection interval
[0120] bond-lacp-rate 1
[0121] Furthermore, after configuring the parameters of the target logical interfaces (i.e., Bond interfaces) corresponding to multiple network ports, the parameters of the second PF device can be configured based on the parameters of the Bond interfaces. It should be noted that configuring the parameters of the second PF device establishes the mapping between the target logical interfaces and the multiple network ports.
[0122] For example, the code for configuring the parameters of the second PF device can be as follows:
[0123] auto eth0
[0124] iface eth0 inet manual
[0125] Bond-master bond0
[0126] It should be noted that after configuring the parameters of the second PF device, the LACP protocol configuration for multiple network ports can be completed through the LACP module in the first server.
[0127] Step 306: The network card obtains the instruction information input by the user and generates multiple virtual function interfaces based on the instruction information through the first physical function device.
[0128] The instruction information contains the identifier of the second device of the first physical functional device.
[0129] In this embodiment, the instruction information is used to instruct the generation of multiple VF interfaces and carries the number of VF interfaces to be generated. Specifically, after obtaining the instruction information input by the user, the first PF device can generate a specified number of VF interfaces according to the instruction information. Then, the queue number, IP address, and other information of each VF interface can be configured to obtain data through the queue of the VF interface.
[0130] In this embodiment, the one-to-one mapping relationship between PF devices and network ports is eliminated, and an innovative technical architecture of PF configuration separation is proposed. A PF device that is independently responsible for NIC bonding and generating VF interfaces is separated, which solves the problem of VF interface status being affected by network port failure linkage in related technologies, and ensures the reliability of services in smart NIC scenarios.
[0131] Step 307: The network card sends a second instruction to the first server.
[0132] In this embodiment, the second instruction is used to obtain the target address of the virtual machine's target cache region. Specifically, the second instruction carries configuration information of the VF interface.
[0133] Step 308: The first server receives the second instruction sent by the network card and, based on the second instruction, sends the target address to the network card.
[0134] In this embodiment, the target address may refer to the address of the target storage region; the target storage region may refer to the region used to store the data to be transferred. In one possible implementation, the target storage region may refer to a portion of the virtual machine's memory region.
[0135] In this embodiment of the application, after receiving the second instruction, the virtio-net front-end driver in the virtual machine running on the first server will verify the configuration information of the VF interface. If the verification passes, the target address of the target storage area of the virtual machine can be sent to the network card so that the VF interface can obtain the data to be transmitted through the target address.
[0136] Step 309: The network card sends configuration information for multiple virtual function interfaces to the first server.
[0137] In this embodiment of the application, the second configuration information includes the MAC address, IP address, and VLAN of the VF interface.
[0138] Step 310: The first server receives the configuration information of multiple virtual function interfaces and sends it to the second server.
[0139] In this embodiment of the application, after receiving configuration information from multiple VF interfaces, the first server will directly forward the configuration information to the second server, which has a VIM editor and SDNC.
[0140] Step 311: The second server determines the initial flow table based on the received configuration information and sends the initial flow table to the first server.
[0141] In this embodiment, after receiving the configuration information of the VF interface, the second server can generate an initial flow table based on the configuration information. The initial flow table can refer to the OpenFlow flow table.
[0142] Furthermore, after generating the initial flow table, it can be sent to the vSwitch control plane in the first server via the OpenFlow protocol.
[0143] Step 312: The first server performs conversion processing on the initial flow table sent by the second server to obtain the target flow table and sends it to the network card.
[0144] In this embodiment, after receiving the initial flow table, the vSwitch control plane can process the initial flow table through command-line tools to obtain the fast path flow table (i.e., the target flow table). Then, the first server can send the fast path flow table to the network card through the Data Plane Development Kit (DPDK) interface.
[0145] Step 313: The network card receives the target flow table sent by the first server through the target forwarding plane.
[0146] In this embodiment of the application, the target forwarding plane may refer to the vSwitch forwarding plane; specifically, the fast path flow table sent by the first server can be received through the vSwitch forwarding plane.
[0147] Step 314: The network card obtains the data to be transmitted through multiple virtual function interfaces corresponding to the first physical function device of the network card.
[0148] Step 315: Based on the basic information related to the data to be transmitted, the network card determines the target network port from among the multiple network ports corresponding to the second physical function device of the network card.
[0149] Among them, the first physical functional device does not have a corresponding relationship with the network interface card's network port.
[0150] Step 316: The network card sends the data to be transmitted to the target device through the target network port.
[0151] The data transmission method provided in the embodiments of this application ensures that the working state of the network port only affects the corresponding second physical function (PF) device, and does not affect the first physical function (PF) device that does not have a corresponding relationship with it. Therefore, it will not affect the multiple virtual function (VF) interfaces corresponding to the first physical function (PF) device. In other words, even if a network port fails, the virtual function (VF) interface can still work normally to obtain the data to be transmitted and forward the data through other network ports. This is unlike the related technologies where the corresponding VF interface cannot work normally as long as the network port fails. This solves the problem in the related technologies where the working state of the VF interface is affected by the working state of the network port during data transmission, thereby improving the data transmission efficiency.
[0152] Based on the foregoing embodiments, this application provides a data transmission device that can be applied to... Figures 1-2 In the data transmission method provided in the embodiment corresponding to 5, refer to Figure 6 As shown, the data transmission device 4 may include: an acquisition unit 41, a determination unit 42, and a transmission unit 43, wherein:
[0153] Acquisition unit 41 is used to acquire data to be transmitted through multiple virtual function interfaces corresponding to the first physical function device of the network card;
[0154] The determining unit 42 is used to determine the target network port from multiple network ports corresponding to the second physical function device of the network card based on basic information related to the data to be transmitted; wherein, the first physical function device and the network port of the network card do not have a corresponding relationship.
[0155] The sending unit 43 is used to send the data to be transmitted to the target device through the target network port.
[0156] In other embodiments of this application, the acquisition unit 41 is further configured to perform the following steps:
[0157] Obtain the target address of the virtual machine's target storage region;
[0158] Data to be transmitted is obtained from the virtual machine based on the target address through multiple virtual function interfaces.
[0159] In other embodiments of this application, the determining unit 42 is further configured to perform the following steps:
[0160] Based on the data processing strategy and basic information in the target flow table, candidate network interfaces are determined from multiple network interfaces;
[0161] Determine the working status of the candidate network ports;
[0162] Based on the working status, the target network port is determined from multiple network ports.
[0163] In other embodiments of this application, the determining unit 42 is further configured to perform the following steps:
[0164] If the working status is normal, determine the candidate network interface as the target network interface;
[0165] If the working status is abnormal, the target network port is determined from the network ports other than the candidate network ports.
[0166] In other embodiments of this application, the determining unit 42 is further configured to perform the following steps:
[0167] Establish a mapping relationship between the second physical functional device and multiple network ports;
[0168] A target instruction carrying the first device identifier and mapping relationship of the second physical function device is sent to the first server, so that the first server configures the parameters of the target logical interfaces corresponding to multiple network ports based on the target instruction and the interface configuration information input by the user, and configures the parameters of the second physical function device based on the parameters of the target logical interfaces.
[0169] In other embodiments of this application, the determining unit 42 is further configured to perform the following steps:
[0170] Obtain user-inputted instruction information; wherein the instruction information carries a second device identifier of the first physical functional device;
[0171] Multiple virtual function interfaces are generated based on instruction information through the first physical functional device.
[0172] In other embodiments of this application, the sending unit 43 is further configured to perform the following steps:
[0173] Send configuration information for multiple virtual function interfaces to the first server;
[0174] The target flow table is received by the first server through the target forwarding plane; wherein the target flow table is obtained by the first server after converting the initial flow table sent by the second server; the initial flow table is determined by the second server based on the configuration information sent by the first server.
[0175] It should be noted that a detailed explanation of the steps performed by each unit can be found in [reference needed]. Figures 1-2 The data transmission method provided in the embodiment corresponding to 5 will not be described again here.
[0176] The data transmission device provided in the embodiments of this application ensures that the working state of the network port only affects the corresponding second physical function (PF) device, and does not affect the first physical function (PF) device that does not have a corresponding relationship with it. Therefore, it will not affect the multiple virtual function (VF) interfaces corresponding to the first physical function (PF) device. In other words, even if a network port fails, the virtual function (VF) interface can still work normally to obtain the data to be transmitted and forward the data through other network ports. This is unlike the related technologies where the corresponding VF interface cannot work normally as long as the network port fails. This solves the problem in the related technologies where the working state of the VF interface is affected by the working state of the network port during data transmission, thereby improving the data transmission efficiency.
[0177] Based on the foregoing embodiments, embodiments of this application provide a network interface card (NIC) that can be applied to... Figures 1-2 In the data transmission method provided in the embodiment corresponding to 5, refer to Figure 7 As shown, the network interface card 5 may include: a processor 51, a memory 52, and a communication bus 53, wherein:
[0178] Communication bus 53 is used to realize the communication connection between processor 51 and memory 52;
[0179] The processor 51 is used to execute the data transfer program in the memory 52 to perform the following steps:
[0180] The data to be transmitted is obtained through multiple virtual function interfaces corresponding to the first physical function device of the network card;
[0181] Based on basic information related to the data to be transmitted, the target network port is determined from multiple network ports corresponding to the second physical function device of the network card; wherein, the first physical function device does not have a corresponding relationship with the network port of the network card;
[0182] Send the data to be transmitted to the target device through the target network port.
[0183] In other embodiments of this application, the processor 51 is used to execute the data transmission program in the memory 52 to obtain the data to be transmitted through multiple virtual function interfaces corresponding to the first physical function device of the network card, so as to achieve the following steps:
[0184] Obtain the target address of the virtual machine's target storage region;
[0185] Data to be transmitted is obtained from the virtual machine based on the target address through multiple virtual function interfaces.
[0186] In other embodiments of this application, the processor 51 is used to execute the data transfer program in the memory 52 to determine the target network port from multiple network ports corresponding to the second physical function device of the network card based on basic information related to the data to be transferred, so as to implement the following steps:
[0187] Based on the data processing strategy and basic information in the target flow table, candidate network interfaces are determined from multiple network interfaces;
[0188] Determine the working status of the candidate network ports;
[0189] Based on the working status, the target network port is determined from multiple network ports.
[0190] In other embodiments of this application, the processor 51 is used to execute a data transfer program in the memory 52 based on its operating state to determine a target network port from a plurality of network ports in order to perform the following steps:
[0191] If the working status is normal, determine the candidate network interface as the target network interface;
[0192] If the working status is abnormal, the target network port is determined from the network ports other than the candidate network ports.
[0193] In other embodiments of this application, processor 51 is used to execute a data transfer program in memory 52 to perform the following steps:
[0194] Establish a mapping relationship between the second physical functional device and multiple network ports;
[0195] A target instruction carrying the first device identifier and mapping relationship of the second physical function device is sent to the first server, so that the first server configures the parameters of the target logical interfaces corresponding to multiple network ports based on the target instruction and the interface configuration information input by the user, and configures the parameters of the second physical function device based on the parameters of the target logical interfaces.
[0196] In other embodiments of this application, processor 51 is used to execute a data transfer program in memory 52 to perform the following steps:
[0197] Obtain user-inputted instruction information; wherein the instruction information carries a second device identifier of the first physical functional device;
[0198] Multiple virtual function interfaces are generated based on instruction information through the first physical functional device.
[0199] In other embodiments of this application, processor 51 is used to execute a data transfer program in memory 52 to perform the following steps:
[0200] Send configuration information for multiple virtual function interfaces to the first server;
[0201] The target flow table is received by the first server through the target forwarding plane; wherein the target flow table is obtained by the first server after converting the initial flow table sent by the second server; the initial flow table is determined by the second server based on the configuration information sent by the first server.
[0202] It should be noted that a detailed description of the steps performed by the processor can be found in [reference needed]. Figures 1-2 The data transmission method provided in the embodiment corresponding to 5 will not be described again here.
[0203] The network interface card provided in the embodiments of this application only affects the corresponding second physical function (PF) device when the network port is in operation, and will not affect the first physical function (PF) device that does not have a corresponding relationship with it. Therefore, it will not affect the multiple virtual function (VF) interfaces corresponding to the first physical function (PF) device. In other words, even if a network port fails, the virtual function (VF) interface can still work normally to obtain the data to be transmitted and forward the data through other network ports. This is unlike the related technologies where the corresponding VF interface cannot work normally as long as the network port fails. This solves the problem in the related technologies where the working state of the VF interface is affected by the working state of the network port when transmitting data, thereby improving the data transmission efficiency.
[0204] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.
[0205] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data transfer apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data transfer apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0206] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data transmission device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0207] These computer program instructions may also be loaded onto a computer or other programmable data transmission device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0208] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A data transmission method, characterized in that, The method includes: Data to be transmitted is obtained through multiple virtual function interfaces corresponding to the first physical function device of the network card; Based on basic information related to the data to be transmitted, a target network port is determined from multiple network ports corresponding to the second physical function device of the network card; wherein, the first physical function device and the network port of the network card do not have a corresponding relationship. The data to be transmitted is sent to the target device through the target network port.
2. The method according to claim 1, characterized in that, The process of obtaining the data to be transmitted through multiple virtual function interfaces corresponding to the first physical function device of the network card includes: Obtain the target address of the virtual machine's target storage region; The data to be transmitted is obtained from the virtual machine based on the target address through the multiple virtual function interfaces.
3. The method according to claim 1, characterized in that, The step of determining the target network port from multiple network ports corresponding to the second physical function device of the network card based on basic information related to the data to be transmitted includes: Based on the data processing strategy in the target flow table and the basic information, candidate network interfaces are determined from the plurality of network interfaces; Determine the working status of the candidate network ports; Based on the operating status, the target network port is determined from the plurality of network ports.
4. The method according to claim 3, characterized in that, The step of determining the target network port from the plurality of network ports based on the working state includes: If the working status is normal, the candidate network port is determined to be the target network port; If the working status is abnormal, the target network port is determined from the network ports other than the candidate network ports among the plurality of network ports.
5. The method according to claim 1, characterized in that, The method further includes: Establish a mapping relationship between the second physical functional device and the plurality of network ports; A target instruction carrying the first device identifier of the second physical function device and the mapping relationship is sent to the first server, so that the first server configures the parameters of the target logical interfaces corresponding to the multiple network ports based on the target instruction and the interface configuration information input by the user, and configures the parameters of the second physical function device based on the parameters of the target logical interfaces.
6. The method according to claim 1, characterized in that, The method further includes: Obtain user-inputted instruction information; wherein, the instruction information carries a second device identifier of the first physical functional device; The first physical functional device generates the plurality of virtual functional interfaces based on the instruction information.
7. The method according to claim 3, characterized in that, The method further includes: Send the configuration information of the multiple virtual function interfaces to the first server; The target flow table is received by the first server through the target forwarding plane; wherein the target flow table is obtained by the first server after converting the initial flow table sent by the second server; the initial flow table is determined by the second server based on the configuration information sent by the first server.
8. A data transmission device, characterized in that, The device includes: The acquisition unit is used to acquire data to be transmitted through multiple virtual function interfaces corresponding to the first physical function device of the network card. The determining unit is configured to determine a target network port from multiple network ports corresponding to the second physical function device of the network card based on basic information related to the data to be transmitted; wherein the first physical function device does not have a corresponding relationship with the network port of the network card; The sending unit is used to send the data to be transmitted to the target device through the target network port.
9. A network interface card (NIC), characterized in that, The network interface card includes: a processor, a memory, and a communication bus; The communication bus is used to realize the communication connection between the processor and the memory; The processor is used to execute a data transfer program in the memory to implement the steps of the data transfer method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the steps of the data transmission method as described in any one of claims 1 to 7.
11. A computer program product, the computer program product comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1 to 7.