Method, device and medium for adapting working mode of network card

CN117061341BActive Publication Date: 2026-10-09INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311014613.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-11
Publication Date
2026-10-09
Estimated Expiration
2043-08-11

AI Technical Summary

Technical Problem

[0006]但是,一个客户预定的服务器的数量往往很多,大量的客户都会预定服务器,如此,导致工作人员的工作量巨大,人工成本高,且人工处理的过程会耗费较多时间,导致服务器出厂的效率低

Benefits of technology

[0122]本申请能有效管控安装在待测试的服务器上的BF3网卡的工作模式,在对待测试的服务器进行整机测试过程中校验安装在待测试的服务器上的BF3网卡的工作模式,如果发现安装在待测试的服务器上的BF3网卡的工作模式与客户的要求不匹配,则可以自动将网卡的工作模式及时修改为客户的要求的工作模式,保证了待测试的服务器在交付时安装在待测试的服务器上的BF3网卡的工作模式符合客户的要求。整个过程可以没有人工参与,可以全程自动化处理,降低了人工成本,且能够保障准确性,提升服务器的交付质量。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117061341B_ABST
    Figure CN117061341B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides an adaptation method, device and equipment of the working mode of a network card and a medium. The application can effectively control the working mode of the BF3 network card installed on the server to be tested, verify the working mode of the BF3 network card installed on the server to be tested in the whole-machine test process of the server to be tested, and automatically modify the working mode of the network card to the working mode required by the customer in time if it is found that the working mode of the BF3 network card installed on the server to be tested does not match the requirement of the customer, so that the working mode of the BF3 network card installed on the server to be tested when the server to be tested is delivered meets the requirement of the customer. The whole process can be automatically processed without human intervention, the labor cost is reduced, the accuracy is guaranteed, and the delivery quality of the server is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method for adapting the working mode of a network interface card (NIC), a device for adapting the working mode of a NIC, an electronic device, and a readable storage medium. Background Technology

[0002] The NVIDIA BlueField-3 (BF3) network interface card is a 400Gb / s infrastructure computing platform that provides line-speed processing for software-defined networking, storage, and network security. Combining powerful computing capabilities, high-speed networking, and extensive programmability, the BF3 offers software-defined, hardware-accelerated solutions for demanding workloads.

[0003] As demand grows, BF3 network cards are being configured and installed in servers ordered by a wide range of customers. BF3 network cards have at least two working modes: NIC working mode and DPU working mode. Different customers often have different requirements for the working mode of BF3 network cards based on their own business scenarios.

[0004] Therefore, before the server ordered by the customer leaves the factory, it is necessary to adapt the working mode of the BF3 network card pre-installed on the server to ensure that the working mode of the BF3 network card pre-installed on the server matches the customer's requirements.

[0005] The current practice is to have staff manually check whether the working mode of the BF3 network card pre-installed on the customer's pre-installed server matches the customer's requirements before the server leaves the factory. If the working mode of the BF3 network card pre-installed on the customer's pre-installed server does not match the customer's requirements, the working mode of the BF3 network card pre-installed on the customer's pre-installed server will be manually modified to match the customer's requirements.

[0006] However, a customer often orders a large number of servers, and a large number of customers order servers, which leads to a huge workload for staff, high labor costs, and a long processing time, resulting in low efficiency in server delivery. Summary of the Invention

[0007] To address the aforementioned problems, the present invention provides a method for adapting the working mode of a network interface card (NIC), a device for adapting the working mode of a NIC, an electronic device, and a readable storage medium.

[0008] This invention provides a method for adapting the working mode of a network interface card (NIC), applied to a complete system testing system. The complete system testing system is installed in the server to be tested. The method includes:

[0009] Check whether a BF3 network card is installed in the server to be tested;

[0010] If a BF3 network card is installed in the server under test, obtain the PCIe bus number of the BF3 network card installed in the server under test; the PCIe bus number of the BF3 network card includes the unique identifier assigned to the BF3 network card by the PCIe bus in the server under test.

[0011] Obtain the original serial number of the BF3 network card installed in the server under test based on the PCIE bus number of the BF3 network card installed in the server under test.

[0012] Based on the original serial number of the BF3 network card installed in the server to be tested and the stored correspondence, obtain the predetermined working mode of the BF3 network card installed in the server to be tested; the correspondence includes the correspondence between the original serial number of the BF3 network card installed in the server and the predetermined working mode of the BF3 network card installed in the server.

[0013] Get the current operating mode of the BF3 network interface card installed on the server to be tested;

[0014] Compare the current operating mode of the BF3 network interface card (NIC) installed in the server under test with the intended operating mode of the BF3 NIC installed in the server under test to see if there are any differences.

[0015] If the current operating mode of the BF3 network card installed on the server under test differs from the intended operating mode of the BF3 network card installed on the server under test, the operating mode of the BF3 network card installed on the server under test will be changed from the current operating mode to the intended operating mode.

[0016] In an optional implementation, the method further includes:

[0017] After changing the operating mode of the BF3 network card installed on the server under test from the current operating mode to the predetermined operating mode, the step of obtaining the current operating mode of the BF3 network card installed on the server under test is executed again.

[0018] In an optional implementation, the method further includes:

[0019] After changing the operating mode of the BF3 network card installed in the server under test from the current operating mode to the predetermined operating mode, the corresponding entries in the mapping relationship, including the original serial number of the BF3 network card installed in the server under test and the predetermined operating mode of the BF3 network card installed in the server under test, are deleted.

[0020] In an optional implementation, detecting whether the server under test has a BF3 network card installed includes:

[0021] Invoke the first detection command lspci|grep"BlueField-3" pre-set in the whole machine testing system;

[0022] If the result returned by the first detection command is empty, it is determined that the BF3 network card is not installed in the server to be tested;

[0023] Alternatively, if the result returned by the first detection command is not empty, the second detection command "echo $?" can be called based on the result returned by the first detection command.

[0024] If the second detection command "echo $?" returns an empty result, it is determined that the BF3 network card is not installed on the server being tested.

[0025] Alternatively, if the result returned by the second detection command "echo $?" is not empty, it can be determined that the server under test has a BF3 network card installed.

[0026] In one optional implementation, the result returned by the first detection command includes the PCIe bus number of the BF3 network card installed in the server under test;

[0027] Obtaining the PCIe bus number of the BF3 network card installed in the server to be tested includes:

[0028] The PCIE bus number retrieval command `lspci|grep"BlueField-3"|awk'{print$1}'` is called based on the result returned by the first detection command to obtain the PCIE bus number of the BF3 network card installed in the server to be tested.

[0029] In an optional implementation, obtaining the original serial number of the BF3 network card installed in the server under test based on the PCIe bus number of the BF3 network card installed in the server under test includes:

[0030] The command `lspci -vvv -s $[PCIE bus number field]|grep "Serial number"|awk -F':''{print$2}'|sed -e's / / / g'` retrieves the original serial number of the BF3 network card installed on the server under test.

[0031] In an optional implementation, obtaining the current operating mode of the BF3 network interface card installed in the server to be tested includes:

[0032] The working mode acquisition command is invoked for the PCIE bus number of the BF3 network card installed in the server to be tested, and the call result returned by the working mode acquisition command is obtained.

[0033] The current operating mode of the BF3 network card installed on the server to be tested is determined based on the returned call result.

[0034] The instructions for obtaining the working mode include:

[0035] "mlxconfig -d [PCIE bus number field] q|grep -iE"

[0036] “INTERNAL_CPU_PAGE_SUPPLIER

[0037] INTERNAL_CPU_ESWITCH_MANAGER

[0038] INTERNAL_CPU_IB_VPORT0

[0039] INTERNAL_CPU_OFFLOAD_ENGINE"".

[0040] In one optional implementation, the call result returned by the working mode acquisition instruction includes: the return value of "INTERNAL_CPU_PAGE_SUPPLIER", the return value of "INTERNAL_CPU_ESWITCH_MANAGER", the return value of "INTERNAL_CPU_IB_VPORT0", and the return value of "INTERNAL_CPU_OFFLOAD_ENGINE".

[0041] The step of determining the current operating mode of the BF3 network card installed on the server under test based on the returned call result includes:

