Data transmission equipment, method and device, electronic equipment and medium

By introducing the NETDEVICE driver module in MCTP over PCIE for packet conversion and transmission, the problems of code redundancy and low reuse rate are solved, and software development efficiency and design reliability are improved.

CN118981310AActive Publication Date: 2024-11-19NETTRIX INFORMATION IND CO LTD

Patent Information

Application Number
CN202411011861.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-11-19
Estimated Expiration
2044-07-26

AI Technical Summary

Technical Problem

During the implementation of traditional MCTP over PCIE, there is redundant code development, resulting in low reuse rate of software design and prolonged software development cycle, which affects the compatibility and scalability of software design.

Method used

By providing a data transmission device, including an application module, a user service module and a NETDEVICE driver module, the user service module forwards the data transmission request of the application module to the NETDEVICE driver module, and the NETDEVICE driver module acquires the data packet to be transferred and converts it. In order to meet the target data packets that are recognized by the receiving end, it is transmitted to the receiving end, and there is no need to deploy the HAL layer for each application to realize data transmission and format conversion.

Benefits of technology

It greatly improves the reuse rate of code, reduces code redundancy, accelerates the software development cycle, and increases the reliability and transmission accuracy of software design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118981310A_ABST
    Figure CN118981310A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides data transmission equipment, a data transmission method, a data transmission device, electronic equipment and a medium, which are used for solving the problem in the prior art that code redundancy development is increased and the reuse rate of software design is influenced. A user service module in the equipment forwards a received data transmission request sent by any target application program in an application program module to an NETDEVICE driving module; and after receiving a data transmission request sent by any target application program, the NETDEVICE driving module acquires a data packet to be transmitted based on the data transmission request, converts the data packet to be transmitted into a target data packet meeting the identification format requirement of the receiving end, and transmits the target data packet to the receiving end. Data transmission and format conversion of any application program are achieved through the NETDEVICE driving module, an HAL layer does not need to be deployed for each application program, the code reuse rate is increased, code redundancy is reduced, the software development period is accelerated, and the software design reliability is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a data transmission device, method, apparatus, electronic device and medium. Background Art

[0002] The Baseboard Management Controller (BMC) is responsible for monitoring and managing the status of server hardware. Through the Management Component Transport Protocol (MCTP) over the high-speed serial computer expansion bus standard (Peripheral Component Interconnect Express, PCIE), the BMC can communicate with various components inside the server more efficiently to achieve real-time monitoring and remote management.

[0003] At present, the implementation process of MCTP over PCIE is: the MCTP controller is integrated as an independent IP core into the commonly used BMC controller system-on-chip (System On a Chip, SOC) chip, so as to encapsulate the received physical link PCIE data into MCTP packets (MCTP packets) and place them in the first-in-first-out queue (FIFO) of the SOC. The process of different component monitoring applications on the software transmitting data through the MCTP controller driver module is as follows: Figure 1 As shown, for different component monitoring applications on the software, a corresponding hardware abstraction layer (HAL) layer is deployed, and the MCTP controller driver module is operated through the service (service) of the HAL layer corresponding to the component monitoring application, and the control information transmitted through the system call function (input / output control, ioctl) of data input and output, and the vendor-defined information (Vendor Defined Message, VDM) business data (i.e., Figure 1 However, this method of deploying HAL layer services for each component monitoring application will increase code redundancy development, resulting in the need for specific software design in specific scenarios, low software design reuse rate, extended software development cycle, increased problem debugging complexity, and seriously affected the compatibility and scalability of software design.

[0004] In summary, the traditional implementation process of MCTP over PCIE prolongs the software development cycle, which affects the reuse rate of software design. Summary of the invention

[0005] The embodiments of the present application provide a data transmission device, method, apparatus, electronic device and medium to solve the problem in the prior art of increasing code redundant development and affecting the reuse rate of software design.

[0006] In a first aspect, the present application provides a data transmission device, the data transmission device comprising an application module, a user service module and a network device NETDEVICE driver module;

[0007] The user service module is used to forward a data transmission request sent by any target application in the application module to the NETDEVICE driver module;

[0008] The NETDEVICE driver module is used to, after receiving a data transmission request sent by any target application, obtain the data packet to be transmitted based on the data transmission request, convert the data packet to be transmitted into a target data packet that meets the format recognition requirements of the receiving end, and transmit the target data packet to the receiving end.

[0009] Through the above method, the data transmission and format conversion of any application can be realized through the NETDEVICE driver module, without the need to deploy the HAL layer for each application, which greatly improves the code reuse rate, reduces code redundancy, speeds up the software development cycle, and increases the reliability of software design.

[0010] In a possible implementation, the device further includes: a management component transport protocol controller MCTPcontroller driver module;

[0011] The NETDEVICE driver module is specifically configured to, after receiving a sending request sent by any target application, obtain a socket buffer SKB data packet sent by the target application carried in the sending request, convert the SKB data packet into a target MCTP data packet, and send the target MCTP data packet carrying the destination address information to the MCTP controller driver module;

[0012] The MCTP controller driver module is used to forward the target MCTP data packet to a receiving end corresponding to the destination address information.

[0013] In the above manner, if the data transmission request is a send request, the NETDEVICE driver module converts the SKB data packet carried in the send request into a target MTCP data packet after receiving the send request, and sends the target MTCP data packet to the MCTP controller driver module. There is no need to deploy the HAL layer for each application. The data packet carried in the send request is sent to the MCTP controller driver module through the corresponding HAL layer, which further improves the code reuse rate, reduces code redundancy, and increases the reliability of software design.

[0014] In a possible implementation, the NETDEVICE driver module is specifically used to verify the SKB data packet after acquiring the SKB data packet, determine whether the SKB data packet is a valid SKB data packet, and if so, convert the valid SKB data packet into a target MCTP data packet.

[0015] Through the above method, the validity of the SKB data packet is verified, the valid SKB data packet is subsequently processed and transmitted, and the invalid SKB data packet is filtered, which can improve the transmission accuracy and reduce the waste of computing resources.

[0016] In a possible implementation, the NETDEVICE driver module is specifically used to determine whether the number of bytes contained in each field in the SKB data packet meets the required number of each field of the preset SKB data packet. If so, the SKB data packet is determined to be a valid SKB data packet; if not, the SKB data packet is determined to be a non-valid SKB data packet.

[0017] In the above manner, whether the SKB data packet is a valid data packet is determined according to the data format requirements of the valid SKB data packet including the required number of each field of the preset SKB data packet, thereby further improving the accuracy of transmission.

[0018] In a possible implementation, the device further includes: a management component transport protocol controller MCTPcontroller driver module;

[0019] The NETDEVICE driver module is specifically configured to, after receiving a receiving request sent by any target application, send the source address information and the identification information of the target application carried in the receiving request to the MCTPcontroller driver module;

[0020] The MCTP controller driver module is configured to receive the source address information and the identification information of the target application, obtain the MCTP data packet sent by the sender corresponding to the source address information, and send the MCTP data packet to the NETDEVICE driver module; wherein the MCTP data packet carries the identification information of the target application;

[0021] The NETDEVICE driver module is specifically used to convert the MCTP data packet into a target SKB data packet, and send the target SKB data packet carrying the identification information of the target application to the user service module;

[0022] The user service module is further used to forward the target SKB data packet to the target application in the application module according to the identification information of the target application.

[0023] Through the above method, if the data transmission request is a receive request, the NETDEVICE driver module converts the obtained MCTP data packet into a target SKB data packet after receiving the receive request, and sends the target SKB data packet to the target application in the application module. There is no need to deploy the HAL layer for each application. The data packet sent by the sender is sent to the target application through the corresponding HAL layer, which further improves the code reuse rate, reduces code redundancy, and increases the reliability of software design.

[0024] In a possible implementation, the NETDEVICE driver module is specifically used to verify the MCTP data packet after acquiring the MCTP data packet, determine whether the MCTP data packet is a legitimate MCTP data packet, and if so, convert the legitimate MCTP data packet into a target SKB data packet.

[0025] Through the above method, the legitimacy of the MCTP data packets is verified, the legal MCTP data packets are subsequently processed and transmitted, and the illegal MCTP data packets are filtered, which can improve the transmission accuracy and reduce the waste of computing resources.

[0026] In a possible implementation, the NETDEVICE driver module is specifically configured to determine whether the number of bytes contained in each field in the MCTP data packet meets the required number of each field of the preset MCTP data packet; if so, the MCTP data packet is determined to be a legal MCTP data packet; if not, the MCTP data packet is determined to be a non-legal MCTP data packet.

[0027] Through the above method, whether the MCTP data packet is a legal data packet is determined according to the data format requirements of the legal MCTP data packet including the required number of each field of the preset MCTP data packet, thereby further improving the accuracy of transmission.

[0028] In a second aspect, the present application provides a data transmission method, which has the function of implementing the behavior of the data transmission device in the first aspect above. The beneficial effects can be found in the description of the first aspect and will not be repeated here. The data transmission method includes:

[0029] Receive data transfer requests sent by any target application;

[0030] Based on the data transmission request, obtaining a data packet to be transmitted;

[0031] The data packet to be transmitted is converted into a target data packet that meets the format recognition requirement of the receiving end, and the target data packet is transmitted to the receiving end.

[0032] In a possible implementation manner, if the data transmission request is a sending request, obtaining a data packet to be transmitted based on the data transmission request includes:

[0033] After receiving a sending request sent by any target application, obtain the SKB data packet sent by the target application carried in the sending request;

[0034] Convert the data packet to be transmitted into a target data packet that meets the format recognition requirements of the receiving end, and transmit the target data packet to the receiving end, including:

[0035] The SKB data packet is converted into a target MCTP data packet, and the target MCTP data packet carrying the destination address information is sent to the MCTP controller driver module, so that the MCTP controller driver module forwards the target MCTP data packet to the receiving end corresponding to the destination address information.

[0036] In a possible implementation, converting the SKB packet into a target MCTP packet includes:

[0037] After obtaining the SKB data packet, the SKB data packet is verified to determine whether the SKB data packet is a valid SKB data packet. If so, the valid SKB data packet is converted into a target MCTP data packet.

[0038] In a possible implementation manner, determining whether the SKB data packet is a valid SKB data packet includes:

[0039] Determine whether the number of bytes contained in each field in the SKB data packet meets the required number of each field of the preset SKB data packet. If so, determine the SKB data packet as a valid SKB data packet; if not, determine that the SKB data packet is not a valid SKB data packet.

[0040] In a possible implementation manner, if the data transmission request is a receiving request, obtaining the data packet to be transmitted based on the data transmission request includes:

[0041] After receiving a receiving request sent by any target application, the source address information and the identification information of the target application are sent to the MCTPcontroller driver module according to the source address information and the identification information of the target application carried in the receiving request;

[0042] Receive an MCTP data packet sent by the MCTP controller driver module and obtained from the source address information; wherein the MCTP data packet carries identification information of the target application;

[0043] Convert the data packet to be transmitted into a target data packet that meets the format recognition requirements of the receiving end, and transmit the target data packet to the receiving end, including:

[0044] The MCTP data packet is converted into a target SKB data packet, and the target SKB data packet carrying the identification information of the target application is sent to the user service module, so that the user service module forwards the target SKB data packet to the target application in the application module according to the identification information of the target application.

[0045] In a possible implementation, converting the MCTP data packet into a target SKB data packet includes:

[0046] After obtaining the MCTP data packet, the MCTP data packet is verified to determine whether the MCTP data packet is a legitimate MCTP data packet. If so, the legitimate MCTP data packet is converted into a target SKB data packet.

[0047] In a possible implementation, determining whether the MCTP data packet is a valid MCTP data packet includes:

[0048] Determine whether the number of bytes contained in each field in the MCTP data packet meets the required number of each field of the preset MCTP data packet. If so, determine the MCTP data packet as a legal MCTP data packet; if not, determine that the MCTP data packet is not a legal MCTP data packet.

[0049] In a third aspect, the present application provides a data transmission device, which has the function of implementing the behavior of the electronic device in the method embodiment of the second aspect above. The beneficial effects can be found in the description of the second aspect and will not be repeated here. The data transmission device includes:

[0050] A receiving module, used for receiving a data transmission request sent by any target application;

[0051] An acquisition module, used for acquiring a data packet to be transmitted based on the data transmission request;

[0052] The conversion module is used to convert the data packet to be transmitted into a target data packet that meets the format recognition requirements of the receiving end, and transmit the target data packet to the receiving end.

[0053] In a fourth aspect, the present application further provides an electronic device, comprising at least a processor and a memory, wherein the processor is configured to implement the steps of the data transmission method as described in any one of the second aspects when executing a computer program stored in the memory.

[0054] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer performs the steps of the data transmission method as described in any one of the second aspects.

[0055] In a sixth aspect, an embodiment of the present application provides a computer program product, which includes: a computer program code, which, when executed on a computer, enables the computer to execute the steps of the data transmission method as described in any one of the second aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0057] Figure 1 Schematic diagram of the data transmission process of different component monitoring applications through the MCTP controller driver module;

