Network card configuration method, device, electronic device and computer-readable storage medium

By identifying the cable media type and dynamically configuring the network card parameters, the problem of fixed network card configuration parameters is solved, and high compatibility and flexible adaptation between the network card and the target device is achieved.

CN115941465BActive Publication Date: 2025-01-07JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211542717.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-02
Publication Date
2025-01-07
Estimated Expiration
2042-12-02

AI Technical Summary

Technical Problem

The configuration parameters of existing network cards are fixed and cannot be dynamically adapted to different interfaces and devices, which limits the application scenarios and compatibility of network cards.

Method used

By identifying the media type of the cable, matching the corresponding configuration parameter group, and dynamically configuring the interface between the network card and the target device to achieve logical negotiation links.

Benefits of technology

Improves the logical compatibility between the network card and the target device, and expands the types and application scenarios of the network card adaptation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115941465B_ABST
    Figure CN115941465B_ABST
Patent Text Reader

Abstract

The present disclosure provides a network card configuration method, device, electronic device and computer-readable storage medium, and relates to the field of computer technology. The network card configuration method includes: the network card determines the medium type of the cable that is physically connected to the network card in contact in response to a configuration instruction, and at least one configuration parameter group is set in the network card, and at least one configuration parameter group includes a first type of configuration parameter group, and the cable is used to physically connect the network card and the target device; the network card determines the first type of configuration parameter group that matches the medium type of the cable in at least one configuration parameter group, wherein different media types correspond to different types of configuration parameter groups; the network card traverses the first type of configuration parameter group, and configures the physical connection interface between the network card and the cable, so that the network card and the target device perform a logical negotiation link. The embodiment of the present disclosure can enable the network card to dynamically configure the physical connection interface according to the cable type to improve the compatibility of the logical negotiation link between the network card and the target device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a network card configuration method and device, an electronic device, and a computer-readable storage medium. Background Art

[0002] In the related art, configuration parameters are usually pre-written into the network card for different interfaces of the network card, so as to realize the logical link between the network card and other devices (such as other network cards or switches, etc.) through the interface.

[0003] However, the configuration parameters in the above method are hard-coded in the physical memory of the network card and cannot be modified. In other words, the interfaces and devices that the network card can logically adapt to are fixed and unchanged (for example, if it is determined to use configuration A for the interface), and since the physical storage space of the network card is limited, the devices that the network card can adapt to are also limited.

[0004] Therefore, the above scenarios limit the application scenarios of the network card, resulting in the network card being able to connect only to fixed and limited devices.