[0042] If the return values ​​of “INTERNAL_CPU_PAGE_SUPPLIER”, “INTERNAL_CPU_ESWITCH_MANAGER”, “INTERNAL_CPU_IB_VPORT0”, and “INTERNAL_CPU_OFFLOAD_ENGINE” are all the first preset values, then the current working mode of the BF3 network card installed in the server to be tested is determined to be NIC working mode.

[0043] or,

[0044] If the return values ​​of “INTERNAL_CPU_PAGE_SUPPLIER”, “INTERNAL_CPU_ESWITCH_MANAGER”, “INTERNAL_CPU_IB_VPORT0”, and “INTERNAL_CPU_OFFLOAD_ENGINE” are all the second preset values, then the current working mode of the BF3 network card installed in the server to be tested is determined to be DPU working mode.

[0045] In an optional implementation, the step of changing the operating mode of the BF3 network card installed in the server to be tested from its current operating mode to a predetermined operating mode includes:

[0046] When the predetermined working mode is NIC working mode, the first modification instruction is invoked according to the PCIE bus number of the BF3 network card installed in the server under test, so as to change the working mode of the BF3 network card installed in the server under test from DPU working mode to NIC working mode.

[0047] The first modification instructions include:

[0048] "mlxconfig -d$BDF S INTERNAL_CPU_MODEL = first preset value\"

[0049] INTERNAL_CPU_PAGE_SUPPLIER = First preset value\

[0050] INTERNAL_CPU_ESWITCH_MANAGER = First preset value\

[0051] INTERNAL_CPU_IB_VPORT0 = First preset value\

[0052] INTERNAL_CPU_OFFLOAD_ENGINE = First preset value\

[0053] INTERNAL_CPU_RSHIM = First preset value.

[0054] In an optional implementation, the step of changing the operating mode of the BF3 network card installed in the server to be tested from its current operating mode to a predetermined operating mode includes:

[0055] When the predetermined working mode is DPU working mode, the second modification instruction is invoked according to the PCIE bus number of the BF3 network card installed in the server under test, so as to change the working mode of the BF3 network card installed in the server under test from NIC working mode to DPU working mode.

[0056] The second modification instruction includes:

[0057] "mlxconfig -d$BDF S INTERNAL_CPU_MODEL = second preset value\"

[0058] INTERNAL_CPU_PAGE_SUPPLIER = Second preset value\

[0059] INTERNAL_CPU_ESWITCH_MANAGER = Second preset value\

[0060] INTERNAL_CPU_IB_VPORT0 = Second preset value\

[0061] INTERNAL_CPU_OFFLOAD_ENGINE = Second preset value\

[0062] INTERNAL_CPU_RSHIM = second preset value.

[0063] This invention provides a network interface card (NIC) operating mode adaptation device, applied to a complete machine testing system. The complete machine testing system is installed in the server to be tested. The device includes:

[0064] The detection module is used to detect whether a BF3 network card is installed in the server to be tested;

[0065] The first acquisition module is used to acquire the PCIe bus number of the BF3 network card installed in the server under test when the BF3 network card is installed in the server under test; the PCIe bus number of the BF3 network card includes the unique identifier assigned to the BF3 network card by the PCIe bus in the server under test.

[0066] The second acquisition module is used to obtain the original serial number of the BF3 network card installed in the server under test based on the PCIE bus number of the BF3 network card installed in the server under test.

[0067] The third acquisition module is used to acquire the predetermined working mode of the BF3 network card installed in the server to be tested based on the original serial number of the BF3 network card installed in the server to be tested and the stored correspondence; the correspondence includes the correspondence between the original serial number of the BF3 network card installed in the server and the predetermined working mode of the BF3 network card installed in the server.

[0068] The fourth acquisition module is used to acquire the current working mode of the BF3 network card installed in the server to be tested;

[0069] The comparison module is used to compare whether the current operating mode of the BF3 network card installed in the server under test is different from the predetermined operating mode of the BF3 network card installed in the server under test.

[0070] The modification module is used to change the operating mode of the BF3 network card installed on the server under test from the current operating mode to the predetermined operating mode when there is a difference between the current operating mode and the predetermined operating mode of the BF3 network card installed on the server under test.

[0071] In an alternative implementation, the apparatus further includes:

[0072] The fourth acquisition module is further configured to: after changing the working mode of the BF3 network card installed in the server to be tested from the current working mode to the predetermined working mode, acquire the current working mode of the BF3 network card installed in the server to be tested again.

[0073] In an alternative implementation, the apparatus further includes:

[0074] The deletion module is used to delete, after changing the working mode of the BF3 network card installed in the server under test from the current working mode to the predetermined working mode, the corresponding entries in the mapping relationship including the original serial number of the BF3 network card installed in the server under test and the predetermined working mode of the BF3 network card installed in the server under test.

[0075] In one optional implementation, the detection module includes:

[0076] The first calling unit is used to call the first detection command lspci|grep"BlueField-3" that is pre-set in the whole machine test system;

[0077] The first determining unit is used to determine that the BF3 network card is not installed in the server to be tested when the result returned by the first detection command is empty.

[0078] Alternatively, the second calling unit is used to call the second detection instruction "echo$?" in response to the result returned by the first detection instruction if the result returned by the first detection instruction is not empty;

[0079] The second determining unit is used to determine that the BF3 network card is not installed in the server to be tested if the result returned by the second detection command "echo $?" is empty.

[0080] Alternatively, the third determining unit is used to determine that the server under test has a BF3 network card installed if the result returned by the second detection command "echo $?" is not empty.

[0081] In one optional implementation, the result returned by the first detection command includes the PCIe bus number of the BF3 network card installed in the server under test;

[0082] The first acquisition module includes:

[0083] The third calling unit is used to call the PCIE bus number acquisition command lspci|grep"BlueField-3"|awk'{print$1}' based on the result returned by the first detection command, to obtain the PCIE bus number of the BF3 network card installed in the server to be tested, which was returned by the PCIE bus number acquisition command.

[0084] In one optional implementation, the second acquisition module includes:

[0085] The fourth retrieval unit is used to retrieve the original serial number of the BF3 network card installed in the server under test by using the PCIE bus number of the BF3 network card installed in the server under test. The original serial number is returned by the original serial number retrieval command and is the original serial number of the BF3 network card installed in the server under test.

[0086] In one optional implementation, the fourth acquisition module includes:

[0087] The fifth retrieval unit is used to retrieve the working mode acquisition command for the PCIE bus number of the BF3 network card installed in the server to be tested, and obtain the call result returned by the working mode acquisition command.

[0088] The fourth determining unit is used to determine the current working mode of the BF3 network card installed in the server to be tested based on the returned call result;

[0089] The instructions for obtaining the working mode include:

[0090] "mlxconfig -d [PCIE bus number field] q|grep -iE"

[0091] “INTERNAL_CPU_PAGE_SUPPLIER

[0092] INTERNAL_CPU_ESWITCH_MANAGER

[0093] INTERNAL_CPU_IB_VPORT0

[0094] INTERNAL_CPU_OFFLOAD_ENGINE"".

[0095] In one optional implementation, the call result returned by the working mode acquisition instruction includes: the return value of "INTERNAL_CPU_PAGE_SUPPLIER", the return value of "INTERNAL_CPU_ESWITCH_MANAGER", the return value of "INTERNAL_CPU_IB_VPORT0", and the return value of "INTERNAL_CPU_OFFLOAD_ENGINE".

[0096] The fourth determining unit includes:

[0097] The first determining subunit is used to determine that the current working mode of the BF3 network card installed in the server to be tested is NIC working mode when the return values ​​of “INTERNAL_CPU_PAGE_SUPPLIER”, “INTERNAL_CPU_ESWITCH_MANAGER”, “INTERNAL_CPU_IB_VPORT0”, and “INTERNAL_CPU_OFFLOAD_ENGINE” are all first preset values.

[0098] or,

[0099] The second determining subunit is used to determine that the current working mode of the BF3 network card installed in the server to be tested is DPU working mode when the return values ​​of “INTERNAL_CPU_PAGE_SUPPLIER”, “INTERNAL_CPU_ESWITCH_MANAGER”, “INTERNAL_CPU_IB_VPORT0”, and “INTERNAL_CPU_OFFLOAD_ENGINE” are all the second preset values.

[0100] In one optional implementation, the modified module includes:

