CN107547304A - Network card testing method, device and machinable medium - Google Patents

Network card testing method, device and machinable medium Download PDF

Info

Publication number
CN107547304A
CN107547304A CN201710569543.9A CN201710569543A CN107547304A CN 107547304 A CN107547304 A CN 107547304A CN 201710569543 A CN201710569543 A CN 201710569543A CN 107547304 A CN107547304 A CN 107547304A
Authority
CN
China
Prior art keywords
network interface
interface card
test data
test
data bag
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710569543.9A
Other languages
Chinese (zh)
Inventor
沈刚
邝金山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Information Technologies Co Ltd
Original Assignee
Unis Huashan Information Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Unis Huashan Information Technologies Co Ltd filed Critical Unis Huashan Information Technologies Co Ltd
Priority to CN201710569543.9A priority Critical patent/CN107547304A/en
Publication of CN107547304A publication Critical patent/CN107547304A/en
Pending legal-status Critical Current

Links

Abstract

The application provides a kind of network card testing method, device and machinable medium, wherein, this method is applied to server, is provided with network interface card in server, and the first network interface and the second network interface on network interface card are direct-connected, and this method includes:Enable kernel thread and test data bag is built according to the test parameter got, wherein, the transmission network interface of nominative testing packet is the first network interface in test parameter;The test data bag that kernel thread is built, network interface card is sent to by network interface layer general-purpose interface corresponding with the first network interface in kernel state, so that network interface card sends test data bag from the first network interface, and the test data bag of loopback is received from the second network interface;After all test data bags are sent completely, network interface card statistics is obtained from network interface card, the state of network interface card is determined according to network interface card statistics, wherein, network interface card statistics is the statistics of the test data bag for the loopback that network interface card counts.

Description