[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure. Summary of the invention

[0006] The purpose of the present disclosure is to provide a network card configuration method, device, electronic device and computer-readable storage medium, which can dynamically adapt different configuration parameter groups according to different cables and devices.

[0007] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.

[0008] An embodiment of the present disclosure provides a network card configuration method, comprising: the network card determines, in response to a configuration instruction, a medium type of a cable that is physically connected to the network card in contact, the network card being provided with at least one configuration parameter group, the at least one configuration parameter group including a first type of configuration parameter group, and the cable being used to physically connect the network card to a target device; the network card determines, from the at least one configuration parameter group, a configuration parameter group of the first type that matches the medium type of the cable, wherein different medium types correspond to different types of configuration parameter groups; the network card traverses the first type of configuration parameter groups and configures a physical connection interface between the network card and the cable, so that the network card and the target device perform a logical negotiation link.

[0009] In some embodiments, the first type of configuration parameter group includes configuration parameter group one and configuration parameter group two; wherein the network card traverses the first type of configuration parameter group to configure the physical connection interface between the network card and the cable so that the network card and the target device perform a logical negotiation link, including: configuring the physical connection interface between the network card and the cable through the configuration parameter group one; if the negotiation link between the network card and the target device is unsuccessful under the configuration of the configuration parameter group one, continuing to use the configuration parameter group two to configure the physical connection interface between the network card and the cable.

[0010] In some embodiments, the configuration parameter group one includes at least two cable rate parameters and at least two coding error correction configuration parameters; wherein, configuring the physical connection interface between the network card and the cable through the configuration parameter group one includes: when the network card configures the physical connection interface between the network card and the cable through the configuration parameter group one, the network card switches between the at least two cable rate parameters to determine a cable rate parameter suitable for the cable; when the network card configures the physical connection interface between the network card and the cable through the configuration parameter group one, the network card also switches between the at least two coding error correction configuration parameters to determine a coding error correction configuration parameter suitable for the cable; when there is a cable rate parameter suitable for the cable among the at least two cable rate parameters and there is a coding error correction configuration parameter suitable for the cable among the at least two coding error correction configuration parameters, the physical connection interface between the network card and the cable is configured successfully.

[0011] In some embodiments, the network card includes an interface controller and a processor; wherein, the network card determines the medium type of the cable that is physically connected to the network card in contact in response to a configuration instruction, including: the processor detects through the interface controller in response to the configuration instruction that the medium type of the cable that is physically connected to the network card in contact is an optical fiber type or a copper type; wherein the network card determines the first type of configuration parameter group that matches the medium type of the cable in the at least one configuration parameter group, including: the processor determines the first type of configuration parameter group corresponding to the optical fiber type or the copper type in the at least one configuration parameter group; wherein the network card traverses the first type of configuration parameter group and configures the physical connection interface between the network card and the cable so that the network card and the target device perform a logical negotiation link, including: the processor traverses the first type of configuration parameter group and configures the interface controller so that the network card and the target device perform a logical negotiation link.

[0012] In some embodiments, before the network card responds to the configuration instruction, the method further includes: generating the configuration instruction when it is detected that the network card is powered on or a cable plugging and unplugging operation occurs on the network card or an interface controller of the network card is reset.

[0013] In some embodiments, the network card includes a processor, which is a read-write processor; wherein the method further includes: when the network card traverses the first type of configuration parameter group to configure the physical connection interface between the network card and the cable and the configuration fails, obtaining the target configuration parameter group corresponding to the target device and the cable; writing the target configuration parameter group corresponding to the target device and the cable into the processor in the network card, so that the processor configures the physical connection interface between the network card and the cable through the target configuration parameter group, so that the network card and the target device perform a logical negotiation link.

[0014] In some embodiments, before the network card responds to the configuration instruction, the method also includes: receiving device configuration parameters corresponding to at least one device, the at least one device including the target device; generating at least one configuration parameter group according to different media types of the cable and the device configuration parameters corresponding to the at least one device, the at least one configuration parameter group including the first type of configuration parameter group; writing the at least one configuration parameter group into the processor of the network card so that the network card configures the logical link between the network card, the cable and the target device according to the at least one configuration parameter group.

[0015] The embodiment of the present disclosure provides a network card configuration device, including: a medium type determination module, a configuration parameter group determination module and a configuration module.

[0016] Among them, the medium type determination module is used for the network card to determine the medium type of the cable that is physically connected to the network card in contact in response to the configuration instruction, and at least one configuration parameter group is set in the network card, and the at least one configuration parameter group includes a first type of configuration parameter group, and the cable is used to physically connect the network card and the target device; the configuration parameter group determination module can be used for the network card to determine the first type of configuration parameter group that matches the medium type of the cable in the at least one configuration parameter group, wherein different media types correspond to different types of configuration parameter groups; the configuration module can be used for the network card to traverse the first type of configuration parameter group and configure the physical connection interface between the network card and the cable so that the network card and the target device can perform a logical negotiation link.

[0017] An embodiment of the present disclosure provides an electronic device, which includes: a memory and a processor; the memory is used to store program instructions; the processor calls the program instructions stored in the memory to implement any of the above-mentioned network card configuration methods.

[0018] The embodiment of the present disclosure provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the network card configuration method as described in any one of the above items is implemented.

[0019] The embodiment of the present disclosure provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above-mentioned network card configuration method.

[0020] The network card configuration method, device, electronic device, and computer-readable storage medium provided by the embodiments of the present disclosure realize the logical link between the network card and the target device by identifying the medium type of the cable, finding the first type of configuration parameter group matching the cable medium type, traversing the first type of configuration parameter group, etc. The above embodiments realize the dynamic configuration of the interface through the network card, and improve the logical compatibility between the network card and the target device.

[0021] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0023] Figure 1 The diagram is a schematic diagram showing a method of connecting devices through a network card according to an exemplary embodiment.

[0024] Figure 2 The present invention is a schematic diagram of a network card structure according to the related technology.

[0025] Figure 3 The figure is a schematic diagram of an online course structure according to an exemplary embodiment.

[0026] Figure 4 The diagram is a schematic diagram showing a method of connecting devices through a network card according to an exemplary embodiment.

[0027] Figure 5 The present invention is a flowchart of a method for configuring a network card according to an exemplary embodiment.

[0028] Figure 6 The present invention is a flowchart of a method for configuring a network card according to an exemplary embodiment.

[0029] Figure 7 The present invention is a flowchart of a method for configuring a network card according to an exemplary embodiment.

[0030] Figure 8 The present invention is a flowchart of a method for configuring a network card according to an exemplary embodiment.

[0031] Fig. 9 The present invention is a flowchart of a method for configuring a network card according to an exemplary embodiment.

[0032] Fig.10 The present invention is a flowchart of a method for configuring a network card according to an exemplary embodiment.

[0033] Fig.11 The present invention is a flowchart of a method for configuring a network card according to an exemplary embodiment.

[0034] Fig.12 The figure is a block diagram showing a network card configuration device according to an exemplary embodiment.

[0035] Fig.13 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0036] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.

[0037] The features, structures or characteristics described in the present disclosure may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.

[0038] The accompanying drawings are only schematic diagrams of the present disclosure, and the same reference numerals in the drawings represent the same or similar parts, so their repeated description will be omitted. Some block diagrams shown in the accompanying drawings do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or micro-interface controller devices.

[0039] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and steps, nor must they be executed in the order described. For example, some steps can be decomposed, and some steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0040] In the description of the present application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is only a kind of association relationship describing the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "plurality" means two or more. The words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be different; the terms "comprising", "including" and "having" are used to express the meaning of open inclusion and mean that in addition to the listed elements / components / etc., there may be other elements / components / etc.

[0041] In order to more clearly understand the above-mentioned purposes, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0042] First, some terms involved in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.

[0043] FPGA: Field Programmable Gate Array, field programmable gate array.

[0044] NIOS: A soft-core processor running on an (Intel Altera) FPGA.

[0045] AOC: Active Optical Cables, active cables, mostly refers to optical fiber, optical transmission medium.

[0046] DAC: Direct Attach Cable, direct cable, multi-finger copper cable, electrical signal transmission medium.

