Disclosure of Invention
In order to solve the above technical problems, the present invention provides an access apparatus and method for a hardware module in a network chip, which can reduce access delay of the hardware module in the network chip, and simultaneously perform non-blocking access to the hardware module, thereby effectively improving management control efficiency.
The invention provides an access device of a hardware module in a network chip, which comprises an access control module, an address decoding module and an adaptation module associated with each hardware module in the network chip, wherein each hardware module in the network chip has a corresponding number, the address decoding module is connected with the access control module, a plurality of adaptation modules are sequentially connected to form a control chain, and the adaptation modules at the head end and the tail end of each control chain are respectively connected with the address decoding module and the access control module;
the access control module is used for receiving and analyzing the management control message sent by the controller, storing message information in the management control message, packaging the management control message into a management control packet, and sending the management control packet to the address decoding module; the management control message carries the number of the hardware module requesting access;
the address decoding module is used for decoding the address of the management control packet and sending the management control packet to a control chain to which an adaptation module associated with the hardware module belongs according to the number of the hardware module which is carried in the management control packet and requests access; the address decoding module stores the serial number of the hardware module associated with each adaptation module on each control chain;
the adaptation module is used for judging whether the serial number of the hardware module which is carried in the management control group and requires access is the serial number of the hardware module associated with the adaptation module, and if not, the management control group is sent to the next adaptation module on the control chain; if so, accessing the hardware module associated with the management control packet according to the management control packet, generating a management response packet after the access is successful, and sending the management response packet to the next adaptation module or the access control module on the control chain;
the access control module is further configured to read message information in a management control message corresponding to the management response packet according to the management response packet, encapsulate the management response packet into a management response message, and send the management response message to the controller.
Preferably, the apparatus further comprises an output scheduling module, and the adaptation module at the tail end of each control chain is connected to the access control module through the output scheduling module;
the output scheduling module is used for receiving the management response packets sent by the adaptation module at the tail end of each control chain and sending the management response packets to the access control module in sequence according to the priority order of each control chain; the output scheduling module stores the priority sequence of each control chain.
Preferably, the access control module includes: the device comprises a connection establishing unit, a message analyzing unit, a first caching unit and a message packaging unit;
the connection establishing unit is used for receiving a connection establishing request sent by the controller and establishing connection with the controller according to the connection establishing request;
the message analysis unit is used for receiving and analyzing the management control message sent by the controller, packaging the management control message into a management control packet and sending the management control packet to the address decoding module; the management control message carries the number of the hardware module requesting access;
the first cache unit is used for storing the message information in the management control message;
the message packaging unit is configured to receive a management response packet sent by the output scheduling module, read message information in a management control message corresponding to the management response packet from the first cache unit according to the management response packet, package the management response packet into a management response message, and send the management response message to the controller.
Preferably, the access control module further comprises a first determination unit;
the first determination unit is configured to determine whether the management control packet is valid after the packet analysis unit receives the management control packet sent by the controller, and if not, discard the management control packet and send a response that the access request is invalid to the controller; and if so, analyzing the management control message through the message analyzing unit.
Preferably, the adaptation module comprises: a second judging unit, a second buffer unit, a grouping processing unit, a third buffer unit and a grouping output unit;
the second judging unit is configured to judge whether the number of the hardware module requesting access, which is carried in the management control packet, is the number of the hardware module associated with the second judging unit, and if not, send the management control packet to the second cache unit; if yes, the management control packet is sent to the packet processing unit;
the second cache unit is used for storing the management control packet;
the packet processing unit is used for accessing the hardware module associated with the packet processing unit according to the management control packet, generating a management response packet after the access is successful, and sending the management response packet to the third cache unit;
the third cache unit is used for storing the management response packet;
and the packet output unit is used for reading the management control packet from the second cache unit and the management response packet from the third cache unit in sequence, and respectively sending the management control packet to the next adaptation module on the control chain and sending the management response packet to the next adaptation module or the access control module on the control chain.
The invention provides an access method of a hardware module in a network chip, which is applied to an access device of the hardware module in the network chip, the device comprises an access control module, an address decoding module and an adapting module associated with each hardware module in the network chip, each hardware module in the network chip has a corresponding number, the address decoding module is connected with the access control module, a plurality of adapting modules are sequentially connected to form a control chain, the adapting modules at the head end and the tail end of each control chain are respectively connected with the address decoding module and the access control module, the method comprises the following steps:
the access control module receives and analyzes a management control message sent by a controller, stores message information in the management control message, packages the management control message into a management control packet and sends the management control packet to the address decoding module; the management control message carries the number of the hardware module requesting access;
the address decoding module is used for decoding the address of the management control packet and sending the management control packet to a control chain to which an adaptation module associated with the hardware module belongs according to the number of the hardware module which is carried in the management control packet and requests to access; the address decoding module stores the serial number of the hardware module associated with each adaptation module on each control chain;
the adaptation module judges whether the serial number of the hardware module which is carried in the management control group and requires access is the serial number of the hardware module associated with the adaptation module, if not, the management control group is sent to the next adaptation module on the control chain; if so, accessing the hardware module associated with the management control packet according to the management control packet, generating a management response packet after the access is successful, and sending the management response packet to the next adaptation module or the access control module on the control chain;
and the access control module reads message information in a management control message corresponding to the management response packet according to the management response packet, encapsulates the management response packet into a management response message, and sends the management response message to the controller.
Preferably, the apparatus further includes an output scheduling module, the adaptation module at the tail end of each control chain is connected to the access control module through the output scheduling module, and the method further includes:
the output scheduling module receives the management response packet sent by the adaptation module at the tail end of each control chain, and sequentially sends the management response packet to the access control module according to the priority order of each control chain; the output scheduling module stores the priority sequence of each control chain.
Preferably, the first and second electrodes are formed of a metal,
the access control module receives and analyzes a management control message sent by a controller, stores message information in the management control message, packages the management control message into a management control packet, and sends the management control packet to the address decoding module, wherein the management control message carries the number of a hardware module requesting access, and the access control module comprises:
receiving a connection establishment request sent by the controller, and establishing connection with the controller according to the connection establishment request;
receiving and analyzing a management control message sent by the controller, packaging the management control message into a management control packet, and sending the management control packet to the address decoding module; the management control message carries the number of the hardware module requesting access;
storing message information in the management control message;
the access control module reads message information in a management control message corresponding to the management response packet according to the management response packet, encapsulates the management response packet into a management response message, and sends the management response message to the controller, and the method comprises the following steps:
and receiving a management response packet sent by the output scheduling module, reading message information in a management control message corresponding to the management response packet according to the management response packet, packaging the management response packet into a management response message, and sending the management response message to the controller.
Preferably, after receiving the management control packet sent by the controller, the method further includes:
judging whether the management control message is effective or not, if not, discarding the management control message, and sending a response that the access request is invalid to the controller; and if so, analyzing the management control message.
Preferably, the first and second electrodes are formed of a metal,
the adaptation module judges whether the serial number of the hardware module which is carried in the management control group and requires access is the serial number of the hardware module associated with the adaptation module, if not, the management control group is sent to the next adaptation module on the control chain; if yes, accessing a hardware module associated with the management control packet according to the management control packet, generating a management response packet after the access is successful, and sending the management response packet to a next adaptation module on a control chain or the access control module, wherein the steps of:
judging whether the number of the hardware module which requests to access and is carried in the management control group is the number of the hardware module associated with the hardware module;
if not, storing the management control group to a first address;
if yes, accessing a hardware module associated with the management control packet according to the management control packet, generating a management response packet after the access is successful, and storing the management response packet to a second address different from the first address;
and reading the management control packet from the first address and the management response packet from the second address in sequence, and respectively sending the management control packet to a next adaptation module on a control chain and sending the management response packet to the next adaptation module or the access control module on the control chain.
The invention has at least the following beneficial effects:
when the embodiment of the invention is applied, when the controller issues the management control message to access the hardware module in the network chip, each hardware module has an associated adaptation module, the adaptation modules are distributed on a plurality of control chains, and a corresponding number is distributed for each hardware module, so that the hardware module requesting access carried in the management control message can be sent to different control chains according to the number of the hardware module to be accessed, the management control message is processed in parallel and in a pipelined manner, thereby reducing the access delay of the hardware module in the network chip, meanwhile, because each control chain is independent, when the access response on different control chains has time delay difference, even if the access speed on a certain control chain with larger time delay is slower, the other control chains can not be blocked, thereby the hardware module in the network chip can be accessed in a non-blocking manner, the management control efficiency is effectively improved.
Detailed Description
The core of the invention is to provide an access device and method for a hardware module in a network chip, which can reduce the access delay of the hardware module in the network chip, and simultaneously can carry out non-blocking access on the hardware module, thereby effectively improving the management control efficiency.
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. 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 invention.
In one aspect, an embodiment of the present invention provides an access apparatus for a hardware module in a network chip, please refer to fig. 1, the apparatus includes an access control module 110, an address decoding module 120, and an adaptation module 130 associated with each hardware module in the network chip, each hardware module in the network chip has a corresponding number, the address decoding module 120 is connected to the access control module 110, a plurality of adaptation modules 130 are sequentially connected to form a control chain, and the adaptation modules 130 at the head and tail ends of each control chain are respectively connected to the address decoding module 120 and the access control module 110.
In the embodiment of the present invention, each hardware module in the network chip has an associated adaptation module 130, and the adaptation modules 130 are distributed on a plurality of control chains, which can be expanded according to user requirements and assign corresponding numbers to each hardware module. The hardware module in the network chip comprises a state register, a configuration register, a counter, a forwarding table and the like.
The access control module 110 is configured to receive and analyze the management control packet sent by the controller, store the packet information in the management control packet, encapsulate the management control packet into a management control packet, and send the management control packet to the address decoding module 120; the management control message carries the number of the hardware module requesting access.
In the embodiment of the present invention, the access control module 110 is connected to the controller through the access control port, receives and analyzes the management control packet sent by the controller, encapsulates the management control packet into a management control packet with a uniform format, and sends the management control packet to the address decoding module 120, and stores key packet information in the management control packet.
The address decoding module 120 is configured to perform address decoding on the management control packet, and send the management control packet to a control chain to which the adaptation module 130 associated with the hardware module belongs according to a serial number of the hardware module requesting access, where the serial number is carried in the management control packet; the address decoding module 120 stores therein the number of the hardware module associated with each adaptation module 130 in each control chain.
In the embodiment of the present invention, the address decoding module 120 distributes the management control packet to each control chain according to the number of the hardware module requesting access, which is carried in the management control packet. For example, when the numbers of the hardware modules requesting access carried in the management control packet are 2 and 4, respectively, if the adaptation module 130 associated with the hardware module with the number 2 is located on the first control chain and the adaptation module 130 associated with the hardware module with the number 4 is located on the second control chain, the address decoding module 120 sends the management control packet with the numbers 2 and 4 carrying the hardware modules requesting access to the first control chain and the second control chain, respectively.
The adaptation module 130 is configured to determine whether the number of the hardware module requesting access, which is carried in the management control packet, is the number of the hardware module associated with the adaptation module 130, and if not, send the management control packet to the next adaptation module 130 in the control chain; if yes, accessing the hardware module associated with the management control packet according to the management control packet, generating a management response packet after the access is successful, and sending the management response packet to the next adaptation module 130 or access control module 110 on the control chain.
In the embodiment of the present invention, after receiving the management control packet, the adaptation module 130 in each control chain determines each management control packet, and if the number of the hardware module requesting access carried in the management control packet is different from the number of the hardware module associated with itself, sends the management control packet to the next adaptation module 130 in the control chain to which the management control packet belongs; if the data is the same as the data, the hardware module associated with the management control packet is accessed according to the management control packet, the operations of reading, writing, inserting, deleting and the like of the register or the table entry are completed, the management response packet is generated after the access is successful, and the management response packet is continuously transmitted downwards along the control chain to which the management response packet belongs until the management response packet is sent to the access control module 110.
The access control module 110 is further configured to read message information in the management control message corresponding to the management response packet according to the management response packet, encapsulate the management response packet into a management response message, and send the management response message to the controller.
In this embodiment of the present invention, after receiving the management response packet returned from the adaptation module 130, the access control module 110 reads the key packet information in the management control packet corresponding to the management response packet, and encapsulates the key packet information into a management response packet meeting the specification of the management control protocol, so as to respond to the controller.
As can be seen from the above, when the controller issues the management control message to access the hardware module in the network chip, each hardware module has an associated adaptation module 130, the adaptation modules 130 are distributed on a plurality of control chains, and each hardware module is assigned with a corresponding number, so that the hardware module requesting access carried in the management control message can be sent to different control chains according to the number of the hardware module, thereby implementing parallel and pipelined processing on the management control message, and reducing the access delay of the hardware module in the network chip, and meanwhile, because each control chain is independent from each other, when the access response on different control chains has a delay difference, even if the access speed on a control chain with a larger delay is slower, no blocking is caused to other control chains, therefore, non-blocking access can be performed on the hardware module in the network chip, and the management control efficiency is effectively improved.
In specific implementation, the access control module 110 encapsulates the received management control packet into a management control packet Ctrl _ MSG with a uniform format, where the format of the management control packet Ctrl _ MSG may be shown in the following table:
each management control group carries key information of network chip management control, and the key information mainly comprises two types: one type is information closely related to management control commands, including: a Header _ flag/Tail _ flag field, a Burst operation length Burst field, an operation Type field, a Reply/Result field, a hardware module number MID field, a storage resource Address field and a Data field are marked from the beginning to the end; another type is information related to the management control protocol, such as the message Sequence number field.
Optionally, in combination with the embodiment shown in fig. 1, in some embodiments of the present invention, as shown in fig. 2, the apparatus further includes an output scheduling module 140, where the adaptation module 130 at the tail end of each control chain is connected to the access control module 110 through the output scheduling module 140;
an output scheduling module 140, configured to receive the management response packet sent by the adaptation module 130 at the tail end of each control chain, and send the management response packet to the access control module 110 in sequence according to the priority order of each control chain; the output scheduling module 140 stores therein a priority order of each control chain.
In the embodiment of the present invention, the adaptation module 130 at the tail end of each control chain sends the management response packet to the output scheduling module 140, and the output scheduling module 140 schedules the management response packet of each control chain according to the preset priority order of each control chain, thereby ensuring that the control chain with high priority can quickly respond to the access of the controller. In specific implementation, a user can set the priority order of the control chains in a register configuration mode according to actual application conditions, so that the control chains sensitive to access delay have high priority authority, and response messages can pass preferentially.
Further, as shown in fig. 3, in some embodiments of the invention, the access control module 110 includes: a connection establishing unit 111, a message parsing unit 112, a first caching unit 113 and a message encapsulation unit 114.
And a connection establishing unit 111, configured to receive the connection establishing request sent by the controller, and establish a connection with the controller according to the connection establishing request.
In the embodiment of the present invention, the connection establishing unit 111 establishes a connection with the controller through the access control port, the connection establishing mode may adopt a TCP three-way handshake mode, the controller sends a connection establishing request, the connection establishing unit 111 establishes a connection with the controller according to the connection establishing request after receiving the connection establishing request, and then the controller can access the hardware module through the access control port, if the connection is not established, the access is not allowed, and all management control messages are discarded.
A message parsing unit 112, configured to receive and parse the management control message sent by the controller, encapsulate the management control message into a management control packet, and send the management control packet to the address decoding module 120; the management control message carries the number of the hardware module requesting access.
In the embodiment of the present invention, after establishing connection with the controller, the message parsing unit 112 receives the management control message from the access control port, parses the management control message, encapsulates the management control message into a management control packet Ctrl _ MSG with a uniform format, and sends the management control packet Ctrl _ MSG to the address decoding module 120. In specific implementation, the message parsing unit 112 generates a Sequence number Sequence of the management control message for each management control message, and puts each Sequence number of the management control message into the corresponding management control packet Ctrl _ MSG.
The first buffer unit 113 is configured to store the message information in the management control message.
In this embodiment of the present invention, the first cache unit 113 stores the key packet information in each management control packet according to the Sequence number of the management control packet. In specific implementation, the first cache unit 113 uses a RAM (random access memory, full name of english, full name of chinese, random access memory), and the key message information in the management control message may include: input port number, message sequence number, source destination address, source IP address, etc.
The packet encapsulating unit 114 is configured to receive the management response packet sent by the output scheduling module 140, read, according to the management response packet, the packet information in the management control packet corresponding to the management response packet from the first cache unit 113, encapsulate the management response packet into a management response packet, and send the management response packet to the controller.
In this embodiment of the present invention, after receiving the management response packet Ctrl _ MSG sent by the output scheduling module 140, the message encapsulation unit 114 reads the key message information in the management control message corresponding to the management response packet Ctrl _ MSG from the first cache unit 113 according to the management control message Sequence in the management response packet Ctrl _ MSG, encapsulates the management response packet Ctrl _ MSG into the management response message, sends the management response message to the controller, and releases the management control message Sequence at the same time to provide a space for storing the next management control message.
Further, in some embodiments of the present invention, the access control module 110 further comprises a first determination unit 115;
a first determining unit 115, configured to determine whether the management control packet is valid after the packet parsing unit 112 receives the management control packet sent by the controller, and if not, discard the management control packet and send a response that the access request is invalid to the controller; if yes, the management control message is parsed by the message parsing unit 112.
In the embodiment of the present invention, after the message parsing unit 112 receives a management control message sent by a controller, the first determining unit 115 determines a source destination address and a source IP address of the management control message, if the source destination address and the source IP address are inconsistent with an address of a current controller, the management control message is considered to be invalid, the management control message is discarded, and a response that an access request is invalid is sent to the controller; if the two are consistent, the management control message is considered to be valid, and the management control message is analyzed through the message analysis unit 112.
Optionally, as shown in fig. 4, in some embodiments of the present invention, the adaptation module 130 includes: a second determination unit 131, a second buffer unit 132, a packet processing unit 133, a third buffer unit 134, and a packet output unit 135;
a second determining unit 131, configured to determine whether the number of the hardware module requesting access, carried in the management control packet, is the number of the hardware module associated with the second determining unit, and if not, send the management control packet to the second caching unit 132; if so, the management control packet is sent to the packet processing unit 133.
In the embodiment of the present invention, the second determining unit 131 determines the number of the hardware module requesting access, which is carried in each management control packet Ctrl _ MSG, and if the number of the hardware module associated with the second determining unit is different, sends the management control packet Ctrl _ MSG to the second caching unit 132; if the same, the management control packet Ctrl _ MSG is sent to the packet processing unit 133.
And a second buffer unit 132 for storing the management control packet.
In the embodiment of the present invention, the second buffer unit 132 uses a FIFO (First Input First Output, chinese First in First out memory), stores the management control packet Ctrl _ MSG with different numbers of its associated hardware modules, and prepares to be quickly forwarded to the next adaptation module 130 on the control chain.
The packet processing unit 133 is configured to access the hardware module associated with the packet processing unit according to the management control packet, generate a management response packet after the access is successful, and send the management response packet to the third cache unit 134.
In the embodiment of the present invention, the packet processing unit 133 accesses the hardware module associated with itself according to the management control packet, implements operations such as reading, writing, inserting, deleting, etc. on the register or table entry of each component in the network chip, provides support for complex network functions such as message analysis, table lookup, message encapsulation, quality of service guarantee, etc., generates a management response packet after successful access, and sends the management response packet to the third cache unit 134. In particular, the control interface of the packet processing unit 133 is determined by the management interface of each hardware module.
And a third buffer unit 134 for storing the management response packet.
In the embodiment of the present invention, the third buffer unit 134 also uses a FIFO and has a different address from the second buffer unit 132, so as to implement clock domain crossing isolation.
And a packet output unit 135, configured to sequentially read the management control packet from the second buffer unit 132 and the management response packet from the third buffer unit 134, and send the management control packet to the next adaptation module 130 in the control chain and send the management response packet to the next adaptation module 130 or the access control module 110 in the control chain, respectively.
In the embodiment of the present invention, the packet output unit 135 preferentially reads the management control packet from the second buffer unit 132 and sends the management control packet to the next adaptation module 130 in the control chain, and then reads the management response packet from the third buffer unit 134 and sends the management response packet to the next adaptation module 130 or the access control module 110 in the control chain.
In specific implementation, the management control message sent by the controller includes connection establishment, connection release, a read request, a write request, a read response, a write response, an insert request, an insert response, a delete request, a delete response, and the like, and after the controller completes access control, the management control message for releasing connection is sent to the access control module 110, so that the access control module 110 releases connection.
In the above-described embodiments, the access device of the hardware module in the network chip is described in detail, and the following description is made in detail by using the method of the embodiment to the access device of the hardware module in the network chip.
Another aspect of the present invention provides a method for accessing a hardware module in a network chip, which is applied to an access device for accessing a hardware module in a network chip, and the device includes an access control module, an address decoding module and an adaptation module associated with each hardware module in the network chip, each hardware module in the network chip has a corresponding number, the address decoding module is connected to the access control module, a plurality of adaptation modules are sequentially connected to form a control chain, the adaptation modules at the head and tail ends of each control chain are respectively connected to the address decoding module and the access control module, please refer to fig. 5, which includes:
s510, the access control module receives and analyzes the management control message sent by the controller, stores message information in the management control message, packages the management control message into a management control packet and sends the management control packet to the address decoding module; the management control message carries the number of the hardware module requesting access.
S520, the address decoding module performs address decoding on the management control packet, and sends the management control packet to a control chain to which an adaptation module associated with the hardware module belongs according to the number of the hardware module which requests access and is carried in the management control packet; the address decoding module stores the serial number of the hardware module associated with each adaptation module on each control chain.
S530, the adaptation module judges whether the serial number of the hardware module which is carried in the management control group and requires access is the serial number of the hardware module associated with the adaptation module, if not, the management control group is sent to the next adaptation module on the control chain; if yes, accessing the hardware module associated with the management control packet according to the management control packet, generating a management response packet after the access is successful, and sending the management response packet to the next adaptation module or access control module on the control chain.
And S540, the access control module reads message information in the management control message corresponding to the management response packet according to the management response packet, encapsulates the management response packet into the management response message, and sends the management response message to the controller.
Optionally, with reference to the embodiment shown in fig. 5, in some embodiments of the present invention, the apparatus further includes an output scheduling module, and the adaptation module at the tail end of each control chain is connected to the access control module through the output scheduling module, as shown in fig. 6, the method includes:
s610, the access control module receives and analyzes the management control message sent by the controller, stores message information in the management control message, packages the management control message into a management control packet and sends the management control packet to the address decoding module; the management control message carries the number of the hardware module requesting access.
S620, the address decoding module performs address decoding on the management control packet, and sends the management control packet to a control chain to which an adaptation module associated with the hardware module belongs according to the number of the hardware module which is requested to access and carried in the management control packet; the address decoding module stores the serial number of the hardware module associated with each adaptation module on each control chain.
S630, the adaptation module judges whether the serial number of the hardware module which is carried in the management control group and requires access is the serial number of the hardware module associated with the adaptation module, if not, the management control group is sent to the next adaptation module on the control chain; if yes, accessing the hardware module associated with the management control packet according to the management control packet, generating a management response packet after the access is successful, and sending the management response packet to the next adaptation module or the output scheduling module on the control chain.
S640, the output scheduling module receives the management response packets sent by the adaptation module at the tail end of each control chain, and sends the management response packets to the access control module in sequence according to the priority sequence of each control chain; the output scheduling module stores the priority sequence of each control chain.
S650, the access control module reads message information in the management control message corresponding to the management response packet according to the management response packet, encapsulates the management response packet into a management response message, and sends the management response message to the controller.
Further, in some embodiments of the present invention, step S610 includes:
and receiving a connection establishment request sent by the controller, and establishing connection with the controller according to the connection establishment request.
Receiving and analyzing the management control message sent by the controller, packaging the management control message into a management control packet, and sending the management control packet to an address decoding module; the management control message carries the number of the hardware module requesting access.
And storing the message information in the management control message.
Step S650 includes:
and receiving the management response packet sent by the output scheduling module, reading message information in the management control message corresponding to the management response packet according to the management response packet, packaging the management response packet into a management response message, and sending the management response message to the controller.
Further, in some embodiments of the present invention, in the process of performing step S610, after receiving the management control packet sent by the controller, the method further includes:
judging whether the management control message is effective or not, if not, discarding the management control message, and sending a response that the access request is invalid to the controller; and if so, analyzing the management control message.
Optionally, in some embodiments of the present invention, step S630 includes:
judging whether the number of the hardware module which requests access and is carried in the management control group is the number of the hardware module associated with the hardware module;
if not, storing the management control group to the first address;
if yes, accessing the hardware module associated with the management control packet according to the management control packet, generating a management response packet after the access is successful, and storing the management response packet to a second address different from the first address;
and reading the management control packet from the first address and the management response packet from the second address in sequence, and respectively sending the management control packet to a next adaptation module on the control chain and sending the management response packet to the next adaptation module or access control module on the control chain.
As can be seen from the above, in the method for accessing a hardware module in a network chip provided in the embodiments of the present invention, when a controller issues a management control message to access the hardware module in the network chip, each hardware module has an associated adaptation module, the adaptation modules are distributed on a plurality of control chains, and each hardware module is assigned with a corresponding number, so that the management control message can be sent to different control chains according to the number of the hardware module requesting access carried in the management control message, thereby implementing parallel and pipelined processing on the management control message, thereby reducing access delay of the hardware module in the network chip, and meanwhile, when access responses on different control chains have delay differences due to mutual independence of the control chains, even if the access speed on a control chain with a larger delay is slower, no blocking is caused to other control chains, thereby enabling non-blocking access to the hardware module in the network chip, the management control efficiency is effectively improved.
For a description of relevant steps in the method for accessing a hardware module in a network chip provided by the embodiment of the present invention, please refer to a detailed description of a corresponding part in an access device for a hardware module in a network chip provided by the embodiment of the present invention, and all of the detailed descriptions have corresponding effects that the access device for a hardware module in a network chip provided by the embodiment of the present invention has, and no further description is given here.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.