[0058] Figure 2 A schematic diagram of the structure of a data transmission device provided in an embodiment of the present application;

[0059] Figure 3A schematic diagram of a data packet sending process of a NETDEVICE driver module provided in an embodiment of the present application;

[0060] Figure 4 A schematic diagram of a data packet receiving process of a NETDEVICE driver module provided in an embodiment of the present application;

[0061] Figure 5 A second structural diagram of a data transmission device provided in an embodiment of the present application;

[0062] Figure 6 An abstract functional schematic diagram of a NETDEVICE driver module provided in an embodiment of the present application;

[0063] Figure 7 A schematic diagram of a NETDEVICE driver module initialization process provided in an embodiment of the present application;

[0064] Figure 8 A schematic diagram of a data transmission process provided in an embodiment of the present application;

[0065] Fig. 9 A schematic diagram of a data transmission process provided in an embodiment of the present application;

[0066] Fig.10 A schematic diagram of the structure of a data transmission device provided in an embodiment of the present application;

[0067] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0068] In order to make the purpose and implementation method of the present application clearer, the exemplary implementation method of the present application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only part of the embodiments of the present application, rather than all the embodiments.

[0069] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.

[0070] The terms "first", "second", "third", etc. in the specification and claims of this application and the above drawings are used to distinguish similar or similar objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise noted. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances.

[0071] The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device comprising a list of components is not necessarily limited to all the components expressly listed but may include other components not expressly listed or inherent to such product or device.

[0072] The term "module" refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code that is capable of performing the functions associated with that element.

[0073] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

[0074] For the convenience of explanation, the above description has been made in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or limit the embodiments to the specific forms disclosed above. Based on the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are to better explain the principles and practical applications, so that those skilled in the art can better use the embodiments and various different variations of the embodiments suitable for specific use considerations.

[0075] The embodiment of the present application provides a data transmission device, method, apparatus, electronic device and medium, the data transmission device includes an application module, a user service module and a NETDEVICE driver module; the user service module is used to forward the data transmission request sent by the application module to the NETDEVICE driver module; the NETDEVICE driver module is used to obtain the data packet to be transmitted based on the data transmission request after receiving the data transmission request, and convert the data packet to be transmitted into a target data packet that meets the format recognition requirements of the receiving end, and transmit the target data packet to the receiving end. In the embodiment of the present application, the data transmission and format conversion of any application are realized through the NETDEVICE driver module, and there is no need to deploy the HAL layer for each application, which greatly improves the code reuse rate, reduces code redundancy, speeds up the software development cycle, and increases the reliability of software design.

[0076] Embodiment 1:

[0077] Figure 2A schematic diagram of the structure of a data transmission device provided in an embodiment of the present application, the data transmission device includes an application module 21, a user service module 22 and a NETDEVICE driver module 23;

[0078] The user service module 22 is used to forward the data transmission request sent by any target application in the application module 21 to the NETDEVICE driver module 23;

[0079] The NETDEVICE driver module 23 is used to obtain the data packet to be transmitted based on the data transmission request after receiving the data transmission request sent by any target application, convert the data packet to be transmitted into a target data packet that meets the format recognition requirements of the receiving end, and transmit the target data packet to the receiving end.

[0080] The data transmission device provided in the embodiment of the present application can be deployed in the BMC of the server. The data transmission device includes an application module 21, a user service module 22 and a NETDEVICE driver module 23.

[0081] Among them, the application module 21 may include multiple applications, and the application is a component monitoring application; the user service module 22 may be an MCTP user service program; and the NETDEVICE driver module 23 may be a physical NETDEVICE driver device.