[0047] FEC: Applicable to high-speed communications (25G, 40G, 100G, especially 40G and 100G), it is an error correction technology.

[0048] The foregoing introduces some terminology concepts involved in the embodiments of the present application. The following introduces the technical features involved in the embodiments of the present application.

[0049] like Figure 1 As shown, the network card 102 may be set in a hardware device (such as the first device 101), and the second device 103 may be linked to the network card to achieve communication between the first device and the second device. The network card may refer to a smart network card.

[0050] The first device and the second device may be arranged in an Ethernet network, but this application does not impose any limitation on this.

[0051] In some embodiments, the first device may be a server in the Ethernet, and the second device may be other network cards or switches in the Ethernet to obtain other hardware devices, etc., which is not limited in this application.

[0052] In the related art, each network card hardware can be equipped with an Ethernet hard core. Ethernet is a computer local area network technology that specifies the content of the physical layer connection, electronic signals and media access layer protocol. It is the most commonly used local area network technology. The network card needs to transmit the received and sent data packets to the CPU for processing through Ethernet (protocol). Among them, the network card can also include an Ethernet interface controller (configurable interface) which is a dedicated circuit module. There will be a large number of (dozens to hundreds) registers that need to be configured to meet the requirements.

[0053] In related technologies, such as Figure 2 As shown, the network card 202 in the first device 201 (which may be a server, for example) may be configured with an ASIC chip 204 (a special integrated circuit), and the configuration information of the interface controller 203 (such as an Ethernet interface controller) may be fixed in the ASIC chip using physical logic, so that the interface controller 203 may be configured when necessary, thereby realizing a logical connection with other devices through the interface. However, the configuration information in this method is fixedly written in the ASIC chip through physical logic, and cannot be modified and reconfigured unless it is re-threaded, and this method occupies the physical storage space of the ASIC chip, so that the types of devices that the network card can adapt to are limited. Figure 2The method of using physical logic to configure related parameters is usually suitable for static configuration, that is, specifying a set of optimal parameters and writing them into the configuration process. The advantage of this method is simplicity, but the disadvantages are also obvious, such as limited compatibility and poor flexibility.

[0054] In this embodiment, if Figure 3 As shown, an FPGA (field programmable logic device) chip can be set in the network card 302 of the first device 301, and a soft-core processor 304 can be set in the FPGA chip, and then the configuration information of the interface controller can be written into the soft-core processor 304 in advance, so that the configuration information in the soft-core processor can be used to configure the interface controller 303 when needed.

[0055] In some embodiments, relevant parameters can be set through the internal control logic of the FPGA chip to achieve a smooth negotiation link with an external peer network card or switch device, thereby performing data interaction.

[0056] Figure 4 FIG. 1 is a diagram showing a device connection architecture according to an exemplary embodiment. Figure 4 As shown, a smart network card 402 can be installed on the first device 401 (such as a server), and the following two components can be configured on the smart network card 402: an interface controller 403 (such as an Ethernet interface controller) and a nios soft-core processor 404. The Ethernet controller is a hard-core IP provided by Intel, which can be instantiated and used directly in the project, and the nios soft-core processor is a configurable processor optimized for programmable logic developed based on C language. The second device 405 (such as a switch) can be connected to the network card 402 through the Ethernet controller 403 (including physical connection and logical link). The second device can be physically connected to the network card in advance through cables and interfaces; then the network card configures the connection interface so that the second device and the network card can be logically negotiated to link.

[0057] The specific process of the network card configuring the connection interface so that the second device and the network card can logically negotiate a link may include reference to the following embodiments.

[0058] Figure 5 The present invention is a flowchart of a method for configuring a network card according to an exemplary embodiment.

[0059] Reference Figure 5 The network card configuration method provided by the embodiment of the present disclosure may include the following steps.

[0060] Step S502, the network card determines the medium type of the cable that is physically connected to the network card in contact in response to the configuration instruction, the network card is provided with at least one configuration parameter group, the at least one configuration parameter group includes a first type of configuration parameter group, and the cable is used to physically connect the network card and the target device.

[0061] The above network card may refer to a smart network card, and the above smart network card may refer to a high-performance access card with a network processor as the core.

[0062] In some embodiments, when it is detected that the network card is powered on (ie, the device where the network card is located is powered on) or there is a cable plugging and unplugging operation on the network card or the interface controller of the network card is reset, a configuration instruction may be generated.

[0063] In some embodiments, the network card detects the media type of the cable directly connected to the network card in response to the configuration instruction. For example, the network card can detect the media type of the cable inserted into the network card. The above-mentioned cable can include an optical fiber cable, a copper cable, etc., and this application does not limit this.

[0064] In some embodiments, the cable can be used to physically connect the network card to a target device, which can be Figure 4 The second device 405 in FIG. 4. It is understandable that if the network card is to communicate with the target device, it is also necessary to control the network card to perform a logical negotiation link with the target device after the network card is physically connected with the target device.

[0065] In some embodiments, interface configuration information (such as at least one configuration parameter group) corresponding to all devices that need to be connected to the network card may be pre-stored in the network card.

[0066] It is understandable that if the same device is connected to the network card through different cables, the information in the corresponding interface configuration parameter group may be different. Therefore, the same device may correspond to different configuration parameter groups due to different connection cables.