Network card testing method, device and machinable medium
Technical field
The application is related to network communication technology field, more particularly to a kind of network card testing method, device and machine readable deposits Storage media.
Background technology
Network interface card is also known as network interface board or communication adapter or network adapter (Network Adapter) or net Network interface card (NIC).
In the server, network interface card carries the role of business input output window.At present, manufacturer server will would generally be adopted The network interface card of purchase is assembled into server as part, and network interface card is tested, to ensure the availability of network interface card and stability.
A kind of conventional network card testing method is equipped with an environment interchanger, and the network interface card to be tested on server is with exchanging Network interface connection on machine.Server OS (Operating System, operating system) ping (Packet upon actuation Internet Groper, the Internet packets survey meter) gateway where interchanger network interface, i.e. by tested network interface card to interchanger net Mouthful where gateway send probe messages, according to ping result come determine network interface card whether normal work.But this method needs to match somebody with somebody Standby environment interchanger, testing cost are higher.
The content of the invention
In view of this, the application provides a kind of network card testing method, device and machinable medium.
Specifically, the application is achieved by the following technical solution:
On the one hand, there is provided a kind of network card testing method, this method are applied to server, network interface card are provided with server, The first network interface and the second network interface on network interface card is direct-connected, and this method includes:
Enable kernel thread and test data bag is built according to the test parameter got, wherein, test parameter middle finger location survey The transmission network interface for trying packet is the first network interface;
The test data bag that kernel thread is built is general by network interface layer corresponding with the first network interface in kernel state Interface is sent to network interface card, so that network interface card sends test data bag from the first network interface, and the test number of loopback is received from the second network interface According to bag;
After all test data bags are sent completely, network interface card statistics is obtained from network interface card, according to network interface card statistical number According to the state for determining network interface card, wherein, network interface card statistics is the statistics of the test data bag for the loopback that network interface card counts.
On the other hand, a kind of network interface card test device is additionally provided, the device is applied to server, net is provided with server Block, the first network interface and the second network interface on network interface card are direct-connected, and the device includes:
Construction unit, test data bag is built according to the test parameter got for enabling kernel thread, wherein, test The transmission network interface of nominative testing packet is the first network interface in parameter;
Transmitting element, for the test data bag for building kernel thread, by corresponding with the first network interface in kernel state Network interface layer general-purpose interface is sent to network interface card, so that network interface card sends test data bag from the first network interface, and is connect from the second network interface Receive the test data bag of loopback;
Acquiring unit, for after all test data bags are sent completely, network interface card statistics to be obtained from network interface card, its In, network interface card statistics is the statistics of the test data bag for the loopback that network interface card counts;
Status determining unit, the network interface card statistics for being got according to acquiring unit determine the state of network interface card.
Another aspect, a kind of network interface card test device is additionally provided, including processor and machinable medium, machine can Read storage medium and be stored with the machine-executable instruction that can be executed by processor, processor is promoted by machine-executable instruction: Realize above-mentioned network card testing method.
Another aspect, additionally provide a kind of machinable medium, it is characterised in that be stored with the executable finger of machine Order, when being called and being performed by processor, machine-executable instruction promotes processor:Realize above-mentioned network card testing method.
It is by the above technical scheme of the application, the first network interface on network interface card to be measured and the second network interface is direct-connected, sending During test data bag, test data bag is sent to using network interface layer general-purpose interface corresponding with the first network interface in kernel state Network interface card, network interface card can send the test data bag from the first network interface, and the test data bag of loopback is received from the second network interface, After all test data bags are sent completely, acquisition network interface card is united to the loopback test packet received directly from network interface card Count obtained network interface card statistics, be that can determine that the state of network interface card according to the network interface card statistics, i.e., network interface card whether normal work. Network interface card is tested using the above method, without being equipped with extra equipment, reduces testing cost, also, due to make use of The data that existing network interface card is counted to received data packet determine the state of network interface card to be measured, and method of testing is easier and easy With, and be easy to carry out location of mistake.
Brief description of the drawings
Fig. 1 is that the network interface on the network interface card to be measured shown in the embodiment of the present application uses the schematic diagram connected from ring mode;
Fig. 2 is that the network interface on the network interface card to be measured shown in the embodiment of the present application uses the schematic diagram that docking mode connects;
Fig. 3 is the flow chart of the network card testing method shown in the embodiment of the present application;
Fig. 4 is the network architecture illustraton of model in the Linux shown in the embodiment of the present application;
Fig. 5 is the test data bag transmission flow figure shown in the embodiment of the present application;
Fig. 6 is the hardware architecture diagram of the network interface card test device shown in the embodiment of the present application;
Fig. 7 is the function partition structure schematic diagram of the network interface card test device shown in the embodiment of the present application.
Embodiment
Here exemplary embodiment will be illustrated in detail, its example is illustrated in the accompanying drawings.Following description is related to During accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represent same or analogous key element.Following exemplary embodiment Described in embodiment do not represent all embodiments consistent with the application.On the contrary, they be only with it is such as appended The example of the consistent apparatus and method of some aspects be described in detail in claims, the application.
It is only merely for the purpose of description specific embodiment in term used in this application, and is not intended to be limiting the application. " one kind " of singulative used in the application and appended claims, " described " and "the" are also intended to including majority Form, unless context clearly shows that other implications.It is also understood that term "and/or" used herein refers to and wrapped Containing the associated list items purpose of one or more, any or all may be combined.
It will be appreciated that though various information, but this may be described using term first, second, third, etc. in the application A little information should not necessarily be limited by these terms.These terms are only used for same type of information being distinguished from each other out.For example, do not departing from In the case of the application scope, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as One information.Depending on linguistic context, word as used in this " if " can be construed to " ... when " or " when ... When " or " in response to determining ".
The network card testing method of prior art needs to be equipped with environment interchanger, and testing cost is higher.In order to solve existing skill Above mentioned problem present in art, a kind of network card testing method is provided in the embodiment of the present application, and this method is appointed without optional equipment What equipment, so as to reduce testing cost, application is larger, and any network interface card is used.
In the method for the embodiment of the present application, network interface card to be measured is arranged on and run in the server of operating system, the network interface card On the first network interface and the second network interface it is direct-connected, wherein, the first network interface and the second network interface can be same network interface or difference Network interface.
As shown in figure 1, when the first network interface and the second network interface are same network interfaces, TX (transmission) lines of the network interface (connect with RX Receive) line is direct-connected, and such a connected mode is properly termed as from ring.Now, installation is needed on network interface from take capel, to realize same network interface TX lines and RX lines are direct-connected, and packet returns after the TX lines of the network interface are sent from the RX wire loops of the network interface.
As shown in Fig. 2 when the first network interface and the second network interface are not same network interfaces, the TX lines and the second network interface of the first network interface RX lines it is direct-connected, the RX lines of the first network interface and the TX lines of the second network interface are direct-connected, and such a connected mode is properly termed as docking.Now, Packet returns after the TX lines of the first network interface are sent from the RX wire loops of the second network interface;Packet is sent from the TX lines of the second network interface Afterwards, returned from the RX wire loops of the first network interface.
It can be seen that either use from the connected mode of ring, or the connected mode using docking, server is from network interface card to be measured The packet sent can be also looped back in server from the network interface card.
Based on this, as shown in figure 3, the network card testing method of the embodiment of the present application comprises the following steps:
Step S301, enable kernel thread and test data bag is built according to the test parameter got, wherein, test parameter The transmission network interface of middle nominative testing packet is the first network interface;
Wherein it is possible to above-mentioned test parameter is obtained to User space, or, it can also be obtained by the way of manual static configuration Take above-mentioned test parameter.
Step S302, the test data bag that kernel thread is built, passes through network corresponding with the first network interface in kernel state Interface layer general-purpose interface is sent to network interface card, so that network interface card sends test data bag from the first network interface, and from the second network interface reception ring The test data bag returned;
Wherein, the transmission network interface that test data bag is specified in test parameter is the first network interface, when performing step S302, Because one-to-one relationship be present in the network interface layer general-purpose interface in physical internet ports and kernel state, hence, it can be determined that go out with Network interface layer general-purpose interface corresponding to the first network interface specified in test parameter, so as to by test data bag by determining Network interface layer general-purpose interface be sent to network interface card, as network interface card from the network interface layer general-purpose interface determined with this corresponding One network interface sends the test data bag.
Step S303, after all test data bags are sent completely, network interface card statistics is obtained from network interface card, according to net Card statistics determines the state of network interface card, wherein, network interface card statistics is the system of the test data bag for the loopback that network interface card counts Count.
In addition, after all test data bags are sent completely, can also be from the error register of network interface card or CPU mistake In register, the error statistics data of the transfer bus between network interface card and CPU are obtained, according to the error statistics data of transfer bus The state of network interface card is determined, wherein, the error statistics data of transfer bus are that the test data bag of loopback is transmitted by transfer bus Wrong data during to CPU.
In actual implementation process, the transfer bus between network interface card and CPU can be specifically PCIE (Peripheral Component Interconnect Express, quick Peripheral Component Interconnect standard) bus.The operation system run on server System can be specifically the operating systems such as Linux, Unix, Windows.
It is in the above embodiments of the present application, the first network interface on network interface card to be measured and the second network interface is direct-connected, test number sending During according to bag, test data bag is sent to network interface card using network interface layer general-purpose interface corresponding with the first network interface in kernel state, Network interface card can send the test data bag from the first network interface, and the test data bag of loopback is received from the second network interface, all After test data bag is sent completely, acquisition network interface card to the loopback test packet received count directly from network interface card The network interface card statistics arrived, and/or network interface card and CPU are directly obtained from the error register of network interface card or CPU error register Between transfer bus error statistics data, according to these statistics be the state of network interface card of can determine that, i.e. network interface card whether just Often work.Network interface card is tested using the above method, without being equipped with extra equipment, reduces testing cost, also, due to Data that existing network interface card is counted to received data packet and the error statistics data of existing transfer bus are make use of, To determine the state of network interface card to be measured, method of testing is easier and easy-to-use, and is easy to carry out location of mistake.
Below exemplified by running (SuSE) Linux OS in server, the network card testing method of above-described embodiment is described in detail. As shown in figure 4, network architecture model is four layer models in Linux, including:Network interface layer, internetwork-ing layer, transport layer, with And application layer, wherein, network interface layer further comprises physical layer and data link layer in standard seven layer model.
1st, the transmission of test data bag
In (SuSE) Linux OS, it is contemplated that packet loopback be present, i.e. the packet ring that server is sent Server is returned to, also, is consumed to reduce transmission of the packet in external network in loop-back process (for example, transmission time Consumption etc.), realize a virtual network equipment in internetwork-ing layer:Loopback (loopback) equipment, Loopback equipment Can be with the loop-back process of analogue data bag, i.e. packet really will not be sent from network interface card, but by Loopback equipment simulatings The encapsulation of packet sends and receives decapsulation process.It can be seen that the needs sent by the interface of internetwork-ing layer above level The packet of loopback, sends all without from network interface card.
But the test data bag sent when being tested in the embodiment of the present application network interface card needs to send from network interface card, Also need to carry out loopback, therefore, in the embodiment of the present application select to send test data bag from network interface layer general-purpose interface.Specifically , network interface layer general-purpose interface can be in the network interface laminar structure net_device in kernel state (also referred to as kernel) Ndo_start_xmit interfaces.Wherein, network interface laminar structure net_device corresponds with network interface, so as to ndo_ Start_xmit interfaces also there is one-to-one relationship with network interface.
It is stored with the relevant parameter of network interface corresponding with the structure in network interface laminar structure net_device, and to Driving layer (data link layer belonged in network interface layer) provides the general-purpose interface defined, and the general-purpose interface is ndo_ Start_xmit interfaces.
In a kind of embodiment, test parameter is configured in kernel state by tester by the way of manual static configuration, So as to complete network interface card test.
In another embodiment, test parameter can be sent to kernel state by User space, so as to complete network interface card test.This When, because ndo_start_xmit interfaces are in kernel state, therefore, it is necessary to switching of the User space to kernel state is realized, to connect The test parameter of User space transmission is received, test data bag, the test data most built at last are then built according to the test parameter Bag is sent to network interface card by ndo_start_xmit interfaces., it is necessary to realize following functions in the embodiment of the present application:
(1) test parameter needed for network interface card test is customized
Customization can receive the test parameter of identification in advance, wherein, test parameter includes:Need the test data bag sent Packet type, time interval of giving out a contract for a project, quantity of giving out a contract for a project N and need the mark of more than one kernel thread enabled, test data Mark of transmission network interface of bag etc..Wherein, N is the positive integer more than 1.
Above-mentioned Packet type can be specifically UDP (User Datagram Protocol, UDP), TCP (Transmission Control Protocol, transmission control protocol), HTTP (Hyper Text Transfer Protocol, HTTP) etc..
(2) Transfer pipe of test parameter is established
Configured due to the actual assignment of test parameter by tester, tester's input test in the server After the assignment of parameter, now test parameter is located in User space, then needs to obtain test parameter to User space by Transfer pipe, Subsequently to be tested according to the test parameter network interface card.Specifically, any of following two modes can be used to build Found above-mentioned Transfer pipe:
Mode one:By way of registering virtual unit to kernel state, generated in User space corresponding with the virtual unit Device node, the device node is above-mentioned Transfer pipe.
At this point it is possible to test ginseng is obtained to User space by the device node using ioctl (input and output control) methods Number.
Mode two:Proc virtual files are set in User space, and the proc virtual files are above-mentioned Transfer pipe.
At this point it is possible to the test parameter of User space write-in is read from proc virtual files.
(3) kernel thread is created
Establish kernel thread pond, the kernel thread number in kernel thread pond is equal to the CPU line number of passes in server, kernel line Journey is bound one by one with CPU line journey.
Wherein, the function of kernel thread mainly includes:Test data bag is built according to the test parameter that gets, so as to by Ndo_start_xmit interfaces are called to send the test data bag with the CPU line journey of kernel thread binding.
It is assumed that the network interface connection mode on network interface card to be measured is used from ring mode, thus, test is sent in the embodiment of the present application The flow of packet is as shown in figure 5, comprise the following steps:
Step S501, test parameter is obtained to User space, wherein, test parameter includes:Need the test data sent 2 kernel threads that the Packet type of bag is UDP, time interval of giving out a contract for a project is 1 millisecond, quantity of giving out a contract for a project N is 10000, needs enable Be identified as process1_1 and process1_2 and the transmission network interface of test data bag is identified as PortA.
Step S502, each kernel thread in kernel thread process1_1 and process1_2 is enabled, according to test The Packet type UDP of the packet and quantity N=10000 that gives out a contract for a project, to build 10000 UDP message bags.
In addition, before kernel thread is enabled, it is also necessary to the transmission of the kernel thread and test data bag enabled will be needed Network interface PortA is bound, so as to call the corresponding ndo_ of network interface PortA with the CPU line journey of kernel thread binding Start_xmit interfaces send test data bag.
Step S503, kernel thread process1_1 is built with the CPU line journey of kernel thread process1_1 bindings UDP message bag, according to 1 millisecond of time interval of giving out a contract for a project, it is sent to by ndo_start_xmit interfaces corresponding to network interface PortA Network interface card to be measured, so that network interface card to be measured sends UDP message bag from network interface PortA, and the UDP message of loopback is received from network interface PortA Bag;Also, it can also perform the step with the CPU line journey of kernel thread process1_2 bindings.
After all UDP message Bao Jun are sent completely, kernel thread process1_1 and kernel thread can be closed process1_2。
In the embodiment of the present application, test data bag is built by kernel thread, moreover, test data bag is from ndo_ By driving layer to issue network interface card on start_xmit interfaces, therefore test data bag, can be sent any not through protocol stack The test data bag of type.
2nd, the reception of test data bag and network interface card test result analysis
In actual implementation process, after network interface card receives packet, the packet received can be counted, for example, Quantity, CRC (the Cyclic Redundancy of loss of data (drop) packet (i.e. the packet is imperfect) be present Check, CRC) verification do not pass through the quantity of packet, the quantity of the unicast packet received, receive Quantity of non-unicast data bag etc..By analyze above-mentioned statistics would know that network interface card (including the transmission network interface of packet and Receive network interface) and transmission link (send network interface and receive the physical connection between network interface) part of composition with the presence or absence of scarce Fall into.
Subsequently, the packet that network interface card will can receive, by the transfer bus between network interface card and CPU (for example, PCIE is total Line) send CPU to, so as to finally be saved in internal memory, during being transmitted by the transfer bus, network interface card and CPU Error statistics can be carried out to the packet transmitted on the transfer bus, so as to which error statistics data are saved in into respective register In.For example, two kinds of error categories are defined in PCIE standards:Fatal error and nonfatal error, wherein, in nonfatal error again Further comprise:Recoverable error and fatal error.By analyze above-mentioned error statistics data would know that network interface card and The part of transfer bus combination whether there is defect.In actual implementation process, because network interface card and CPU can be total to the transmission The packet transmitted on line carries out error statistics, and the error statistics data that both statistics obtain are consistent, therefore, from corresponding to network interface card Above-mentioned error statistics data are obtained in register corresponding to register or CPU.
Based on this, the test data bag of the embodiment of the present application receives statistics and network card status analysis process is as follows:
After all test data bags are sent completely, network interface card statistics is obtained from network interface card, wherein, network interface card statistical number According to including:The test data bag quantity, the test data bag quantity that verification does not pass through, the loopback received of loss of data be present Test data bag quantity.Because in actual implementation process, the test data bag of transmission is usually unicast packet, therefore, is connect The loopback test data packet number received is exactly the quantity of unicast packet.If the test data bag quantity of loss of data be present not For 0, illustrate that the test data bag that has is imperfect, if the test data bag quantity that verification does not pass through not is 0, illustrates the test number having There is mistake according to bag, if the loopback test data packet number received and the test data bag quantity sent are inconsistent, explanation The partial test packet sent is not received, in the event of above-mentioned phenomenon, then judge network interface card and network interface to be measured it Between physical connection composition part failure problems be present.Lacked i.e., it is possible to orient network interface card and/or transmission link to be measured and exist Fall into.
In addition, after all test data bags are sent completely, can also be from the error register of network interface card or CPU mistake The error statistics data of PCIE buses are obtained in register, if according to the error statistics data of the transfer bus got, it is determined that Go out the test data bag transmitted on transfer bus and mistake be present, then judge that the part of network interface card and PCIE bus composition to be measured is present Failure problems.I.e., it is possible to orient network interface card and/or PCIE bus existing defects to be measured.
By the above method, data, Yi Jixian that existing network interface card is counted to received data packet can be directly obtained The error statistics data of some PCIE buses, the state of network interface card to be measured is determined using these statistics, that is, determines network interface card to be measured Whether normal work, method of testing is easier and easy-to-use, and be easy to carry out location of mistake.
It is corresponding with the embodiment of foregoing network card testing method, present invention also provides the embodiment of network interface card test device, The network interface card test device can be applied on the server.Fig. 6 is the hardware knot for the network interface card test device that the embodiment of the present application provides Structure schematic diagram.The network interface card test device may include processor 601, be stored with the machinable medium of machine-executable instruction 602.Processor 601 can communicate with machinable medium 602 via system bus 603.Also, by reading and performing machine Machine-executable instruction in device readable storage medium storing program for executing 602, processor 601 can perform above-described network card testing method.
Machinable medium 602 referred to herein can be any electronics, magnetic, optics or other physical stores Device, can be included or storage information, such as executable instruction, data, etc..For example, machinable medium can be: RAM (Radom Access Memory, random access memory), volatile memory, nonvolatile memory, flash memory, storage are driven Dynamic device (such as hard disk drive), solid state hard disc, any kind of storage dish (such as CD, dvd), or similar storage are situated between Matter, or combinations thereof.
The embodiment of the present application additionally provides a kind of machinable medium including machine-executable instruction, such as Fig. 6 In machinable medium 602, the machine-executable instruction can be performed by the processor 601 in network interface card test device with Realize network card testing method described above.As shown in fig. 7, functionally divide, the network interface card test device of the embodiment of the present application Include:Construction unit 701, transmitting element 702, acquiring unit 703 and status determining unit 704, wherein:
Construction unit 701, test data bag is built according to the test parameter got for enabling kernel thread, wherein, The network interface that sends of nominative testing packet is the first network interface on network interface card, the first network interface and second on the network interface card in test parameter Network interface is direct-connected;
Transmitting element 702, for the test data bag for building kernel thread, by corresponding with the first network interface in kernel state Network interface layer general-purpose interface be sent to network interface card so that network interface card sends test data bag from the first network interface, and from the second network interface Receive the test data bag of loopback;
Acquiring unit 703, for after all test data bags are sent completely, network interface card statistical number to be obtained from network interface card According to, wherein, network interface card statistics is the statistics of the test data bag for the loopback that network interface card counts;
Status determining unit 704, the network interface card statistics for being got according to acquiring unit 703 determine the shape of network interface card State.
Wherein, acquiring unit 703, it is additionally operable to after all test data bags are sent completely, from the mistake deposit of network interface card In device or CPU error register, the error statistics data of the transfer bus between network interface card and CPU are obtained, wherein, transfer bus Error statistics data be wrong data when the test data bag of loopback sends CPU to by transfer bus;
Status determining unit 704, the error statistics data of transfer bus for being additionally operable to be got according to acquiring unit 703 are true Determine the state of network interface card.
Wherein, test parameter includes:The Packet type for the test data bag for needing to send, time interval of giving out a contract for a project, number of giving out a contract for a project The mark for more than one kernel thread that amount N and needs enable, N are the positive integer more than 1;
Then, construction unit 701 is specifically used for enabling kernel thread in the following manner according to the test parameter structure got Build test data bag:Each kernel thread in more than one kernel thread is enabled to build N number of test number for meeting Packet type According to bag;
Transmitting element 702 is specifically used for the test data bag for sending kernel thread structure in the following manner:For each The kernel thread being activated, the test data bag of kernel thread structure is sent according to time interval of giving out a contract for a project.
Wherein, network interface card statistics includes:The test data bag quantity of loss of data be present, the test number that verification does not pass through According to bag quantity, the loopback test data packet number received, then,
Status determining unit 704 is specifically used for the state for determining network interface card according to network interface card statistics in the following manner:If The test data bag quantity that loss of data be present is not 0, or, it is not 0 to verify the test data bag quantity not passed through, or, The loopback test data packet number received and the test data bag quantity sent are inconsistent, it is determined that network interface card and the first net Failure problems be present in the part of the physical connection composition between mouth and the second network interface;
Status determining unit 704 is specifically used for determining network interface card according to the error statistics data of transfer bus in the following manner State:If according to the error statistics data of transfer bus, there is mistake in the test data bag for determining to transmit on transfer bus, Then determine that network interface card and the part of transfer bus composition have failure problems.
Wherein, when the first network interface and the second network interface are same network interfaces, the transmission TX lines of the network interface are direct-connected with receiving RX lines; When the first network interface and the second network interface are not same network interfaces, the TX lines of the first network interface and the RX lines of the second network interface are direct-connected, the first net The TX lines of the RX lines and the second network interface of mouth are direct-connected.
The function of unit and the implementation process of effect specifically refer to and step are corresponded in the above method in said apparatus Implementation process, it will not be repeated here.
For device embodiment, because it corresponds essentially to embodiment of the method, so related part is real referring to method Apply the part explanation of example.Device embodiment described above is only schematical, wherein described be used as separating component The unit of explanation can be or may not be physically separate, can be as the part that unit is shown or can also It is not physical location, you can with positioned at a place, or can also be distributed on multiple NEs.Can be according to reality Need to select some or all of module therein to realize the purpose of application scheme.Those of ordinary skill in the art are not paying In the case of going out creative work, you can to understand and implement.
The preferred embodiment of the application is the foregoing is only, not limiting the application, all essences in the application God any modification, equivalent substitution and improvements done etc., should be included within the scope of the application protection with principle.