[0082] It is understandable that, since PCIE is currently widely used in modern computer systems to connect motherboards and various high-speed peripheral devices, such as network interfaces, storage devices, etc., and as the demand for data centers and high-performance computing (HPC) grows, the demand for high-speed data transmission also increases, and PCIE provides high-bandwidth and low-latency data transmission capabilities, so it is suitable for transmitting large amounts of data and management information. In addition, MCTP is a protocol independent of a specific bus and can be implemented on a variety of physical layers. By applying MCTP to the PCIE bus, the interoperability of different manufacturers and devices can be ensured, and the complexity of protocol management can be simplified. The design of the PCIE bus allows the connection of multiple high-speed external devices, and the system can be expanded by adding more channels, and MCTP over PCIe can flexibly adapt to this scalability, providing plug-and-play management capabilities for newly added devices, and the MCTP protocol supports encryption and authentication mechanisms to ensure the security of transmitted data, so that when MCTP is implemented on the PCIe bus, these security features help protect management communications from unauthorized access and data leakage. Therefore, in order to be applicable to server and data center environments that require high-speed data transmission and complex system management, the data transmission device provided in the embodiment of the present application is used to implement kernel MCTP over PCIe.

[0083] Furthermore, the current related technologies require software designers to understand the communication details, and the required knowledge breadth and accumulation are high, and the development difficulty is high. However, when using the data transmission device provided in the embodiment of the present application to implement kernel MCTP over PCIE, business developers only need to understand general network program development skills and no longer need to care about the communication details of the VDM datagram.

[0084] Specifically, in the embodiment of the present application, any target application in the application module 21 sends a data transmission request corresponding to the target application to the user service module 22; the data transmission request can be a sending request or a receiving request.

[0085] After receiving a data transmission request sent by any target application in the application module 21, the user service module 22 directly forwards the data transmission request to the NETDEVICE driver module 23 in one possible implementation; in another possible implementation, the data transmission request is then forwarded to the NETDEVICE driver module 23 via other modules in the data transmission device. For example, the other modules may be general network protocol stack modules, etc., which are not limited here.

[0086] After receiving a data transmission request sent by any target application, the NETDEVICE driver module 23 obtains the data packet to be transmitted based on the data transmission request. Therefore, the NETDEVICE driver module 23 provided by the embodiment of the present application can implement the data transmission and other processing processes of any different target application.

[0087] In a possible implementation, if the data transmission request is a sending request, and the sending request carries a data packet to be transmitted sent by the target application, the NETDEVICE driver module 23 obtains the data packet to be transmitted carried in the sending request.

[0088] In another possible implementation, if the data transmission request is a receiving request, and the receiving request carries source address information, the NETDEVICE driver module 23 obtains the data packet to be transmitted sent by the sending end corresponding to the source address information.

[0089] After acquiring the data packet to be transmitted, the NETDEVICE driver module 23 determines the receiving end corresponding to the data packet to be transmitted according to the type of data transmission request and the destination address information carried in the data packet to be transmitted.

[0090] According to the data type of the data packet to be transmitted and the correspondence between the stored data types and the receiving end identification format requirements, the receiving end identification format requirements corresponding to the data transmission request are determined.

[0091] For example, the saved data type and the receiving end recognition format requirements include: if the data type of the data packet to be transmitted is a socket buffer (SKB) data packet, the corresponding receiving end recognition format requirement is to convert the SKB data packet into an MCTP data packet format, thereby facilitating the conversion of the data packet to be transmitted into data in a format that can be recognized by the receiving end; if the data type of the data packet to be transmitted is an MCTP data packet, the corresponding receiving end recognition format requirement is to convert the MCTP data packet into an SKB data packet format, thereby facilitating the conversion of the data packet to be transmitted obtained from the sending end into data in a format that can be recognized by the application module 21.

[0092] After determining the receiving end identification format requirement corresponding to the data transmission request, the NETDEVICE driver module 23 converts the data packet to be transmitted according to the receiving end identification format requirement to obtain a target data packet that meets the receiving end identification format requirement. According to the receiving end corresponding to the data packet to be transmitted, the converted target data packet is transmitted to the receiving end.

[0093] In the embodiment of the present application, the data transmission and format conversion of any application is realized through the NETDEVICE driver module, and there is no need to deploy the HAL layer service for each component monitoring application, which greatly improves the code reuse rate, reduces code redundancy, speeds up the software development cycle, and increases the reliability of software design.

[0094] Embodiment 2:

[0095] In order to further improve the reuse rate of the code, on the basis of the above embodiment, in the embodiment of the present application, the data transmission device further includes: an MCTP controller driving module 24;

[0096] The NETDEVICE driver module 23 is specifically configured to, after receiving a sending request sent by any target application, obtain an SKB data packet sent by the target application carried in the sending request, convert the SKB data packet into a target MCTP data packet, and send the target MCTP data packet carrying the destination address information to the MCTP controller driver module 24;

[0097] The MCTP controller driver module 24 is used to forward the target MCTP data packet to the receiving end corresponding to the destination address information.

[0098] In the embodiment of the present application, if the data transmission request sent by any target application is a send request, the send request carries an SKB data packet sent by the target application, and the SKB data packet carries the destination address information. After receiving the send request, the NETDEVICE driver module 23 obtains the SKB data packet carried in the send request and stores the SKB data packet in the send queue of the NETDEVICE driver module 23.

[0099] The data conversion submodule included in the NETDEVICE driver module 23 will wait whether there is an SKB data packet in the sending queue. If there is, the data conversion submodule in the NETDEVICE driver module 23 will obtain the SKB data packet in the sending queue.

[0100] In the embodiment of the present application, the data transmission device further includes an MCTP controller driver module 24, and the data packet carried in the sending request will be transmitted to the receiving end via the MCTP controller driver module 24, and the MCTP controller driver module 24 cannot recognize the data packet in the SKB format. Therefore, after obtaining the SKB data packet, the data conversion submodule of the NETDEVICE driver module 23 parses the SKB data packet in order to send the SKB data packet to the MCTP controller driver module 24, and combines the first transmission header information, the first link header information, and the first payload information contained in the SKB data packet obtained by the parsing according to the recognition format requirements of the MCTP controller driver module 24 to obtain the converted target MCTP data packet. Among them, since the SKB data packet before conversion carries the destination address information, the target MCTP data packet obtained after the SKB data packet is converted also carries the destination address information.

[0101] After obtaining the target MCTP data packet, the sending thread of the NETDEVICE driver module 23 calls the sending function corresponding to the MCTPcontroller driver module 24, and sends the target MCTP data packet carrying the destination address information to the MCTP controller driver module 24 through the sending function.

[0102] After receiving the target MCTP data packet carrying the destination address information, the MCTP controller driver module 24 sends the target MCTP data packet to the receiving end corresponding to the destination address information through the PCIE bus connected to the MCTP controller driver module 24, thereby completing the SKB data packet sent by any target application being processed by the NETDEVICE driver module 23 and forwarded by the MCTP controller driver module 24, and then transmitted to the corresponding receiving end. The receiving end may be a high-speed external device connected to the BMC of the server, such as a network card, a disk array (Redundant Arrays of Independent Disks, RAID) card, PCIE, a switch, and other devices.

[0103] In an embodiment of the present application, if the data transmission request is a send request, the NETDEVICE driver module converts the SKB data packet carried in the send request into a target MTCP data packet after receiving the send request, and sends the target MTCP data packet to the MCTP controller driver module. There is no need to deploy a HAL layer for each application. The data packet carried in the send request is sent to the MCTP controller driver module through the corresponding HAL layer, which further improves the code reuse rate, reduces code redundancy, and increases the reliability of software design.

[0104] Embodiment 3:

[0105] In order to improve the transmission accuracy, based on the above embodiments, in the embodiment of the present application, the NETDEVICE driver module 23 is specifically used to verify the SKB data packet after obtaining the SKB data packet, determine whether the SKB data packet is a valid SKB data packet, and if so, convert the valid SKB data packet into a target MCTP data packet.

[0106] In the embodiment of the present application, the data format requirements of the valid SKB data packet are stored in the NETDEVICE driver module 23.

[0107] After the NETDEVICE driver module 23 obtains the SKB data packet stored in the sending queue, in order to avoid wasting resources by transmitting invalid SKB data packets, in an embodiment of the present application, the verification submodule in the NETDEVICE driver module 23 verifies the validity of the SKB data packet according to the data format requirements of the valid SKB data packet, and determines whether the SKB data packet is a valid SKB data packet.

[0108] If the SKB data packet is a valid SKB data packet, the data conversion submodule in the NETDEVICE driver module 23 converts the valid SKB data packet into a target MCTP data packet, thereby sending the target MCTP data packet to the MCTPcontroller driver module 24.