[0067] Step S504: The network card determines a first type of configuration parameter group that matches the medium type of the cable from at least one configuration parameter group, wherein different medium types correspond to different types of configuration parameter groups.

[0068] In some embodiments, a first type of configuration parameter group matching the medium type of the cable may be determined from the at least one configuration parameter group.

[0069] Step S506: The network card traverses the first type of configuration parameter group and configures the physical connection interface between the network card and the cable so that the network card and the target device can perform a logical negotiation link.

[0070] In some embodiments, a traversal can be performed in the first type of configuration parameter group, and the traversal results can be used to configure the physical connection interface between the cable and the network card until a configuration parameter group matching the target device is found in the first type of configuration parameter group, so that the network card and the target device can perform a logical negotiation link.

[0071] The network card configuration method provided by the embodiment of the present disclosure realizes the logical link between the network card and the target device by identifying the medium type of the cable, finding the first type of configuration parameter group matching the cable medium type, traversing the first type of configuration parameter group, etc. The above embodiment realizes the dynamic configuration of the interface through the network card, and improves the logical compatibility between the network card and the target device.

[0072] Figure 6 The present invention is a flowchart of a method for configuring a network card according to an exemplary embodiment.

[0073] In some embodiments, the first type of configuration parameter group may include configuration parameter group one and configuration parameter group two.

[0074] refer to Figure 6 , the above network card configuration method may include the following steps.

[0075] Step S602, the network card determines the medium type of the cable that is physically connected to the network card in contact in response to the configuration instruction, the network card is provided with at least one configuration parameter group, the at least one configuration parameter group includes a first type of configuration parameter group, and the cable is used to physically connect the network card and the target device.

[0076] Step S604: The network card determines a first type of configuration parameter group that matches the medium type of the cable in at least one configuration parameter group, wherein the first type of configuration parameter group includes configuration parameter group one and configuration parameter group two, wherein different medium types correspond to different types of configuration parameter groups.

[0077] The network card will traverse the first type of configuration parameter group to configure the physical connection interface between the network card and the cable, which may specifically include the following steps.

[0078] Step S606: configure the physical connection interface between the network card and the cable by configuring a pair of parameter groups.

[0079] Step S608: If the negotiation link between the network card and the target device is unsuccessful under the configuration of the configuration parameter group 1, the physical connection interface between the network card and the cable is configured by continuing to use the configuration parameter group 2.

[0080] In some embodiments, if the network card fails to negotiate with the target device under the configuration of configuration parameter group one, configuration parameter group two is continued to be used to configure the physical connection interface between the network card and the cable.

[0081] In the above embodiment, the physical connection interface between the network card and the cable is configured by configuration parameter group 1 and configuration parameter group 2 in the first type configuration parameter group to implement a logical negotiation link between the network card and the target device, thereby improving the compatibility of the network card.

[0082] Figure 7 The present invention is a flowchart of a method for configuring a network card according to an exemplary embodiment.

[0083] In some embodiments, the above-mentioned configuration parameter group 1 may include at least two cable rate parameters and at least two coding error correction configuration parameters.

[0084] refer to Figure 7 The configuration method for configuring a network card by configuring a parameter group may include the following steps.

[0085] Step S702: When configuring the physical connection interface between the network card and the cable through a configuration parameter group, the network card switches between at least two cable rate parameters to determine a cable rate parameter suitable for the cable.

[0086] Step S704: When configuring the physical connection interface between the network card and the cable through the configuration parameter group, the network card also switches between at least two coding error correction configuration parameters to determine coding error correction configuration parameters suitable for the cable.

[0087] Step S706: If there is a cable rate parameter suitable for the cable among the at least two cable rate parameters and there is a coding error correction configuration parameter suitable for the cable among the at least two coding error correction configuration parameters, the physical connection interface between the network card and the cable is configured successfully.

[0088] In the above embodiment, the configuration of the physical connection interface between the network card and the cable is realized by switching the cable rate parameters and the coding error correction parameters, thereby determining whether the configuration of the physical connection interface between the network card and the cable is successful.

[0089] Figure 8 The present invention is a flowchart of a method for configuring a network card according to an exemplary embodiment.

[0090] In some embodiments, the network card may include an interface controller and a processor (eg, Figure 4 The interface controller 403 and the soft core processor 404 are shown).

[0091] refer to Figure 8 , the above network card configuration method may include the following process.

[0092] Step S802: In response to the configuration instruction, the processor of the network card detects through the interface controller whether the medium type of the cable physically connected to the network card is an optical fiber type or a copper type.

[0093] Step S804: The processor of the network card determines a first type of configuration parameter group corresponding to the optical fiber type or the copper type in at least one configuration parameter group.

[0094] Step S806: The processor of the network card traverses the first type of configuration parameter group and configures the interface controller of the network card so that the network card and the target device can perform a logical negotiation link.

[0095] In the above embodiment, on the one hand, at least one configuration parameter group is written into the processor, so that the configuration parameter group no longer occupies the physical content of the network card, thereby optimizing the physical memory usage of the network card; on the other hand, dynamic configuration of the interface is realized through the network card, thereby improving the logical compatibility between the network card and the target device.

[0096] Fig. 9 The present invention is a flowchart of a method for configuring a network card according to an exemplary embodiment.

[0097] In some embodiments, the network card may include a processor, which may be a read-write processor.

[0098] refer to Fig. 9 , the above network card configuration method may include the following steps.

