CN113900849A - GMAC network card fault solving method under Linux operating system - Google Patents

GMAC network card fault solving method under Linux operating system Download PDF

Info

Publication number
CN113900849A
CN113900849A CN202111234450.3A CN202111234450A CN113900849A CN 113900849 A CN113900849 A CN 113900849A CN 202111234450 A CN202111234450 A CN 202111234450A CN 113900849 A CN113900849 A CN 113900849A
Authority
CN
China
Prior art keywords
state
phy
mac
gmac
link
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.)
Granted
Application number
CN202111234450.3A
Other languages
Chinese (zh)
Other versions
CN113900849B (en
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.)
Kirin Software Co Ltd
Original Assignee
Kirin Software 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 Kirin Software Co Ltd filed Critical Kirin Software Co Ltd
Priority to CN202111234450.3A priority Critical patent/CN113900849B/en
Publication of CN113900849A publication Critical patent/CN113900849A/en
Application granted granted Critical
Publication of CN113900849B publication Critical patent/CN113900849B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Environmental & Geological Engineering (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application discloses a GMAC network card fault solving method under a Linux operating system, wherein in the process of reading a PHY state, an MAC state is read, the PHY and the MAC can be ensured to be simultaneously in a 1000/Full state, namely, the ping is ensured to be abnormal, and the phenomenon that the ping is occasionally blocked during the startup process can be solved, namely, the ping is abnormal and the situation that no available buffer space exists is prompted.

Description

GMAC network card fault solving method under Linux operating system
Technical Field
The application relates to the technical field of network card fault solutions, in particular to a GMAC network card fault solution method under a Linux operating system.
Background
Today, no network is imaginable. The network card is one of the most important output devices in a modern computer system, and the network card is abnormal, so that the computer cannot be networked directly. Therefore, for the equipment which needs to be connected with the local area network or the internet, the abnormity of the network is a fault which needs to be solved urgently. The Loongson GMAC network card (PID/VID is 0x0014/0x7a03) is taken as a Loongson 3A4000+7a1000 desktop mainboard with a home network card, and is widely applied to the home-made kylin operating system. In recent years, the international trade friction, and the resulting national science and technology struggle, has placed a tremendous impact on the world division of labor under the WTO regulations, resulting in a wider range of domestic alternatives that appear to have become government, market, and public consensus. At present, when a domestic GMAC network card is started, a ping non-closing abnormal phenomenon occasionally occurs, namely, a ping abnormal condition indicates that no available buffer area space exists, and a network card fault is caused.
Disclosure of Invention
The application provides a GMAC network card fault solving method under a Linux operating system, which can solve the problem of abnormal phenomena of occasional ping during startup.
In view of this, the present application provides a method for solving a GMAC network card fault in a Linux operating system, including the following steps:
step 1, opening RGMII interruption when initializing MAC state;
and 2, when registering the STmmac _ interrupt in the network card drive, if receiving the RGMII interrupt, calling a PHY _ MAC _ interrupt to trigger a state machine, monitoring the link state between the PHY and the MAC in real time and synchronizing the link state to the state machine.
The calling of the PHY _ MAC _ interrupt to trigger the state machine, the monitoring of the link state between the PHY and the MAC in real time, and the synchronizing of the link state to the state machine include:
calling a PHY _ MAC _ interrupt function to execute a state machine, reading the value of an SGMII/RGMII state register GMAC _ S _ R _ GMII in the PHY _ MAC _ interrupt call, obtaining the link state between the MAC and the PHY according to the value of the SGMII/RGMII state register GMAC _ S _ R _ GMII, and putting the link state between the MAC and the PHY into a work queue to synchronize the state of the PHY and the state of the MAC.
The RGMII interrupt is opened by writing a value of 0x207 to the interrupt mask register, corresponding to binary 1000000111.
Wherein the Link state between the PHY and the MAC includes 10/Half, Link Down and 1000/Full.
When detecting that the link state between the PHY and the MAC is 10/Half, the state machine enters a PHY _ UP state; when detecting that the Link state between the PHY and the MAC is Link Down, the state machine enters a PHY _ NOLINK state; when the link state between PHY and MAC is detected to be 1000/Full, the state machine enters the PHY _ CHANGELINK state.
According to the technical scheme, the method has the following advantages:
the method for solving the GMAC network card fault in the Linux operating system reads the MAC state in the process of reading the PHY state, can ensure that the PHY and the MAC are simultaneously in a 1000/Full state, can ensure that there is no abnormality in ping, and can solve the phenomenon of occasional ping disconnection abnormality in the boot process, namely that the ping is abnormal and prompts that no available buffer space exists.
Drawings
In order to express the technical scheme of the embodiment of the invention more clearly, the drawings used for describing the embodiment will be briefly introduced below, and obviously, the drawings in the following description are only some embodiments of the invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a schematic diagram of a state machine variation prior to an unused embodiment solution;
FIG. 2 is a diagram illustrating a variation of a state machine after use of an embodiment scheme.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The GMAC network card fault solving method under the Linux operating system comprises the following steps:
step 1, opening RGMII (Reduced Gigabit Media independent Interface) interrupt when initializing MAC state. RGMII is called Reduced Gigabit Media independent Interface, the Chinese name is Reduced Gigabit Media independent Interface, RGMII interrupt belongs to an interrupt state stored in a GMAC interrupt state register, and is related to a link between MAC and PHY.
And 2, when registering the STmmac _ interrupt in the network card drive, if receiving the RGMII interrupt, calling a PHY _ MAC _ interrupt to trigger a state machine, monitoring the link state between the PHY and the MAC in real time and synchronizing the link state to the state machine.
The scheme of the application is described in detail in combination with the actual debugging process.
Referring to fig. 1, before the solution of the embodiment of the present application is not used, a change process of the portal state machine at startup is as follows: PHY _ UP- -PHY _ AN- -PHY _ NOLINK- -PHY _ RUNNING.
And (3) actual debugging process: the starting state machine is in PHY _ READY by default, when AN open network card enters a PHY _ UP state from the PHY _ READY state, then automatically enters a PHY _ AN auto-negotiation state, the MII _ BMSR basic mode state register value is read at the moment, the phydev- > Link is judged to be 0, the PHY _ NOLINK state is entered, the MII _ BMSR mode state register value is read for three times to be 0, the phydev- > Link is judged to be 1 during the fourth reading, the printing PHY state is 'Link is Up-1000/Full', and the PHY _ RUNNING state is entered;
at some time thereafter, the stmmac _ interrupt is triggered, the GMAC _ INT _ STATUS interrupt STATUS register value is read (0x1), the SGMII/RGMII STATUS register GMAC _ S _ R _ GMII value is read (0xd), and the pcs _ Link is set to 1, that is, the MAC state is "Link is Up-1000/Full".
Namely, the original scheme is to read the state of the PHY first and then read the MAC state. After many tests, when the PHY is Up, when the interrupt is triggered to read the SGMII/RGMII status register, the MAC state is generally Up, but in the actual case, there is a process of Up-Down-Up in the MAC state (the giga MAC or the giga MAC can directly reach one giga or ten thousand mega speed without being powered Up, there is a process from low speed to high speed, and the value read by the link status register in the conversion process is 0, and the external expression is that the MAC is in Down state), when the PHY is Up, the MAC is in Down, the ping exception will be caused.
Referring to fig. 2, after using the embodiment of the present application, the portal state machine changes: PHY _ UP- -PHY _ AN- -PHY _ NOLINK- -PHY _ CHANGELINK- -PHY _ RUNNING.
And (3) actual debugging process: after the network card DMA sends data, the stmmac _ interrupt is triggered for the first time, and an interrupt STATUS register GMAC _ INT _ STATUS value (0x1, and the phy _ mac _ interrupt is triggered) is read. Secondly, reading the value of an SGMII/RGMII status register GMAC _ S _ R _ GMII to be 0x8, reading the value of an MII _ BMSR basic mode status register to judge that phydev- > link is 1 and speed _ value is 0, wherein the link state is 10/Half at the moment; in the Phy _ mac _ interrupt call, phydev- > link ═ 1 is put into the work queue, and the state machine Phy state is Phy _ UP.
Triggering stmmac _ interrupt for the second time after the network card DMA sends data, reading an interrupt state register GMAC _ INT _ STATUS value (0x1, triggering phy _ mac _ interrupt), reading an SGMII/RGMII state register GMAC _ S _ R _ GMII value to be 0, reading an MII _ BMSR basic mode state register value, judging phy _ dev- > Link to be 0, and entering a Link Down. In the Phy _ mac _ interrupt call, Phy- > link is 0, the work queue is put in, the state machine Phy state is Phy _ AN at this time, the auto-negotiation state is entered, Phy- > link is 0, the state is firstly switched to Phy _ noise, and the link speed is adjusted.
Triggering stmmac _ interrupt for the third time after the network card DMA sends data, reading an interrupt STATUS register GMAC _ INT _ STATUS value (0x1, triggering phy _ mac _ interrupt), reading an SGMII/RGMII STATUS register GMAC _ S _ R _ GMII value to be 0xd, reading an MII _ BMSR basic mode STATUS register value, judging phydev- > link to be 1, and setting a link to be 1000/Full. When PHY- > link changes from 0 to 1, the state machine goes to CHANGELINK, reads the MII _ BMSR basic mode state register value to determine phydev- > link is 1, sets the state to PHY _ RUNNING, and adjusts the link speed, after which the state machine state is always PHY _ RUNNING.
Because the MAC state has a process from 10/Half to Link Down (the read Link state register value is 0) to 1000/Full, the MAC state is read in the process of reading the PHY state in the scheme, namely the SGMII/RGMII state register GMAC _ S _ R _ GMII value is read firstly, the MAC is ensured to be in the 1000/Full state when the PHY is in the 1000/Full state, thereby ensuring that the PHY and the MAC are in the 1000/Full state at the same time and ensuring that the ping has no abnormity. After the scheme of the application is applied, the problem of accidental ping faults can not occur after hundreds of tests.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes in the foregoing system embodiments may be referred to for corresponding processes in the foregoing method embodiments, and the functions and effects are also the same, which are not described herein again.
The terms "first," "second," "third," "fourth," and the like in the description of the application and the above-described figures, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (5)

1. A GMAC network card fault solving method under a Linux operating system is characterized by comprising the following steps:
step 1, opening RGMII interruption when initializing MAC state;
and 2, when registering the STmmac _ interrupt in the network card drive, if receiving the RGMII interrupt, calling a PHY _ MAC _ interrupt to trigger a state machine, monitoring the link state between the PHY and the MAC in real time and synchronizing the link state to the state machine.
2. The GMAC network card fault resolution method under the Linux operating system of claim 1, wherein the calling PHY _ MAC _ interrupt triggers a state machine, and the monitoring the link state between the PHY and the MAC in real time and synchronizing the link state to the state machine comprises:
calling a PHY _ MAC _ interrupt function to execute a state machine, reading the value of an SGMII/RGMII state register GMAC _ S _ R _ GMII in the PHY _ MAC _ interrupt call, obtaining the link state between the MAC and the PHY according to the value of the SGMII/RGMII state register GMAC _ S _ R _ GMII, and putting the link state between the MAC and the PHY into a work queue to synchronize the state of the PHY and the state of the MAC.
3. The GMAC network card failure resolution method under the Linux operating system according to claim 1, wherein the method for opening the RGMII interrupt is to write a value of 0x207, corresponding to binary 1000000111, to the interrupt mask register.
4. The GMAC network card fault resolution method under the Linux operating system according to claim 1, wherein the Link state between the PHY and the MAC comprises 10/Half, Link Down and 1000/Full.
5. The GMAC network card fault resolution method under the Linux operating system according to claim 4, wherein when detecting that the link state between the PHY and the MAC is 10/Half, the state machine enters the PHY _ UP state; when detecting that the Link state between the PHY and the MAC is Link Down, the state machine enters a PHY _ NOLINK state; when the link state between PHY and MAC is detected to be 1000/Full, the state machine enters the PHY _ CHANGELINK state.
CN202111234450.3A 2021-10-22 2021-10-22 GMAC network card fault solving method under Linux operating system Active CN113900849B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111234450.3A CN113900849B (en) 2021-10-22 2021-10-22 GMAC network card fault solving method under Linux operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111234450.3A CN113900849B (en) 2021-10-22 2021-10-22 GMAC network card fault solving method under Linux operating system

Publications (2)

Publication Number Publication Date
CN113900849A true CN113900849A (en) 2022-01-07
CN113900849B CN113900849B (en) 2023-06-27

Family

ID=79026030

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111234450.3A Active CN113900849B (en) 2021-10-22 2021-10-22 GMAC network card fault solving method under Linux operating system

Country Status (1)

Country Link
CN (1) CN113900849B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115941477A (en) * 2022-11-22 2023-04-07 麒麟软件有限公司 Optimization method for GMAC network card connectivity

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6065073A (en) * 1998-08-17 2000-05-16 Jato Technologies, Inc. Auto-polling unit for interrupt generation in a network interface device
CN102064964A (en) * 2010-12-13 2011-05-18 中国人民解放军国防科学技术大学 Method for rapidly switching gigabit network cards in gigabit switching environment
US20120170591A1 (en) * 2010-12-30 2012-07-05 Broadcom Corporation Advanced and Dynamic Physical Layer Device Capabilities Utilizing a Link Interruption Signal
CN108173756A (en) * 2017-12-18 2018-06-15 天津津航计算技术研究所 A kind of dual redundant ethernet mac state health control method
CN108632084A (en) * 2018-03-30 2018-10-09 天津麒麟信息技术有限公司 A kind of network interface state updating method based on GMAC network controllers built in Feiteng processor
CN110535715A (en) * 2018-05-25 2019-12-03 北京东土科技股份有限公司 Port status real-time detection method, circuit and interchanger based on Linux
CN113348633A (en) * 2019-02-01 2021-09-03 联想(新加坡)私人有限公司 Side chain failure detection and recovery

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6065073A (en) * 1998-08-17 2000-05-16 Jato Technologies, Inc. Auto-polling unit for interrupt generation in a network interface device
CN102064964A (en) * 2010-12-13 2011-05-18 中国人民解放军国防科学技术大学 Method for rapidly switching gigabit network cards in gigabit switching environment
US20120170591A1 (en) * 2010-12-30 2012-07-05 Broadcom Corporation Advanced and Dynamic Physical Layer Device Capabilities Utilizing a Link Interruption Signal
CN108173756A (en) * 2017-12-18 2018-06-15 天津津航计算技术研究所 A kind of dual redundant ethernet mac state health control method
CN108632084A (en) * 2018-03-30 2018-10-09 天津麒麟信息技术有限公司 A kind of network interface state updating method based on GMAC network controllers built in Feiteng processor
CN110535715A (en) * 2018-05-25 2019-12-03 北京东土科技股份有限公司 Port status real-time detection method, circuit and interchanger based on Linux
CN113348633A (en) * 2019-02-01 2021-09-03 联想(新加坡)私人有限公司 Side chain failure detection and recovery

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
FIREFLYCJD: "PHY寄存器", Retrieved from the Internet <URL:https://www.cnblogs.com/Fireflycjd/p/14650413.html> *
JERRY_CHG: "Linux Mii management/mdio子系统分析之五 PHY状态机分析及其与net_device的关联", Retrieved from the Internet <URL:https://blog.csdn.net/lickylin/article/details/104718409/> *
大不列颠小小咸鱼: "MAC/PHY传输协议", Retrieved from the Internet <URL:https://blog.csdn.net/weixin_40877615/article/details/94208978> *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115941477A (en) * 2022-11-22 2023-04-07 麒麟软件有限公司 Optimization method for GMAC network card connectivity
CN115941477B (en) * 2022-11-22 2024-08-16 麒麟软件有限公司 Optimization method for connectivity of GMAC network card

Also Published As

Publication number Publication date
CN113900849B (en) 2023-06-27

Similar Documents

Publication Publication Date Title
AU2014399227B2 (en) Fault Processing Method, Related Apparatus and Computer
CN112965908A (en) Communication test method, communication test device, communication equipment and storage medium
CN113190487A (en) PCIe device hot-drawing method and device
CN113900849A (en) GMAC network card fault solving method under Linux operating system
EP1640865A2 (en) Process management system
CN104734904B (en) The automatic test approach and system of bypass equipment
EP2980697B1 (en) System and method for altering a functionality of an application
US6499113B1 (en) Method and apparatus for extracting first failure and attendant operating information from computer system devices
CN116137603B (en) Link fault detection method and device, storage medium and electronic device
CN101136756B (en) Electric self-checking method, system and BMC chip on network long-range control host machine
CN117472625A (en) Method and device for determining abnormal information of PCIE link
CN108984377B (en) Method, system and medium for counting BIOS log
CN101989936A (en) Test method and system of single plate fault
CN115964218A (en) Method and device for identifying fault of high-speed serial computer expansion bus equipment
CN115373916A (en) Abnormality detection method, abnormality detection device, electronic apparatus, and computer-readable storage medium
CN111966599B (en) Virtualization platform reliability testing method, system, terminal and storage medium
Cisco Troubleshooting and Fault Management
CN113742113B (en) Health management method, equipment and storage medium for embedded system
CN109639525B (en) Network interface detection method based on homemade operating system
Cisco Troubleshooting the Router
Cisco Troubleshooting the Router
TWI711285B (en) Network failure detection method and network failure detection device
CN111857689A (en) Framework, function configuration method of framework, terminal and storage medium
CN111752736A (en) Remote collection method and system for Linux system downtime information
KR100267857B1 (en) Ethernet frame analyzer for pc using packet driver and method for processing command and received packets

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
GR01 Patent grant
GR01 Patent grant