[0109] If the SKB data packet is not a valid SKB data packet, the non-valid SKB data packet is filtered, and the sending queue of the NETDEVICE driver module 23 continues to wait whether there is a SKB data packet stored in the sending queue. When it is identified that there is a SKB data packet stored in the sending queue, the verification submodule in the NETDEVICE driver module 23 continues to determine whether the SKB data packet is a valid SKB data packet.

[0110] In addition, it can be understood that, in another possible implementation, if the NETDEVICE driver module 23 fails to receive the sending request, it is determined that the SKB data packet carried in the unsuccessfully received sending request is not a valid SKB data packet.

[0111] In the embodiment of the present application, the validity of the SKB data packet is verified, the valid SKB data packet is subsequently processed and transmitted, and the invalid SKB data packet is filtered, which can improve the transmission accuracy and reduce the waste of computing resources.

[0112] Embodiment 4:

[0113] In order to further improve the transmission accuracy, based on the above embodiments, in the embodiment of the present application, the NETDEVICE driver module 23 is specifically used to determine whether the number of bytes contained in each field in the SKB data packet meets the required number of each field of the preset SKB data packet. If so, the SKB data packet is determined to be a valid SKB data packet; if not, the SKB data packet is determined to be a non-valid SKB data packet.

[0114] In the embodiment of the present application, the data format requirement of the valid SKB data packet saved by the NETDEVICE driver module 23 includes the required number of each field of the preset SKB data packet.

[0115] Therefore, the verification submodule of the NETDEVICE driver module 23 obtains the number of bytes contained in each field in the SKB data packet, and determines whether the number of bytes contained in each field in the SKB data packet obtained from the sending request meets the preset number of bytes required for each field in the SKB data packet according to the data format requirements of the valid SKB data packet. If so, the SKB data packet is determined to be a valid SKB data packet; if not, the SKB data packet is determined to be a non-valid SKB data packet.

[0116] Among them, the general network protocol stack module in the data transmission device will record the length information of each field in the SKB data packet, such as the physical layer header information (Media Access Control header len, mac_header_len), the transmission header data length (transport_header_len), the non-linear data length (data_len), etc., and send the recorded length information of each field in the SKB data packet to the NETDEVICE driver module 23; therefore, in an embodiment of the present application, the verification submodule of the NETDEVICE driver module 23 obtains the number of bytes contained in each field in the SKB data packet recorded in the general network protocol stack module.

[0117] In the embodiment of the present application, whether the SKB data packet is a valid data packet is determined based on the data format requirements of the valid SKB data packet including the required number of each field of the preset SKB data packet, thereby further improving the accuracy of transmission.

[0118] Based on the above embodiments, Figure 3 The data packet sending process of the NETDEVICE driver module is shown, including:

[0119] Step 1: The NETDEVICE driver module waits to see if there is a valid SKB data packet in the sending queue. If so, execute step 2; if not, continue to execute step 1.

[0120] Step 2: Take out the valid SKB data packet from the sending queue.

[0121] Step 3: The data conversion submodule of the NETDEVICE driver module parses the valid SKB data packet to obtain the first transmission header information, the first link header information, and the first payload information contained in the valid SKB data packet.

[0122] Step 4: Combine the first transmission header information, the first link header information, and the first payload information contained in the valid SKB data packet according to the MCTP controller driver module recognition format requirement, that is, according to the MCTP data format requirement, to obtain a target MCTP data packet corresponding to the valid SKB data packet.

[0123] Step 5: The sending thread of the NETDEVICE driver module calls the sending function corresponding to the MCTP controller driver module, sends the target MCTP data packet to the MCTP controller driver module through the sending function, and re-executes step 1.

[0124] Embodiment 5:

[0125] In order to further improve the reuse rate of the code, on the basis of the above embodiments, in the embodiment of the present application, the device further includes: a management component transport protocol controller MCTP controller driver module 24;

[0126] The NETDEVICE driver module 23 is specifically configured to send the source address information and the identification information of the target application to the MCTP controller driver module 24 according to the source address information and the identification information of the target application carried in the receiving request after receiving the receiving request sent by any target application;

[0127] The MCTP controller driver module 24 is used to receive the source address information and the identification information of the target application, obtain the MCTP data packet sent by the sender corresponding to the source address information, and send the MCTP data packet to the NETDEVICE driver module 23; wherein the MCTP data packet carries the identification information of the target application;

[0128] The NETDEVICE driver module 23 is specifically used to convert the MCTP data packet into a target SKB data packet, and send the target SKB data packet carrying the identification information of the target application to the user service module 22;

[0129] The user service module 22 is further configured to forward the target SKB data packet to the target application in the application module 21 according to the identification information of the target application.

[0130] In an embodiment of the present application, if the data transmission request sent by any target application is a receiving request, the receiving request carries source address information and identification information of the target application (i.e., identification information of the recipient); wherein the target application is the recipient of the receiving request.

[0131] After receiving the receiving request, the NETDEVICE driving module 23 obtains the source address information and the identification information of the target application program carried in the receiving request.

[0132] Since in the embodiment of the present application, the data transmission device also includes an MCTP controller driver module 24, and the sending end corresponding to the source address information needs to transfer the data packet to be transmitted to the MCTP controller driver module 24 through the PCIE bus connected to the MCTP controller driver module 24, and then sequentially passes through the MCTP controller driver module 24, the NETDEVICE driver module 23, the user service module 22, etc. to reach the application module 21, therefore, in the embodiment of the present application, in order to obtain the data packet to be transmitted from the sending end corresponding to the source address information, the source address information and the identification information of the target application are sent to the MCTP controller driver module 24, so that the MCTP controller driver module 24 can obtain the data packet to be transmitted carrying the identification information of the target application sent by the sending end corresponding to the source address information according to the source address information.

[0133] The sending end may be a high-speed external device connected to the BMC of the server, such as a network card, a RAID card, a PCIE, a switch, and other devices.

[0134] After receiving the source address information, the MCTP controller driver module 24 sends the identification information of the target application to the sending end corresponding to the source address information based on the source address information, so that the sending end sends the MCTP data packet carrying the identification information of the target application to the MCTP controller driver module 24 according to the identification information of the target application; the MCTP controller driver module 24 obtains the MCTP data packet sent by the sending end corresponding to the source address information; wherein the sending end transmits the MCTP data packet to the MCTPcontroller driver module 24 via the PCIE bus transmission connected to the MCTP controller driver module 24.

[0135] The MCTP controller driver module 24 sends the MCTP data packet carrying the identification information of the target application obtained from the sending end to the NETDEVICE driver module 23. The receiving thread of the NETDEVICE driver module 23 calls the receiving function corresponding to the MCTP controller driver module 24, and receives the MCTP data packet through the receiving function.

[0136] Since the application module 21 cannot recognize the data packet in the MCTP format, in order to send the MCTP data packet to the application module 21, the MCTP data packet needs to be converted according to the data format that the recipient (i.e., the application module 21) can recognize. Therefore, in an embodiment of the present application, after receiving the MCTP data packet, the data conversion submodule of the NETDEVICE driver module 23 parses the MCTP data packet, determines the second transmission header information, the second link header information, and the second payload information contained in the MCTP data packet, and combines the second transmission header information, the second link header information, and the second payload information contained in the MCTP data packet according to the recognition format requirements of the application module 21 to obtain the converted target SKB data packet. Among them, since the MCTP data packet before the conversion carries the identification information of the target application (i.e., the identification information of the recipient), the target SKB data packet obtained after the MCTP data packet is converted also carries the identification information of the target application.

[0137] Furthermore, it can be understood that before converting the MCTP data packet into the target SKB data packet, in order to store the target SKB data packet, in the embodiment of the present application, an SKB memory is applied for the MCTP data packet, and the basic parameters corresponding to the SKB memory are initialized, so as to facilitate storing the target SKB data packet obtained after the MCTP data packet is converted into the SKB memory. Among them, applying for the SKB memory and initializing the basic parameters corresponding to the SKB memory are prior arts and will not be described in detail here.

[0138] After obtaining the converted target SKB data packet, the sending thread of the NETDEVICE driver module 23 calls the general network protocol stack sending function, and through the general network protocol stack sending function, the target SKB data packet carrying the identification information of the target application is sent to the user service module 22. In a possible implementation, the NETDEVICE driver module 23 sends the target SKB data packet carrying the identification information of the target application to the user service module 22 via other modules in the data transmission device. For example, the other modules can be general network protocol stack modules, etc., which are not limited here.