[0099] Step S902, the network card determines the medium type of the cable that is physically connected to the network card in contact in response to the configuration instruction, the network card is provided with at least one configuration parameter group, the at least one configuration parameter group includes a first type of configuration parameter group, and the cable is used to physically connect the network card and the target device.

[0100] Step S904: The network card determines a first type of configuration parameter group that matches the medium type of the cable from at least one configuration parameter group, wherein different medium types correspond to different types of configuration parameter groups.

[0101] Step S906: The network card traverses the first type of configuration parameter group and configures the physical connection interface between the network card and the cable so that the network card and the target device can perform a logical negotiation link.

[0102] Step S908: When the network card traverses the first type of configuration parameter group to configure the physical connection interface between the network card and the cable and the configuration fails, a target configuration parameter group corresponding to the target device and the cable is obtained.

[0103] Step S910, write the target configuration parameter group corresponding to the target device and the cable into the processor in the network card, so that the processor configures the physical connection interface between the network card and the cable through the target configuration parameter group, so that the network card and the target device can perform a logical negotiation link.

[0104] The above embodiment can obtain the target configuration parameter group corresponding to the target device and write the target configuration parameter group into the processor of the network card when traversing at least one configuration parameter group and failing to configure the physical connection interface, so as to perform interface configuration on the cable corresponding to the target device (or a device of the same type as the target device) next time.

[0105] Fig.10 The present invention is a flowchart of a method for configuring a network card according to an exemplary embodiment.

[0106] In some embodiments, the above network card configuration method can be executed before the network card responds to the configuration instruction.

[0107] refer to Fig.10 , the above network card configuration method may include the following steps.

[0108] Step S1002: receiving device configuration parameters corresponding to at least one device, where the at least one device includes a target device.

[0109] Step S1004: generating at least one configuration parameter group according to different media types of the cable and device configuration parameters corresponding to at least one device, wherein the at least one configuration parameter group includes a first type configuration parameter group.

[0110] Step S1006: write at least one configuration parameter group into a processor of the network card, so that the network card configures the logical link of the network card, the cable, and the target device according to the at least one configuration parameter group.

[0111] In the above embodiment, the configuration parameters of all devices that may be connected to the network card can be dynamically written into the network card in advance, so that when the device is connected to the network card, the network card can dynamically configure the connection interface, thereby improving the compatibility of the network card.

[0112] Fig.11 The present invention is a flowchart of a method for configuring a network card according to an exemplary embodiment.

[0113] In some embodiments, Figure 4 As shown, the network card can be set on the first device (such as a server), and the network card can include an interface controller (such as an Ethernet interface controller) and a soft-core processor (such as a nios soft-core processor). The second device can be physically and logically connected to the network card through the interface controller.

[0114] In some embodiments, before executing the following network card configuration method, the configuration parameter groups corresponding to each device (such as a switch) that needs to be connected to the network card under different cable types (for example, optical fiber type cables and copper type cables) can be written into the network card through read-write technology.

[0115] refer to Fig.11 , the above network card configuration method may include the following steps.

[0116] S1101: The smart network card is powered on, the Ethernet controller is reset as a whole, or a cable hot plug is detected.

[0117] In the following three situations: the first device (such as a server) is powered on to power on the smart network card, the cable module DAC (copper cable) / AOC (optical fiber) is plugged in or out, or the interface controller is reset, the nios soft core processor starts to work.

[0118] S1102, determining whether the cable type is an optical fiber type or a copper type.

[0119] The nios soft-core processor controls the Ethernet controller to read relevant register parameters to detect the type of cable connected to the network card and determine whether it is DAC (copper cable) or AOC (optical fiber).

[0120] In some embodiments, if the cable is determined to be a fiber optic cable, steps S1103 to S1109 are executed; if the cable is determined to be a copper cable, steps S1110 to S1116 are executed.

[0121] Among them, the configuration parameter group corresponding to the optical fiber cable may include configuration parameter groups A1~An. When configuring the interface corresponding to the optical fiber cable, the configuration parameter groups A1~An can be traversed to configure the interface until a configuration parameter group that enables a successful logical link between the network card and the second device is found.

[0122] refer to Fig.11 , steps S1103 to S1109 may include the following process.

[0123] S1103, configure parameter group A1.

[0124] If an AOC cable is detected, the prepared parameter group A1 is configured.

[0125] S1104, switching of rate and error correction configuration parameters is supported, and determining whether the link is successful.

[0126] After the parameter configuration is completed, the cable rate (25G / 10G) and FEC (coding error correction) related configurations are switched. If the link with the current second device (such as a switch) is successful, the loop is exited, otherwise step S1105 is continued.

[0127] S1105, configure parameter group A2.

[0128] Similarly, if the connection with the current second device is successful through the configuration parameter group A2, the loop can be exited, otherwise the next round of parameter group configuration can be continued.

[0129] S1106, switching of rate and error correction configuration parameters is supported, and determining whether the link is successful.

[0130] S1107, perform rate and error correction configuration parameter support switching, and determine whether the link is successful.

[0131] S1108, configure parameter group An.

[0132] S1109, switching of rate and error correction configuration parameters is supported, and determining whether the link is successful.

[0133] It is understandable that, since docking training has been performed with all second devices in advance, the link will inevitably be successful on a certain set of parameters.