[0101] The sixth fetching unit is used to call the first modification instruction according to the PCIE bus number of the BF3 network card installed in the server under test when the predetermined working mode is NIC working mode, so as to change the working mode of the BF3 network card installed in the server under test from DPU working mode to NIC working mode.

[0102] The first modification instructions include:

[0103] "mlxconfig -d$BDF S INTERNAL_CPU_MODEL = first preset value\"

[0104] INTERNAL_CPU_PAGE_SUPPLIER = First preset value\

[0105] INTERNAL_CPU_ESWITCH_MANAGER = First preset value\

[0106] INTERNAL_CPU_IB_VPORT0 = First preset value\

[0107] INTERNAL_CPU_OFFLOAD_ENGINE = First preset value\

[0108] INTERNAL_CPU_RSHIM = First preset value.

[0109] In one optional implementation, the modified module includes:

[0110] The seventh calling unit is used to call the second modification instruction according to the PCIE bus number of the BF3 network card installed in the server under test when the predetermined working mode is DPU working mode, so as to change the working mode of the BF3 network card installed in the server under test from NIC working mode to DPU working mode.

[0111] The second modification instruction includes:

[0112] "mlxconfig -d$BDF S INTERNAL_CPU_MODEL = second preset value\"

[0113] INTERNAL_CPU_PAGE_SUPPLIER = Second preset value\

[0114] INTERNAL_CPU_ESWITCH_MANAGER = Second preset value\

[0115] INTERNAL_CPU_IB_VPORT0 = Second preset value\

[0116] INTERNAL_CPU_OFFLOAD_ENGINE = Second preset value\

[0117] INTERNAL_CPU_RSHIM = second preset value.

[0118] This invention also discloses an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0119] Memory, used to store computer programs;

[0120] When a processor executes a program stored in memory, it implements the method steps described above.

[0121] This invention also discloses a readable storage medium, wherein when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is able to perform one or more of the methods described in this invention.

[0122] This application effectively manages the operating mode of the BF3 network interface cards (NICs) installed on the server under test. During the overall system testing of the server, it verifies the operating mode of the BF3 NICs installed on the server. If it finds that the operating mode of the BF3 NICs installed on the server under test does not match the customer's requirements, it can automatically modify the NIC's operating mode to meet the customer's requirements in a timely manner. This ensures that the BF3 NICs installed on the server under test meet the customer's requirements when the server is delivered. The entire process can be automated without human intervention, reducing labor costs, ensuring accuracy, and improving the quality of server delivery. Attached Figure Description

[0123] Figure 1 The flowchart illustrates the steps of a method for adapting the working mode of a network interface card (NIC) according to an embodiment of the present invention.

[0124] Figure 2 This diagram illustrates one possible result returned by the first detection command;

[0125] Figure 3 This diagram illustrates one possible result returned by a PCIe bus number retrieval command.

[0126] Figure 4 This diagram illustrates one possible result returned by the original serial number retrieval command.

[0127] Figure 5 This diagram illustrates one possible result returned by the working mode acquisition command;

[0128] Figure 6 The diagram shows a structural block diagram of an embodiment of a network interface card (NIC) working mode adaptation device according to an embodiment of the present invention.

[0129] Figure 7 A structural block diagram of an electronic device according to an exemplary embodiment is shown. Detailed Implementation

[0130] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0131] Before introducing the solution of this application, the technical terms that may be involved in the solution of this application will be explained.

[0132] Network Interface Card (NIC) Management System: A management system for configuring and verifying network interface cards (NICs).

[0133] Complete Server Testing System: This system performs complete server testing. It is a server system-level complete server testing system used to ensure the quality of the shipped server. This includes testing whether the hardware / firmware configuration meets the requirements, whether the functions are normal, whether the load component stress test is stable, and whether the overall stability and performance meet the requirements and customer-specified requirements.

[0134] PCIe bus number: Each function in the PCIe bus has a unique identifier. This identifier is the PCIe bus number, which can also be seen as a BDF number, where B represents Bus, D represents Device, and F represents Function.

[0135] PCIe: is a high-speed serial computer expansion bus standard.

[0136] BUS: Bus number. A maximum of 256 bus numbers can be assigned via configuration software. The initial bus number, Bus 0, is typically assigned by hardware to the Root Complex. Bus 0 consists of a virtual PCI bus with integrated endpoints and a virtual PCI-to-PCI bridge (P2P) with hard-coded device and function numbers. Each P2P bridge creates a new bus, and additional PCIe devices can connect to that bus. Each bus must be assigned a unique bus number.

[0137] Device: Device number. PCIe allows up to 32 device numbers on a single PCI bus; however, the point-to-point nature of PCIe means that only a single device can be directly connected to a PCIe link, and that device always ends with device 0. RC and Switch have a virtual PCI bus that allows multiple devices to be "connected" to the bus. Each device must implement Function0 and may contain a set of up to 8 Functions.

[0138] Function: A function number; functions are included in each device. These functions may include hard drive interfaces, display controllers, Ethernet controllers, USB controllers, etc. Devices with multiple functions do not need to be implemented sequentially. For example, a device might implement Functions 0, 2, and 7. Therefore, when software detects a multi-functional device, it must check every possible function to determine which functions are present. Each function also has its own configuration address space for setting associated resources.

[0139] Reference Figure 1 This diagram illustrates a flowchart of an embodiment of a network interface card (NIC) working mode adaptation method provided by the present invention. The method is applied to a complete machine testing system, which is installed in the server to be tested. The method includes:

[0140] In step S101, it is detected whether a BF3 network card is installed in the server to be tested.

[0141] In one embodiment of this application, the first detection command lspci|grep"BlueField-3" pre-set in the whole machine testing system can be invoked.

[0142] Statistics show that when a BF3 network card is installed on the server, the result returned by the first detection command lspci|grep "BlueField-3" is often not empty.

[0143] When the BF3 network card is not installed on the server, the first detection command lspci|grep "BlueField-3" will often return an empty result.

[0144] Thus, after calling the first detection command lspci|grep "BlueField-3" pre-set in the whole machine test system, if the result returned by the first detection command is empty, it is determined that the BF3 network card is not installed in the server to be tested.

[0145] Furthermore, even if the result returned by the first detection command is not empty, it cannot be 100% certain that the server under test has a BF3 network card installed, and further verification is required.

[0146] For example, the second detection command "echo $?" is called in response to the result returned by the first detection command.

[0147] Statistics show that when a BF3 network card is installed on the server, after calling the second detection command "echo $?" in response to the result returned by the first detection command, the result returned by the second detection command is often not empty.

[0148] If the server does not have a BF3 network card installed, after calling the second detection command "echo $?" in response to the result returned by the first detection command, the result returned by the second detection command is often empty.

[0149] Therefore, if the second detection command "echo $?" returns an empty result, it can be determined that the server under test does not have a BF3 network card installed. Alternatively, if the second detection command "echo $?" returns a non-empty result, it can be determined that the server under test has a BF3 network card installed.

[0150] For example, the result returned by the first detection command can be seen in... Figure 2 As shown.

[0151] If a BF3 network card is installed in the server to be tested, in step S102, the PCIE bus number of the BF3 network card installed in the server to be tested is obtained.

[0152] The PCIe bus number of the BF3 network card includes the unique identifier assigned to the BF3 network card by the PCIe bus in the server under test.

[0153] Different devices in a server have different PCIe bus numbers.

[0154] In this application, if a BF3 network card is installed in the server to be tested, the BF3 network card will necessarily have its own PCIe bus number.

[0155] The first test command returns the PCIe bus number of the BF3 network card installed in the server under test. However, the result often includes other information, allowing the PCIe bus number of the BF3 network card to be indexed from the first command's return. For example, the command `lspci|grep"BlueField-3"|awk'{print$1}'` can be used to retrieve the PCIe bus number of the BF3 network card installed in the server under test, as returned by the first test command.

[0156] For example, the result returned by the PCIe bus number retrieval command can be found in [reference needed]. Figure 3 As shown. From Figure 3 As can be seen from the data, there are multiple PCIe bus numbers, which suggests that there are multiple BF3 network cards installed on the server being tested.

[0157] In step S103, the original serial number of the BF3 network card installed in the server under test is obtained based on the PCIE bus number of the BF3 network card installed in the server under test.

