Business analysis method and device, electronic equipment and computer storage medium
By scanning the maximum link width of the endpoint device and reallocating the bar space address, the address segment in the service packet is adjusted to solve the problem of mismatch between the root complex and the endpoint device storage space, achieving correct parsing of the service packet and normal operation of the PCIE system.
Patent Information
- Application Number
- CN202110296744.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-19
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2041-03-19
AI Technical Summary
In a PCIE system, the storage space address allocated by the root complex to the endpoint device is inconsistent with the storage space size of the endpoint device itself, resulting in the root complex being unable to send service packets to the endpoint device, or the endpoint device being unable to correctly parse the service packets after receiving them.
By scanning the maximum link width of the endpoint device, the bar space address is reallocated, and the address in the service package to be parsed is updated, divided into address segments representing the service parsing type and storage location, and the second address segment is adjusted to ensure correct parsing.
In the case that the storage space addresses of the root complex and the endpoint device do not match, the service packet is successfully received and correctly parsed to ensure the normal operation of the PCIE system.
Smart Images

Figure CN115114208B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data processing, and particularly relates to a service analysis method and device, electronic equipment and computer storage medium. BACKGROUND
[0002] In modern industry and communication industry, PCIE (peripheral component interconnect express) system has a wide range of applications.
[0003] The PCIE system is generally composed of a root complex, a switch, an endpoint device and a bridge connecting each part. For a PCIE system, the root complex generally allocates a bar (Base Address Register) space address to the endpoint device. In general, when the root complex allocates a storage space address to the endpoint device, it is generally allocated according to the storage space of the endpoint device itself. However, for some cases, the storage space address allocated by the root complex to the endpoint device may not be consistent with the storage space size of the endpoint device itself, which may cause the root complex to be unable to send a service packet to the endpoint device, or the endpoint device to be unable to analyze the service packet after receiving it. SUMMARY
[0004] The present application aims to at least solve one of the above technical defects, in particular, the technical defect that the root complex is unable to send a service packet to the endpoint device, or the endpoint device is unable to analyze the service packet after receiving it.
[0005] According to one aspect of the present application, a service analysis method is provided, applied to a PCIE system, the PCIE system comprising a root complex and at least one endpoint device, comprising:
[0006] scanning the endpoint device to obtain the maximum link width of the endpoint device;
[0007] when the maximum link width of the endpoint device is a first preset value, reallocating a bar space address to the endpoint device;
[0008] receiving a to-be-analyzed service packet based on the bar space address, and updating an address in the to-be-analyzed service packet, the address in the to-be-analyzed service packet being used to represent a service analysis type;
[0009] analyzing the to-be-analyzed service packet according to the updated address in the to-be-analyzed service packet to obtain an analysis result.
[0010] As a possible implementation form of the present application, after the maximum link width of each endpoint device is obtained, the method further comprises:
[0011] When the maximum link width of the endpoint device itself is determined as the second preset value, the bar space address is not re-matched for the endpoint device.
[0012] As a possible implementation form of the present application, in the implementation form, the address in the to-be-analyzed service packet comprises a first address segment representing a bar space address configured for the endpoint device by a root federation, a second address segment representing a service analysis type, and a third address segment representing a storage location of a to-be-processed service, and the updating of the address in the to-be-analyzed service packet comprises:
[0013] If the highest address bit in the first address segment is within the second address segment, the second address segment in the address of the to-be-analyzed service packet is updated according to the highest address bit in the first address segment.
[0014] The analysis of the to-be-analyzed service packet according to the updated address in the to-be-analyzed service packet comprises:
[0015] The to-be-processed service is determined according to the third address segment, and the to-be-processed service is analyzed according to the service analysis type represented by the updated second address segment.
[0016] As a possible implementation form of the present application, in the implementation form, the updating of the second address segment in the address of the to-be-analyzed service packet according to the highest address bit in the first address segment comprises:
[0017] A target address bit in the second address segment is determined, the target address bit being an address bit in the second address segment corresponding to the highest address bit in the first address segment.
[0018] An or operation is performed on the address in the target address bit and the address in the highest address bit, and if the obtained operation result is inconsistent with the address in the target address bit, the target address bit is adjusted to 0.
[0019] As a possible implementation form of the present application, in the implementation form, the method further comprises:
[0020] If the obtained operation result is consistent with the address in the target address bit, the address of the target address bit remains unchanged.
[0021] As a possible implementation form of the present application, in the implementation form, after the maximum link width of each endpoint device is obtained, the method further comprises:
[0022] configure the maximum load width of the endpoint device as a first load width when the maximum link width of the endpoint device is a first preset value;
[0023] configure the maximum load width of the endpoint device as a second load width when the maximum link width of the endpoint device is a second preset value.
[0024] According to another aspect of the present application, a service resolution device is provided, which comprises:
[0025] a device scanning module configured to scan each endpoint device to obtain the maximum link width of each endpoint device;
[0026] an address allocation module configured to re-allocate a bar space address to an endpoint device when the maximum link width of the endpoint device is a first preset value;
[0027] an address updating module configured to receive a to-be-resolved service packet based on the re-allocated bar space address and update an address in the to-be-resolved service packet, the address in the to-be-resolved service packet being used to represent a service resolution type;
[0028] a resolution module configured to resolve the to-be-resolved service packet according to the updated address in the to-be-resolved service packet to obtain a resolution result.
[0029] As a possible implementation form of the present application, in this implementation form, the address allocation module comprises:
[0030] a first load width configuration module configured to configure the maximum load width of the endpoint device as a first load width when the maximum link width of the endpoint device is a first preset value;
[0031] a second load width configuration module configured to configure the maximum load width of the endpoint device as a second load width when the maximum link width of the endpoint device is a second preset value.
[0032] According to another aspect of the present application, an electronic device is provided, which comprises:
[0033] one or more processors;
[0034] a memory;
[0035] one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to perform the service resolution method described above.
[0036] According to still another aspect of the present application, a computer storage medium is provided, which stores at least one instruction, at least one program, a code set or an instruction set, which is loaded and executed by the processor to implement the above-mentioned service parsing method.
[0037] When the bar space address allocated by the root complex to the endpoint device does not match the memory space size of the endpoint device, the address of the to-be-parsed service packet is divided into a first address segment representing the bar space address configured by the root complex for the endpoint device, a second address segment representing the service parsing type, and a third address segment representing the storage location of the to-be-processed service. When it is determined that the address in the first address segment has an impact on the second address segment representing the service parsing type, the second address segment is adjusted based on the relationship between the highest bit address of the first address segment and the second address segment. The service is parsed based on the adjusted second address segment to obtain a parsing result. The to-be-parsed service packet can be successfully received when the bar space address allocated by the root complex to the endpoint device does not match the memory space size of the endpoint device, and the to-be-parsed service can be correctly parsed, thereby ensuring the normal operation of the PCIE system. BRIEF DESCRIPTION OF DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the description of the embodiments of the present application will be briefly introduced.
[0039] Figure 1 A structural schematic diagram of a PCIE system is provided for the embodiments of the present application.
[0040] Figure 2 A flowchart of a service parsing method is provided for the embodiments of the present application.
[0041] Figure 3 A bar space address diagram is provided for the embodiments of the present application.
[0042] Figure 4 A second address segment adjustment diagram is provided for the embodiments of the present application.
[0043] Figure 5 A flowchart of a method for updating the second address segment is provided for the embodiments of the present application.
[0044] Figure 6 A diagram of an adjusted target address bit address is provided for the embodiments of the present application.
[0045] Figure 7 A diagram of a target address bit address without adjustment is provided for the embodiments of the present application.
[0046] Figure 8 A structural schematic diagram of a service analysis device provided by an embodiment of the present application is shown in FIG. 1.
[0047] Figure 9 A structural schematic diagram of an address updating module provided by an embodiment of the present application is shown in FIG. 4.
[0048] Figure 10 A structural schematic diagram of an electronic device provided by an embodiment of the present application is shown in FIG. 5.
[0049] The above and other features, advantages, and aspects of embodiments of the present application will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings in which: DETAILED DESCRIPTION
[0050] Embodiments of the present application are described in detail below with reference to the attached drawings, which show by way of illustration, and not of limitation, the principles of the present application. The same or similar components have the same reference numbers throughout the drawings.
[0051] As will be appreciated by skilled artisans, the singular forms "a," "an," and "the" include plural referents unless the context clearly dictates otherwise. It should be further understood that the terms "comprises," "comprising," "includes," "including," and the like, when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items. As used herein, the term "connected" can include direct connection, indirect connection, or both, and can further include wired or wireless connection.
[0052] In order to make the purposes, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the drawings.
[0053] First, several terms related to the present application are introduced and explained:
[0054] (1) PCIE system. A PCIE system is generally composed of a root complex, a switch, an endpoint device, a PCIE-to-PCI / PCI-X bridge, and the like, as shown in FIG. 2. Figure 1As shown, the root complex is an important component of the PCIE architecture, and the CPU implements initialization and configuration of the endpoint device through the root complex, and allocates bar space to each endpoint device.
[0055] In actual applications, the root complex generally allocates bar space to the endpoint device according to the bar space of the endpoint device itself, and in general cases, the bar space allocated to the endpoint device by the root complex matches the bar space of the endpoint device. Different service types transmitted between the root complex and the endpoint device in a system are distinguished by preset offset addresses. For example, in a certain system, the endpoint device needs to receive upgrade data, image data, and register data, and the endpoint device parses different service types according to the preset offset addresses of the services. For a system, the root complex generally allocates only one fixed bar space to the endpoint device, but in some applications, the root complex needs to reallocate the bar space of the endpoint device. When the bar space reallocated by the root complex to the endpoint device does not match the fixed bar space of the endpoint device itself, the root complex and the endpoint device cannot communicate.
[0056] The technical problem to be solved by the service parsing method and device, the electronic device, and the computer storage medium provided in the present application is to solve the above technical problem of the prior art.
[0057] The technical solution of the present application and how the technical solution of the present application solves the above technical problem will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes can not be described again in some embodiments. The embodiments of the present application will be described below with reference to the drawings.
[0058] A service parsing method is provided in the embodiments of the present application, which is applied to a PCIE system. As shown in the figure, the method comprises the following steps. Figure 2 The method comprises the following steps.
[0059] In step S201, the endpoint device is scanned, and the maximum link width of the endpoint device is obtained.
[0060] In the disclosed embodiment, a PCIE scan is performed on an endpoint device through a root complex to obtain information about the current endpoint device, such as the maximum link width of the endpoint device. When it is determined that the maximum link width of the endpoint device is a first preset value, such as 2, it indicates that the bar space address of the endpoint device needs to be reallocated. The root complex reallocates the bar space address for the endpoint device and configures the maximum payload width of the endpoint device to the first preset value (such as 256) to inform the endpoint device that the bar space address has been reallocated. The endpoint device will then restrict the address of the received service packet to be parsed and block invalid address space. When it is determined that the maximum link width of the endpoint device itself is a second preset value, such as 4, it indicates that the bar space address of the endpoint device does not need to be reallocated. The root complex will configure the maximum payload width of the endpoint device to the second preset value (such as 1024) to inform the endpoint device that its bar space address has not been reallocated. When receiving the service packet to be parsed, the endpoint device will not restrict the address of the received service packet to be parsed and will directly parse the service packet based on the address of the service packet to be parsed.
[0061] Step S202: when the maximum link width of the endpoint device is a first preset value, reallocate a bar space address for the endpoint device;
[0062] In the implementation of this application, when the maximum link width of the endpoint device is determined to be a first preset value, such as 2, it indicates that the bar space address of the endpoint device needs to be reallocated. The root complex fully allocates the bar space address for the endpoint device. The endpoint device will restrict the address of the received business packet to be parsed and block invalid address space.
[0063] Step S203: receiving a service package to be parsed based on the bar space address, and updating the address in the service package to be parsed, where the address in the service package to be parsed is used to characterize the service parsing type;
[0064] In an embodiment of the present application, the service packet to be parsed refers to a packet containing service data sent by the root complex in the PCIE system to the endpoint device, wherein the root complex and the endpoint device communicate through routing addressing, and an address is set in the service packet to be parsed, which includes a first address segment for representing the bar space address configured by the root complex for the endpoint device, a second address segment for representing the service parsing type, and a third address segment for representing the storage location of the service to be processed.
[0065] For the convenience of explanation, a specific embodiment is taken as an example. Figure 3 As shown, the bar space address allocated by the root complex to the endpoint device is 2 0 ~2 n-3 , the address of the business package to be parsed is 20 ~2 n-3 , wherein the second address segment for indicating the service type in the service packet to be parsed is an address bit of a preset value. In the embodiment of the present application, the second address segment can be selected as 2 n-3 ~2 n-4 Address bit, the category of the service contained in the service packet to be parsed is service 1. According to the preset value rule, the address corresponding to service 1 is 00. In the second address segment 2 of the service packet to be parsed, n-3 ~2 n-4 The address bits are 00, and the third address segment is used to represent the storage location of service 1. If the highest address bit of the first address segment refers to the first address bit of the service packet to be parsed, when the highest address bit of the first address segment of the service packet to be parsed is within the second address segment, the second address segment of the service packet to be parsed needs to be updated based on the highest address bit of the first address segment to ensure that the service type represented by the second address segment remains unchanged.
[0066] For the convenience of explanation, a specific embodiment is taken as an example. Figure 4 As shown, the first address segment of the service packet to be parsed is 2 0 ~2 n-3 , of which 2 n-3 The address bit is 1, and the third address segment is 2 0 ~2 n-5 , used to represent the location where business data is stored, the second address segment is 2 n-4 ~2 n-3 , where the service to be parsed is service 1, then the address of the second address segment corresponding to it is 00, that is, in the second address segment, 2 n-4 ~2 n-3 The addresses in are 0, 2 n-3 The address bit is the highest address bit of the first address segment, and the highest address is within the second address segment. When the second address segment is packaged into the service package to be parsed, the overlapping part of the second address segment and the first address segment will be calculated to obtain the address of the service package to be parsed. After receiving the parsed service package, the endpoint device needs to first restrict the address of the service package to be parsed to ensure that the service type represented by the second address segment in the service package to be parsed remains unchanged. In this case, 2 n-3 The address in the address bit is modified to 0 accordingly to ensure that the second address segment 2 n-4 ~2 n-3 The address is 00.
[0067] Step S204: Parse the service package to be parsed according to the updated address in the service package to be parsed to obtain a parsing result.
[0068] In the embodiment of the present application, after the second address segment is updated, the type of the service in the to-be-resolved service packet is determined based on the updated second address segment, and the to-be-resolved service packet is resolved to obtain service data.
[0069] In the embodiment of the present application, the address of the to-be-resolved service packet is divided into a first address segment representing a bar space address configured by the root complex for the endpoint device, a second address segment representing a service resolution type, and a third address segment representing a storage location of a to-be-processed service. When it is determined that the address in the first address segment has an impact on the second address segment representing the service resolution type, the second address segment is adjusted, and the service is resolved based on the adjusted second address segment to obtain a resolution result. The root complex can successfully receive the to-be-resolved service packet when the bar space address allocated by the root complex for the endpoint device does not match the bar space size of the endpoint device, and can correctly resolve the to-be-resolved service, thereby ensuring the normal operation of the PCIE system.
[0070] The embodiment of the present application provides a possible implementation, in which after the maximum link width of each endpoint device is obtained, the method further includes:
[0071] When it is determined that the maximum link width of the endpoint device itself is a second preset value, the bar space address is not re-allocated for the endpoint device.
[0072] In the embodiment of the present application, after the maximum link width of the endpoint device is obtained, when it is determined that the maximum link width of the endpoint device itself is a second preset value, such as 4, it is indicated that the bar space address of the endpoint device does not need to be re-allocated, and the address of the to-be-resolved service packet received by the endpoint device is not limited, and the service packet is directly resolved based on the address of the to-be-resolved service packet.
[0073] The embodiment of the present application provides a possible implementation, in which the address in the to-be-resolved service packet includes a first address segment representing a bar space address configured by the root complex for the endpoint device, a second address segment representing a service resolution type, and a third address segment representing a storage location of a to-be-processed service. The updating of the address in the to-be-resolved service packet includes:
[0074] If the highest address bit of the first address segment is in the second address segment, the second address segment in the address of the to-be-resolved service packet is updated according to the highest bit address in the first address segment;
[0075] The resolving of the to-be-resolved service packet according to the updated address in the to-be-resolved service packet includes:
[0076] The service to be processed is determined according to the third address segment, and the service to be processed is parsed according to the service parsing type represented by the updated second address segment.
[0077] In an embodiment of the present disclosure, an address is set in the service package to be parsed, which includes a first address segment for representing the bar space address configured by the root complex for the endpoint device, a second address segment for representing the service parsing type, and a third address segment for representing the storage location of the service to be processed.
[0078] For the convenience of explanation, a specific embodiment is used as an example. Figure 3 As shown, the bar space address allocated by the root complex to the endpoint device is 2 0 ~2 n-3 , the address of the business package to be parsed is 2 0 ~2 n-3 , wherein the second address segment for indicating the service type in the service packet to be parsed is an address bit of a preset value. In the embodiment of the present application, the second address segment can be selected as 2 n-3 ~2 n-4 Address bit, the category of the service contained in the service packet to be parsed is service 1. According to the preset value rule, the address corresponding to service 1 is 00. In the second address segment 2 of the service packet to be parsed, n-3 ~2 n-4 The address bits are 00, and the third address segment is used to represent the storage location of the service 1.
[0079] In the embodiment of the present disclosure, the highest address bit of the first address segment refers to the first address bit of the business packet to be parsed. When the highest address bit of the first address segment of the business packet to be parsed is within the second address segment, it is necessary to update the second address segment in the business packet to be parsed according to the highest address bit of the first address segment to ensure that the business type represented by the second address segment remains unchanged.
[0080] For the convenience of explanation, a specific embodiment is used as an example. Figure 4 As shown, the first address segment of the service packet to be parsed is 2 0 ~2 n-3 , of which 2 n-3 The address bit is 1, and the third address segment is 2 0 ~2 n-5 , used to represent the location where business data is stored, the second address segment is 2 n-4 ~2 n-3 , where the service to be parsed is service 1, then the address of the second address segment corresponding to it is 00, that is, in the second address segment, 2 n-4 ~2 n-3 The addresses in are 0, 2 n-3The address bit is the highest address bit of the first address segment, and the highest address is within the second address segment. When the second address segment is packaged into the service package to be parsed, the overlapping part of the second address segment and the first address segment will be calculated to obtain the address of the service package to be parsed. After receiving the parsed service package, the endpoint device needs to first restrict the address of the service package to be parsed to ensure that the service type represented by the second address segment in the service package to be parsed remains unchanged. In this case, 2 n-3 The address in the address bit is modified to 0 accordingly to ensure that the second address segment 2 n-4 ~2 n-3 The address is 00.
[0081] In the embodiment of the present application, after the second address segment is updated, the type of service in the service packet to be parsed is determined based on the updated second address segment, and the service packet to be parsed is parsed to obtain service data.
[0082] The present application embodiment provides a possible implementation method, in which, Figure 5 As shown, updating the second address segment in the address of the service packet to be parsed according to the highest address in the first address segment includes:
[0083] Step S501 : determining a target address bit in the second address segment, where the target address bit is the address bit in the second address segment corresponding to the highest address bit in the first address segment.
[0084] In an embodiment of the present application, the target address bit refers to an address bit in the second address segment, and the position of the target address bit in the address carried by the business packet to be parsed is the same as the position of the highest address bit of the first address segment in the address carried in the business packet to be parsed.
[0085] For the convenience of explanation, a specific embodiment is used as an example. Figure 6 As shown, for a service packet to be parsed, the second address segment is 2 n-4 ~2 n-3 , the first address segment is 2 0 ~2 n-3 , where the highest address bit of the first address segment is 2 n-3 , then the highest address bit in the first address segment of the service packet to be parsed and an address bit in the second address segment are in the same position in the service packet to be parsed, that is, 2 n-3 address bit, then the address bit is determined as the target address bit. Optionally, in the first address segment, the address of the address bit is 1, and in the second address segment, the address of the address bit is 0.
[0086] Step S502, performing an OR operation between the target address bit and the highest address bit, and if the operation result is inconsistent with the target address bit, adjusting the target address to 0.
[0087] In the embodiment of the present application, after the target address bit is determined, an OR operation is performed between the target address bit and the highest address bit, and if the operation result is inconsistent with the target address bit, the target address is adjusted to 0.
[0088] For the embodiment of the present application, for the convenience of description, a specific embodiment is taken as an example, as shown in FIG. 6, the address in the target address bit in the second address segment is 0, the corresponding address bit in the first address segment is 1, and the result of 0 OR 1 is 1, at this time, the address in the second address segment is 10, and the type of the service in the service packet to be parsed is service 1, and the corresponding second address segment should be 00, therefore, the target address in the second address segment in the service packet to be parsed needs to be adjusted to 0, so as to ensure that the type of the service guaranteed by the target address is service 1. Figure 6
[0089] The embodiment of the present application determines the target address bit in the second address segment, performs an OR operation between the target address bit and the highest address bit, and if the operation result is inconsistent with the target address bit, adjusts the target address to 0, so as to ensure that the type of the service represented by the second address segment is unchanged.
[0090] The embodiment of the present application provides a possible implementation, in which the method further comprises:
[0091] If the operation result is consistent with the address of the target address, the address of the target address bit remains unchanged.
[0092] For the embodiment of the present application, for the convenience of description, a specific embodiment is taken as an example, as shown in FIG. 6, the address in the target address bit in the second address segment is 0, the corresponding address bit in the first address segment is 1, and the result of 0 OR 1 is 1, at this time, the address in the second address segment is 10, and the type of the service in the service packet to be parsed is service 1, and the corresponding second address segment should be 00, therefore, the target address in the second address segment in the service packet to be parsed needs to be adjusted to 0, so as to ensure that the type of the service guaranteed by the target address is service 1. Figure 7
[0093] When the maximum link width of the endpoint device is the first preset value, the maximum load width of the endpoint device is configured as the first load width.
[0094] When the maximum link width of the endpoint device is the second preset value, the maximum load width of the endpoint device is configured as the second load width.
[0095] In the embodiments of the present disclosure, in the embodiments of the present application, after the root complex obtains the maximum link width of the endpoint device, whether to perform the re-allocation of the BAR space address of the endpoint device is selected based on the maximum link width of each endpoint device, and the root complex needs to inform the endpoint device of the information whether the re-allocation of the BAR space address of the endpoint device is performed, in the embodiments of the present application, the information can be informed by configuring the maximum load width of the endpoint device, different maximum load widths are configured for the endpoint device for the two cases that the re-allocation of the BAR space address of the endpoint device is performed or the re-allocation of the BAR space address of the endpoint device is not performed, and the maximum load width is used to inform the endpoint device whether the BAR space address of the endpoint device is re-allocated.
[0096] For the embodiments of the present application, for the convenience of description, taking one specific embodiment as an example, in a PCIE system, there are three endpoint devices connected with the root complex, including an endpoint device A, an endpoint device B and an endpoint device C, after the PCIE system is started, the root complex starts to scan each endpoint device to obtain the device information of each endpoint device, wherein, for example, the maximum link width of each endpoint device, the maximum link width of the endpoint device A is 2, the maximum link width of the endpoint device B is 2, and the maximum link width of the endpoint device C is 4. Of course, when the root complex obtains the device information of the endpoint device, other information of the endpoint device can also be obtained, such as identity information, model information, etc. In the embodiments of the present application, when the maximum link width of the endpoint device is 2, it indicates that the BAR space address of the endpoint device needs to be re-allocated, and the root complex will forcibly re-allocate the BAR space address of the endpoint device, and configure the maximum load width of the endpoint device as a first load width, such as 256, when the endpoint device learns that the maximum load width of itself is configured as the first load width (256), it is determined that the BAR space address of itself is re-allocated, and when the endpoint device receives a to-be-analyzed service packet, the address of the to-be-analyzed service packet will be limited. As another embodiment of the present application, when the maximum link width of the endpoint device is 4, it indicates that the BAR space address of the endpoint device does not need to be re-allocated, and the root complex will configure the maximum load width of the endpoint device as a second load width, such as 1024, when the endpoint device learns that the maximum load width of itself is configured as the second load width (1024), it is determined that the BAR space address of itself is not re-allocated, and when the endpoint device receives a to-be-analyzed service packet, the address of the to-be-analyzed service packet will not be limited.
[0097] In the embodiments of the present application, by configuring the maximum load width of the endpoint device, the endpoint device is informed whether the BAR space address of itself is re-allocated, and the endpoint device is facilitated to limit the address of the received to-be-analyzed service packet in the case that the BAR space address is re-allocated.
[0098] When the bar space address allocated by the root complex to the endpoint device does not match the memory space size of the endpoint device, the address of the to-be-resolved service packet is divided into a first address segment for representing the bar space address configured by the root complex for the endpoint device, a second address segment for representing the service resolution type, and a third address segment for representing the storage location of the to-be-processed service. When it is determined that the address in the first address segment has an impact on the second address segment for representing the service resolution type based on the relationship between the highest bit address of the first address segment and the second address segment, the second address segment is adjusted, and the service is resolved based on the adjusted second address segment to obtain a resolution result. The to-be-resolved service packet can be successfully received when the bar space address allocated by the root complex to the endpoint device does not match the memory space size of the endpoint device, and the to-be-resolved service can be correctly resolved, thereby ensuring the normal operation of the PCIE system.
[0099] The embodiment of the application provides a service resolution device, as shown in Figure 8 The service resolution device 80 can include a device scanning module 801, an address allocation module 802, an address updating module 803, and a resolution module 804, wherein
[0100] The device scanning module 801 is configured to scan each endpoint device and obtain the maximum link width of each endpoint device.
[0101] The address allocation module 802 is configured to re-allocate a bar space address to the endpoint device when the maximum link width of the endpoint device is a first preset value.
[0102] The address updating module 803 is configured to receive a to-be-resolved service packet based on the re-allocated bar space address and update the address in the to-be-resolved service packet, wherein the address in the to-be-resolved service packet is used to represent the service resolution type.
[0103] The resolution module 804 is configured to resolve the to-be-resolved service packet based on the updated address in the to-be-resolved service packet to obtain a resolution result.
[0104] Optionally, as shown in Figure 9 The address allocation module 802 further includes
[0105] The first load width configuration module 901 is configured to configure the maximum load width of the endpoint device as a first load width when the maximum link width of the endpoint device is a first preset value.
[0106] The second load width configuration module 902 is configured to configure the maximum load width of the endpoint device as a second load width when the maximum link width of the endpoint device is a second preset value.
[0107] Optionally, after scanning each endpoint device and obtaining the maximum link width of each endpoint device, the device scanning module 801 may further be used to:
[0108] When it is determined that the maximum link width of the endpoint device itself is the second preset value, the bar space address is not re-matched for the endpoint device.
[0109] Optionally, the address in the service package to be parsed includes a first address segment for representing a bar space address configured by the root complex for the endpoint device, a second address segment for representing a service parsing type, and a third address segment for representing a storage location of the service to be processed. Updating the address in the service package to be parsed includes:
[0110] If the highest address bit of the first address segment is within the second address segment, updating the second address segment in the address of the service packet to be parsed according to the highest address bit in the first address segment;
[0111] The parsing of the service package to be parsed according to the updated address in the service package to be parsed includes:
[0112] The service to be processed is determined according to the third address segment, and the service to be processed is parsed according to the service parsing type represented by the updated second address segment.
[0113] Optionally, when the address allocation module 802 updates the second address segment in the address of the service packet to be resolved according to the highest address bit in the first address segment, it can be used to:
[0114] Determine a target address bit in the second address segment, where the target address bit is an address bit in the second address segment corresponding to a highest address bit in the first address segment;
[0115] An OR operation is performed on the address in the target address bit and the address in the highest address bit. If the operation result is inconsistent with the address in the target address bit, the target address bit is adjusted to 0.
[0116] Optionally, the address allocation module 802 may also be used to:
[0117] If the obtained operation result is consistent with the address in the target address bit, the address of the target address bit remains unchanged.
[0118] Optionally, after obtaining the maximum link width of each endpoint device, the method further includes:
[0119] When the maximum link width of the endpoint device is a first preset value, configuring the maximum load width of the endpoint device to be the first load width;
[0120] When the maximum link width of the endpoint device is the second preset value, the maximum load width of the endpoint device is configured as the second load width.
[0121] The service distribution apparatus provided by the embodiments of the present application can execute the service distribution method shown in the foregoing embodiments of the present application, and the implementation principles are similar, which will not be described here again.
[0122] The electronic device provided in the embodiments of the present application includes a memory and a processor, and at least one program stored in the memory and used for being executed by the processor. Compared with the prior art, the program can realize that when the bar space address allocated by the root complex to the endpoint device does not match the memory space size of the endpoint device, the address of the to-be-analyzed service packet is divided into a first address segment used for representing the bar space address configured by the root complex for the endpoint device, a second address segment used for representing the service analysis type, and a third address segment used for representing the storage position of the to-be-processed service, and based on the relationship between the highest bit address of the first address segment and the second address segment, when it is determined that the address in the first address segment has an influence on the second address segment used for representing the service analysis type, the second address segment is adjusted, and based on the adjusted second address segment, the service is analyzed to obtain an analysis result. The electronic device can successfully receive the to-be-analyzed service packet when the bar space address allocated by the root complex to the endpoint device does not match the memory space size of the endpoint device, and can correctly analyze the to-be-analyzed service, thereby ensuring the normal operation of the PCIE system.
[0123] In an optional embodiment, an electronic device is provided, as shown in Figure 10 The electronic device 4000 shown in Figure 10 The electronic device 4000 shown in
[0124] The processor 4001 can be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It can implement or execute various exemplary logical blocks, modules and circuits described in connection with the disclosure. The processor 4001 can also be a combination of computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0125] The bus 4002 can include a path for transmitting information between the above-mentioned components. The bus 4002 can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 4002 can be divided into an address bus, a data bus, a control bus, etc. For convenience of representation, Figure 10 In the figure, only one thick line is used to represent the bus, but it does not mean that there is only one bus or only one type of bus.
[0126] The memory 4003 can be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, an optical disk storage (including a compact disk, a laser disk, an optical disk, a digital versatile disk, a Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but not limited to this.
[0127] The memory 4003 is configured to store application code (computer program) for implementing the scheme of the present application, and the processor 4001 is configured to control the execution. The processor 4001 is configured to execute the application code stored in the memory 4003 to implement the content shown in the foregoing method embodiments.
[0128] The electronic device includes, but is not limited to, a computer, a tablet computer, a server, a smart phone, and the like.
[0129] The embodiments of the present application provide a computer storage medium, and the computer storage medium stores a computer program. When the computer program is run on a computer, the computer can execute the corresponding content in the foregoing method embodiments.
[0130] It should be understood that, although each step in the flowchart of the accompanying drawings is shown in sequence according to the direction of the arrow, these steps are not necessarily executed in sequence according to the direction of the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and they can be executed in other sequences. Moreover, at least part of the steps in the flowchart of the accompanying drawings can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or sub-steps or stages of other steps.
[0131] The above only describes some embodiments of the present application. It should be pointed out that, for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.
Claims
1. A service parsing method, applied to a PCIE system, wherein the PCIE system includes a root complex and at least one endpoint device, characterized in that: include: Scan endpoint devices to obtain the maximum link width of the endpoint devices; When the maximum link width of the endpoint device is a first preset value, reallocating a bar space address for the endpoint device; receiving a service package to be parsed based on the bar space address, and updating the address in the service package to be parsed, where the address in the service package to be parsed is used to characterize the service parsing type; Parsing the service package to be parsed according to the updated address in the service package to be parsed to obtain a parsing result; The address in the service package to be parsed includes a first address segment for representing a bar space address configured by the root complex for the endpoint device, a second address segment for representing a service parsing type, and a third address segment for representing a storage location of the service to be processed. The updating of the address in the service package to be parsed includes: If the highest address bit of the first address segment is within the second address segment, the second address segment in the address of the service packet to be resolved is updated according to the highest address bit in the first address segment.
2. The service parsing method according to claim 1, after scanning the endpoint device and obtaining the maximum link width of the endpoint device, further comprising: When it is determined that the maximum link width of the endpoint device itself is the second preset value, the bar space address is not re-matched for the endpoint device.
3. The business analysis method according to claim 1, characterized in that: The parsing of the service package to be parsed according to the updated address in the service package to be parsed includes: The service to be processed is determined according to the third address segment, and the service to be processed is parsed according to the service parsing type represented by the updated second address segment.
4. The business analysis method according to claim 3, characterized in that: The updating of the second address segment in the address of the service packet to be parsed according to the highest address in the first address segment includes: Determine a target address bit in the second address segment, where the target address bit is an address bit in the second address segment corresponding to a highest address bit in the first address segment; An OR operation is performed on the address in the target address bit and the address in the highest address bit. If the operation result is inconsistent with the address in the target address bit, the target address bit is adjusted to 0.
5. The business analysis method according to claim 4, characterized in that: The method further comprises: If the obtained operation result is consistent with the address in the target address bit, the address of the target address bit remains unchanged.
6. The business analysis method according to claim 2, characterized in that: After obtaining the maximum link width of the endpoint device, the method further includes: When the maximum link width of the endpoint device is a first preset value, configuring the maximum load width of the endpoint device to be the first load width; When the maximum link width of the endpoint device is a second preset value, the maximum load width of the endpoint device is configured as a second load width.
7. A business analysis device, characterized in that: include: A device scanning module, configured to scan each endpoint device and obtain the maximum link width of each endpoint device; An address allocation module, configured to reallocate a bar space address to an endpoint device when the maximum link width of the endpoint device is a first preset value; an address updating module, configured to receive a service package to be parsed based on the reallocated bar space address, and update the address in the service package to be parsed, wherein the address in the service package to be parsed is used to characterize a service parsing type; A parsing module, configured to parse the service package to be parsed according to the updated address in the service package to be parsed, and obtain a parsing result; The address in the service package to be parsed includes a first address segment for representing a bar space address configured by the root complex for the endpoint device, a second address segment for representing a service parsing type, and a third address segment for representing a storage location of the service to be processed. The address updating module updates the address in the service package to be parsed, including: If the highest address bit of the first address segment is within the second address segment, the second address segment in the address of the service packet to be resolved is updated according to the highest address bit in the first address segment.
8. The service analysis device according to claim 7, characterized in that: The address allocation module includes: a first load width configuration module, configured to configure the maximum load width of the endpoint device to a first load width when the maximum link width of the endpoint device is a first preset value; The second load width configuration module is configured to configure the maximum load width of the endpoint device to a second load width when the maximum link width of the endpoint device is a second preset value.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors; Memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to: execute the business parsing method according to any one of claims 1 to 6.
10. A computer storage medium, characterized in that The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the business parsing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
PCIe bus address extension method and device, equipment and medium
CN110990318A
Compatibility processing method and device of PCIe equipment, equipment and storage medium
CN111581139A