[0134] In some embodiments, the configuration parameter group corresponding to the copper cable may include configuration parameter groups B1 to Bn. When configuring the interface corresponding to the copper cable, the configuration parameter groups B1 to Bn may be traversed to configure the interface until a configuration parameter group is found that enables a successful logical link between the network card and the second device.

[0135] refer to Fig.11 , steps S1110 to S1116 may include the following process.

[0136] S1110, configure parameter group B1.

[0137] Similarly, if a DAC cable is detected, the prepared parameter group B1 is configured. The subsequent configuration process is similar to the above-mentioned AOC cable and will not be repeated here.

[0138] S1111, rate and error correction configuration parameter support switching is performed, and it is determined whether the link is successful.

[0139] S1112, configuration parameter group B2

[0140] S1113, switching of rate and error correction configuration parameters is supported, and determining whether the link is successful.

[0141] S1114, rate and error correction configuration parameter support switching is performed, and it is determined whether the link is successful.

[0142] S1115, configure parameter group Bn.

[0143] S1116, rate and error correction configuration parameter support switching is performed, and it is determined whether the link is successful.

[0144] In some embodiments, if a second device type is added midway, and all parameter groups corresponding to the second device and the cable medium type fail to link, it is necessary to obtain the configuration parameter group corresponding to the second device, write the configuration parameter group into the network card through coding, and re-execute Fig.11 The technical solution corresponding to the embodiment shown.

[0145] The technical solution provided in this embodiment designs an improved method for the problem of insufficient compatibility of Ethernet interfaces in current smart network cards. The method adds a nios soft-core processor inside the hardware, and configures multiple sets of parameter configurations required by the Ethernet controller according to a certain process, thereby improving the compatibility of the smart network card port with the switch auto-negotiation.

[0146] Based on the same inventive concept, the present disclosure also provides a network card configuration device, such as the following embodiment. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.

[0147] Fig.12 is a block diagram of a network card configuration device according to an exemplary embodiment. Fig.12 The network card configuration device 1200 provided in the embodiment of the present disclosure may include: a medium type determination module 1201, a configuration parameter group determination module 1202 and a configuration module 1203.

[0148] Among them, the medium type determination module 1201 can be used for the network card to respond to the configuration instruction and determine the medium type of the cable that is physically connected to the network card in contact, and at least one configuration parameter group is set in the network card, and at least one configuration parameter group includes a first type of configuration parameter group, and the cable is used to physically connect the network card and the target device; the configuration parameter group determination module 1202 can be used for the network card to determine the first type of configuration parameter group that matches the medium type of the cable in at least one configuration parameter group, wherein different media types correspond to different types of configuration parameter groups; the configuration module 1203 can be used for the network card to traverse the first type of configuration parameter group and configure the physical connection interface between the network card and the cable so that the network card and the target device can perform a logical negotiation link.

[0149] It should be noted that the above-mentioned medium type determination module 1201, configuration parameter group determination module 1202, and configuration module 1203 correspond to S502 to S506 in the method embodiment, and the examples and application scenarios implemented by the above-mentioned modules and corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned method embodiment. It should be noted that the above-mentioned modules as part of the device can be executed in a computer system such as a set of computer executable instructions.

[0150] In some embodiments, the first type of configuration parameter group includes configuration parameter group one and configuration parameter group two; wherein the configuration module 1203 may include: a configuration parameter group one configuration unit and a configuration failure unit.

[0151] Among them, the configuration parameter group one configuration unit can be used to configure the physical connection interface between the network card and the cable through the configuration parameter group one; the configuration failure unit can be used to continue to use the configuration parameter group two to configure the physical connection interface between the network card and the cable if the negotiation link between the network card and the target device is unsuccessful under the configuration of the configuration parameter group one.

[0152] In some embodiments, configuration parameter group one includes at least two cable rate parameters and at least two coding error correction configuration parameters; wherein the configuration parameter group one configuration unit may include: a rate parameter switching unit, an error correction configuration parameter switching unit, and a configuration success determination unit.

[0153] Among them, the rate parameter switching unit can be used for the network card to switch between at least two cable rate parameters when configuring the physical connection interface between the network card and the cable through a configuration parameter group, so as to determine the cable rate parameters suitable for the cable; the error correction configuration parameter switching unit can be used for the network card to switch between at least two coding error correction configuration parameters when configuring the physical connection interface between the network card and the cable through a configuration parameter group, so as to determine the coding error correction configuration parameters suitable for the cable; the configuration success determination unit can be used for successfully configuring the physical connection interface between the network card and the cable when there is a cable rate parameter suitable for the cable among the at least two cable rate parameters and there is a coding error correction configuration parameter suitable for the cable among the at least two coding error correction configuration parameters.

[0154] In some embodiments, the network card includes an interface controller and a processor; wherein the medium type determination module 1201 may include: a type determination unit; the configuration parameter group determination module 1202 may include: a configuration parameter group determination unit; the configuration module 1203 may include: a configuration unit.

[0155] Among them, the type determination unit can be used for the processor to respond to the configuration instruction and detect through the interface controller whether the medium type of the cable that is physically connected to the network card in contact is an optical fiber type or a copper type; the configuration parameter group determination unit can be used for the processor to determine a first type of configuration parameter group corresponding to the optical fiber type or the copper type in at least one configuration parameter group; the configuration unit can be used for the processor to traverse the first type of configuration parameter group and configure the interface controller so that the network card and the target device can perform a logical negotiation link.