[0158] The original serial number of a BF3 network card is set by the manufacturer before the card leaves the factory; it is the card's serial number. Different BF3 network cards have different original serial numbers.

[0159] In the previous scenario of producing a server to be tested, a BF3 network card would be installed on the server to be tested. The server to be tested would then obtain the original serial number of the BF3 network card from the BF3 network card and store the original serial number of the BF3 network card on the server to be tested.

[0160] Then, the original serial number of the BF3 network card can be obtained through commands. For example, to retrieve the original serial number of the BF3 network card installed in the server under test, the command `lspci -vvv -s $[PCIE bus number field]|grep "Serial number"|awk -F':"{print$2}'|sed -e's / / / g'` will return the original serial number of the BF3 network card installed in the server under test.

[0161] For example, the result returned by the command to retrieve the original serial number can be found in [reference]. Figure 4 As shown.

[0162] In step S104, the predetermined operating mode of the BF3 network card installed in the server under test is obtained based on the original serial number of the BF3 network card installed in the server and the stored correspondence. The correspondence includes the correspondence between the original serial number of the BF3 network card installed in the server and the predetermined operating mode of the BF3 network card installed in the server.

[0163] The BF3 network card installed in the server is configured to operate in the mode requested by the customer who ordered the server.

[0164] The whole machine testing system has a corresponding cloud platform.

[0165] In one scenario, a customer can reserve a server through the ordering system. After reservation, the system automatically equips the server with a BF3 network interface card (NIC). The BF3 NIC is already in the manufacturer's inventory, and its original serial number is stored in the database. The system can then retrieve the BF3 NIC's original serial number from this database, linking the server to the automatically assigned BF3 NIC. Furthermore, the system prompts the customer to specify the intended operating mode for the BF3 NIC installed on the server. Once the customer specifies this mode, it is linked to the original serial number of the automatically assigned BF3 NIC.

[0166] The ordering system will transmit the scheduled operating mode of the BF3 network card installed in the server and the original serial number of the BF3 network card automatically assigned to the server to the cloud.

[0167] After obtaining the intended operating mode of the BF3 network card installed on the server and the original serial number of the BF3 network card automatically assigned to the server from the cloud, the original serial number of the BF3 network card automatically assigned to the server and the intended operating mode of the BF3 network card installed on the server can be combined into a corresponding table entry and stored in the correspondence between the original serial number of the BF3 network card installed on the server and the intended operating mode of the BF3 network card installed on the server.

[0168] The same applies to every other server booked through the ordering system.

[0169] Thus, in this step, the corresponding predetermined operating mode of the original serial number of the BF3 network card installed in the server can be found in the correspondence between the original serial number of the BF3 network card installed in the server and the predetermined operating mode of the BF3 network card installed in the server, and this predetermined operating mode can be used as the predetermined operating mode of the BF3 network card installed in the server to be tested.

[0170] The mapping relationship can be located in the cloud corresponding to the whole machine test system. The whole machine test system can remotely retrieve the mapping relationship from the cloud and find the predetermined working mode of the BF3 network card installed in the server to be tested.

[0171] This application allows customers to specify the intended operating mode of the BF3 network interface card (NIC) installed on the server directly in the ordering system when placing their order for the server. This ensures the completeness, accuracy, and reliability of the intended operating mode, guaranteeing that it meets the customer's requirements. The intended operating mode of the BF3 NIC is determined at the initial customer stage and remains unchanged throughout the backend production server process, ensuring accuracy.

[0172] In one example, the correspondence between the original serial number of the BF3 network card installed in the server and the predetermined operating mode of the BF3 network card installed in the server can be shown in the table below. The table includes two columns: the first column is the original serial number of the BF3 network card, and the second column is the predetermined operating mode of the BF3 network card.

[0173]

[0174]

[0175] In step S105, the current operating mode of the BF3 network card installed in the server to be tested is obtained.

[0176] In one embodiment of this application, a working mode acquisition command can be invoked for the PCIe bus number of the BF3 network card installed in the server under test, and the call result returned by the working mode acquisition command can be obtained. Then, the current working mode of the BF3 network card installed in the server under test can be determined based on the returned call result.

[0177] The instructions for obtaining the working mode include:

[0178] "mlxconfig -d [PCIE bus number field] q|grep -iE"

[0179] “INTERNAL_CPU_PAGE_SUPPLIER

[0180] INTERNAL_CPU_ESWITCH_MANAGER

[0181] INTERNAL_CPU_IB_VPORT0

[0182] INTERNAL_CPU_OFFLOAD_ENGINE"".

[0183] In one example, the call results returned by the working mode acquisition instruction include the return values ​​of "INTERNAL_CPU_PAGE_SUPPLIER", "INTERNAL_CPU_ESWITCH_MANAGER", "INTERNAL_CPU_IB_VPORT0", and "INTERNAL_CPU_OFFLOAD_ENGINE".

[0184] Thus, if the return values ​​of "INTERNAL_CPU_PAGE_SUPPLIER", "INTERNAL_CPU_ESWITCH_MANAGER", "INTERNAL_CPU_IB_VPORT0", and "INTERNAL_CPU_OFFLOAD_ENGINE" are all the first preset values, the current operating mode of the BF3 network card installed in the server under test is determined to be NIC operating mode. Alternatively, if the return values ​​of "INTERNAL_CPU_PAGE_SUPPLIER", "INTERNAL_CPU_ESWITCH_MANAGER", "INTERNAL_CPU_IB_VPORT0", and "INTERNAL_CPU_OFFLOAD_ENGINE" are all the second preset values, the current operating mode of the BF3 network card installed in the server under test is determined to be DPU operating mode.

[0185] The first preset value can include 1, and the second preset value can include 0, etc.

[0186] For example, the result returned by the working mode acquisition command can be found in [reference]. Figure 5 As shown. Figure 5 The return values ​​of “INTERNAL_CPU_PAGE_SUPPLIER”, “INTERNAL_CPU_ESWITCH_MANAGER”, “INTERNAL_CPU_IB_VPORT0”, and “INTERNAL_CPU_OFFLOAD_ENGINE” are all 1.

[0187] In step S106, a comparison is made between the current operating mode of the BF3 network card installed in the server under test and the predetermined operating mode of the BF3 network card installed in the server under test to determine if they differ.

[0188] If the current operating mode of the BF3 network card installed in the server under test differs from the predetermined operating mode of the BF3 network card installed in the server under test, in step S107, the operating mode of the BF3 network card installed in the server under test will be changed from the current operating mode to the predetermined operating mode.

[0189] In one embodiment of this application, when the predetermined working mode is NIC working mode, a first modification instruction is invoked according to the PCIE bus number of the BF3 network card installed in the server under test, so as to change the working mode of the BF3 network card installed in the server under test from DPU working mode to NIC working mode.

[0190] The first modification instructions include:

[0191] "mlxconfig -d$BDF S INTERNAL_CPU_MODEL = first preset value\"

[0192] INTERNAL_CPU_PAGE_SUPPLIER = First preset value\

[0193] INTERNAL_CPU_ESWITCH_MANAGER = First preset value\

[0194] INTERNAL_CPU_IB_VPORT0 = First preset value\

[0195] INTERNAL_CPU_OFFLOAD_ENGINE = First preset value\

[0196] INTERNAL_CPU_RSHIM = First preset value.

[0197] Alternatively, in another embodiment of this application, when the predetermined working mode is DPU working mode, a second modification instruction is invoked according to the PCIE bus number of the BF3 network card installed in the server under test, so as to change the working mode of the BF3 network card installed in the server under test from NIC working mode to DPU working mode.

[0198] The second modification instruction includes:

[0199] "mlxconfig -d$BDF S INTERNAL_CPU_MODEL = second preset value\"

[0200] INTERNAL_CPU_PAGE_SUPPLIER = Second preset value\

[0201] INTERNAL_CPU_ESWITCH_MANAGER = Second preset value\

[0202] INTERNAL_CPU_IB_VPORT0 = Second preset value\

[0203] INTERNAL_CPU_OFFLOAD_ENGINE = Second preset value\

[0204] INTERNAL_CPU_RSHIM = second preset value.

[0205] Alternatively, if the current operating mode of the BF3 network card installed in the server under test is the same as the predetermined operating mode of the BF3 network card installed in the server under test, the testing of the operating mode of the BF3 network card installed in the server under test can be terminated.