[0139] After receiving the target SKB data packet carrying the identification information of the target application, the user service module 22 parses the target SKB data packet, determines the identification information of the target application carried in the target SKB data packet, and forwards the target SKB data packet to the target application of the identification information in the application module based on the identification information of the target application.

[0140] In an embodiment of the present application, if the data transmission request is a receive request, the NETDEVICE driver module converts the acquired MCTP data packet into a target SKB data packet after receiving the receive request, and sends the target SKB data packet to the target application in the application module. There is no need to deploy a HAL layer for each application. The data packet sent by the sender is sent to the target application through the corresponding HAL layer, which further improves the code reuse rate, reduces code redundancy, and increases the reliability of software design.

[0141] Embodiment 6:

[0142] In order to improve the transmission accuracy, based on the above embodiments, in the embodiment of the present application, the NETDEVICE driver module 23 is specifically used to verify the MCTP data packet after obtaining the MCTP data packet, and determine whether the MCTP data packet is a legal MCTP data packet. If so, convert the legal MCTP data packet into a target SKB data packet.

[0143] In the embodiment of the present application, the NETDEVICE driver module 23 stores the data format requirements of the legal MCTP data packets.

[0144] After the NETDEVICE driver module 23 receives the MCTP data packet sent by the MCTP controller driver module 24, in order to avoid wasting resources by transmitting illegal MCTP data packets, in an embodiment of the present application, the verification submodule in the NETDEVICE driver module 23 verifies the legitimacy of the MCTP data packet according to the data format requirements of the legal MCTP data packet, and determines whether the MCTP data packet is a legal MCTP data packet.

[0145] If the MCTP data packet is a legal MCTP data packet, the data conversion submodule in the NETDEVICE driver module 23 converts the legal MCTP data packet into a target SKB data packet, thereby sending the target SKB data packet to the user service module 22.

[0146] If the MCTP data packet is not a legal MCTP data packet, the illegal MCTP data packet is filtered, and the NETDEVICE driver module 23 continues to wait whether a MCTP data packet is transmitted to the NETDEVICE driver module 23. When it is identified that a MCTP data packet is transmitted to the NETDEVICE driver module 23, the verification submodule in the NETDEVICE driver module 23 continues to determine whether the MCTP data packet is a legal MCTP data packet.

[0147] In addition, it can be understood that in another possible implementation, if the NETDEVICE driver module 23 fails to successfully receive the receiving request, it is determined that the MCTP data packet carried in the unsuccessfully received receiving request is not a legitimate MCTP data packet.

[0148] In the embodiment of the present application, the legitimacy of the MCTP data packets is verified, the legal MCTP data packets are subsequently processed and transmitted, and the illegal MCTP data packets are filtered, which can improve the transmission accuracy and reduce the waste of computing resources.

[0149] Embodiment 7:

[0150] In order to further improve the transmission accuracy, based on the above embodiments, in the embodiment of the present application, the NETDEVICE driver module 23 is specifically used to determine whether the number of bytes contained in each field in the MCTP data packet meets the required number of each field of the preset MCTP data packet. If so, the MCTP data packet is determined to be a legal MCTP data packet; if not, the MCTP data packet is determined to be a non-legal MCTP data packet.

[0151] In the embodiment of the present application, the data format requirements of the legal MCTP data packet saved by the NETDEVICE driver module 23 include the required number of each field of the preset MCTP data packet.

[0152] Therefore, the verification submodule of the NETDEVICE driver module 23 obtains the number of bytes contained in each field in the MCTP data packet, and determines whether the number of bytes contained in each field in the received MCTP data packet meets the preset number of bytes required for each field of the MCTP data packet according to the data format requirements of the legal MCTP data packet. If so, the MCTP data packet is determined to be a legal MCTP data packet; if not, the MCTP data packet is determined to be an illegal MCTP data packet.

[0153] Among them, since the protocol corresponding to the MCTP data packet stipulates that a specific field in the MCTP data packet (for the convenience of description, the first field is used instead of the specific field below) carries the length information of each field in the data packet, in the embodiment of the present application, the verification submodule of the NETDEVICE driver module 23 parses the MCTP data packet, and obtains the number of bytes contained in each field in the MCTP data packet according to the length information of each field recorded in the first field in the parsed MCTP data packet.

[0154] In the embodiment of the present application, whether the MCTP data packet is a legal data packet is determined based on the data format requirements of the legal MCTP data packet including the required number of each field of the preset MCTP data packet, thereby further improving the accuracy of transmission.

[0155] Based on the above embodiments, Figure 4 The data packet receiving process of the NETDEVICE driver module is shown, including:

[0156] Step 1: The receiving thread of the NETDEVICE driver module calls the receiving function corresponding to the MCTP controller driver module, and receives the MCTP data packet sent by the MCTP controller driver module through the receiving function.

[0157] Step 2: The verification submodule of the NETDEVICE driver module determines whether the received MCTP data packet is a legal MCTP data packet. If so, execute step 3; if not, execute step 1.

[0158] Step 3: The data conversion submodule of the NETDEVICE driver module applies for SKB memory for the MCTP data packet and initializes basic parameters.

[0159] Step 4: Parse the legal MCTP data packet to obtain the second transmission header information, the second link header information, and the second payload information contained in the legal MCTP data packet.

[0160] Step 5: Combine the second transmission header information, the second link header information, and the second payload information contained in the legal MCTP data packet according to the application module identification format requirements, that is, according to the SKB data format requirements, to obtain the target SKB data packet corresponding to the legal MCTP data packet, and store the target SKB data packet in the SKB memory.

[0161] Step 6: If the sending thread of the NETDEVICE driver module recognizes that the target SKB data packet exists in the SKB memory, it calls the general network protocol stack sending function, sends the target SKB data packet to the user service module through the sending function, and repeats step 1.

[0162] Embodiment 8:

[0163] Based on the above embodiments, the present application embodiment provides a second structural diagram of a data transmission device, such as Figure 5 As shown, the data transmission device includes: an application module 51, a user service module 52, a general network protocol stack module 53, a kernel MCTP protocol stack module 54, a NETDEVICE driver module 55 and a MCTP controller driver module 56, and a network connection NETLINK module 57.

[0164] First, based on the data transmission device, the data generation process of the application module 51 is described:

[0165] The application module 51 sends a sending request of any target application to the user service module 52. The sending request carries an original SKB data packet, and the original SKB data packet carries the destination address information.

[0166] After receiving a sending request sent by any target application in the application module 51 , the user service module 52 calls the sys_sendto function to forward the sending request to the general network protocol stack module 53 .

[0167] The general network protocol stack module 53 receives the sending request, and sends the original SKB data packet sent by the target application carried in the sending request to the kernel MCTP protocol stack module 54 through the socket batch sending function (sock_sendmsg).

[0168] After receiving the original SKB data packet, the kernel MCTP protocol stack module 54 creates a NETDEVICE physical link header for the original SKB data packet, determines the SKB data packet to be sent based on the NETDEVICE physical link header and the original SKB data packet sent by the target application, and sends the SKB data packet to be sent to the general network protocol stack module 53.

[0169] After receiving the SKB data packet to be sent sent by the kernel MCTP protocol stack module 54, the general network protocol stack module 53 sends the SKB data packet to be sent and the sending request to the NETDEVICE driver module 55.

[0170] After receiving the SKB data packet to be sent and the sending request, the NETDEVICE driver module 55 stores the SKB data packet to be sent into the sending queue, determines whether the SKB data packet to be sent in the sending queue is a valid SKB data packet, and if so, parses the SKB data packet to be sent, obtains the first transmission header information, the first link header information and the first payload information contained in the SKB data packet to be sent, and combines the first transmission header information, the first link header information and the first payload information contained in the SKB data packet to be sent according to the MCTP data format to obtain the converted target MCTP data packet, and sends the target MCTP data packet carrying the destination address information to the MCTPcontroller driver module 56; if not, continues to wait whether a valid SKB data packet is received.

[0171] After receiving the target MCTP data packet carrying the destination address information, the MCTP controller driver module 56 sends the target MCTP data packet to the receiving end corresponding to the destination address information through the PCIE bus connected to the MCTP controller driver module 56 according to the destination address information.

[0172] Then, based on the data transmission device, the data receiving process of the application module 51 is described:

[0173] The application module 51 sends the receiving request sent by any target application to the NETDEVICE driver module 55 via the user service module 52, the general network protocol stack module 53, and the kernel MCTP protocol stack module 54. The receiving request carries the source address information and the identification information of the target application.

[0174] After receiving the receiving request, the NETDEVICE driver module 55 sends the source address information and the identification information of the target application carried in the receiving request to the MCTP controller driver module 56 according to the source address information and the identification information of the target application carried in the receiving request.

