CN109117326A - The processing method and processing device that User space network interface card based on Shen prestige framework detects automatically - Google Patents
The processing method and processing device that User space network interface card based on Shen prestige framework detects automatically Download PDFInfo
- Publication number
- CN109117326A CN109117326A CN201810765994.4A CN201810765994A CN109117326A CN 109117326 A CN109117326 A CN 109117326A CN 201810765994 A CN201810765994 A CN 201810765994A CN 109117326 A CN109117326 A CN 109117326A
- Authority
- CN
- China
- Prior art keywords
- network interface
- interface card
- information
- user space
- type
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2273—Test methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/10—Program control for peripheral devices
- G06F13/12—Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor
- G06F13/122—Program control for peripheral devices using hardware independent of the central processor, e.g. channel or peripheral processor where hardware performs an I/O function other than control of data transfer
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Computer And Data Communications (AREA)
Abstract
The processing method and processing device that the User space network interface card of prestige framework in Shen provided in an embodiment of the present invention detects automatically, which comprises if detecting the trigger action of opening of device, the path for opening Peripheral Component Interconnect standard device PCI is macro;Read the device PCI directory information under the macro respective path in the path;The device PCI type file in the device PCI directory information is parsed, if judgement knows that the device PCI type file value parsed is identical as default network interface card classification yardage value, it is determined that the device PCI being currently detected is User space network interface card;Successively parse the corresponding directory information of the User space network interface card, to obtain the first kind information and Second Type information of the User space network interface card, and using the device PCI type file value, the first kind information and the Second Type information as the detection information of the User space network interface card.Described device executes the above method.Method and device provided in an embodiment of the present invention can effectively detect network interface card automatically, to get detection information.
Description
Technical field
The present embodiments relate to hardware equipment information processing technology fields, and in particular to a kind of use based on Shen prestige framework
The processing method and processing device that family state network interface card detects automatically.
Background technique
The User space drive load of network interface card in the equipment (may include the hardware devices such as firewall) based on Shen prestige framework
It is commonplace, but how to accomplish to detect automatically as linux kernel, be loaded automatically as the technical field research
A difficult problem.
A kind of method in the prior art is that trawl performance is compiled into kernel, will be with driving in kernel initialization driving
Matched facility information saves, and then returns to the network interface card that do not reinitialize, and kernel stage guarantor is obtained when User space initializes network interface card
The facility information deposited carries out drive load, realizes that the User space of network interface card detects and drive load automatically;Another method is to pass through
Lspci order preservation Peripheral Component Interconnect standard (Peripheral Component Interconnect, hereinafter referred to as
" PCI ") facility information be file, then filter extraction document information in network card equipment information realization detect automatically.Existing skill
The shortcomings that art method is: first method will modify kernel, need to be called kernel function by the method for equipment ioctl
Obtain network interface card information, the characteristics of this kind of interface is to will affect performance if frequently called, institute in this approach with kernel strong correlation and
It modifies more, not nimble enough.Second method depends critically upon the file format of lspci preservation, and filtering is extracted network interface card information and needed
It to be carried out according to the format of lspci, detection method can fail if version or format change, could again after needing to adjust
It uses.
Therefore, drawbacks described above how is avoided, User space network interface card is effectively detected automatically, to get User space network interface card
Detection information, becoming need solve the problems, such as.
Summary of the invention
In view of the problems of the existing technology, the embodiment of the present invention provide a kind of User space network interface card based on Shen prestige framework from
The processing method and processing device of dynamic detection.
In a first aspect, the embodiment of the present invention provides a kind of processing side that the User space network interface card based on Shen prestige framework detects automatically
Method, which comprises
If detecting the trigger action of opening of device, the path for opening Peripheral Component Interconnect standard device PCI is macro;
Read the device PCI directory information under the macro respective path in the path;
The device PCI type file in the device PCI directory information is parsed, if the device PCI parsed is known in judgement
Type file value is identical as default network interface card classification yardage value, it is determined that the device PCI being currently detected is User space network interface card;
The corresponding directory information of the User space network interface card is parsed, successively to obtain the first kind letter of the User space network interface card
Breath and Second Type information, and by the device PCI type file value, the first kind information and the Second Type information
Detection information as the User space network interface card.
Second aspect, the embodiment of the present invention provide a kind of processing that the User space network interface card based on Shen prestige framework detects automatically dress
It sets, described device includes:
Opening unit, if opening Peripheral Component Interconnect standard device PCI for detecting the trigger action of opening of device
Path is macro;
Reading unit, for reading the device PCI directory information under the macro respective path in the path;
Resolution unit, for parsing the device PCI type file in the device PCI directory information, if solution is known in judgement
The device PCI type file value of precipitation is identical as default network interface card classification yardage value, it is determined that the device PCI being currently detected is to use
Family state network interface card;
Probe unit, for successively parsing the corresponding directory information of the User space network interface card, to obtain the User space net
The first kind information and Second Type information of card, and by the device PCI type file value, the first kind information and institute
State detection information of the Second Type information as the User space network interface card.
The third aspect, the embodiment of the present invention provide a kind of electronic equipment based on Shen prestige framework, comprising: Shen prestige processor,
Memory and bus, wherein
The Shen prestige processor and the memory complete mutual communication by the bus;
The memory is stored with the program instruction that can be executed by the Shen prestige processor, and the Shen prestige processor calls institute
It states program instruction and is able to carry out following method:
If detecting the trigger action of opening of device, the path for opening Peripheral Component Interconnect standard device PCI is macro;
Read the device PCI directory information under the macro respective path in the path;
The device PCI type file in the device PCI directory information is parsed, if the device PCI parsed is known in judgement
Type file value is identical as default network interface card classification yardage value, it is determined that the device PCI being currently detected is User space network interface card;
The corresponding directory information of the User space network interface card is parsed, successively to obtain the first kind letter of the User space network interface card
Breath and Second Type information, and by the device PCI type file value, the first kind information and the Second Type information
Detection information as the User space network interface card.
Fourth aspect, the embodiment of the present invention provide a kind of non-transient computer readable storage medium, comprising:
The non-transient computer readable storage medium stores computer instruction, and the computer instruction makes the computer
Execute following method:
If detecting the trigger action of opening of device, the path for opening Peripheral Component Interconnect standard device PCI is macro;
Read the device PCI directory information under the macro respective path in the path;
The device PCI type file in the device PCI directory information is parsed, if the device PCI parsed is known in judgement
Type file value is identical as default network interface card classification yardage value, it is determined that the device PCI being currently detected is User space network interface card;
The corresponding directory information of the User space network interface card is parsed, successively to obtain the first kind letter of the User space network interface card
Breath and Second Type information, and by the device PCI type file value, the first kind information and the Second Type information
Detection information as the User space network interface card.
The processing method and processing device that User space network interface card provided in an embodiment of the present invention based on Shen prestige framework detects automatically is led to
Reading and parsing device PCI directory information are crossed, first determines whether the device PCI that is currently detected is User space network interface card, then by PCI
Device type file value, the first kind information of User space network interface card and Second Type information, can be effectively as detection information
Automatic detection network interface card, to get the detection information of User space network interface card.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is this hair
Bright some embodiments for those of ordinary skill in the art without creative efforts, can be with root
Other attached drawings are obtained according to these attached drawings.
Fig. 1 is the processing method process signal that the embodiment of the present invention is detected automatically based on the User space network interface card of Shen prestige framework
Figure;
Fig. 2 is the processing unit structural representation that the embodiment of the present invention is detected automatically based on the User space network interface card of Shen prestige framework
Figure;
Fig. 3 is electronic equipment entity structure schematic diagram provided in an embodiment of the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
Every other embodiment obtained without creative efforts, shall fall within the protection scope of the present invention.
Fig. 1 is the processing method that the embodiment of the present invention is detected automatically based on the User space network interface card of Shen prestige framework, such as Fig. 1 institute
Show, a kind of processing method that the User space network interface card based on Shen prestige framework detects automatically provided in an embodiment of the present invention, including following
Step:
S101: if detecting the trigger action of opening of device, the path for opening Peripheral Component Interconnect standard device PCI is macro.
If opening the road of Peripheral Component Interconnect standard device PCI specifically, device detects the trigger action of opening of device
Diameter is macro.Device can be understood as the component with logical operation function in the equipment, for executing the side of the embodiment of the present invention
Method.Trigger action can be the facility switching button of user's click.The macro PCI_DEVICE_FILE_PATH in path can for "/
sys/bus/pci/devices".The road of device PCI can be opened by the opendir () function in device PCI scanning function
Diameter is macro.It should be understood that the data structure for saving User space network interface card detection information can be pre-created and be claimed as global change
Measure array, the array member of global variable array may include: driver (driving type), verdor (network card equipment manufacturer),
Classs (device PCI classification code, the device PCI classification code correspond to device PCI type file), device (vendor equipment type
Mark), subsystem_device (sub- vendor equipment type identification), subsystem_verdor (the sub- manufacturer of network card equipment),
(bus is compiled by numa_node (Shen prestige processor node number), resource (the corresponding PCI address spatial information of network interface card), busid
Number), devid (device numbering), funcid (function number).
S102: the device PCI directory information under the macro respective path in the path is read.
Specifically, device reads the device PCI directory information under the macro respective path in the path.Readdir can be passed through
() function traverses in while Do statement reads the device PCI directory information.
S103: parsing the device PCI type file in the device PCI directory information, if the PCI parsed is known in judgement
Device type file value is identical as default network interface card classification yardage value, it is determined that the device PCI being currently detected is User space network interface card.
Specifically, device parses the device PCI type file in the device PCI directory information, if parsing is known in judgement
Device PCI type file value out is identical as default network interface card classification yardage value, it is determined that the device PCI being currently detected is user
State network interface card, and device PCI type file value is assigned to corresponding array member classs in global variable array.If parsing
Device PCI type file value out is not 0x020000, it is determined that the device PCI being currently detected is not User space network interface card, after
The continuous movement for executing the device PCI type file that circulation parses in the device PCI directory information.
S104: successively parsing the corresponding directory information of the User space network interface card, to obtain the first of the User space network interface card
Type information and Second Type information, and by the device PCI type file value, the first kind information and second class
Detection information of the type information as the User space network interface card.
Specifically, device successively parses the corresponding directory information of the User space network interface card, to obtain the User space network interface card
First kind information and Second Type information, and by the device PCI type file value, the first kind information and described
Detection information of the Second Type information as the User space network interface card.First kind information can be understood as and User space network interface card phase
The facility information of pass may include vendor equipment type identification, the network card equipment manufacturer, the sub- factory of network card equipment of User space network interface card
Quotient, sub- vendor equipment type identification, Shen prestige processor node number and the corresponding PCI address spatial information of network interface card, by above-mentioned difference
Corresponding file value is assigned to corresponding array member in global variable array, such as by the corresponding file value of network card equipment manufacturer
The array member verdor being assigned in global variable array, alternative document value assignment repeat no more.It can be according to the manufacturer
Device type mark and default corresponding relationship, obtain driving type corresponding with the vendor equipment type identification;By the drive
Type is moved as the detection information;Wherein, the default corresponding relationship is each driving type and each vendor equipment type identification
Between one-to-one relationship.The network interface card (corresponding vendor equipment type identification) of the different model of different network card equipment manufacturers is corresponding
Driver, a kind of driver corresponds to a kind of driving type, i.e., between each driving type and each vendor equipment type identification
There are one-to-one relationships.The one-to-one relationship can be indicated by PCI_TABLE table.
Second Type information can be understood as bus message relevant to User space network interface card, may include: the User space
Above-mentioned corresponding file value is assigned to global variable number by the corresponding bus number of network interface card, device numbering and function number
Corresponding array member in group, such as the array member corresponding file value of bus number being assigned in global variable array
Busid, alternative document value assignment repeat no more.A file value is often got it should be noted that can be, immediately by this article
Part value is assigned to corresponding array member in global variable array.The global variable array of array member composition i.e. after assignment is deposited
The detection information of User space network interface card is stored up, for using when the load of User space trawl performance.
This method can also include: the device PCI type text repeated in the parsing device PCI directory information
The step of part, and determine the mark of the User space network interface card;According to the recognition result of the mark, all User space network interface cards are obtained
Quantity.It can be realized by way of accumulation calculating, that is, carry out circulation parsing, every execution circulation parsing is primary, determines one
The mark of secondary User space network interface card, cumulative global variable numerical value are the quantity of User space network interface card.
The processing method that User space network interface card provided in an embodiment of the present invention based on Shen prestige framework detects automatically, passes through reading
With parsing device PCI directory information, first determine whether the device PCI that is currently detected is User space network interface card, then by device PCI class
Type file value, the first kind information of User space network interface card and Second Type information can be visited effectively automatically as detection information
Survey grid card, to get the detection information of User space network interface card.
On the basis of the above embodiments, the first kind information includes the vendor equipment type of the User space network interface card
Mark, the method also includes:
According to the vendor equipment type identification and default corresponding relationship, obtain corresponding with the vendor equipment type identification
Driving type;Using the driving type as the detection information;Wherein, the default corresponding relationship be each driving type and
One-to-one relationship between each vendor equipment type identification.
Specifically, device obtains and the vendor equipment according to the vendor equipment type identification and default corresponding relationship
The corresponding driving type of type identification;Using the driving type as the detection information;Wherein, the default corresponding relationship is
One-to-one relationship between each driving type and each vendor equipment type identification.It can refer to above-described embodiment, repeat no more.
The processing method that User space network interface card provided in an embodiment of the present invention based on Shen prestige framework detects automatically, by that will drive
Type is moved as detection information, detection information can be obtained more fully hereinafter.
On the basis of the above embodiments, the method also includes:
The step of repeating the device PCI type file in the parsing device PCI directory information, and determine institute
State the mark of User space network interface card.
Specifically, device repeats the step of the device PCI type file in the parsing device PCI directory information
Suddenly, and determine the mark of the User space network interface card.It can refer to above-described embodiment, repeat no more.
According to the recognition result of the mark, the quantity of all User space network interface cards is obtained, and as the detection information.
Specifically, recognition result of the device according to the mark, obtains the quantity of all User space network interface cards, and as described
Detection information.It can refer to above-described embodiment, repeat no more.
The processing method that User space network interface card provided in an embodiment of the present invention based on Shen prestige framework detects automatically, by by institute
There is the quantity of User space network interface card as detection information, is further able to obtain detection information more fully hereinafter.
On the basis of the above embodiments, the first kind information further includes network card equipment manufacturer, the sub- factory of network card equipment
Quotient, sub- vendor equipment type identification, Shen prestige processor node number and the corresponding PCI address spatial information of network interface card.
Specifically, the first kind information in device further includes network card equipment manufacturer, the sub- manufacturer of network card equipment, Zi Chang
Quotient's device type mark, Shen prestige processor node number and the corresponding PCI address spatial information of network interface card.It can refer to above-described embodiment,
It repeats no more.
The processing method that User space network interface card provided in an embodiment of the present invention based on Shen prestige framework detects automatically, by making
One type information further includes network card equipment manufacturer, the sub- manufacturer of network card equipment, sub- vendor equipment type identification, Shen prestige processor node
Number PCI address spatial information corresponding with network interface card, is further able to obtain detection information more fully hereinafter.
On the basis of the above embodiments, the Second Type information includes: that the corresponding bus of the User space network interface card is compiled
Number, device numbering and function number.
Specifically, the Second Type information in device includes: the corresponding bus number of the User space network interface card, equipment
Number and function number.It can refer to above-described embodiment, repeat no more.
The processing method that User space network interface card provided in an embodiment of the present invention based on Shen prestige framework detects automatically, by making
Two type informations include the corresponding bus number of User space network interface card, device numbering and function number, are further able to more comprehensively
Ground obtains detection information.
On the basis of the above embodiments, the method also includes:
Global variable array is pre-created.
Specifically, global variable array is pre-created in device.It can refer to above-described embodiment, repeat no more.
By the driving type, the quantity of all User space network interface cards, the network card equipment manufacturer, the device PCI
It is type file, the vendor equipment type identification, the sub- manufacturer of the network card equipment, the sub- vendor equipment type identification, described
Shen prestige processor node number, the address space information, the bus number, the device numbering and function number difference
Corresponding file value is assigned to corresponding array member in the global variable array.
Specifically, device by the driving type, the quantity of all User space network interface cards, the network card equipment manufacturer,
The device PCI type file, the vendor equipment type identification, the sub- manufacturer of the network card equipment, the sub- vendor equipment class
Type mark, the Shen prestige processor node number, the address space information, the bus number, the device numbering and described
The corresponding file value of function number is assigned to corresponding array member in the global variable array.It can refer to above-mentioned implementation
Example, repeats no more.
The processing method that User space network interface card provided in an embodiment of the present invention based on Shen prestige framework detects automatically, by will be each
The corresponding file value of kind detection information is assigned to corresponding array member in global variable array, being capable of effective storage detection
Information, convenient for being used in the load of User space trawl performance.
Fig. 2 is the processing unit structural representation that the embodiment of the present invention is detected automatically based on the User space network interface card of Shen prestige framework
Figure, as shown in Fig. 2, the embodiment of the invention provides a kind of processing that the User space network interface card based on Shen prestige framework detects automatically dresses
It sets, including opening unit 201, reading unit 202, resolution unit 203 and probe unit 204, in which:
If opening unit 201 is used to detect the trigger action of opening of device, Peripheral Component Interconnect standard device PCI is opened
Path it is macro;Reading unit 202 is used to read the device PCI directory information under the macro respective path in the path;Resolution unit 203
For parsing the device PCI type file in the device PCI directory information, if the device PCI type parsed is known in judgement
File value is identical as default network interface card classification yardage value, it is determined that the device PCI being currently detected is User space network interface card;Probe unit
204 for successively parsing the corresponding directory information of the User space network interface card, to obtain the first kind letter of the User space network interface card
Breath and Second Type information, and by the device PCI type file value, the first kind information and the Second Type information
Detection information as the User space network interface card.
If opening Peripheral Component Interconnect standard specifically, opening unit 201 is used to detect the trigger action of opening of device
The path of device PCI is macro;Reading unit 202 is used to read the device PCI directory information under the macro respective path in the path;Parsing
Unit 203 is used to parse the device PCI type file in the device PCI directory information, if judgement knows that the PCI parsed is set
Standby type file value is identical as default network interface card classification yardage value, it is determined that the device PCI being currently detected is User space network interface card;It visits
Unit 204 is surveyed for successively parsing the corresponding directory information of the User space network interface card, to obtain the first of the User space network interface card
Type information and Second Type information, and by the device PCI type file value, the first kind information and second class
Detection information of the type information as the User space network interface card.
The processing unit that User space network interface card provided in an embodiment of the present invention based on Shen prestige framework detects automatically, passes through reading
With parsing device PCI directory information, first determine whether the device PCI that is currently detected is User space network interface card, then by device PCI class
Type file value, the first kind information of User space network interface card and Second Type information can be visited effectively automatically as detection information
Survey grid card, to get the detection information of User space network interface card.
The processing unit that User space network interface card provided in an embodiment of the present invention based on Shen prestige framework detects automatically specifically can be with
For executing the process flow of above-mentioned each method embodiment, details are not described herein for function, is referred to above method embodiment
Detailed description.
Fig. 3 is electronic equipment entity structure schematic diagram provided in an embodiment of the present invention, as shown in figure 3, the electronic equipment
It include: Shen prestige processor (processor) 301, memory (memory) 302 and bus 303;
Wherein, the Shen prestige processor 301, memory 302 complete mutual communication by bus 303;
The Shen prestige processor 301 is used to call the program instruction in the memory 302, real to execute above-mentioned each method
Apply method provided by example, for example, if detecting the trigger action of opening of device, open Peripheral Component Interconnect standard PCI
The path of equipment is macro;Read the device PCI directory information under the macro respective path in the path;Parse the device PCI catalogue letter
Device PCI type file in breath, if the device PCI type file value and default network interface card classification yardage value parsed is known in judgement
It is identical, it is determined that the device PCI being currently detected is User space network interface card;Successively parse the corresponding catalogue letter of the User space network interface card
Breath, to obtain the first kind information and Second Type information of the User space network interface card, and by the device PCI type file
Value, the detection information of the first kind information and the Second Type information as the User space network interface card.
The present embodiment discloses a kind of computer program product, and the computer program product includes being stored in non-transient calculating
Computer program on machine readable storage medium storing program for executing, the computer program include program instruction, when described program instruction is calculated
When machine executes, computer is able to carry out method provided by above-mentioned each method embodiment, for example, if detecting opening of device
Trigger action, open Peripheral Component Interconnect standard device PCI path it is macro;Read the PCI under the macro respective path in the path
Facility inventory information;The device PCI type file in the device PCI directory information is parsed, if the PCI parsed is known in judgement
Device type file value is identical as default network interface card classification yardage value, it is determined that the device PCI being currently detected is User space network interface card;
The corresponding directory information of the User space network interface card is parsed, successively to obtain the first kind information and second of the User space network interface card
Type information, and using the device PCI type file value, the first kind information and the Second Type information as described in
The detection information of User space network interface card.
The present embodiment provides a kind of non-transient computer readable storage medium, the non-transient computer readable storage medium
Computer instruction is stored, the computer instruction makes the computer execute method provided by above-mentioned each method embodiment, example
If such as including: the trigger action for detecting opening of device, the path for opening Peripheral Component Interconnect standard device PCI is macro;Read institute
State the device PCI directory information under the macro respective path in path;Parse the device PCI type text in the device PCI directory information
Part, if judgement knows that the device PCI type file value parsed is identical as default network interface card classification yardage value, it is determined that current detection
The device PCI arrived is User space network interface card;The corresponding directory information of the User space network interface card is parsed, successively to obtain the User space
The first kind information and Second Type information of network interface card, and by the device PCI type file value, the first kind information and
Detection information of the Second Type information as the User space network interface card.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above method embodiment can pass through
The relevant hardware of program instruction is completed, and program above-mentioned can be stored in a computer readable storage medium, the program
When being executed, step including the steps of the foregoing method embodiments is executed;And storage medium above-mentioned includes: ROM, RAM, magnetic disk or light
The various media that can store program code such as disk.
The embodiments such as electronic equipment described above are only schematical, wherein it is described as illustrated by the separation member
Unit may or may not be physically separated, and component shown as a unit may or may not be object
Manage unit, it can it is in one place, or may be distributed over multiple network units.It can select according to the actual needs
Some or all of the modules therein is selected to achieve the purpose of the solution of this embodiment.Those of ordinary skill in the art are not paying wound
In the case where the labour for the property made, it can understand and implement.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can
It realizes by means of software and necessary general hardware platform, naturally it is also possible to pass through hardware.Based on this understanding, on
Stating technical solution, substantially the part that contributes to existing technology can be embodied in the form of software products in other words, should
Computer software product may be stored in a computer readable storage medium, such as ROM/RAM, magnetic disk, CD, including several fingers
It enables and using so that a computer equipment (can be personal computer, server or the network equipment etc.) executes each implementation
Method described in certain parts of example or embodiment.
Finally, it should be noted that the above various embodiments is only to illustrate the technical solution of the embodiment of the present invention, rather than it is right
It is limited;Although the embodiment of the present invention is described in detail referring to foregoing embodiments, the ordinary skill of this field
Personnel are it is understood that it is still possible to modify the technical solutions described in the foregoing embodiments, or to part
Or all technical features are equivalently replaced;And these are modified or replaceed, it does not separate the essence of the corresponding technical solution
The range of various embodiments of the present invention technical solution.
Claims (9)
1. a kind of processing method that the User space network interface card based on Shen prestige framework detects automatically characterized by comprising
If detecting the trigger action of opening of device, the path for opening Peripheral Component Interconnect standard device PCI is macro;
Read the device PCI directory information under the macro respective path in the path;
The device PCI type file in the device PCI directory information is parsed, if the device PCI type parsed is known in judgement
File value is identical as default network interface card classification yardage value, it is determined that the device PCI being currently detected is User space network interface card;
Successively parse the corresponding directory information of the User space network interface card, with obtain the User space network interface card first kind information and
Second Type information, and using the device PCI type file value, the first kind information and the Second Type information as
The detection information of the User space network interface card.
2. the method according to claim 1, wherein the first kind information includes the User space network interface card
Vendor equipment type identification, the method also includes:
According to the vendor equipment type identification and default corresponding relationship, drive corresponding with the vendor equipment type identification is obtained
Dynamic type;Using the driving type as the detection information;Wherein, the default corresponding relationship is each driving type and each factory
One-to-one relationship between quotient's device type mark.
3. according to the method described in claim 2, it is characterized in that, the method also includes:
The step of repeating the device PCI type file in the parsing device PCI directory information, and determine the use
The mark of family state network interface card;
According to the recognition result of the mark, the quantity of all User space network interface cards is obtained, and as the detection information.
4. according to the method described in claim 3, it is characterized in that, the first kind information further include network card equipment manufacturer,
The sub- manufacturer of network card equipment, sub- vendor equipment type identification, Shen prestige processor node number and the corresponding PCI address space letter of network interface card
Breath.
5. according to the method described in claim 4, it is characterized in that, the Second Type information includes: the User space network interface card
Corresponding bus number, device numbering and function number.
6. according to the method described in claim 5, it is characterized in that, the method also includes:
Global variable array is pre-created;
By the driving type, the quantity of the different user state network interface card, the network card equipment manufacturer, the device PCI type
File, the vendor equipment type identification, the sub- manufacturer of the network card equipment, the sub- vendor equipment type identification, the Shen prestige
Processor node number, the address space information, the bus number, the device numbering and the function number respectively correspond
File value be assigned to corresponding array member in the global variable array.
7. a kind of processing unit that the User space network interface card based on Shen prestige framework detects automatically characterized by comprising
Opening unit, if opening the path of Peripheral Component Interconnect standard device PCI for detecting the trigger action of opening of device
It is macro;
Reading unit, for reading the device PCI directory information under the macro respective path in the path;
Resolution unit is parsed for parsing the device PCI type file in the device PCI directory information if judgement is known
Device PCI type file value it is identical as default network interface card classification yardage value, it is determined that the device PCI being currently detected be User space
Network interface card;
Probe unit, for successively parsing the corresponding directory information of the User space network interface card, to obtain the User space network interface card
First kind information and Second Type information, and by the device PCI type file value, the first kind information and described
Detection information of two type informations as the User space network interface card.
8. a kind of electronic equipment based on Shen prestige framework characterized by comprising Shen prestige processor, memory and bus,
In,
The Shen prestige processor and the memory complete mutual communication by the bus;
The memory is stored with the program instruction that can be executed by the Shen prestige processor, and the Shen prestige processor calls the journey
Sequence instruction is able to carry out the method as described in claim 1 to 6 is any.
9. a kind of non-transient computer readable storage medium, which is characterized in that the non-transient computer readable storage medium is deposited
Computer instruction is stored up, the computer instruction makes the computer execute the method as described in claim 1 to 6 is any.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810765994.4A CN109117326A (en) | 2018-07-12 | 2018-07-12 | The processing method and processing device that User space network interface card based on Shen prestige framework detects automatically |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810765994.4A CN109117326A (en) | 2018-07-12 | 2018-07-12 | The processing method and processing device that User space network interface card based on Shen prestige framework detects automatically |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109117326A true CN109117326A (en) | 2019-01-01 |
Family
ID=64862912
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810765994.4A Pending CN109117326A (en) | 2018-07-12 | 2018-07-12 | The processing method and processing device that User space network interface card based on Shen prestige framework detects automatically |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109117326A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110795374A (en) * | 2019-10-16 | 2020-02-14 | 苏州浪潮智能科技有限公司 | Equipment access method and device and readable storage medium |
CN116303148A (en) * | 2023-05-17 | 2023-06-23 | 北京中科网威信息技术有限公司 | Multi-slot device network card detection method and device, electronic device and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101163055A (en) * | 2007-11-21 | 2008-04-16 | 浪潮电子信息产业股份有限公司 | Method of automatically detecting server hardware information |
US20120311385A1 (en) * | 2011-05-31 | 2012-12-06 | Hon Hai Precision Industry Co., Ltd. | Control server and method for switching running of test programs stored in multiple storage mediums of test server |
CN103150190A (en) * | 2013-03-26 | 2013-06-12 | 汉柏科技有限公司 | Automatic detecting and driving loading method of user mode network card in Linux system |
CN103777978A (en) * | 2014-01-07 | 2014-05-07 | 汉柏科技有限公司 | Automatic user-mode 3G-USB network interface card detecting method based on Linux kernel |
CN104980603A (en) * | 2015-05-13 | 2015-10-14 | 汉柏科技有限公司 | USB_3G network card user state automatic identification and dialing method and device |
-
2018
- 2018-07-12 CN CN201810765994.4A patent/CN109117326A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101163055A (en) * | 2007-11-21 | 2008-04-16 | 浪潮电子信息产业股份有限公司 | Method of automatically detecting server hardware information |
US20120311385A1 (en) * | 2011-05-31 | 2012-12-06 | Hon Hai Precision Industry Co., Ltd. | Control server and method for switching running of test programs stored in multiple storage mediums of test server |
CN103150190A (en) * | 2013-03-26 | 2013-06-12 | 汉柏科技有限公司 | Automatic detecting and driving loading method of user mode network card in Linux system |
CN103777978A (en) * | 2014-01-07 | 2014-05-07 | 汉柏科技有限公司 | Automatic user-mode 3G-USB network interface card detecting method based on Linux kernel |
CN104980603A (en) * | 2015-05-13 | 2015-10-14 | 汉柏科技有限公司 | USB_3G network card user state automatic identification and dialing method and device |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110795374A (en) * | 2019-10-16 | 2020-02-14 | 苏州浪潮智能科技有限公司 | Equipment access method and device and readable storage medium |
CN116303148A (en) * | 2023-05-17 | 2023-06-23 | 北京中科网威信息技术有限公司 | Multi-slot device network card detection method and device, electronic device and storage medium |
CN116303148B (en) * | 2023-05-17 | 2023-08-22 | 北京中科网威信息技术有限公司 | Multi-slot device network card detection method and device, electronic device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Wang et al. | Rafiki: Machine learning as an analytics service system | |
CN107045503B (en) | A kind of method and device that feature set determines | |
CN110060090A (en) | Method, apparatus, electronic equipment and the readable storage medium storing program for executing of Recommendations combination | |
CN108304112B (en) | Data processing method and device | |
CN108876470A (en) | Tagging user extended method, computer equipment and storage medium | |
CN109117326A (en) | The processing method and processing device that User space network interface card based on Shen prestige framework detects automatically | |
CN109558674A (en) | Method for Sales Forecast and its model training method, device | |
CN103810105A (en) | Method and device for detecting application program version | |
CN104809751A (en) | Method and device for generating event group evolution diagram | |
US10042638B2 (en) | Evaluating documentation coverage | |
CN109033078B (en) | The recognition methods of sentence classification and device, storage medium, processor | |
CN107766231B (en) | Automatic testing method and device | |
CN106227502A (en) | A kind of method and device obtaining hard disk firmware version | |
CN109660392A (en) | Hardware unitizes adaptive management dispositions method and system under a kind of linux system | |
CN110377741A (en) | File classification method, intelligent terminal and computer readable storage medium | |
US20070057956A1 (en) | Method, apparatus, and computer program product for implementing self-modeling computer systems componentry | |
CN106933896B (en) | Shortest access path identification method and device | |
CN115098362A (en) | Page testing method and device, electronic equipment and storage medium | |
CN110221952B (en) | Service data processing method and device and service data processing system | |
CN111652122A (en) | Configuration method and device of vision system | |
US9779132B1 (en) | Predictive information discovery engine | |
KR102074419B1 (en) | Intelligent product information collection server and product information collect method using the same | |
CN106067139A (en) | A kind of mthods, systems and devices of construction feature database | |
CN107066247A (en) | Patch querying method and device | |
KR20130129494A (en) | Recommendation service system and method of altering recommendation algorithm |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190101 |