[0206] Furthermore, after executing step S107 to modify the working mode of the BF3 network card installed in the server under test from the current working mode to the predetermined working mode, steps S105 to S106 are executed again until it is determined that the modified working mode of the BF3 network card installed in the server under test is the same as the predetermined working mode of the BF3 network card installed in the server under test. After that, the test on the working mode of the BF3 network card installed in the server under test can be ended.

[0207] In another embodiment of this application, after changing the operating mode of the BF3 network card installed in the server under test from the current operating mode to the predetermined operating mode, the goal of matching the operating mode of the BF3 network card installed in the server under test with the customer's requirements for the server under test has been achieved. There is no need to further modify the operating mode of the BF3 network card installed in the server under test, nor is it necessary to test the operating mode of the BF3 network card installed in the server under test. Therefore, to save storage space, the corresponding entries for the original serial number and the predetermined operating mode of the BF3 network card installed in the server can be deleted from the mapping relationship between the original serial number and the predetermined operating mode of the BF3 network card installed in the server.

[0208] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0209] Reference Figure 6 This diagram illustrates a structural block diagram of an embodiment of a network interface card (NIC) working mode adaptation device provided by an embodiment of the present invention. The device is applied to a complete machine testing system, which is installed in the server to be tested. The device includes:

[0210] The detection module 11 is used to detect whether a BF3 network card is installed in the server to be tested;

[0211] The first acquisition module 12 is used to acquire the PCIE bus number of the BF3 network card installed in the server under test when the BF3 network card is installed in the server under test; the PCIE bus number of the BF3 network card includes the unique identifier assigned to the BF3 network card by the PCIE bus in the server under test.

[0212] The second acquisition module 13 is used to obtain the original serial number of the BF3 network card installed in the server under test based on the PCIE bus number of the BF3 network card installed in the server under test.

[0213] The third acquisition module 14 is used to acquire the predetermined working mode of the BF3 network card installed in the server to be tested based on the original serial number of the BF3 network card installed in the server to be tested and the stored correspondence; the correspondence includes the correspondence between the original serial number of the BF3 network card installed in the server and the predetermined working mode of the BF3 network card installed in the server.

[0214] The fourth acquisition module 15 is used to acquire the current working mode of the BF3 network card installed in the server to be tested;

[0215] Comparison module 16 is used to compare whether the current operating mode of the BF3 network card installed in the server under test is different from the predetermined operating mode of the BF3 network card installed in the server under test.

[0216] Modify module 17 to change the operating mode of the BF3 network card installed on the server under test from the current operating mode to the predetermined operating mode when the current operating mode of the BF3 network card installed on the server under test is different from the predetermined operating mode of the BF3 network card installed on the server under test.

[0217] In an alternative implementation, the apparatus further includes:

[0218] The fourth acquisition module is further configured to: after changing the working mode of the BF3 network card installed in the server to be tested from the current working mode to the predetermined working mode, acquire the current working mode of the BF3 network card installed in the server to be tested again.

[0219] In an alternative implementation, the apparatus further includes:

[0220] The deletion module is used to delete, after changing the working mode of the BF3 network card installed in the server under test from the current working mode to the predetermined working mode, the corresponding entries in the mapping relationship including the original serial number of the BF3 network card installed in the server under test and the predetermined working mode of the BF3 network card installed in the server under test.

[0221] In one optional implementation, the detection module includes:

[0222] The first calling unit is used to call the first detection command lspci|grep"BlueField-3" that is pre-set in the whole machine test system;

[0223] The first determining unit is used to determine that the BF3 network card is not installed in the server to be tested when the result returned by the first detection command is empty.

[0224] Alternatively, the second calling unit is used to call the second detection instruction "echo$?" in response to the result returned by the first detection instruction if the result returned by the first detection instruction is not empty;

[0225] The second determining unit is used to determine that the BF3 network card is not installed in the server to be tested if the result returned by the second detection command "echo $?" is empty.

[0226] Alternatively, the third determining unit is used to determine that the server under test has a BF3 network card installed if the result returned by the second detection command "echo $?" is not empty.

[0227] In one optional implementation, the result returned by the first detection command includes the PCIe bus number of the BF3 network card installed in the server under test;

[0228] The first acquisition module includes:

[0229] The third calling unit is used to call the PCIE bus number acquisition command lspci|grep"BlueField-3"|awk'{print$1}' based on the result returned by the first detection command, to obtain the PCIE bus number of the BF3 network card installed in the server to be tested, which was returned by the PCIE bus number acquisition command.

[0230] In one optional implementation, the second acquisition module includes:

[0231] The fourth retrieval unit is used to retrieve the original serial number of the BF3 network card installed in the server under test by using the PCIE bus number of the BF3 network card installed in the server under test. The original serial number is returned by the original serial number retrieval command and is the original serial number of the BF3 network card installed in the server under test.

[0232] In one optional implementation, the fourth acquisition module includes:

[0233] The fifth retrieval unit is used to retrieve the working mode acquisition command for the PCIE bus number of the BF3 network card installed in the server to be tested, and obtain the call result returned by the working mode acquisition command.

[0234] The fourth determining unit is used to determine the current working mode of the BF3 network card installed in the server to be tested based on the returned call result;

[0235] The instructions for obtaining the working mode include:

[0236] "mlxconfig -d [PCIE bus number field] q|grep -iE"

[0237] “INTERNAL_CPU_PAGE_SUPPLIER

[0238] INTERNAL_CPU_ESWITCH_MANAGER

[0239] INTERNAL_CPU_IB_VPORT0

[0240] INTERNAL_CPU_OFFLOAD_ENGINE"".

[0241] In one optional implementation, the call result returned by the working mode acquisition instruction includes: the return value of "INTERNAL_CPU_PAGE_SUPPLIER", the return value of "INTERNAL_CPU_ESWITCH_MANAGER", the return value of "INTERNAL_CPU_IB_VPORT0", and the return value of "INTERNAL_CPU_OFFLOAD_ENGINE".

[0242] The fourth determining unit includes:

[0243] The first determining subunit is used to determine that the current working mode of the BF3 network card installed in the server to be tested is NIC working mode when the return values ​​of “INTERNAL_CPU_PAGE_SUPPLIER”, “INTERNAL_CPU_ESWITCH_MANAGER”, “INTERNAL_CPU_IB_VPORT0”, and “INTERNAL_CPU_OFFLOAD_ENGINE” are all first preset values.

[0244] or,

[0245] The second determining subunit is used to determine that the current working mode of the BF3 network card installed in the server to be tested is DPU working mode when the return values ​​of “INTERNAL_CPU_PAGE_SUPPLIER”, “INTERNAL_CPU_ESWITCH_MANAGER”, “INTERNAL_CPU_IB_VPORT0”, and “INTERNAL_CPU_OFFLOAD_ENGINE” are all the second preset values.

[0246] In one optional implementation, the modified module includes:

[0247] The sixth fetching unit is used to call the first modification instruction according to the PCIE bus number of the BF3 network card installed in the server under test when the predetermined working mode is NIC working mode, so as to change the working mode of the BF3 network card installed in the server under test from DPU working mode to NIC working mode.

[0248] The first modification instructions include:

[0249] "mlxconfig -d$BDF S INTERNAL_CPU_MODEL = first preset value\"

[0250] INTERNAL_CPU_PAGE_SUPPLIER = First preset value\

[0251] INTERNAL_CPU_ESWITCH_MANAGER = First preset value\

[0252] INTERNAL_CPU_IB_VPORT0 = First preset value\

[0253] INTERNAL_CPU_OFFLOAD_ENGINE = First preset value\

[0254] INTERNAL_CPU_RSHIM = First preset value.

[0255] In one optional implementation, the modified module includes:

[0256] The seventh calling unit is used to call the second modification instruction according to the PCIE bus number of the BF3 network card installed in the server under test when the predetermined working mode is DPU working mode, so as to change the working mode of the BF3 network card installed in the server under test from NIC working mode to DPU working mode.

[0257] The second modification instruction includes:

[0258] "mlxconfig -d$BDF S INTERNAL_CPU_MODEL = second preset value\"

[0259] INTERNAL_CPU_PAGE_SUPPLIER = Second preset value\