Claims (12)

1. a kind of network card testing method, it is characterised in that applied to server, network interface card, the net are provided with the server The first network interface and the second network interface on card is direct-connected, and methods described includes:
Enable kernel thread and test data bag is built according to the test parameter got, wherein, the test parameter middle finger location survey The transmission network interface for trying packet is first network interface;
The test data bag that the kernel thread is built, pass through network interface layer corresponding with first network interface in kernel state General-purpose interface is sent to the network interface card, so that the network interface card sends test data bag from first network interface, and from described second Network interface receives the test data bag of loopback;
After all test data bags are sent completely, network interface card statistics is obtained from the network interface card, is united according to the network interface card The state for determining the network interface card is counted, wherein, the network interface card statistics is the survey for the loopback that the network interface card counts Try the statistics of packet.
2. according to the method for claim 1, it is characterised in that after all test data bags are sent completely, in addition to:
From the error register of the network interface card or CPU error register, the transmission between the network interface card and the CPU is obtained The error statistics data of bus, the state of the network interface card is determined according to the error statistics data of the transfer bus, wherein, it is described The error statistics data of transfer bus are when the test data bag of the loopback sends the CPU to by the transfer bus Wrong data.
3. according to the method for claim 1, it is characterised in that the test parameter includes:Need the test number sent According to the Packet type of bag, time interval of giving out a contract for a project, quantity of giving out a contract for a project N and the mark of more than one kernel thread enabled is needed, N is Positive integer more than 1;
Then, kernel thread is enabled in the following manner, and test data bag is built according to the test parameter got:Enable described one Each kernel thread in individual above kernel thread builds N number of test data bag for meeting the Packet type;
The test data bag of the kernel thread structure is sent in the following manner:For each kernel thread being activated, press The test data bag of kernel thread structure is sent according to the time interval of giving out a contract for a project.
4. according to the method for claim 2, it is characterised in that the network interface card statistics includes:Loss of data be present Test data bag quantity, the test data bag quantity that verification does not pass through, the loopback test data packet number received, then,
The state of the network interface card is determined according to the network interface card statistics, is specifically included:If the test that loss of data be present Data packet number is not 0, or, the test data bag quantity not passed through that verifies is not 0, or, the ring received Return test data bag quantity and the test data bag quantity of transmission is inconsistent, it is determined that the network interface card and first network interface Failure problems be present in the part of the physical connection composition between second network interface;
The state of the network interface card is determined according to the error statistics data of the transfer bus, is specifically included:If according to the transmission There is mistake in the error statistics data of bus, the test data bag for determining to transmit on the transfer bus, it is determined that the net Failure problems be present in the part of card and transfer bus composition.
5. according to the method for claim 1, it is characterised in that when first network interface and second network interface are same nets During mouth, the transmission TX lines and reception RX lines of the network interface are direct-connected;
When first network interface and second network interface are not same network interfaces, the TX lines of first network interface and second net The RX lines of mouth are direct-connected, and the TX lines of the RX lines of first network interface and second network interface are direct-connected.
6. a kind of network interface card test device, it is characterised in that applied to server, network interface card, the net are provided with the server The first network interface and the second network interface on card is direct-connected, and described device includes:
Construction unit, test data bag is built according to the test parameter got for enabling kernel thread, wherein, the test The transmission network interface of nominative testing packet is first network interface in parameter;
Transmitting element, for the test data bag for building the kernel thread, by kernel state with first network interface pair The network interface layer general-purpose interface answered is sent to the network interface card, so that the network interface card sends test data from first network interface Wrap, and the test data bag of loopback is received from second network interface;
Acquiring unit, for after all test data bags are sent completely, network interface card statistics to be obtained from the network interface card, its In, the network interface card statistics is the statistics of the test data bag for the loopback that the network interface card counts;
Status determining unit, the network interface card statistics for being got according to the acquiring unit determine the shape of the network interface card State.
7. device according to claim 6, it is characterised in that
The acquiring unit, be additionally operable to after all test data bags are sent completely, from the error register of the network interface card or In CPU error register, the error statistics data of the transfer bus between the network interface card and the CPU are obtained, wherein, it is described The error statistics data of transfer bus are when the test data bag of the loopback sends the CPU to by the transfer bus Wrong data;
The status determining unit, it is additionally operable to the error statistics data of the transfer bus got according to the acquiring unit Determine the state of the network interface card.
8. device according to claim 6, it is characterised in that the test parameter includes:Need the test number sent According to the Packet type of bag, time interval of giving out a contract for a project, quantity of giving out a contract for a project N and the mark of more than one kernel thread enabled is needed, N is Positive integer more than 1;
Then, the construction unit is specifically used for enabling kernel thread in the following manner according to the test parameter structure survey got Try packet:Each kernel thread in one above kernel thread is enabled to build N number of survey for meeting the Packet type Try packet;
The transmitting element is specifically used for the test data bag for sending the kernel thread structure in the following manner:For each The kernel thread being activated, the test data bag of kernel thread structure is sent according to the time interval of giving out a contract for a project.
9. device according to claim 7, it is characterised in that the network interface card statistics includes:Loss of data be present Test data bag quantity, the test data bag quantity that verification does not pass through, the loopback test data packet number received, then,
The status determining unit is specifically used for the shape for determining the network interface card according to the network interface card statistics in the following manner State:If the test data bag quantity that loss of data be present is not 0, or, it is described to verify the test data bag number not passed through Amount is not 0, or, the loopback test data packet number received and the test data bag quantity sent are inconsistent, then really Failure be present and ask in the part of fixed physical connection composition between the network interface card and first network interface and second network interface Topic;
The status determining unit is specifically used for determining institute according to the error statistics data of the transfer bus in the following manner State the state of network interface card:If according to the error statistics data of the transfer bus, the test transmitted on the transfer bus is determined There is mistake in packet, it is determined that the part of the network interface card and transfer bus composition has failure problems.
10. device according to claim 6, it is characterised in that when first network interface and second network interface are same During network interface, the transmission TX lines of the network interface are direct-connected with receiving RX lines;
When first network interface and second network interface are not same network interfaces, the TX lines of first network interface and second net The RX lines of mouth are direct-connected, and the TX lines of the RX lines of first network interface and second network interface are direct-connected.
11. a kind of network interface card test device, it is characterised in that described machine readable including processor and machinable medium Storage medium, which is stored with, be can perform by the machine-executable instruction of the computing device, the processor by the machine Instruction promotes:Realize the network card testing method any one of the claims 1 to 5.
A kind of 12. machinable medium, it is characterised in that be stored with machine-executable instruction, by processor call and During execution, the machine-executable instruction promotes the processor:Realize the net any one of the claims 1 to 5 Card test method.
CN201710569543.9A 2017-07-13 2017-07-13 Network card testing method, device and machinable medium Pending CN107547304A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710569543.9A CN107547304A (en) 2017-07-13 2017-07-13 Network card testing method, device and machinable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710569543.9A CN107547304A (en) 2017-07-13 2017-07-13 Network card testing method, device and machinable medium