[0175] After receiving the source address information and the identification information of the target application, the MCTP controller driver module 56 determines the sending end corresponding to the source address information, obtains the MCTP data packet carrying the identification information of the target application sent by the sending end corresponding to the source address information, and sends the MCTP data packet to the NETDEVICE driver module 55.

[0176] After receiving the MCTP data packet, the NETDEVICE driver module 55 determines whether the MCTP data packet is a legal MCTP data packet. If so, it applies for SKB memory for the legal MCTP data packet, initializes the basic parameters corresponding to the SKB memory, parses the legal MCTP data packet, obtains the second transmission header information, the second link header information and the second payload information contained in the legal MCTP data packet, converts the second transmission header information, the second link header information and the second payload information contained in the legal MCTP data packet according to the SKB data format, obtains the target SKB data packet carrying the identification information of the target application, and sends the target SKB data packet carrying the identification information of the target application to the general network protocol stack module 53; if not, continues to wait whether a legal MCTP data packet sent by the MCTPcontroller driver module 56 is received.

[0177] After receiving the target SKB data packet carrying the identification information of the target application, the general network protocol stack module 53 forwards the target SKB data packet carrying the identification information of the target application to the MCTP controller driver module 56.

[0178] After receiving the target SKB data packet carrying the identification information of the target application, the MCTP controller driver module 56 parses the target SKB data packet, determines the target socket (socket, sock) corresponding to the target SKB data packet, and transmits the identification information of the target SKB data packet and the target sock to the general network protocol stack module 53.

[0179] The general network protocol stack module 53 determines the target queue corresponding to the target sock based on the identification information of the target sock, and stores the target SKB data packet in the target queue, so that the sending queue of the general network protocol stack module 53 takes out the target SKB data packet from the target queue, and sends the target SKB data packet carrying the identification information of the target application to the user service module 52 through the network protocol family MCTP function (Address FamilyMCTP, AF_MCTP).

[0180] The user service module 52 obtains the identification information of the target application carried in the target SKB data packet, and sends the target SKB data packet to the target application in the application module 51 according to the identification information of the target application.

[0181] In addition, it can be understood that, based on the above embodiments, the NETDEVICE driver module provided in the embodiment of the present application has the ability to connect the data path of the MCTP controller driver module and the general network protocol stack module, and has the ability to convert the SKB data packet recognizable by the general network protocol stack module into the MCTP data packet recognizable by the MCTP controller driver module, and convert the MCTP data packet recognizable by the MCTPcontroller driver module into the SKB data packet recognizable by the general network protocol stack module, thereby realizing the seamless transition of the SKB buffer (SKBBUFFER) of the general network protocol stack module and the MCTP packet of the MCTP controller driver module.

[0182] In the embodiment of the present application, the capabilities of the NETDEVICE driver module are abstracted, and the abstract design is completed using structure definition in software, such as Figure 6 The abstract functional diagram of the NETDEVICE driver module is shown. The NETDEVICE driver module has general network device capabilities (i.e., it can interact with general network protocol stack modules), MCTP device capabilities (i.e., it can interact with MCTPcontroller driver modules), data packet reception processing, data packet transmission processing, data management (including caching and conversion of data packets), and synchronization management. Among them, synchronization management means that data transmission and data reception are two independent processes in the NETDEVICE driver module, and the two processes can be performed concurrently in the NETDEVICE driver module, so data synchronization function is required to cope with concurrent scenarios.

[0183] Furthermore, in order to enable the NETDEVICE driver module to have the above capabilities, in an embodiment of the present application, before data is transmitted through the NETDEVICE driver module, the NETDEVICE driver module is initialized so that the NETDEVICE driver module has the above capabilities.

[0184] like Figure 7 The NETDEVICE driver module initialization process is shown:

[0185] Step 1: The NETDEVICE driver module obtains the MCTP device capability. Specifically, since the MCTPcontroller driver module is actually a controller, in the embodiment of the present application, the NETDEVICE driver module is used as a slave (client) of the controller (i.e., the MCTP controller driver module); and the NETDEVICE driver module is used as the data processor of the host (i.e., the MCTPcontroller driver module), i.e., the default handle, so that all data interaction processes of the host (i.e., the MCTP controller driver module) can be completed through the slave (i.e., the NETDEVICE driver module), so that the NETDEVICE driver module has the ability to interact with the MCTP controller driver module.

[0186] Step 2: The NETDEVICE driver module initializes the general network device capabilities. Specifically, the NETDEVICE driver module initializes the general network device attributes, such as the type of data packet processed, the maximum transmission unit (MUT) of the data packet, the creation operation of the network device physical link header, and because different operations are involved in data processing, it is also necessary to initialize the network device data operation set in the embodiment of the present application, such as the start_xmit and uninit functions for sending data packets, and the open function for opening and creating files.

[0187] Step 3: Create the background process for sending and receiving. Specifically, create a data receiving thread (rx_thread); create a data sending thread (tx_thread).

[0188] Step 4: Data processing and synchronization information initialization: Specifically, the synchronization lock of the sending operation is initialized, the sending SKB queue is initialized, and the sending waiting queue is initialized.

[0189] Embodiment 9:

[0190] Based on the same concept, on the basis of the above embodiments, the present application provides a data transmission method. Figure 8 A schematic diagram of a data transmission process provided for some embodiments of the present application, the process comprising:

[0191] S801: Receive a data transmission request sent by any target application.

[0192] The data transmission method provided in the embodiment of the present application is applied to the NETDEVICE driver module shown in the above embodiments. The NETDEVICE driver module may be a NETDEVICE entity device.

[0193] In a possible implementation, after receiving a data transmission request sent by any target application in the application module, the user service module directly sends the data transmission request to the NETDEVICE driver module, and the NETDEVICE driver module receives the data transmission request directly sent by the user service module.

[0194] In another possible implementation, after receiving a data transmission request sent by any target application in the application module, the user service module forwards the data transmission request to the NETDEVICE driver module via other modules in the data transmission device, and the NETDEVICE driver module receives the data transmission request sent by the user service module and passed through other modules. For example, the other module may be a general network protocol stack module.

[0195] The data transmission request may be a sending request or a receiving request.

[0196] S802: Based on the data transmission request, obtain a data packet to be transmitted.

[0197] In a possible implementation, if the data transmission request is a send request, and the send request carries a data packet to be transmitted sent by the target application, the NETDEVICE driver module obtains the data packet to be transmitted carried in the send request.

[0198] In another possible implementation, if the data transmission request is a receiving request, and the receiving request carries source address information, the NETDEVICE driver module obtains the data packet to be transmitted sent by the sending end corresponding to the source address information.

[0199] S803: Convert the data packet to be transmitted into a target data packet that meets the format recognition requirement of the receiving end, and transmit the target data packet to the receiving end.

[0200] The NETDEVICE driver module determines the receiving end identification format requirement corresponding to the data transmission request according to the data type of the data packet to be transmitted and the correspondence between the stored data types and the receiving end identification format requirement.

[0201] For example, the saved data type and the receiving end recognition format requirements include: if the data type of the data packet to be transmitted is an SKB data packet, the corresponding receiving end recognition format requirement is to convert the SKB data packet into an MCTP data packet format, thereby facilitating the conversion of the data packet to be transmitted into data in a format that can be recognized by the receiving end; if the data type of the data packet to be transmitted is an MCTP data packet, the corresponding receiving end recognition format requirement is to convert the MCTP data packet into an SKB data packet format, thereby facilitating the conversion of the data packet to be transmitted obtained from the sending end into data in a format that can be recognized by the application module.

[0202] After determining the receiving end identification format requirement corresponding to the data transmission request, the NETDEVICE driver module converts the data packet to be transmitted according to the receiving end identification format requirement to obtain a target data packet that meets the receiving end identification format requirement. According to the receiving end corresponding to the data packet to be transmitted, the converted target data packet is transmitted to the receiving end.

[0203] In the embodiment of the present application, the data transmission and format conversion of any application is realized through the NETDEVICE driver module, and there is no need to deploy the HAL layer for each application, which greatly improves the code reuse rate, reduces code redundancy, speeds up the software development cycle, and increases the reliability of software design.

[0204] In order to further improve the reuse rate of the code, on the basis of the above embodiments, in the embodiment of the present application, if the data transmission request is a sending request, then based on the data transmission request, obtaining the data packet to be transmitted includes:

[0205] After receiving a sending request sent by any target application, obtain the SKB data packet sent by the target application carried in the sending request;