[0260] INTERNAL_CPU_ESWITCH_MANAGER = Second preset value\

[0261] INTERNAL_CPU_IB_VPORT0 = Second preset value\

[0262] INTERNAL_CPU_OFFLOAD_ENGINE = Second preset value\

[0263] INTERNAL_CPU_RSHIM = second preset value.

[0264] This application effectively manages the operating mode of the BF3 network interface cards (NICs) installed on the server under test. During the overall system testing of the server, it verifies the operating mode of the BF3 NICs installed on the server. If it finds that the operating mode of the BF3 NICs installed on the server under test does not match the customer's requirements, it can automatically modify the NIC's operating mode to meet the customer's requirements in a timely manner. This ensures that the BF3 NICs installed on the server under test meet the customer's requirements when the server is delivered. The entire process can be automated without human intervention, reducing labor costs, ensuring accuracy, and improving the quality of server delivery.

[0265] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0266] Figure 7 This is a structural block diagram illustrating an electronic device 700 according to an exemplary embodiment. For example, the electronic device 700 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.

[0267] Reference Figure 7 The electronic device 700 may include one or more of the following components: a processing component 702, a memory 704, a power supply component 706, a multimedia component 708, an audio component 710, an input / output (I / O) interface 712, a sensor component 714, and a communication component 716.

[0268] Processing component 702 typically controls the overall operation of electronic device 700, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 702 may include one or more processors 720 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 702 may include one or more modules to facilitate interaction between processing component 702 and other components. For example, processing component 702 may include a multimedia module to facilitate interaction between multimedia component 708 and processing component 702.

[0269] Memory 704 is configured to store various types of data to support the operation of device 700. Examples of this data include instructions for any application or method operating on electronic device 700, contact data, phonebook data, messages, pictures, videos, etc. Memory 704 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0270] Power component 704 provides power to various components of electronic device 700. Power component 704 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 700.

[0271] Multimedia component 708 includes a screen that provides an output interface between the electronic device 700 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 708 includes a front-facing camera and / or a rear-facing camera. When the electronic device 700 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0272] Audio component 710 is configured to output and / or input audio signals. For example, audio component 710 includes a microphone (MIC) configured to receive external audio signals when electronic device 700 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 704 or transmitted via communication component 716. In some embodiments, audio component 710 also includes a speaker for outputting audio signals.

[0273] I / O interface 712 provides an interface between processing component 702 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0274] Sensor assembly 714 includes one or more sensors for providing state assessments of various aspects of electronic device 700. For example, sensor assembly 714 may detect the on / off state of device 700, the relative positioning of components such as the display and keypad of electronic device 700, changes in position of electronic device 700 or a component of electronic device 700, the presence or absence of user contact with electronic device 700, orientation or acceleration / deceleration of electronic device 700, and temperature changes of electronic device 700. Sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 714 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 714 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.

[0275] Communication component 716 is configured to facilitate wired or wireless communication between electronic device 700 and other devices. Electronic device 700 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 714 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 714 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0276] In an exemplary embodiment, the electronic device 700 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.

[0277] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 704 including instructions, which can be executed by a processor 720 of an electronic device 700 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0278] A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform a network interface card (NIC) operating mode adaptation method, applied to a complete machine testing system installed in a server under test, the method comprising:

[0279] Check whether a BF3 network card is installed in the server to be tested;

[0280] If a BF3 network card is installed in the server under test, obtain the PCIe bus number of the BF3 network card installed in the server under test; the PCIe bus number of the BF3 network card includes the unique identifier assigned to the BF3 network card by the PCIe bus in the server under test.

[0281] Obtain the original serial number of the BF3 network card installed in the server under test based on the PCIE bus number of the BF3 network card installed in the server under test.

[0282] Based on the original serial number of the BF3 network card installed in the server to be tested and the stored correspondence, obtain the predetermined working mode of the BF3 network card installed in the server to be tested; the correspondence includes the correspondence between the original serial number of the BF3 network card installed in the server and the predetermined working mode of the BF3 network card installed in the server.

[0283] Get the current operating mode of the BF3 network interface card installed on the server to be tested;

[0284] Compare the current operating mode of the BF3 network interface card (NIC) installed in the server under test with the intended operating mode of the BF3 NIC installed in the server under test to see if there are any differences.

[0285] If the current operating mode of the BF3 network card installed on the server under test differs from the intended operating mode of the BF3 network card installed on the server under test, the operating mode of the BF3 network card installed on the server under test will be changed from the current operating mode to the intended operating mode.

[0286] In an optional implementation, the method further includes:

[0287] After changing the operating mode of the BF3 network card installed on the server under test from the current operating mode to the predetermined operating mode, the step of obtaining the current operating mode of the BF3 network card installed on the server under test is executed again.

[0288] In an optional implementation, the method further includes:

[0289] After changing the operating mode of the BF3 network card installed in the server under test from the current operating mode to the predetermined operating mode, the corresponding entries in the mapping relationship, including the original serial number of the BF3 network card installed in the server under test and the predetermined operating mode of the BF3 network card installed in the server under test, are deleted.

[0290] In an optional implementation, detecting whether the server under test has a BF3 network card installed includes:

[0291] Invoke the first detection command lspci|grep"BlueField-3" pre-set in the whole machine testing system;

[0292] If the result returned by the first detection command is empty, it is determined that the BF3 network card is not installed in the server to be tested;

[0293] Alternatively, if the result returned by the first detection command is not empty, the second detection command "echo $?" can be called based on the result returned by the first detection command.

[0294] If the second detection command "echo $?" returns an empty result, it is determined that the BF3 network card is not installed on the server being tested.

[0295] Alternatively, if the result returned by the second detection command "echo $?" is not empty, it can be determined that the server under test has a BF3 network card installed.

[0296] In one optional implementation, the result returned by the first detection command includes the PCIe bus number of the BF3 network card installed in the server under test;

[0297] Obtaining the PCIe bus number of the BF3 network card installed in the server to be tested includes:

[0298] The PCIE bus number retrieval command `lspci|grep"BlueField-3"|awk'{print$1}'` is called based on the result returned by the first detection command to obtain the PCIE bus number of the BF3 network card installed in the server to be tested.

[0299] In an optional implementation, obtaining the original serial number of the BF3 network card installed in the server under test based on the PCIe bus number of the BF3 network card installed in the server under test includes:

[0300] The command `lspci -vvv -s $[PCIE bus number field]|grep "Serial number"|awk -F':''{print$2}'|sed -e's / / / g'` retrieves the original serial number of the BF3 network card installed on the server under test.

[0301] In an optional implementation, obtaining the current operating mode of the BF3 network interface card installed in the server to be tested includes:

[0302] The working mode acquisition command is invoked for the PCIE bus number of the BF3 network card installed in the server to be tested, and the call result returned by the working mode acquisition command is obtained.

[0303] The current operating mode of the BF3 network card installed on the server to be tested is determined based on the returned call result.

[0304] The instructions for obtaining the working mode include:

[0305] "mlxconfig -d [PCIE bus number field] q|grep -iE"

[0306] “INTERNAL_CPU_PAGE_SUPPLIER

[0307] INTERNAL_CPU_ESWITCH_MANAGER

[0308] INTERNAL_CPU_IB_VPORT0

[0309] INTERNAL_CPU_OFFLOAD_ENGINE"".

[0310] In one optional implementation, the call result returned by the working mode acquisition instruction includes: the return value of "INTERNAL_CPU_PAGE_SUPPLIER", the return value of "INTERNAL_CPU_ESWITCH_MANAGER", the return value of "INTERNAL_CPU_IB_VPORT0", and the return value of "INTERNAL_CPU_OFFLOAD_ENGINE".

[0311] The step of determining the current operating mode of the BF3 network card installed on the server under test based on the returned call result includes:

[0312] If the return values ​​of “INTERNAL_CPU_PAGE_SUPPLIER”, “INTERNAL_CPU_ESWITCH_MANAGER”, “INTERNAL_CPU_IB_VPORT0”, and “INTERNAL_CPU_OFFLOAD_ENGINE” are all the first preset values, then the current working mode of the BF3 network card installed in the server to be tested is determined to be NIC working mode.

[0313] or,

