MAC function switching method, device, equipment and program product
By pre-stored configuration information of multiple MAC function modes in Ethernet devices, and configured and adjusted according to network speed and clock frequency, the hot switching of MAC functions is achieved, solving the problem of the equipment in the prior art that power outages and re-burns. Problem, improving switching efficiency and automation.
Patent Information
- Application Number
- CN202411406649.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-01-03
AI Technical Summary
Existing Ethernet devices require the device to power down and re-fire firmware when switching MAC function mode, which is complex and inefficient.
By pre-stored hardware configuration information of multiple MAC function modes in Ethernet devices, the target MAC function mode and clock frequency are determined according to the network rate, and configured and adjusted in the system driver to achieve hot switching of MAC functions to avoid power outage and re-resolution Burn.
It realizes hot switching of MAC function of Ethernet devices, reduces switching complexity and time, improves switching efficiency, and supports automated switching.
Smart Images

Figure CN119254752A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a MAC function switching method, device, equipment and program product. Background Art
[0002] Ethernet devices usually support multiple different MAC function modes, and a MAC function mode needs to be implemented through corresponding configuration firmware and drivers. When an Ethernet device needs to switch from one MAC function mode to another MAC function mode, the device needs to be powered off, and then the boot medium is re-burned with the firmware corresponding to another MAC function mode and the corresponding driver is switched to implement another MAC function mode.
[0003] The above MAC function switching method is relatively cumbersome, complicated to operate and has low switching efficiency. Summary of the invention
[0004] In response to the above technical problems, the present application proposes a MAC function switching method, device, equipment and program product, which can realize MAC function hot switching, thereby improving the MAC function switching efficiency.
[0005] In a first aspect, the present application provides a MAC function switching method, which is applied to an Ethernet device, wherein the Ethernet device stores MAC hardware configuration information corresponding to a plurality of different MAC function modes, wherein the MAC hardware configuration information includes MAC initialization configuration information and serializer-deserializer configuration information, and the method includes:
[0006] Determine a corresponding target MAC functional mode according to the network rate, and determine a clock frequency corresponding to the target MAC functional mode;
[0007] Configuring MAC hardware configuration information corresponding to the target MAC functional mode in the system driver of the Ethernet device;
[0008] The clock frequency of the Ethernet device is adjusted to the clock frequency corresponding to the target MAC functional mode, and the MAC function driver is loaded to switch the Ethernet device to the target MAC functional mode.
[0009] In some implementations, determining a corresponding target MAC functional mode according to a network rate includes:
[0010] Identify the network rate of the optical module or physical layer interface chip of the Ethernet device;
[0011] Determine the target MAC function mode corresponding to the network rate of the optical module or physical layer interface chip.
[0012] In some implementations, configuring MAC hardware configuration information corresponding to the target MAC functional mode in the system driver of the Ethernet device includes:
[0013] Obtain MAC hardware configuration information corresponding to the target MAC functional mode;
[0014] Clearing the MAC hardware configuration information in the system driver of the Ethernet device;
[0015] The MAC hardware configuration information corresponding to the target MAC functional mode is written into the system driver of the Ethernet device.
[0016] In some implementations, adjusting the clock frequency of the Ethernet device to a clock frequency corresponding to the target MAC functional mode includes:
[0017] The clock frequency of the Ethernet device is divided so that the clock frequency of the Ethernet device is the clock frequency corresponding to the target MAC functional mode.
[0018] In some implementations, the method further includes:
[0019] When the Ethernet device starts, the random firmware is run and the operating system is loaded, and the random firmware includes any MAC hardware configuration information and serial deserializer configuration information.
[0020] In some implementations, the clock frequency of the Ethernet device is 156.25 MHz, and the target MAC functional mode includes any one of SGMII 1G, SGMII 2.5G, USXGMII 5G, and USXGMII 10G.
[0021] In a second aspect, the present application provides a MAC function switching device, which is applied to an Ethernet device, wherein the Ethernet device stores MAC hardware configuration information corresponding to a plurality of different MAC function modes, wherein the MAC hardware configuration information includes MAC initialization configuration information and serial deserializer configuration information, and the device includes:
[0022] A mode determination unit, configured to determine a corresponding target MAC functional mode according to a network rate, and determine a clock frequency corresponding to the target MAC functional mode;
[0023] A configuration updating unit, configured to configure MAC hardware configuration information corresponding to the target MAC functional mode in a system driver of the Ethernet device;
[0024] The function switching unit is used to adjust the clock frequency of the Ethernet device to the clock frequency corresponding to the target MAC function mode, and load the MAC function driver to switch the Ethernet device to the target MAC function mode.
[0025] A third aspect of the present application provides an Ethernet device, comprising:
[0026] Memory and processor;
[0027] The memory is connected to the processor and is used to store programs and MAC hardware configuration information corresponding to a plurality of different MAC functional modes, wherein the MAC hardware configuration information includes MAC initialization configuration information and serial deserializer configuration information;
[0028] The processor is used to implement the above-mentioned MAC function switching method by running the program in the memory.
[0029] A fourth aspect of the present application proposes a computing device, comprising the above-mentioned Ethernet device, or the computing device is configured to execute the above-mentioned MAC function switching method.
[0030] In a fifth aspect, the present application proposes a computer program product, comprising computer program instructions, which, when executed by a processor of an Ethernet device, cause the Ethernet device to execute the above-mentioned MAC function switching method; the Ethernet device stores MAC hardware configuration information corresponding to a plurality of different MAC function modes, wherein the MAC hardware configuration information comprises MAC initialization configuration information and serializer-deserializer configuration information.
[0031] The MAC function switching method proposed in the present application stores MAC hardware configuration information corresponding to a plurality of different MAC function modes in advance in the Ethernet device, such as MAC initialization configuration information and serial deserializer configuration information. Then, during the operation of the Ethernet device, the target MAC function mode to be switched is determined according to the network rate, and the clock frequency corresponding to the target MAC function mode is determined, and then the MAC hardware configuration information corresponding to the target MAC function mode is configured in the system driver of the Ethernet device; finally, the clock frequency of the Ethernet device is adjusted to the clock frequency corresponding to the target MAC function mode, and the MAC function driver is loaded to switch the Ethernet device to the target MAC function mode. The above-mentioned MAC function switching method stores MAC hardware configuration information corresponding to a plurality of different MAC function modes in advance in the Ethernet device, and when it is identified that the MAC function switching is required, the MAC hardware configuration information corresponding to the target MAC function mode is configured in the system driver of the Ethernet device, so as to realize the update of the system firmware and the driver, and then realize the hot switching of the MAC function. The above-mentioned MAC function switching process does not require the device to be powered off, nor does it require the firmware to be re-burned, and can realize automatic switching, and the switching efficiency is higher. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0033] Figure 1 A schematic diagram of an Ethernet interface circuit provided in an embodiment of the present application.
[0034] Figure 2 A schematic diagram of a processing process for switching MAC functions provided in an embodiment of the present application.
[0035] Figure 3 A flowchart of a MAC function switching method provided in an embodiment of the present application.
[0036] Figure 4 A schematic diagram of the structure of a MAC function switching device provided in an embodiment of the present application.
[0037] Figure 5 A schematic diagram of the structure of an Ethernet device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] From the hardware perspective, the Ethernet interface circuit is mainly composed of two parts: MAC (Media Access Control) controller and physical layer interface PHY (Physical Layer, PHY), such as Figure 1 shown. Figure 1 The DMA (Direct Memory Access) controller in the CPU is usually part of the CPU. Figure 1 The DMA controller is shown with a dotted line to indicate that the DMA controller may be involved in network port data transmission.
[0039] MAC and PHY work in the data link layer and physical layer of the OSI seven-layer model respectively. Among them, MAC (Media Access Control) is the media access control sublayer protocol. MAC can be a combination of a hardware controller and a MAC communication protocol. The MAC communication protocol is located in the lower half of the data link layer in the OSI seven-layer protocol, and is mainly responsible for controlling the physical medium that connects to the physical layer. When sending data, the MAC protocol can determine in advance whether the data can be sent. If it can be sent, some control information will be added to the data, and finally the data and control information will be sent to the physical layer in a specified format. When receiving data, the MAC protocol first determines whether the input information has a transmission error. If there is no error, the control information is removed and sent to the LLC (Logical Link Control) layer.
[0040] Since PHY integrates a lot of analog hardware, while MAC is a typical all-digital device, considering the chip area and analog / digital hybrid architecture, MAC is usually integrated into the microcontroller and PHY is left outside the chip. With the development of new product security technology, more flexible and higher density chip technology can realize the single-chip integration of MAC and PHY.
[0041] Devices with Ethernet interfaces usually support a variety of different MAC interface solutions, that is, they support a variety of different MAC function modes, such as SGMII, USXGMII and other MAC modes, and can also support multi-rate switching such as 100M, 1G, 2.5G, 5G, 10G, etc. A MAC function mode needs to be implemented through the corresponding configuration firmware and driver. When the Ethernet device needs to switch from one MAC function mode to another MAC function mode, the device needs to be powered off, and then the boot medium is re-burned with the firmware corresponding to another MAC function mode and the corresponding driver is switched to implement another MAC function mode.
[0042] like Figure 2As shown in the figure, when the Ethernet interface adopts the SGMII 1G interface solution, the required clock is a 100MHz clock. In order to realize the MAC interface mode, it is necessary to configure the hardware board-level design of the 100MHz clock, and then configure the software solution on the hardware board-level design, first configure the SGMII 1G firmware (configure the SGMII 1G MAC and serdes and other hardware configurations), then load the corresponding driver by loading the "SGMII" property description of the device tree, and finally load and start the operating system to realize the SGMII1G functional interface.
[0043] After implementing the SGMII 1G function, if you want to switch to the USXGMII 10G interface mode, you need to power off and replace the hardware board-level design of the 156.25MHz clock. After powering on, reconfigure the software solution on the hardware board-level design. First, configure the USXGMII 10G firmware (configure USXGMII 10G MAC and serdes and other hardware configurations), then load the corresponding driver by loading the "USXGMII" property description of the device tree, and finally load and start the operating system to implement the USXGMII 10G functional interface.
[0044] The above MAC function switching method requires powering off and reconfiguring the device, which is cumbersome to implement, complicated to operate, and has low switching efficiency.
[0045] In view of the above technical problems, an embodiment of the present application proposes a MAC function switching method, which can realize MAC function hot switching without powering off the Ethernet device, thereby reducing the complexity of MAC function switching and improving switching efficiency.
[0046] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0047] An embodiment of the present application provides a MAC function switching method, which is applied to an Ethernet device, where the Ethernet device refers to a device with an Ethernet interface, such as a computer, a server, a router, a switch, etc.
[0048] In the Ethernet device, a processor and a memory are provided. The memory may refer to any type of memory used to store data in the Ethernet device, such as an internal memory, such as RAM (SRAM, DRAM), ROM (PROM, EPROM), an external memory, a buffer memory, a flash memory, etc. In an embodiment of the present application, the memory of the Ethernet device stores MAC hardware configuration information corresponding to a plurality of different MAC functional modes, and the MAC hardware configuration information includes MAC initialization configuration information (including MAC basic initialization information, MAC initialization clock, etc.) and serial deserializer configuration information (including serdes initialization information, clock configuration information, PLL (Phase Locked Loop, phase-locked loop) configuration information, etc.). For example, for various MAC functional modes such as SGMII 1G, SGMII 2.5G, USXGMII 5G, and USXGMII 10G, the MAC hardware configuration information corresponding to each of them is stored in the memory of the above-mentioned Ethernet device.
[0049] The processor in the Ethernet device is a device with data calculation, processing and control functions, such as a CPU on a computer or server, a controller or processor on a router or switch, etc. In the embodiment of the present application, the processing of the Ethernet device is used to execute the MAC function switching method proposed in the embodiment of the present application.
[0050] In order to implement the more efficient MAC function switching method proposed in the embodiment of the present application in the above-mentioned Ethernet device, the above-mentioned Ethernet device adopts a hardware board-level design common to the SGMII interface and the USXGMII interface, and the hardware clock adopts a 156.25MHz clock. Among them, in each embodiment of the present application, the hardware clock of the Ethernet device can be the clock of the entire Ethernet device, or it can be the clock provided by the Ethernet device for the Ethernet interface. In short, in the Ethernet device of the embodiment of the present application, the clock of the Ethernet interface is a 156.25MHz clock.
[0051] On the other hand, the operating system driver of the Ethernet device integrates MAC hardware configuration information, such as MAC initialization configuration information and serial deserializer configuration information, and the operating system can update the MAC hardware configuration information in the driver to the firmware.
[0052] Based on the above characteristics, the above Ethernet device can run random firmware when it is started, and then load the operating system to start running. Among them, the above random firmware refers to the firmware that loads and runs including any MAC hardware configuration information after the Ethernet device is powered on, without considering which MAC function mode will be adopted when the device is running. After the Ethernet device is started, the MAC function switching method proposed in the embodiment of the present application can be executed to update the MAC hardware configuration information in the operating system driver in the operating system to achieve the update of the MA hardware configuration information in the firmware.
[0053] See also Figure 3 As shown, the MAC function switching method proposed in the embodiment of the present application includes:
[0054] S101. Determine a corresponding target MAC functional mode according to a network rate, and determine a clock frequency corresponding to the target MAC functional mode.
[0055] The above network rate refers to the network rate required to be achieved by the MAC interface mode, that is, the network rate of the MAC function mode to be switched. Since different MAC function modes correspond to different network rates, such as SGMII 1G, SGMII 2.5G, USXGMII 5G, and USXGMII 10G, the corresponding network rates are 1G, 2.5G, 5G, and 10G, respectively. Therefore, in some cases, the purpose of switching the MAC function mode can be achieved by specifying or switching the network rate.
[0056] Exemplarily, the user can select the network rate of the Ethernet device by configuring the system. Accordingly, the processing of the Ethernet device can determine the network rate by reading the network rate configuration of the system. Then, based on the network rates corresponding to different MAC functional modes, the target MAC functional mode can be determined. In this embodiment, the above-mentioned target MAC functional mode includes but is not limited to any one of SGMII 1G, SGMII 2.5G, USXGMII 5G, and USXGMII 10G.
[0057] In some embodiments, the network rate of the Ethernet device is determined by the rate of the optical module or PHY chip to which the MAC interface is connected, so the processor can identify the network rate of the optical module or physical layer interface chip of the Ethernet device to determine the target MAC functional mode. That is, the MAC functional mode corresponding to the network rate of the optical module or physical layer interface chip of the Ethernet device is determined as the target MAC functional mode.
[0058] The above implementation can enable the Ethernet device to automatically determine the target MAC functional mode according to the network rate, thereby facilitating the subsequent automatic switching of the MAC functional mode.
[0059] After determining the target MAC function mode, the processor further determines the clock frequency required for the target MAC function mode. Each MAC function mode needs to work at a specific clock frequency, so the correspondence between each MAC function mode and the clock frequency can be determined in advance, and then after determining the target MAC function mode, the clock frequency corresponding to the target MAC function mode can be determined based on the above correspondence.
[0060] S102: Configure MAC hardware configuration information corresponding to the target MAC functional mode in the system driver of the Ethernet device.
[0061] As introduced in the above embodiment, the embodiment of the present application integrates MAC hardware configuration information in the driver of the operating system of the Ethernet device. Therefore, during the operation of the Ethernet device, the MAC hardware configuration information can be configured through the driver of the operating system, and then the MAC hardware configuration information in the Ethernet device firmware can be updated, so that the Ethernet device can achieve a specific MAC function mode.
[0062] Therefore, after determining the target MAC functional mode in step S101, the processor of the Ethernet device further configures MAC hardware configuration information corresponding to the target MAC functional mode in the startup driver of the Ethernet device.
[0063] Exemplarily, since MAC hardware configuration information corresponding to a plurality of different MAC functional modes is pre-stored in the memory of the Ethernet device, the processor may read the MAC hardware configuration information corresponding to the target MAC functional mode from the memory.
[0064] Then, the processor clears the original MAC hardware configuration information in the operating system driver, and then writes the MAC hardware configuration information corresponding to the target MAC functional mode into the operating system driver of the Ethernet device.
[0065] At this time, the MAC hardware configuration information in the operating system driver of the Ethernet device is updated to the MAC hardware configuration information corresponding to the target MAC functional mode. Further, the operating system can also update the MAC hardware configuration information in the Ethernet device firmware to the MAC hardware configuration information corresponding to the target MAC functional mode.
[0066] At this point, the MAC hardware configuration of the Ethernet device is already able to support the Ethernet device to run the target MAC function mode.
[0067] S103: Adjust the clock frequency of the Ethernet device to the clock frequency corresponding to the target MAC functional mode, and load the MAC function driver to switch the Ethernet device to the target MAC functional mode.
[0068] Specifically, since any MAC function mode needs to work at a specific clock frequency, and the clock provided by the Ethernet device for the Ethernet interface has only one clock frequency of 156.25MHz, in order to implement hot switching of different MAC function modes on the Ethernet device, it is necessary to make the clock of the Ethernet device meet the clock requirements of different MAC function modes.
[0069] In order to meet the clock frequency corresponding to the target MAC functional mode, the processor of the Ethernet device adjusts the clock frequency provided by the Ethernet device to the clock frequency corresponding to the target MAC functional mode.
[0070] For example, the processor may directly adjust the frequency provided by the Ethernet device so that the frequency of the clock provided by the Ethernet device is updated to the clock frequency corresponding to the target MAC functional mode.
[0071] In another embodiment, the processor may control the frequency division circuit to divide the clock provided by the Ethernet device so that the divided clock frequency is the clock frequency corresponding to the target MAC functional mode.
[0072] For example, assuming that the target MAC functional mode is SGMII 1G, the processor divides the clock provided by the Ethernet device into a clock of 156.25*8=1.25GHz, which is encoded by 8b / 10b to a 1G rate; if the target MAC functional mode is SGMII2.5G, the processor divides the clock provided by the Ethernet device into a clock of 156.25*20=3.25GHz, which is encoded by 8b / 10b to a 2.5G rate; if the target MAC functional mode is USXGMII 5G, the processor divides the clock provided by the Ethernet device into a clock of 156.25*33=5.15625GHz, which is encoded by 64b / 66b to a 5G rate; if the target MAC functional mode is USXGMII 10G, the processor divides the clock provided by the Ethernet device into a clock of 156.25*66=10.3125GHz, which is encoded by 64b / 66b to a 10G rate.
[0073] After having the clock frequency corresponding to the target MAC function mode, the processor further loads the MAC function driver, that is, loads the original MAC function driver, performs MAC initialization and packet sending and receiving configuration process, at which time the interface enables the Ethernet device to switch to the target MAC function mode.
[0074] When the Ethernet device is running in the above-mentioned target MAC functional mode, if the MAC functional mode needs to be switched again, the above-mentioned steps S101 to S103 can be executed again to implement the switching of the MAC functional mode again without powering off the Ethernet device.
[0075] It can be seen from the above introduction that the MAC function switching method proposed in the embodiment of the present application pre-stores MAC hardware configuration information corresponding to a plurality of different MAC function modes in the Ethernet device, such as MAC initialization configuration information and serial deserializer configuration information. Then, during the operation of the Ethernet device, the target MAC function mode to be switched is determined according to the network rate, and the clock frequency corresponding to the target MAC function mode is determined, and then the MAC hardware configuration information corresponding to the target MAC function mode is configured in the system driver of the Ethernet device; finally, the clock frequency of the Ethernet device is adjusted to the clock frequency corresponding to the target MAC function mode, and the MAC function driver is loaded to switch the Ethernet device to the target MAC function mode. The above-mentioned MAC function switching method pre-stores MAC hardware configuration information corresponding to a plurality of different MAC function modes in the Ethernet device, and when it is identified that the MAC function switching is required, the MAC hardware configuration information corresponding to the target MAC function mode is configured in the system driver of the Ethernet device, so as to realize the update of the system firmware and the driver, and then realize the hot switching of the MAC function. The above-mentioned MAC function switching process does not require the device to be powered off, nor does it require the firmware to be re-burned, and can realize automatic switching, and the switching efficiency is higher.
[0076] Corresponding to the above-mentioned MAC function switching method, the embodiment of the present application further proposes a MAC function switching device, which can be applied to an Ethernet device, wherein the Ethernet device stores MAC hardware configuration information corresponding to a plurality of different MAC function modes, wherein the MAC hardware configuration information includes MAC initialization configuration information and serial deserializer configuration information, see Figure 4 As shown, the MAC function switching device includes:
[0077] The mode determination unit 100 is used to determine the corresponding target MAC functional mode according to the network rate, and determine the clock frequency corresponding to the target MAC functional mode;
[0078] A configuration updating unit 110, configured to configure MAC hardware configuration information corresponding to the target MAC functional mode in a system driver of the Ethernet device;
[0079] The function switching unit 120 is used to adjust the clock frequency of the Ethernet device to the clock frequency corresponding to the target MAC function mode, and load the MAC function driver to switch the Ethernet device to the target MAC function mode.
[0080] In some implementations, the mode determination unit 100 determines the corresponding target MAC functional mode according to the network rate, including:
[0081] Identify the network rate of the optical module or physical layer interface chip of the Ethernet device;
[0082] Determine the target MAC function mode corresponding to the network rate of the optical module or physical layer interface chip.
[0083] In some implementations, the configuration updating unit 110 configures the MAC hardware configuration information corresponding to the target MAC functional mode in the system driver of the Ethernet device, including:
[0084] Obtain MAC hardware configuration information corresponding to the target MAC functional mode;
[0085] Clearing the MAC hardware configuration information in the system driver of the Ethernet device;
[0086] The MAC hardware configuration information corresponding to the target MAC functional mode is written into the system driver of the Ethernet device.
[0087] In some implementations, the function switching unit 120 adjusts the clock frequency of the Ethernet device to the clock frequency corresponding to the target MAC functional mode, including:
[0088] The clock frequency of the Ethernet device is divided so that the clock frequency of the Ethernet device is the clock frequency corresponding to the target MAC functional mode.
[0089] In some implementations, when the Ethernet device starts up, it runs random firmware and loads an operating system, wherein the random firmware includes any MAC hardware configuration information and serial deserializer configuration information.
[0090] In some implementations, the clock frequency of the Ethernet device is 156.25 MHz, and the target MAC functional mode includes any one of SGMII 1G, SGMII 2.5G, USXGMII 5G, and USXGMII 10G.
[0091] The MAC function switching device provided in this embodiment belongs to the same application concept as the MAC function switching method provided in the above embodiments of this application, and can execute the MAC function switching method provided in any of the above embodiments of this application, and has the corresponding functional modules and beneficial effects of the execution method. For the technical details not described in detail in this embodiment, please refer to the specific processing content of the MAC function switching method provided in the above embodiments of this application, and will not be repeated here.
[0092] The functions implemented by the above-mentioned mode determination unit 100, configuration update unit 110 and function switching unit 120 may be implemented by the same or different processors respectively, which is not limited in the embodiments of the present application.
[0093] It should be understood that the units in the above devices can be implemented in the form of a processor calling software. For example, the device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or realize the functions of each unit of the device, wherein the processor can be a general-purpose processor, such as a CPU or a microprocessor, etc., and the memory can be a memory in the device or a memory outside the device. Alternatively, the units in the device can be implemented in the form of hardware circuits, and the functions of some or all units can be realized by designing the hardware circuits. The hardware circuit can be understood as one or more processors; for example, in one implementation, the hardware circuit is an ASIC, and the functions of some or all of the above units are realized by designing the logical relationship of the components in the circuit; for another example, in another implementation, the hardware circuit can be implemented by PLD, taking FPGA as an example, which can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by the configuration file, so as to realize the functions of some or all of the above units. All units of the above devices can be implemented in the form of a processor calling software, or in the form of hardware circuits, or in part by a processor calling software, and the remaining part is implemented in the form of hardware circuits.
[0094] In an embodiment of the present application, a processor is a circuit with the ability to process signals. In one implementation, the processor may be a circuit with the ability to read and run instructions, such as a CPU, a microprocessor, a GPU, or a DSP; in another implementation, the processor may implement certain functions through the logical relationship of a hardware circuit, and the logical relationship of the hardware circuit is fixed or reconfigurable, such as a hardware circuit implemented by an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the hardware circuit configuration can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units. In addition, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as an NPU, TPU, DPU, etc.
[0095] It can be seen that each unit in the above device can be one or more processors (or processing circuits) configured to implement the above method, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.
[0096] In addition, all or part of the units in the above device can be integrated together, or can be implemented independently. In one implementation, these units are integrated together and implemented in the form of a SOC. The SOC may include at least one processor for implementing any of the above methods or implementing the functions of each unit of the device. The type of the at least one processor may be different, for example, including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.
[0097] Another embodiment of the present application also provides an Ethernet device, see Figure 5 As shown, the device includes:
[0098] Memory 200 and processor 210;
[0099] The memory 200 is connected to the processor 210 and is used to store programs and to store MAC hardware configuration information corresponding to a plurality of different MAC functional modes, wherein the MAC hardware configuration information includes MAC initialization configuration information and serial deserializer configuration information;
[0100] The processor 210 is configured to implement the MAC function switching method disclosed in any one of the above embodiments by running the program stored in the memory 200.
[0101] Specifically, the Ethernet device may further include: a bus, a communication interface 220 , an input device 230 and an output device 240 .
[0102] The processor 210, the memory 200, the communication interface 220, the input device 230 and the output device 240 are connected to each other via a bus.
[0103] A bus may include a pathway that transfers information between components of a computer system.
[0104] The processor 210 may be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the scheme of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0105] The processor 210 may include a main processor, and may also include a baseband chip, a modem, and the like.
[0106] The memory 200 stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes a computer operation instruction. More specifically, the memory 200 may include a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), other types of dynamic storage devices that can store information and instructions, a disk storage, a flash, and the like.
[0107] The input device 230 may include a device for receiving data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.
[0108] Output device 240 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.
[0109] The communication interface 220 may include any transceiver or the like to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0110] The processor 210 executes the program stored in the memory 200 and calls other devices, which can be used to implement each step of any MAC function switching method provided in the above embodiments of the present application.
[0111] The Ethernet device mentioned above may specifically be a device having an Ethernet interface, such as a computer, server, router, switch, etc. having an Ethernet interface.
[0112] An embodiment of the present application further proposes a chip, which includes a processor and a data interface. The processor reads and runs a program or data stored in a memory through the data interface to execute the MAC function switching method introduced in any of the above embodiments. The specific processing process and its beneficial effects can be found in the above-mentioned embodiment of the MAC function switching method.
[0113] In addition to the above methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps in the MAC function switching method described in any of the above embodiments of this specification.
[0114] The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0115] In addition, the embodiment of the present application may also be a storage medium on which a computer program is stored, and the computer program is executed by a processor to execute the steps of the MAC function switching method described in any of the above embodiments of this specification.
[0116] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0117] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0118] The steps in the methods of each embodiment of the present application can be adjusted in order, combined and deleted according to actual needs, and the technical features recorded in each embodiment can be replaced or combined.
[0119] The modules and sub-modules in the devices and terminals of the various embodiments of the present application can be combined, divided and deleted according to actual needs.
[0120] In the several embodiments provided in the present application, it should be understood that the disclosed terminals, devices and methods can be implemented in other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or submodules is only a logical function division, and there may be other division methods in actual implementation, for example, multiple submodules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0121] The modules or submodules described as separate components may or may not be physically separated, and the components of the modules or submodules may or may not be physical modules or submodules, that is, they may be located in one place, or they may be distributed on multiple network modules or submodules. Some or all of the modules or submodules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0122] In addition, each functional module or submodule in each embodiment of the present application may be integrated into one processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into one module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or in the form of software functional modules or submodules.
[0123] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0124] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly by hardware, software units executed by a processor, or a combination of the two. The software units may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0125] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0126] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A MAC function switching method, characterized in that: Applied to an Ethernet device, the Ethernet device stores MAC hardware configuration information corresponding to a plurality of different MAC function modes, the MAC hardware configuration information includes MAC initialization configuration information and serial deserializer configuration information, and the method includes: Determine a corresponding target MAC functional mode according to the network rate, and determine a clock frequency corresponding to the target MAC functional mode; Configuring MAC hardware configuration information corresponding to the target MAC functional mode in the system driver of the Ethernet device; The clock frequency of the Ethernet device is adjusted to the clock frequency corresponding to the target MAC functional mode, and the MAC function driver is loaded to switch the Ethernet device to the target MAC functional mode.
2. The method according to claim 1, characterized in that Determine the corresponding target MAC function mode according to the network rate, including: Identify the network rate of the optical module or physical layer interface chip of the Ethernet device; Determine the target MAC function mode corresponding to the network rate of the optical module or physical layer interface chip.
3. The method according to claim 1, characterized in that Configuring MAC hardware configuration information corresponding to the target MAC functional mode in the system driver of the Ethernet device includes: Obtain MAC hardware configuration information corresponding to the target MAC functional mode; Clearing the MAC hardware configuration information in the system driver of the Ethernet device; The MAC hardware configuration information corresponding to the target MAC functional mode is written into the system driver of the Ethernet device.
4. The method according to claim 1, characterized in that: Adjusting the clock frequency of the Ethernet device to a clock frequency corresponding to the target MAC functional mode includes: The clock frequency of the Ethernet device is divided so that the clock frequency of the Ethernet device is the clock frequency corresponding to the target MAC functional mode.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: When the Ethernet device starts, the random firmware is run and the operating system is loaded, and the random firmware includes any MAC hardware configuration information and serial deserializer configuration information.
6. The method according to any one of claims 1 to 4, characterized in that The clock frequency of the Ethernet device is 156.25 MHz, and the target MAC functional mode includes any one of SGMII 1G, SGMII 2.5G, USXGMII 5G, and USXGMII10G.
7. A MAC function switching device, characterized in that: Applied to an Ethernet device, wherein the Ethernet device stores MAC hardware configuration information corresponding to a plurality of different MAC function modes, wherein the MAC hardware configuration information includes MAC initialization configuration information and serial deserializer configuration information, and the device includes: A mode determination unit, configured to determine a corresponding target MAC functional mode according to a network rate, and determine a clock frequency corresponding to the target MAC functional mode; A configuration updating unit, configured to configure MAC hardware configuration information corresponding to the target MAC functional mode in a system driver of the Ethernet device; The function switching unit is used to adjust the clock frequency of the Ethernet device to the clock frequency corresponding to the target MAC function mode, and load the MAC function driver to switch the Ethernet device to the target MAC function mode.
8. An Ethernet device, characterized in that: include: Memory and processor; The memory is connected to the processor and is used to store programs and MAC hardware configuration information corresponding to a plurality of different MAC functional modes, wherein the MAC hardware configuration information includes MAC initialization configuration information and serial deserializer configuration information; The processor is used to implement the MAC function switching method according to any one of claims 1 to 6 by running the program in the memory.
9. A computing device, characterized in that The method comprises the Ethernet device as claimed in claim 8, or the computing device is configured to execute the MAC function switching method as claimed in any one of claims 1 to 6.
10. A computer program product, characterized in that The method comprises computer program instructions, which, when executed by a processor of an Ethernet device, enable the Ethernet device to execute the MAC function switching method as described in any one of claims 1 to 6; the Ethernet device stores MAC hardware configuration information corresponding to a plurality of different MAC function modes, wherein the MAC hardware configuration information comprises MAC initialization configuration information and serial deserializer configuration information.