Publications (1)

Publication Number Publication Date
CN107547304A true CN107547304A (en) 2018-01-05

Family

ID=60970665

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710569543.9A Pending CN107547304A (en) 2017-07-13 2017-07-13 Network card testing method, device and machinable medium

Country Status (1)

Country Link
CN (1) CN107547304A (en)

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108196798A (en) * 2018-01-31 2018-06-22 紫光华山信息技术有限公司 A kind of RAID control cards configuration method and device
CN110191380A (en) * 2019-05-22 2019-08-30 苏州浪潮智能科技有限公司 A kind of serpentine flow test macro and method based on Linux
CN110505110A (en) * 2018-05-18 2019-11-26 杭州海康威视数字技术股份有限公司 Test method, device and the Multi-netmouth host of network interface
CN111064553A (en) * 2019-12-12 2020-04-24 苏州浪潮智能科技有限公司 Switch and loopback diagnosis method, device and storage medium of management network port thereof
CN111147330A (en) * 2019-12-28 2020-05-12 国铁吉讯科技有限公司 Network quality evaluation method and device, storage medium and processor
CN111162966A (en) * 2019-12-23 2020-05-15 广州视源电子科技股份有限公司 Method and device for testing network interface hardware of receiving card, storage medium and processor
CN111224847A (en) * 2020-01-15 2020-06-02 广州视源电子科技股份有限公司 Network port test method and test system of sending card
CN111464378A (en) * 2020-03-13 2020-07-28 苏州浪潮智能科技有限公司 Server network card double-network-speed testing method and system
CN112235032A (en) * 2020-09-17 2021-01-15 中国科学院西安光学精密机械研究所 Hyperspectral imager 1553B bus communication method based on time service
CN112260884A (en) * 2020-09-25 2021-01-22 苏州浪潮智能科技有限公司 Network card self-loop test method, system, equipment and readable storage medium
CN113489625A (en) * 2021-07-21 2021-10-08 宁畅信息产业(北京)有限公司 Network card testing method and device, electronic equipment and computer readable storage medium
CN113872826A (en) * 2021-08-31 2021-12-31 苏州浪潮智能科技有限公司 Network card port stability testing method, system, terminal and storage medium
CN114236451A (en) * 2021-11-29 2022-03-25 上海电气(集团)总公司智惠医疗装备分公司 Test method and device based on magnetic resonance spectrometer and electronic equipment
CN114338474A (en) * 2021-12-27 2022-04-12 南京创通微新通信有限公司 Instrument-free testing system, method and storage medium for air interface link
CN114338457A (en) * 2021-12-23 2022-04-12 绿盟科技集团股份有限公司 System, method, device, equipment and medium for testing network card switching effectiveness
CN114363150A (en) * 2021-12-28 2022-04-15 浪潮通信技术有限公司 Network card connectivity monitoring method and device for server cluster

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101163051A (en) * 2006-10-13 2008-04-16 鸿富锦精密工业(深圳)有限公司 Network card transmission speed testing system and method
US7519004B1 (en) * 2005-02-18 2009-04-14 Netowrk Appliance, Inc. Loopback testing of a network interface device from a user-space software layer
CN102571482A (en) * 2011-11-28 2012-07-11 曙光信息产业(北京)有限公司 System and method for testing stability of network card
CN105207848A (en) * 2015-09-25 2015-12-30 浪潮(北京)电子信息产业有限公司 SerDes bit error rate detecting method and system based on embedded chip
CN105429895A (en) * 2015-11-02 2016-03-23 汉柏科技有限公司 Message transmission method based on ten-gigabit network card and message transmission system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7519004B1 (en) * 2005-02-18 2009-04-14 Netowrk Appliance, Inc. Loopback testing of a network interface device from a user-space software layer
CN101163051A (en) * 2006-10-13 2008-04-16 鸿富锦精密工业(深圳)有限公司 Network card transmission speed testing system and method
CN102571482A (en) * 2011-11-28 2012-07-11 曙光信息产业(北京)有限公司 System and method for testing stability of network card
CN105207848A (en) * 2015-09-25 2015-12-30 浪潮(北京)电子信息产业有限公司 SerDes bit error rate detecting method and system based on embedded chip
CN105429895A (en) * 2015-11-02 2016-03-23 汉柏科技有限公司 Message transmission method based on ten-gigabit network card and message transmission system

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108196798A (en) * 2018-01-31 2018-06-22 紫光华山信息技术有限公司 A kind of RAID control cards configuration method and device
CN108196798B (en) * 2018-01-31 2021-03-23 新华三信息技术有限公司 RAID control card configuration method and device
CN110505110A (en) * 2018-05-18 2019-11-26 杭州海康威视数字技术股份有限公司 Test method, device and the Multi-netmouth host of network interface
CN110191380A (en) * 2019-05-22 2019-08-30 苏州浪潮智能科技有限公司 A kind of serpentine flow test macro and method based on Linux
CN111064553A (en) * 2019-12-12 2020-04-24 苏州浪潮智能科技有限公司 Switch and loopback diagnosis method, device and storage medium of management network port thereof
CN111162966A (en) * 2019-12-23 2020-05-15 广州视源电子科技股份有限公司 Method and device for testing network interface hardware of receiving card, storage medium and processor
CN111147330A (en) * 2019-12-28 2020-05-12 国铁吉讯科技有限公司 Network quality evaluation method and device, storage medium and processor
CN111224847B (en) * 2020-01-15 2023-02-28 西安青松光电技术有限公司 Network port test method and test system of sending card
CN111224847A (en) * 2020-01-15 2020-06-02 广州视源电子科技股份有限公司 Network port test method and test system of sending card
CN111464378A (en) * 2020-03-13 2020-07-28 苏州浪潮智能科技有限公司 Server network card double-network-speed testing method and system
CN112235032A (en) * 2020-09-17 2021-01-15 中国科学院西安光学精密机械研究所 Hyperspectral imager 1553B bus communication method based on time service
CN112260884A (en) * 2020-09-25 2021-01-22 苏州浪潮智能科技有限公司 Network card self-loop test method, system, equipment and readable storage medium
CN113489625A (en) * 2021-07-21 2021-10-08 宁畅信息产业(北京)有限公司 Network card testing method and device, electronic equipment and computer readable storage medium
CN113872826A (en) * 2021-08-31 2021-12-31 苏州浪潮智能科技有限公司 Network card port stability testing method, system, terminal and storage medium
CN113872826B (en) * 2021-08-31 2023-02-28 苏州浪潮智能科技有限公司 Network card port stability testing method, system, terminal and storage medium
CN114236451A (en) * 2021-11-29 2022-03-25 上海电气(集团)总公司智惠医疗装备分公司 Test method and device based on magnetic resonance spectrometer and electronic equipment
CN114236451B (en) * 2021-11-29 2023-09-12 上海电气(集团)总公司智惠医疗装备分公司 Testing method and device based on magnetic resonance spectrometer and electronic equipment
CN114338457A (en) * 2021-12-23 2022-04-12 绿盟科技集团股份有限公司 System, method, device, equipment and medium for testing network card switching effectiveness
CN114338457B (en) * 2021-12-23 2023-12-01 绿盟科技集团股份有限公司 Test system, method, device, equipment and medium for network card switching effectiveness
CN114338474A (en) * 2021-12-27 2022-04-12 南京创通微新通信有限公司 Instrument-free testing system, method and storage medium for air interface link
CN114363150A (en) * 2021-12-28 2022-04-15 浪潮通信技术有限公司 Network card connectivity monitoring method and device for server cluster