[0314] If the return values ​​of “INTERNAL_CPU_PAGE_SUPPLIER”, “INTERNAL_CPU_ESWITCH_MANAGER”, “INTERNAL_CPU_IB_VPORT0”, and “INTERNAL_CPU_OFFLOAD_ENGINE” are all the second preset values, then the current working mode of the BF3 network card installed in the server to be tested is determined to be DPU working mode.

[0315] In an optional implementation, the step of changing the operating mode of the BF3 network card installed in the server to be tested from its current operating mode to a predetermined operating mode includes:

[0316] When the predetermined working mode is NIC working mode, the first modification instruction is invoked according to the PCIE bus number of the BF3 network card installed in the server under test, so as to change the working mode of the BF3 network card installed in the server under test from DPU working mode to NIC working mode.

[0317] The first modification instructions include:

[0318] "mlxconfig -d$BDF S INTERNAL_CPU_MODEL = first preset value\"

[0319] INTERNAL_CPU_PAGE_SUPPLIER = First preset value\

[0320] INTERNAL_CPU_ESWITCH_MANAGER = First preset value\

[0321] INTERNAL_CPU_IB_VPORT0 = First preset value\

[0322] INTERNAL_CPU_OFFLOAD_ENGINE = First preset value\

[0323] INTERNAL_CPU_RSHIM = First preset value.

[0324] In an optional implementation, the step of changing the operating mode of the BF3 network card installed in the server to be tested from its current operating mode to a predetermined operating mode includes:

[0325] When the predetermined working mode is DPU working mode, the second modification instruction is invoked according to the PCIE bus number of the BF3 network card installed in the server under test, so as to change the working mode of the BF3 network card installed in the server under test from NIC working mode to DPU working mode.

[0326] The second modification instruction includes:

[0327] "mlxconfig -d$BDF S INTERNAL_CPU_MODEL = second preset value\"

[0328] INTERNAL_CPU_PAGE_SUPPLIER = Second preset value\

[0329] INTERNAL_CPU_ESWITCH_MANAGER = Second preset value\

[0330] INTERNAL_CPU_IB_VPORT0 = Second preset value\

[0331] INTERNAL_CPU_OFFLOAD_ENGINE = Second preset value\

[0332] INTERNAL_CPU_RSHIM = second preset value.

[0333] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0334] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0335] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0336] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0337] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0338] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.

[0339] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0340] The above provides a detailed description of a network interface card (NIC) working mode adaptation method, a NIC working mode adaptation device, an electronic device, and a readable storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for adapting the working mode of a network interface card (NIC), characterized in that, The method, applied to a complete system testing system installed in the server to be tested, includes: Check whether a BF3 network card is installed in the server to be tested; If a BF3 network card is installed in the server under test, obtain the PCIe bus number of the BF3 network card installed in the server under test; the PCIe bus number of the BF3 network card includes the unique identifier assigned to the BF3 network card by the PCIe bus in the server under test. Obtain the original serial number of the BF3 network card installed in the server under test based on the PCIE bus number of the BF3 network card installed in the server under test. Based on the original serial number of the BF3 network card installed in the server to be tested and the stored correspondence, obtain the predetermined working mode of the BF3 network card installed in the server to be tested; the correspondence includes the correspondence between the original serial number of the BF3 network card installed in the server and the predetermined working mode of the BF3 network card installed in the server. Get the current operating mode of the BF3 network interface card installed on the server to be tested; Compare the current operating mode of the BF3 network interface card (NIC) installed in the server under test with the intended operating mode of the BF3 NIC installed in the server under test to see if there are any differences. If the current operating mode of the BF3 network card installed on the server under test differs from the intended operating mode of the BF3 network card installed on the server under test, the operating mode of the BF3 network card installed on the server under test will be changed from the current operating mode to the intended operating mode.

2. The method according to claim 1, characterized in that, The method further includes: After changing the operating mode of the BF3 network card installed on the server under test from the current operating mode to the predetermined operating mode, the step of obtaining the current operating mode of the BF3 network card installed on the server under test is executed again.

3. The method according to claim 1, characterized in that, The method further includes: After changing the operating mode of the BF3 network card installed in the server under test from the current operating mode to the predetermined operating mode, the corresponding entries in the mapping relationship, including the original serial number of the BF3 network card installed in the server under test and the predetermined operating mode of the BF3 network card installed in the server under test, are deleted.

4. The method according to claim 1, characterized in that, The detection of whether the server under test has a BF3 network card installed includes: Invoke the first detection command lspci|grep"BlueField-3" pre-set in the whole machine testing system; If the result returned by the first detection command is empty, it is determined that the BF3 network card is not installed in the server to be tested; Alternatively, if the result returned by the first detection command is not empty, the second detection command "echo $?" can be called based on the result returned by the first detection command. If the second detection command "echo $?" returns an empty result, it is determined that the BF3 network card is not installed on the server being tested. Alternatively, if the result returned by the second detection command "echo $?" is not empty, it can be determined that the server under test has a BF3 network card installed.

5. The method according to claim 4, characterized in that, The results returned by the first test command include the PCIE bus number of the BF3 network card installed in the server under test; Obtaining the PCIe bus number of the BF3 network card installed in the server to be tested includes: The PCIE bus number retrieval command `lspci|grep"BlueField-3"|awk'{print$1}'` is called based on the result returned by the first detection command to obtain the PCIE bus number of the BF3 network card installed in the server to be tested.

6. The method according to claim 1, characterized in that, The step of obtaining the original serial number of the BF3 network card installed in the server under test based on the PCIe bus number of the BF3 network card installed in the server under test includes: The command `lspci -vvv -s $[PCIE bus number field]|grep "Serial number"|awk -F':''{print$2}'|sed -e's / / / g'` retrieves the original serial number of the BF3 network card installed on the server under test.

7. The method according to claim 1, characterized in that, The step of obtaining the current operating mode of the BF3 network card installed in the server to be tested includes: The working mode acquisition command is invoked for the PCIE bus number of the BF3 network card installed in the server to be tested, and the call result returned by the working mode acquisition command is obtained. The current operating mode of the BF3 network card installed on the server to be tested is determined based on the returned call result. The instructions for obtaining the working mode include: "mlxconfig -d [PCIE bus number field] q|grep -iE" "INTERNAL_CPU_PAGE_SUPPLIER INTERNAL_CPU_ESWITCH_MANAGER INTERNAL_CPU_IB_VPORT0 INTERNAL_CPU_OFFLOAD_ENGINE"".

8. The method according to claim 7, characterized in that, The call results returned by the working mode acquisition instruction include: the return value of "INTERNAL_CPU_PAGE_SUPPLIER", the return value of "INTERNAL_CPU_ESWITCH_MANAGER", the return value of "INTERNAL_CPU_IB_VPORT0", and the return value of "INTERNAL_CPU_OFFLOAD_ENGINE". The step of determining the current operating mode of the BF3 network card installed on the server under test based on the returned call result includes: If the return values ​​of "INTERNAL_CPU_PAGE_SUPPLIER", "INTERNAL_CPU_ESWITCH_MANAGER", "INTERNAL_CPU_IB_VPORT0", and "INTERNAL_CPU_OFFLOAD_ENGINE" are all the first preset values, then the current working mode of the BF3 network card installed in the server to be tested is determined to be NIC working mode. or, If the return values ​​of "INTERNAL_CPU_PAGE_SUPPLIER", "INTERNAL_CPU_ESWITCH_MANAGER", "INTERNAL_CPU_IB_VPORT0", and "INTERNAL_CPU_OFFLOAD_ENGINE" are all the second preset values, then the current working mode of the BF3 network card installed in the server to be tested is determined to be DPU working mode.

9. The method according to claim 8, characterized in that, The process of changing the operating mode of the BF3 network card installed in the server to be tested from its current operating mode to a predetermined operating mode includes: When the predetermined working mode is NIC working mode, the first modification instruction is invoked according to the PCIE bus number of the BF3 network card installed in the server under test, so as to change the working mode of the BF3 network card installed in the server under test from DPU working mode to NIC working mode. The first modification instructions include: "mlxconfig -d$BDF S INTERNAL_CPU_MODEL = first preset value\ INTERNAL_CPU_PAGE_SUPPLIER = First preset value\ INTERNAL_CPU_ESWITCH_MANAGER = First preset value\ INTERNAL_CPU_IB_VPORT0 = First preset value\ INTERNAL_CPU_OFFLOAD_ENGINE = First preset value\ INTERNAL_CPU_RSHIM = First preset value.