[0156] In some embodiments, the network card configuration device may further include a configuration instruction generation module; wherein the configuration instruction generation module may be used to generate configuration instructions before the network card responds to the configuration instruction, when it is detected that the network card is powered on or there is a cable plugging and unplugging operation on the network card or the interface controller of the network card is reset.

[0157] In some embodiments, the network card includes a processor, and the processor is a read-write processor; wherein the network card configuration device may further include: a target configuration parameter group acquisition module and a target configuration parameter group writing module.

[0158] Among them, the target configuration parameter group acquisition module can be used to obtain the target configuration parameter group corresponding to the target device and cable when the network card traverses the first type of configuration parameter group to configure the physical connection interface between the network card and the cable and the configuration fails; the target configuration parameter group writing module can be used to write the target configuration parameter group corresponding to the target device and the cable into the processor in the network card, so that the processor configures the physical connection interface between the network card and the cable through the target configuration parameter group, so that the network card and the target device can perform a logical negotiation link.

[0159] In some embodiments, the network card configuration apparatus may further include: a device configuration parameter receiving module, at least one configuration parameter group generating module, and at least one configuration parameter group writing module.

[0160] The device configuration parameter receiving module is used to receive the configuration parameters before the network card responds to the configuration instruction.

[0161] Receive device configuration parameters corresponding to at least one device, the at least one device includes a target device; at least one configuration parameter group generation module is used to generate at least one configuration parameter group according to different media types of the cable and the device configuration parameters corresponding to the at least one device, the at least one configuration parameter group includes a first type configuration parameter group; at least one configuration parameter group writing module is used to write at least one configuration parameter group into a processor of the network card, so that the network card configures the logical link of the network card, the cable and the target device according to the at least one configuration parameter group.

[0162] Since the functions of the device 1200 have been described in detail in the corresponding method embodiments, the present disclosure will not elaborate on them here.

[0163] The modules and / or units involved in the embodiments described in the present application may be implemented by software or hardware. The modules and / or units described may also be arranged in a processor. The names of these modules and / or units do not, in certain circumstances, constitute limitations on the modules and / or units themselves.

[0164] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0165] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.

[0166] Fig.13 FIG. 1 shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present disclosure. It should be noted that: Fig.13 The electronic device 1300 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0167] like Fig.13 As shown, the electronic device 1300 includes a central processing unit (CPU) 1301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1302 or a program loaded from a storage part 1308 into a random access memory (RAM) 1303. In the RAM 1303, various programs and data required for the operation of the electronic device 1300 are also stored. The CPU 1301, the ROM 1302, and the RAM 1303 are connected to each other via a bus 1304. An input / output (I / O) interface 1305 is also connected to the bus 1304.

[0168] The following components are connected to the I / O interface 1305: an input section 1306 including a keyboard, a mouse, etc.; an output section 1307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1308 including a hard disk, etc.; and a communication section 1309 including a network interface card such as a LAN card, a modem, etc. The communication section 1309 performs communication processing via a network such as the Internet. A drive 1310 is also connected to the I / O interface 1305 as needed. A removable medium 1311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1310 as needed, so that a computer program read therefrom is installed into the storage section 1308 as needed.

[0169] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part 1309, and / or installed from a removable medium 1311. When the computer program is executed by a central processing unit (CPU) 1301, the above-mentioned functions defined in the system of the present application are executed.

[0170] It should be noted that the computer-readable storage medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable storage medium other than a computer-readable storage medium that can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0171] As another aspect, the present application also provides a computer-readable storage medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed by a device, the device can realize functions including: the network card responds to the configuration instruction, determines the medium type of the cable that is physically connected to the network card, and the network card is provided with at least one configuration parameter group, and at least one configuration parameter group includes a first type of configuration parameter group, and the cable is used to physically connect the network card and the target device; the network card determines the first type of configuration parameter group that matches the medium type of the cable in at least one configuration parameter group, wherein different media types correspond to different types of configuration parameter groups; the network card traverses the first type of configuration parameter group, and configures the physical connection interface between the network card and the cable, so that the network card and the target device can perform a logical negotiation link.

[0172] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in various optional implementations of the above-mentioned embodiments.

[0173] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution of the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of instructions for a computing device (which can be a personal computer, a server, a mobile terminal, or a smart device, etc.) to execute the method according to the embodiment of the present disclosure, for example Figure 5 to Figure 11 One or more of the steps shown.

[0174] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not applied for by the present disclosure. The specification and examples are to be regarded as exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

[0175] It should be understood that the present disclosure is not limited to the detailed structures, drawings or implementations shown herein, but rather the present disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims

1. A network card configuration method, characterized in that: A network card is installed on the first device, the network card is configured with a processor and an interface controller, and the target device is physically connected to the network card through a cable and the interface controller, including: The processor in the network card detects the medium type of the cable that is physically connected to the network card in contact through the interface controller in the network card in response to the configuration instruction, the processor of the network card is provided with at least one configuration parameter group, the at least one configuration parameter group includes a first type of configuration parameter group, and the cable is used to physically connect the network card and the target device; wherein the processor is provided in the field programmable logic device of the network card; wherein the processor is a programmable optimized configurable soft core processor; The network card determines, from the at least one configuration parameter group, a configuration parameter group of the first type that matches the medium type of the cable, wherein different medium types correspond to different types of configuration parameter groups; The network card traverses the first type of configuration parameter group and configures the physical connection interface between the network card and the cable so that the network card and the target device perform a logical negotiation link; Wherein, before the network card responds to the configuration instruction, the method further includes: receiving a device configuration parameter corresponding to at least one device, the at least one device including the target device; Generate at least one configuration parameter group according to different media types of the cable and device configuration parameters corresponding to the at least one device, wherein the at least one configuration parameter group includes the first type of configuration parameter group; The at least one configuration parameter group is written into the processor of the network card so that the network card configures the logical link between the network card, the cable and the target device according to the at least one configuration parameter group.