Similar Documents

Publication Publication Date Title
CN107547304A (en) Network card testing method, device and machinable medium
CN110351156B (en) Test method and device
US6408335B1 (en) Methods, systems and computer program products for endpoint pair based communications network performance testing
CN102244594B (en) At the networks simulation technology manually and in automatic testing instrument
US5881237A (en) Methods, systems and computer program products for test scenario based communications network performance testing
US6061725A (en) Endpoint node systems computer program products for application traffic based communications network performance testing
US8233399B2 (en) Generic packet generator and method
US7440415B2 (en) Virtual network addresses
US8042004B2 (en) Diagnosing communications between computer systems
CN102882746B (en) Measuring method and measuring system of flow table adding rate in Openflow switchboard system
CN106484622A (en) Method of testing, apparatus and system
US20160182310A1 (en) Methods and systems for providing background pretesting of communications or storage network equipment
CN101873236B (en) Method and system for testing message
CN112653600A (en) Network card performance testing method and device based on USB network card and electronic equipment
CN102291274B (en) A kind of system and method realizing automatic adaptation of network testing instrument
CN108111367A (en) Performance test methods and device
CN101800672B (en) Equipment detection method and equipment
CN106100939A (en) The network equipment starts time test method and test console
CN109246159A (en) A kind of method and apparatus for verifying security strategy
US9985864B2 (en) High precision packet generation in software using a hardware time stamp counter
US8966321B2 (en) Logical port and layer protocol test configuration resource manager
CN108595320A (en) a kind of test method and device
CN109299195A (en) Data processing method, device and storage medium
CN108562805A (en) A kind of interactive mode break-make electric test device, system and method
CN110958079B (en) Test method, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 310052 11th Floor, 466 Changhe Road, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: Xinhua Sanxin Information Technology Co., Ltd.

Address before: 310052 11th Floor, 466 Changhe Road, Binjiang District, Hangzhou City, Zhejiang Province

Applicant before: Huashan Information Technology Co., Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180105