10. The method according to claim 8, characterized in that, The process of changing the operating mode of the BF3 network card installed in the server to be tested from its current operating mode to a predetermined operating mode includes: When the predetermined working mode is DPU working mode, the second modification instruction is invoked according to the PCIE bus number of the BF3 network card installed in the server under test, so as to change the working mode of the BF3 network card installed in the server under test from NIC working mode to DPU working mode. The second modification instruction includes: "mlxconfig -d$BDF S INTERNAL_CPU_MODEL = second preset value\ INTERNAL_CPU_PAGE_SUPPLIER = Second preset value\ INTERNAL_CPU_ESWITCH_MANAGER = Second preset value\ INTERNAL_CPU_IB_VPORT0 = Second preset value\ INTERNAL_CPU_OFFLOAD_ENGINE = Second preset value\ INTERNAL_CPU_RSHIM = second preset value.

11. A device for adapting the working mode of a network interface card (NIC), characterized in that, An apparatus for use in a complete system testing system, wherein the complete system testing system is installed in the server to be tested, the apparatus comprising: The detection module is used to detect whether a BF3 network card is installed in the server to be tested; The first acquisition module is used to acquire the PCIe bus number of the BF3 network card installed in the server under test when the BF3 network card is installed in the server under test; the PCIe bus number of the BF3 network card includes the unique identifier assigned to the BF3 network card by the PCIe bus in the server under test. The second acquisition module is used to obtain the original serial number of the BF3 network card installed in the server under test based on the PCIE bus number of the BF3 network card installed in the server under test. The third acquisition module is used to acquire the predetermined working mode of the BF3 network card installed in the server to be tested based on the original serial number of the BF3 network card installed in the server to be tested and the stored correspondence; the correspondence includes the correspondence between the original serial number of the BF3 network card installed in the server and the predetermined working mode of the BF3 network card installed in the server. The fourth acquisition module is used to acquire the current working mode of the BF3 network card installed in the server to be tested; The comparison module is used to compare whether the current operating mode of the BF3 network card installed in the server under test is different from the predetermined operating mode of the BF3 network card installed in the server under test. The modification module is used to change the operating mode of the BF3 network card installed on the server under test from the current operating mode to the predetermined operating mode when there is a difference between the current operating mode and the predetermined operating mode of the BF3 network card installed on the server under test.

12. The apparatus according to claim 11, characterized in that, The device further includes: The fourth acquisition module is further configured to: after changing the working mode of the BF3 network card installed in the server to be tested from the current working mode to the predetermined working mode, acquire the current working mode of the BF3 network card installed in the server to be tested again.

13. The apparatus according to claim 11, characterized in that, The device further includes: The deletion module is used to delete, after changing the working mode of the BF3 network card installed in the server under test from the current working mode to the predetermined working mode, the corresponding entries in the mapping relationship including the original serial number of the BF3 network card installed in the server under test and the predetermined working mode of the BF3 network card installed in the server under test.

14. The apparatus according to claim 11, characterized in that, The detection module includes: The first calling unit is used to call the first detection command lspci|grep"BlueField-3" that is pre-set in the whole machine test system; The first determining unit is used to determine that the BF3 network card is not installed in the server to be tested when the result returned by the first detection command is empty. Alternatively, the second calling unit is used to call the second detection instruction "echo$?" in response to the result returned by the first detection instruction if the result returned by the first detection instruction is not empty; The second determining unit is used to determine that the BF3 network card is not installed in the server to be tested if the result returned by the second detection command "echo $?" is empty. Alternatively, the third determining unit is used to determine that the server under test has a BF3 network card installed if the result returned by the second detection command "echo $?" is not empty.

15. The apparatus according to claim 14, characterized in that, The results returned by the first test command include the PCIE bus number of the BF3 network card installed in the server under test; The first acquisition module includes: The third calling unit is used to call the PCIE bus number acquisition command lspci|grep"BlueField-3"|awk'{print$1}' based on the result returned by the first detection command, to obtain the PCIE bus number of the BF3 network card installed in the server to be tested, which was returned by the PCIE bus number acquisition command.

16. The apparatus according to claim 11, characterized in that, The second acquisition module includes: The fourth retrieval unit is used to retrieve the original serial number of the BF3 network card installed in the server under test by using the PCIE bus number of the BF3 network card installed in the server under test. The original serial number is returned by the original serial number retrieval command and is the original serial number of the BF3 network card installed in the server under test.

17. The apparatus according to claim 11, characterized in that, The fourth acquisition module includes: The fifth retrieval unit is used to retrieve the working mode acquisition command for the PCIE bus number of the BF3 network card installed in the server to be tested, and obtain the call result returned by the working mode acquisition command. The fourth determining unit is used to determine the current working mode of the BF3 network card installed in the server to be tested based on the returned call result; The instructions for obtaining the working mode include: "mlxconfig -d [PCIE bus number field] q|grep -iE" "INTERNAL_CPU_PAGE_SUPPLIER INTERNAL_CPU_ESWITCH_MANAGER INTERNAL_CPU_IB_VPORT0 INTERNAL_CPU_OFFLOAD_ENGINE"".

18. The apparatus according to claim 17, characterized in that, The call results returned by the working mode acquisition instruction include: the return value of "INTERNAL_CPU_PAGE_SUPPLIER", the return value of "INTERNAL_CPU_ESWITCH_MANAGER", the return value of "INTERNAL_CPU_IB_VPORT0", and the return value of "INTERNAL_CPU_OFFLOAD_ENGINE". The fourth determining unit includes: The first determining subunit is used to determine that the current working mode of the BF3 network card installed in the server to be tested is NIC working mode when the return values ​​of "INTERNAL_CPU_PAGE_SUPPLIER", "INTERNAL_CPU_ESWITCH_MANAGER", "INTERNAL_CPU_IB_VPORT0", and "INTERNAL_CPU_OFFLOAD_ENGINE" are all first preset values. or, The second determining subunit is used to determine that the current working mode of the BF3 network card installed in the server to be tested is DPU working mode when the return values ​​of "INTERNAL_CPU_PAGE_SUPPLIER", "INTERNAL_CPU_ESWITCH_MANAGER", "INTERNAL_CPU_IB_VPORT0", and "INTERNAL_CPU_OFFLOAD_ENGINE" are all the second preset values.

19. The apparatus according to claim 18, characterized in that, The modification module includes: The sixth fetching unit is used to call the first modification instruction according to the PCIE bus number of the BF3 network card installed in the server under test when the predetermined working mode is NIC working mode, so as to change the working mode of the BF3 network card installed in the server under test from DPU working mode to NIC working mode. The first modification instructions include: "mlxconfig -d$BDF S INTERNAL_CPU_MODEL = first preset value\ INTERNAL_CPU_PAGE_SUPPLIER = First preset value\ INTERNAL_CPU_ESWITCH_MANAGER = First preset value\ INTERNAL_CPU_IB_VPORT0 = First preset value\ INTERNAL_CPU_OFFLOAD_ENGINE = First preset value\ INTERNAL_CPU_RSHIM = First preset value.

20. The apparatus according to claim 18, characterized in that, The modification module includes: The seventh calling unit is used to call the second modification instruction according to the PCIE bus number of the BF3 network card installed in the server under test when the predetermined working mode is DPU working mode, so as to change the working mode of the BF3 network card installed in the server under test from NIC working mode to DPU working mode. The second modification instruction includes: "mlxconfig -d$BDF S INTERNAL_CPU_MODEL = second preset value\ INTERNAL_CPU_PAGE_SUPPLIER = Second preset value\ INTERNAL_CPU_ESWITCH_MANAGER = Second preset value\ INTERNAL_CPU_IB_VPORT0 = Second preset value\ INTERNAL_CPU_OFFLOAD_ENGINE = Second preset value\ INTERNAL_CPU_RSHIM = second preset value.

21. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method as claimed in any one of claims 1-10.

22. A readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the method as claimed in any one of claims 1-10.

Citation Information

Patent Citations

  • Storage system adapter configuration method and device, equipment and storage medium

    CN112685341A

  • Network card configuration recovery method and device

    CN116346603A