[0206] Convert the data packet to be transmitted into a target data packet that meets the format recognition requirements of the receiving end, and transmit the target data packet to the receiving end, including:

[0207] The SKB data packet is converted into a target MCTP data packet, and the target MCTP data packet carrying the destination address information is sent to the MCTP controller driver module, so that the MCTP controller driver module forwards the target MCTP data packet to the receiving end corresponding to the destination address information.

[0208] In order to improve transmission accuracy, based on the above embodiments, in the embodiment of the present application, the SKB data packet is converted into a target MCTP data packet, including:

[0209] After obtaining the SKB data packet, the SKB data packet is verified to determine whether the SKB data packet is a valid SKB data packet. If so, the valid SKB data packet is converted into a target MCTP data packet.

[0210] In order to further improve the transmission accuracy, based on the above embodiments, in the embodiment of the present application, judging whether the SKB data packet is a valid SKB data packet includes:

[0211] Determine whether the number of bytes contained in each field in the SKB data packet meets the required number of each field of the preset SKB data packet. If so, determine the SKB data packet as a valid SKB data packet; if not, determine that the SKB data packet is not a valid SKB data packet.

[0212] In order to further improve the reuse rate of the code, on the basis of the above embodiments, in the embodiment of the present application, if the data transmission request is a receiving request, obtaining the data packet to be transmitted based on the data transmission request includes:

[0213] After receiving a receiving request sent by any target application, the source address information and the identification information of the target application are sent to the MCTPcontroller driver module according to the source address information and the identification information of the target application carried in the receiving request;

[0214] Receive an MCTP data packet sent by the MCTP controller driver module and obtained from the source address information; wherein the MCTP data packet carries identification information of the target application;

[0215] Convert the data packet to be transmitted into a target data packet that meets the format recognition requirements of the receiving end, and transmit the target data packet to the receiving end, including:

[0216] The MCTP data packet is converted into a target SKB data packet, and the target SKB data packet carrying the identification information of the target application is sent to the user service module, so that the user service module forwards the target SKB data packet to the target application in the application module according to the identification information of the target application.

[0217] In order to improve transmission accuracy, based on the above embodiments, in the embodiment of the present application, the MCTP data packet is converted into a target SKB data packet, including:

[0218] After obtaining the MCTP data packet, the MCTP data packet is verified to determine whether the MCTP data packet is a legitimate MCTP data packet. If so, the legitimate MCTP data packet is converted into a target SKB data packet.

[0219] In order to further improve the transmission accuracy, based on the above embodiments, in the embodiment of the present application, judging whether the MCTP data packet is a legal MCTP data packet includes:

[0220] Determine whether the number of bytes contained in each field in the MCTP data packet meets the required number of each field of the preset MCTP data packet. If so, determine the MCTP data packet as a legal MCTP data packet; if not, determine that the MCTP data packet is not a legal MCTP data packet.

[0221] Among them, the specific implementation process of the data transmission method provided in the embodiment of the present application is similar to the process of data processing by the data transmission device provided in the above embodiment, and will not be repeated here.

[0222] Embodiment 10:

[0223] Based on the above embodiments, the present application embodiment provides a data transmission process diagram, such as Fig. 9 As shown:

[0224] First, the data sending process (i.e. Fig. 9 The process includes the following steps:

[0225] Step 1: After receiving a sending request from any target application in the application module, the user service module calls the sys_sendto function to pass the sending request to the general network protocol stack module. The general network protocol stack module sends the original SKB data packet sent by the target application carried in the sending request to the kernel MCTP (kernelMCTP) protocol stack module.

[0226] Step 2: After receiving the original SKB data packet, the kernel MCTP protocol stack module sends the original SKB data packet to the MCTP route output (MCTP route output) submodule of the kernel MCTP protocol stack module through the MCTP sendmsg function, creates a NETDEVICE physical link header for the original SKB data packet based on the MCTP route output, and determines the SKB data packet to be sent based on the NETDEVICE physical link header and the original SKB data packet, and sends the SKB data packet to be sent to the general network protocol stack module.

[0227] Step 3: The general network protocol stack module stores the received SKB data packet to be sent into the first queue through the dev_queue_xmit function, and calls the netdev_start_xmit function to send the SKB data packet to be sent in the first queue and the sending request to the NETDEVICE driver module.

[0228] Step 4: After receiving the SKB data packet to be sent and the sending request, the NETDEVICE driver module stores the SKB data packet to be sent into the sending queue, determines whether the SKB data packet to be sent in the sending queue is a valid SKB data packet, and if so, parses the SKB data packet to be sent, obtains the first transmission header information, the first link header information and the first payload information contained in the SKB data packet to be sent, and combines the first transmission header information, the first link header information and the first payload information contained in the SKB data packet to be sent according to the MCTP data format to obtain the converted target MCTP data packet, and sends the target MCTP data packet carrying the destination address information to the MCTP controller driver module through the NETDEVICE sending thread (tx_thread); if not, continues to wait whether a valid SKB data packet is received.

[0229] Step 5: After receiving the target MCTP data packet carrying the destination address information, the MCTP controller driver module sends the target MCTP data packet to the receiving end corresponding to the destination address information through the PCIE bus connected to the MCTPcontroller driver module according to the destination address information.

[0230] Then, the data receiving process (i.e. Fig. 9 The process is described in the following steps:

[0231] Step 1: Any target application in the application module sends a receiving request to the NETDEVICE driver module via the user service module, the general network protocol stack module, and the kernel MCTP protocol stack module, wherein the receiving request carries source address information and identification information of the target application.

[0232] After receiving a receiving request sent by any target application, the NETDEVICE driver module sends the source address information and identification information of the target application carried in the receiving request to the MCTPcontroller driver module.

[0233] After receiving the source address information and the identification information of the target application, the MCTP controller driver module determines the sender corresponding to the source address information, obtains the MCTP data packet carrying the identification information of the target application sent by the sender corresponding to the source address information, and sends the MCTP data packet to the NETDEVICE driver module.

[0234] Step 2: After receiving the MCTP data packet, the receiving thread (rx_thread) of the NETDEVICE driver module determines whether the MCTP data packet is a legal MCTP data packet. If so, apply for SKB memory for the legal MCTP data packet, initialize the basic parameters corresponding to the SKB memory, parse the legal MCTP data packet, obtain the second transmission header information, the second link header information and the second payload information contained in the legal MCTP data packet, convert the second transmission header information, the second link header information and the second payload information contained in the legal MCTP data packet according to the SKB data format, obtain the target SKB data packet carrying the identification information of the target application, and send the target SKB data packet carrying the identification information of the target application to the general network protocol stack module; if not, continue to wait whether the legal MCTP data packet sent by the MCTPcontroller driver module is received.

[0235] Step three, the general network protocol stack module calls the netif_rx function to receive the target SKB data packet carrying the identification information of the target application, and compares the network protocol type information carried in the target SKB data packet with the registered network protocol type through the soft interrupt processing function (net_recv_action), and determines whether the registered network protocol type contains the network protocol type carried in the target SKB data packet. If it does, the target SKB data packet is forwarded to the device corresponding to the network protocol type for processing. In this embodiment of the present application, since the target SKB data packet carries the MCTP protocol type, the target SKB data packet is forwarded to the MCTP controller driver module.

[0236] The MCTP controller driver module receives the target SKB data packet through the MCTP packet recv function. After receiving the target SKB data packet, it parses the target SKB data packet to determine the target sock corresponding to the target SKB data packet, and transmits the identification information of the target SKB data packet and the target sock to the general network protocol stack module through the MCTP route input.

[0237] The general network protocol stack module determines the target queue corresponding to the target sock based on the identification information of the target sock, and stores the target SKB data packet in the target queue through the sock_queue_recv_skb function. Then the sending queue of the general network protocol stack module takes out the target SKB data packet from the target queue through the datagram_poll / sock_recvmsg function, and sends the target SKB data packet carrying the identification information of the target application to the user service module.

[0238] The user service module calls the sock_poll / sys_recvform function to receive a target SKB data packet carrying identification information of the target application, and sends the target SKB data packet to the target application in the application module according to the identification information of the target application.

[0239] Embodiment 11:

[0240] Based on the same technical concept, on the basis of the above embodiments, the present application provides a data transmission device, Fig.10 A schematic diagram of a data transmission device structure provided in an embodiment of the present application is shown in FIG. Fig.10 As shown, the device comprises:

[0241] The receiving module 1001 is used to receive a data transmission request sent by any target application;

[0242] An acquisition module 1002 is used to acquire a data packet to be transmitted based on the data transmission request;

[0243] The conversion module 1003 is used to convert the data packet to be transmitted into a target data packet that meets the format recognition requirement of the receiving end, and transmit the target data packet to the receiving end.

[0244] In a possible implementation, the acquisition module 1002 is specifically configured to, after receiving a sending request sent by any target application, acquire an SKB data packet sent by the target application carried in the sending request;

[0245] The conversion module 1003 is specifically configured to convert the SKB data packet into a target MCTP data packet, and send the target MCTP data packet carrying the destination address information to the MCTP controller driver module, so that the MCTP controller driver module forwards the target MCTP data packet to a receiving end corresponding to the destination address information.

[0246] In a possible implementation, the conversion module 1003 is specifically configured to verify the SKB data packet after acquiring the SKB data packet, determine whether the SKB data packet is a valid SKB data packet, and if so, convert the valid SKB data packet into a target MCTP data packet.

[0247] In a possible implementation, the conversion module 1003 is specifically used to determine whether the number of bytes contained in each field in the SKB data packet meets the required number of each field of the preset SKB data packet. If so, the SKB data packet is determined to be a valid SKB data packet; if not, the SKB data packet is determined to be a non-valid SKB data packet.

[0248] In a possible implementation, the acquisition module 1002 is specifically configured to, after receiving a reception request sent by any target application, send the source address information and the identification information of the target application to the MCTPcontroller driver module according to the source address information and the identification information of the target application carried in the reception request; receive the MCTP data packet sent by the MCTPcontroller driver module and obtained from the source address information; wherein the MCTP data packet carries the identification information of the target application;

[0249] The conversion module 1003 is specifically used to convert the MCTP data packet into a target SKB data packet, and send the target SKB data packet carrying the identification information of the target application to the user service module, so that the user service module forwards the target SKB data packet to the target application in the application module according to the identification information of the target application.

[0250] In a possible implementation, the conversion module 1003 is specifically configured to verify the MCTP data packet after acquiring the MCTP data packet, determine whether the MCTP data packet is a legitimate MCTP data packet, and if so, convert the legitimate MCTP data packet into a target SKB data packet.

[0251] In a possible implementation, the conversion module 1003 is specifically configured to determine whether the number of bytes contained in each field in the MCTP data packet meets the required number of each field of the preset MCTP data packet. If so, the MCTP data packet is determined to be a legal MCTP data packet; if not, the MCTP data packet is determined to be a non-legal MCTP data packet.

[0252] Embodiment 12:

[0253] Based on the same technical concept, the present application also provides an electronic device, Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Fig.11 As shown, it includes: a processor 1101, a communication interface 1102, a memory 1103 and a communication bus 1104, wherein the processor 1101, the communication interface 1102, and the memory 1103 communicate with each other through the communication bus 1104;

[0254] The memory 1103 stores a computer program, and when the program is executed by the processor 1101, the processor 1101 implements any of the above embodiments. Since the principle of solving the problem by the electronic device is similar to the data transmission method, the implementation of the electronic device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0255] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, a PCIE bus, an Inter-Integrated Circuit (I2C), an Improved Inter Integrated Circuit (I3C), etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0256] The communication interface 1102 is used for communication between the above electronic device and other devices.