2. The method according to claim 1, characterized in that: The first type of configuration parameter group includes configuration parameter group 1 and configuration parameter group 2; wherein the network card traverses the first type of configuration parameter group and configures the physical connection interface between the network card and the cable so that the network card and the target device perform a logical negotiation link, including: Configuring the physical connection interface between the network card and the cable through the configuration parameter group one; If the negotiation link between the network card and the target device is unsuccessful under the configuration of the configuration parameter group 1, the physical connection interface between the network card and the cable is configured using the configuration parameter group 2.

3. The method according to claim 2, characterized in that: The configuration parameter group 1 includes at least two cable rate parameters and at least two coding error correction configuration parameters; wherein, configuring the physical connection interface between the network card and the cable through the configuration parameter group 1 includes: When the network card configures the physical connection interface between the network card and the cable through the configuration parameter group 1, the network card switches between the at least two cable rate parameters to determine a cable rate parameter suitable for the cable; When the network card configures the physical connection interface between the network card and the cable through the configuration parameter group, the network card also switches between the at least two coding error correction configuration parameters to determine the coding error correction configuration parameters suitable for the cable; When the at least two cable rate parameters include a cable rate parameter suitable for the cable, and the at least two coding error correction configuration parameters include a coding error correction configuration parameter suitable for the cable, the physical connection interface between the network card and the cable is configured successfully.

4. The method according to claim 1, characterized in that: The network card includes an interface controller and a processor; wherein the network card determines the media type of the cable physically connected to the network card in contact in response to a configuration instruction, including: The processor detects, in response to the configuration instruction, through the interface controller, whether the medium type of the cable physically connected to the network card in contact is an optical fiber type or a copper type; The network card determines, from the at least one configuration parameter group, the first type of configuration parameter group that matches the medium type of the cable, including: The processor determines, from the at least one configuration parameter group, a configuration parameter group of the first type corresponding to the optical fiber type or the copper type; The network card traverses the configuration parameter group of the first type and configures the physical connection interface between the network card and the cable so that the network card and the target device perform a logical negotiation link, including: The processor traverses the first type of configuration parameter group and configures the interface controller so that the network card and the target device perform a logical negotiation link.

5. The method according to claim 1, characterized in that: Before the network card responds to the configuration instruction, the method further includes: When it is detected that the network card is powered on or a cable plugging and unplugging operation occurs on the network card or the interface controller of the network card is reset, the configuration instruction is generated.

6. The method according to claim 1, characterized in that: The network card includes a processor, and the processor is a read-write processor; wherein the method further includes: When the network card traverses the first type of configuration parameter group to configure the physical connection interface between the network card and the cable and the configuration fails, obtaining a target configuration parameter group corresponding to the target device and the cable; The target configuration parameter group corresponding to the target device and the cable is written into the read-write processor in the network card, so that the read-write processor configures the physical connection interface between the network card and the cable through the target configuration parameter group, so that the network card and the target device can perform a logical negotiation link.

7. A network card configuration device, characterized in that: The device is set on a first device, wherein a network card is installed on the first device, a processor and an interface controller are configured on the network card, and a target device is physically connected to the network card through a cable and the interface controller. The device includes: a medium type determination module, configured to detect, by the processor in the network card in response to a configuration instruction, a medium type of a cable physically connected to the network card in contact through an interface controller in the network card, wherein the network card is provided with at least one configuration parameter group, the at least one configuration parameter group includes a first type of configuration parameter group, and the cable is used to physically connect the network card and a target device; wherein the processor is provided in a field programmable logic device of the network card; wherein the processor is a programmable optimized configurable soft core processor; a configuration parameter group determination module, configured for the network card to determine, from the at least one configuration parameter group, a configuration parameter group of the first type that matches the medium type of the cable, wherein different medium types correspond to different types of configuration parameter groups; A configuration module, used for the network card to traverse the configuration parameter group of the first type and configure the physical connection interface between the network card and the cable so that the network card and the target device can perform a logical negotiation link; Before the network card responds to the configuration instruction, the method further includes: receiving a device configuration parameter corresponding to at least one device, the at least one device including the target device; Generate at least one configuration parameter group according to different media types of the cable and device configuration parameters corresponding to the at least one device, wherein the at least one configuration parameter group includes the first type of configuration parameter group; The at least one configuration parameter group is written into the processor of the network card so that the network card configures the logical link between the network card, the cable and the target device according to the at least one configuration parameter group.

8. An electronic device, characterized in that: include: Memory; as well as A processor coupled to the memory, the processor being used to execute the network card configuration method according to any one of claims 1 to 6 based on instructions stored in the memory.

9. A computer-readable storage medium having program instructions stored thereon, wherein the program instructions, when executed by a processor, implement the network card configuration method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Cable diagnosis system, method and system for configuring Ethernet port

    CN102098178A