[0257] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0258] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processing processor (Digital Signal Processing, DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.

[0259] Embodiment 13:

[0260] Based on the same technical concept, the embodiment of the present application provides a computer-readable storage medium, in which a computer program executable by an electronic device is stored, and when the program is run on the electronic device, the electronic device implements any of the above embodiments when executing. Since the principle of solving the problem by the computer-readable storage medium is similar to the data transmission method, the implementation of the computer-readable storage medium can refer to the implementation of the method, and the repeated parts will not be repeated.

[0261] The above-mentioned computer-readable storage medium can be any available medium or data storage device that can be accessed by the processor in the electronic device, including but not limited to magnetic storage such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc., optical storage such as CD, DVD, BD, HVD, etc., and semiconductor storage such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD), etc.

[0262] Based on the same technical concept, the embodiment of the present application also provides a computer program product, which includes: computer program code, when the computer program code is run on a computer, the computer executes any of the above embodiments. Since the principle of solving the problem by the above computer program product is similar to that of the data transmission method, the implementation of the above computer program product can refer to the implementation of the method, and the repeated parts will not be repeated.

[0263] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0264] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0265] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0266] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0267] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A data transmission device, characterized in that: The data transmission device comprises an application program module, a user service module and a network device NETDEVICE driver module; The user service module is used to forward a data transmission request sent by any target application in the application module to the NETDEVICE driver module; The NETDEVICE driver module is used to, after receiving a data transmission request sent by any target application, obtain the data packet to be transmitted based on the data transmission request, convert the data packet to be transmitted into a target data packet that meets the format recognition requirements of the receiving end, and transmit the target data packet to the receiving end.

2. The device according to claim 1, characterized in that The device also includes: a management component transport protocol controller MCTP controller driver module; The NETDEVICE driver module is specifically configured to, after receiving a sending request sent by any target application, obtain a socket buffer SKB data packet sent by the target application carried in the sending request, convert the SKB data packet into a target MCTP data packet, and send the target MCTP data packet carrying the destination address information to the MCTPcontroller driver module; The MCTP controller driver module is used to forward the target MCTP data packet to a receiving end corresponding to the destination address information.

3. The device according to claim 2, characterized in that The NETDEVICE driver module is specifically used to verify the SKB data packet after obtaining the SKB data packet, determine whether the SKB data packet is a valid SKB data packet, and if so, convert the valid SKB data packet into a target MCTP data packet.

4. The device according to claim 3, characterized in that The NETDEVICE driver module is specifically used to determine whether the number of bytes contained in each field in the SKB data packet meets the required number of each field of the preset SKB data packet. If so, the SKB data packet is determined to be a valid SKB data packet; if not, the SKB data packet is determined to be a non-valid SKB data packet.

5. The device according to claim 1, characterized in that The device also includes: a management component transport protocol controller MCTP controller driver module; The NETDEVICE driver module is specifically configured to, after receiving a receiving request sent by any target application, send the source address information and the identification information of the target application carried in the receiving request to the MCTP controller driver module; The MCTP controller driver module is configured to receive the source address information and the identification information of the target application, obtain the MCTP data packet sent by the sender corresponding to the source address information, and send the MCTP data packet to the NETDEVICE driver module; wherein the MCTP data packet carries the identification information of the target application; The NETDEVICE driver module is specifically used to convert the MCTP data packet into a target SKB data packet, and send the target SKB data packet carrying the identification information of the target application to the user service module; The user service module is further used to forward the target SKB data packet to the target application in the application module according to the identification information of the target application.

6. The device according to claim 5, characterized in that The NETDEVICE driver module is specifically used to verify the MCTP data packet after obtaining the MCTP data packet, determine whether the MCTP data packet is a legal MCTP data packet, and if so, convert the legal MCTP data packet into a target SKB data packet.

7. The device according to claim 6, characterized in that The NETDEVICE driver module is specifically used to determine whether the number of bytes contained in each field in the MCTP data packet meets the required number of each field of the preset MCTP data packet, and if so, determine the MCTP data packet as a legal MCTP data packet; if not, determine that the MCTP data packet is not a legal MCTP data packet.

8. A data transmission method, characterized in that: The method comprises: Receive data transfer requests sent by any target application; Based on the data transmission request, obtaining a data packet to be transmitted; The data packet to be transmitted is converted into a target data packet that meets the format recognition requirement of the receiving end, and the target data packet is transmitted to the receiving end.

9. A data transmission device, characterized in that: The device comprises: A receiving module, used for receiving a data transmission request sent by any target application; An acquisition module, used for acquiring a data packet to be transmitted based on the data transmission request; The conversion module is used to convert the data packet to be transmitted into a target data packet that meets the format recognition requirements of the receiving end, and transmit the target data packet to the receiving end.

10. An electronic device, characterized in that: The electronic device comprises at least a processor and a memory, and the processor is used to implement the steps of the data transmission method according to claim 8 when executing a computer program stored in the memory.

Citation Information

Patent Citations

  • Method for realizing data transmission in gateway equipment of ubiquitous network and gateway equipment using method

    CN104253763A

  • Firmware updating method and device of equipment, server and storage medium

    CN116578316A

  • Smart device management method and apparatus, network device, and readable storage medium

    WO2020238801A1

Cited By

  • MCTP implementation device, data transmission method, chip and control system

    CN122160449A