CN115469911A - Parameter configuration method, system and computer readable storage medium - Google Patents

Parameter configuration method, system and computer readable storage medium Download PDF

Info

Publication number
CN115469911A
CN115469911A CN202211156961.2A CN202211156961A CN115469911A CN 115469911 A CN115469911 A CN 115469911A CN 202211156961 A CN202211156961 A CN 202211156961A CN 115469911 A CN115469911 A CN 115469911A
Authority
CN
China
Prior art keywords
configuration
configuration page
message
data
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211156961.2A
Other languages
Chinese (zh)
Inventor
刘明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202211156961.2A priority Critical patent/CN115469911A/en
Publication of CN115469911A publication Critical patent/CN115469911A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/16Handling requests for interconnection or transfer for access to memory bus
    • G06F13/1668Details of memory controller
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a parameter configuration method, a system and a computer readable storage medium, which relate to the field of SAS controllers, and the method comprises the following steps: when receiving a parameter configuration message which is sent by host equipment and used for updating a persistent configuration page in an NVSRAM (network video random access memory), an SAS (serial attached SCSI) controller extracts a configuration page type, a configuration page number, address information and data to be updated from the parameter configuration message; determining a target configuration page in the persistent configuration page according to the type and the number of the configuration page, determining target data in the target configuration page by using the address information, and updating the target data by using the data to be updated; when the updating is successful, constructing a configuration success reply message by using the configuration page type, the configuration page number and the message state representing the successful updating, and returning the configuration success reply message to the host equipment so as to ensure that the host equipment determines that the data updating is successful; the SAS controller can be controlled to update the persistent configuration page on line, and meanwhile, specific target data in the persistent configuration page can be locally updated, so that the updating efficiency can be improved.

Description

Parameter configuration method, system and computer readable storage medium
Technical Field
The present invention relates to the field of SAS controllers, and in particular, to a parameter configuration method, system, and computer readable storage medium.
Background
SAS controllers (Serial Attached SCSI) are common controllers in computer devices for performing I/O functions between a host and a storage device. The controller is provided with various register configuration data, and to ensure that its corresponding configuration data is not electrically lost under the computer, the configuration data is generally stored in a persistent data area of a Non-volatile SRAM (NVSRAM) memory. The data held by the SAS controller in this persistent data area may also be referred to as a persistent configuration page.
In the related art, in order to update a persistent configuration page, the configuration page to be updated and the firmware of the SAS controller need to be merged into a same file, and the file is burned into a flash memory of the SAS controller; when the SAS controller is powered on next time, the files in the flash memory are loaded to the internal memory, and the configuration pages in the files are stored in the persistent data area again. Therefore, the updating method for the persistent configuration page is complex and cannot be updated online, which brings trouble to the maintenance of the SAS controller.
Disclosure of Invention
The invention aims to provide a parameter configuration method, a parameter configuration system and a computer readable storage medium, which can control an SAS controller to update a persistent configuration page on line, and can also locally update specific target data in the persistent configuration page, thereby improving the updating efficiency of the persistent configuration page.
To solve the above technical problem, the present invention provides a parameter configuration method, which includes:
when receiving a parameter configuration message which is sent by host equipment and used for updating a persistent configuration page in an NVSRAM (network video random access memory), an SAS (serial attached SCSI) controller extracts a configuration page type, a configuration page number, address information and data to be updated from the parameter configuration message;
determining a target configuration page in the persistent configuration page according to the configuration page type and the configuration page number, determining target data in the target configuration page by using the address information, and updating the target data by using the data to be updated;
and when the updating is successful, constructing a configuration success reply message by using the configuration page type, the configuration page number and the message state representing the successful updating, and returning the configuration success reply message to the host equipment so that the host equipment determines that the data updating is successful.
Optionally, before receiving a parameter configuration message sent by the host device for updating a persistent configuration page in the NVSRAM, the method further includes:
the method comprises the steps that when the host equipment receives a parameter configuration command, a preset configuration request message structure body is obtained;
and writing the configuration page type, the configuration page number, the address information and the data to be updated in the parameter configuration command into the configuration request message structure to obtain the parameter configuration message.
Optionally, the writing the configuration page type, the configuration page number, the address information, and the data to be updated in the parameter configuration command into the configuration request message structure to obtain the parameter configuration message includes:
the host equipment determines the configuration page type and the configuration page length of a target configuration page corresponding to the configuration page number according to preset configuration page structure parameters;
writing the configuration page type, the configuration page number, the configuration page length, the address information and the data to be updated into the configuration request message structure to obtain the parameter configuration message;
correspondingly, before determining the target configuration page in the persistent configuration page according to the configuration page type and the configuration page number, the method further includes:
the SAS controller applies for a system memory space according to the length of the configuration page in the parameter configuration message and writes data to be updated in the parameter configuration message into the system memory space;
correspondingly, the updating the target data by using the data to be updated includes:
and the SAS controller updates the target data by using the data to be updated in the system memory space.
Optionally, the address information is an offset value, and determining the target data in the target configuration page by using the address information includes:
and the SAS controller searches a corresponding offset position of the offset value in the target configuration page and sets data in the offset position as the target data.
Optionally, the address information is a configuration page address, the target configuration page includes configuration parameters of a plurality of objects, and determining target data in the target configuration page by using the address information includes:
and the SAS controller inquires an object corresponding to the configuration page address in the target configuration page and sets all configuration parameters corresponding to the object as the target data.
Optionally, the constructing a configuration success reply message by using the configuration page type, the configuration page number, and the message status indicating that the updating is successful includes:
the SAS controller acquires a preset configuration reply message structure;
and writing the configuration page type, the configuration page number and the message state representing successful updating into the configuration reply message structure body to obtain the configuration successful reply message.
Optionally, after the target data is updated by using the data to be updated, the method further includes:
and when the updating fails, the SAS controller constructs a configuration failure reply message by using the configuration page type, the configuration page number and the message state representing the updating failure, and returns the configuration failure reply message to the host equipment so that the host equipment determines that the data updating fails.
Optionally, after returning the configuration success reply message to the host device, the method further includes:
and when receiving a restart command sent by the host equipment, the SAS controller executes a restart operation and loads the updated persistent configuration page into an internal memory in the restart process so as to enable the updated persistent configuration page to take effect.
Optionally, the method further comprises:
when receiving a parameter reading message which is sent by the host equipment and used for reading the persistent configuration page, the SAS controller determines configuration page data in the persistent configuration page by using the type, number and address information of the configuration page in the parameter reading message;
writing the configuration page data into the parameter reading message, and when the reading is successful, constructing a reading success reply message by using the configuration page type, the configuration page number and the message state representing the successful reading;
and returning the successfully-read reply message and the written parameter reading message to the host equipment so that the host equipment determines that the data is successfully read and acquires the configuration page data from the parameter reading message.
The invention also provides a parameter configuration system, comprising: a SAS controller and a host device, wherein,
the SAS controller is used for extracting a configuration page type, a configuration page number, address information and data to be updated from a parameter configuration message when the parameter configuration message which is sent by the host equipment and used for updating a persistent configuration page in the NVSRAM is received; determining a target configuration page in the persistent configuration page according to the configuration page type and the configuration page number, determining target data in the target configuration page by using the address information, and updating the target data by using the data to be updated; when the updating is successful, constructing a configuration success reply message by using the configuration page type, the configuration page number and the message state representing the successful updating, and returning the configuration success reply message to the host equipment;
and the host device is used for sending the parameter configuration message to the SAS controller and determining that the data updating is successful when the successful reply message is received.
The present invention also provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are loaded and executed by a processor, the parameter configuration method as described above is implemented.
The invention provides a parameter configuration method, which comprises the following steps: when receiving a parameter configuration message which is sent by host equipment and used for updating a persistent configuration page in an NVSRAM (nonvolatile random Access memory), an SAS (Serial attached SCSI) controller extracts a configuration page type, a configuration page number, address information and data to be updated from the parameter configuration message; determining a target configuration page in the persistent configuration page according to the configuration page type and the configuration page number, determining target data in the target configuration page by using the address information, and updating the target data by using the data to be updated; and when the updating is successful, constructing a configuration success reply message by using the configuration page type, the configuration page number and the message state representing the successful updating, and returning the configuration success reply message to the host equipment so that the host equipment determines that the data updating is successful.
Therefore, in the invention, the host device can directly send a parameter configuration message for updating the persistent configuration page in the NVSRAM to the SAS controller, and the SAS controller can automatically extract the type, the number, the address information and the data to be updated of the configuration page from the message when receiving the message; then, the SAS controller inquires a corresponding target configuration page in the persistent configuration page according to the type and the number of the configuration page, determines corresponding target data in the target configuration page by using the address information, and updates the target data by using the data to be updated, so that the SAS controller can be controlled to update the persistent configuration page on line, specific target data contained in the target configuration page in the persistent configuration page can be locally updated, and the updating efficiency of the persistent configuration page of the SAS controller can be remarkably improved; in addition, after determining that the update is successful, the SAS controller may further construct a configuration success reply message by using the configuration page type, the configuration page number, and the message status indicating that the update is successful, and return the configuration success reply message to the host device, so that the host device determines that the data update is successful, which may further facilitate the update process of the persistent configuration page. The invention also provides a parameter configuration system and a computer readable storage medium, which have the beneficial effects.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a parameter configuration method according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a persistent configuration page according to an embodiment of the present invention;
fig. 3 is a block diagram of a parameter configuration system according to an embodiment of the present invention.
Detailed Description
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 the related art, in order to update a persistent configuration page, the configuration page to be updated and the firmware of the SAS controller need to be merged into a same file, and the file is burned into a flash memory of the SAS controller; when the SAS controller is powered on next time, the files in the flash memory are loaded to the internal memory, and the configuration pages in the files are stored in the persistent data area again. Therefore, the update mode of the persistent configuration page is complex and cannot be updated online, which brings troubles to the maintenance of the SAS controller. In view of this, the present invention can provide a parameter configuration method, which can control an SAS controller to update a persistent configuration page online, and can also locally update specific target data in the persistent configuration page, so as to improve the update efficiency of the persistent configuration page. Referring to fig. 1, fig. 1 is a flowchart of a parameter configuration method according to an embodiment of the present invention, where the method includes:
s101, when receiving a parameter configuration message which is sent by a host device and used for updating a persistent configuration page in an NVSRAM (nonvolatile random access memory), an SAS (serial attached SCSI) controller extracts a configuration page type, a configuration page number, address information and data to be updated from the parameter configuration message.
It should be noted that all the interaction processes between the host device and the SAS controller in the embodiments of the present invention may be performed by the SAS controller management tool provided in the host device, and the SAS firmware and the controller driver provided in the SAS controller. In order to update the persistent configuration page stored in the NVSRAM by the SAS controller on line, the embodiment of the present invention may provide two message structures, namely, a configuration request message structure and a configuration reply message structure, where the host device may generate a configuration request message by using the configuration request message structure and send the configuration request message to the SAS controller, so that the SAS controller operates the persistent configuration page according to the content contained in the message; after the SAS controller completes the related operations, the configuration reply message structure may be utilized to generate a configuration reply message, and the configuration reply message may be sent to the host device, so that the host device may know the execution status of the related operations. The above two message structures will be described in detail below.
First, a configuration request message structure is described. For ease of understanding, please refer to fig. 2, fig. 2 is a schematic diagram of a persistent configuration page according to an embodiment of the present invention. The persistent configuration page includes various types of configuration pages, for example, fig. 2 includes a SAS phy configuration page, a BIOS configuration page (Basic Input/Output System), a SAS port configuration page, a SAS expansion card configuration page, a log configuration page, and the like. Different types of configuration pages contain different configuration data, so when data updating is performed, the type of the configuration page corresponding to the target configuration page to be updated should be determined first. Furthermore, each configuration page also includes a plurality of configuration pages, each configuration page records different configuration data, and each page is provided with a corresponding page number, so that after the configuration page type corresponding to the target configuration page to be updated is determined, the corresponding configuration page number needs to be further determined. Further, it can be understood that each configuration page has recorded therein multi-bit data, and a part of the configuration pages has recorded therein configuration data of a plurality of objects, for example, the SAS phy configuration pages have recorded therein configuration data of a plurality of SAS phy objects, so that in order to update the configuration data at a certain position in the target configuration page or the configuration data of a certain object, it is also necessary to determine corresponding address information of the configuration data in the configuration page, for example, a specific configuration page address or an address offset value. Obviously, in order to locally update the persistent configuration page, the configuration page type, the configuration page number, the address information, and the data to be updated are necessarily required, so as to determine a specific target data in the persistent configuration page according to the configuration page type, the configuration page number, and the address information, and update the target data by using the data to be updated. Therefore, in order to meet the requirement of the update operation on the persistent configuration page, at least the configuration page type, the configuration page number, the address information and the write position of the data to be updated should be included in the configuration request message structure.
Of course, other contents may also be included in the configuration request message structure to meet other application requirements. For example, the configuration request message structure may satisfy a requirement for executing an update operation on a persistent configuration page, may also satisfy a requirement for executing a read operation on the persistent configuration page, and may also satisfy a requirement for executing an update operation and a read operation on a configuration page included in another location of the SAS controller, and further, the configuration request message structure may further include an "operation type" to distinguish an operation type corresponding to a current request; in addition, considering that the volume of the data to be updated may be large, or a large amount of configuration data may be read from the persistent configuration page, the configuration request message structure may also include a "configuration page length" for recording the length of the target configuration page to be updated or read, so that the SAS controller applies for a system memory space according to the length, and caches the data to be updated or the data read from the target configuration page by using the space; the configuration request message structure body also can contain a 'zone bit' for marking the system memory space applied by the SAS controller; in addition, in order to facilitate the management of the request log, the configuration request message structure body can also comprise a configuration page version so as to record the version of the current persistent configuration page; in addition, to facilitate message identification, the configuration request message structure may also include a "function" for identifying the configuration request message generated by the configuration request message structure. In one possible scenario, the configuration request message structure may be of the form illustrated in the following table:
Figure BDA0003859179260000071
parameter interpretation:
the operation type is as follows: reading an NVSRAM configuration page, writing the NVSRAM configuration page, reading a current configuration page and writing the current configuration page;
a flag bit: designating a memory address space of the SAS controller for caching a configuration page value;
offset value: the offset address of the target data corresponding to the target configuration page;
the functions are as follows: acquiring or modifying NVSRAM configuration parameter function;
configuration page version: a version of a certain configuration page;
configuration page length: a certain configuration page length;
configuration page number: a certain configuration page number;
the configuration page type: specifying a specific configuration page;
configuration of page address: configuring page addresses for nonvolatile data in the NVSRAM;
configuring page data: the configuration page is used for loading data to be updated or data read from the target configuration page.
The configuration reply message structure will be described below. Because the structure is used for generating the configuration reply message after the SAS controller completes the related operation, and the configuration reply message should be returned to the host device so that the host device can know the execution condition of the related operation, the configuration reply message structure at least should include the above configuration page type and configuration page number so that the host device can determine that the data to be updated is written into the correct position or the configuration data is read from the correct position; in addition, it is necessary to include a "message status" for recording the execution status of the relevant operation, such as operation success, operation failure, etc. Of course, the "message status" may also further record the failure reason, such as operation non-support, configuration page type non-support, etc., so that the host device can know the specific reason of the failure.
In addition, to meet other requirements, the configuration reply message structure may also add other fields like the configuration request message structure, such as adding "operation type", "flag bit", "message length" (for recording the length of the configuration reply message), "function", "configuration page version", "configuration page length", and so on; in addition, for convenience of log management, the configuration reply message structure may also include a "message log" field for recording message details, such as an error code when an error occurs. In one possible case, the configuration reply message structure may be of the form shown in the following table:
Figure BDA0003859179260000081
parameter interpretation:
message status: returning the message request processing result state, such as success, operation non-support, configuration page type non-support, etc.;
message logging: message details such as error codes when errors occur are recorded.
After the two message structures are set, the host device can control the SAS controller to directly modify the configuration data in the persistent configuration page in a message issuing mode. Specifically, the host device may construct a parameter configuration message (i.e., a configuration request message with an operation type of "write NVSRAM configuration page"), and send the message to the SAS controller; the latter can determine the specific target data in the persistent configuration page according to the configuration page type, the configuration page number and the address information in the parameter configuration message, and update the target data by using the data to be updated. Of course, for the convenience of the relevant personnel, the host device side may also perform conversion from command to message, that is, the relevant personnel inputs a parameter configuration command, and the SAS controller management tool in the host device converts the command into a parameter configuration message and issues the parameter configuration message to the SAS controller. It should be noted that the embodiment of the present invention does not limit the specific form of the parameter configuration command, and it should be understood that the parameter configuration command at least includes a configuration page type, a configuration page number, address information, and data to be updated, and of course, additional setting may be performed according to other fields in the configuration request message structure, and the setting may be performed according to actual application requirements.
In one possible case, before receiving a parameter configuration message sent by the host device for updating the persistent configuration page in the NVSRAM, the method may further include:
step 11: when the host equipment receives a parameter configuration command, acquiring a preset configuration request message structure;
step 12: and writing the configuration page type, the configuration page number, the address information and the data to be updated in the parameter configuration command into a configuration request message structure body to obtain a parameter configuration message.
The following is a brief introduction to the form of the parameter configuration command. In one possible scenario, the basic form of the parameter configuration command may be:
./scrtnycli.x86_64-i<N>cfg-t<PageType>-n<PageNumber>-o<offset>-w<DataByte>-a[address]-f[region]
the content of a command fixed head is/scrtnycli.x86 _64, and can be changed arbitrarily according to actual application requirements; i is used to specify the SAS controller to which the command is specifically directed, starting with 1, e.g., N is 1; cfg is a function identifier, which is used for indicating that the current command is used for executing the NVSRAM nonvolatile data configuration parameter function; t is used to specify a configuration page type (PageType); n is used to specify a configuration page number (PageNumber); a is used for specifying the address value (address) of a register in a configuration page of the SAS controller; o specifies an address offset (offset) in a configuration page of the SAS controller; w specifies the data to be updated (DataByte); f specifies a storage region (region) of the SAS controller configuration page, such as the persistent data area of NVSRAM. It should be noted that the address offset and the address value may exist separately or simultaneously. When both exist at the same time, the corresponding meanings are as follows: and shifting the data position corresponding to the address offset backward by taking the address value as a base address.
The parameter configuration command is described below as a specific example. In one possible case, the meaning of the command/scrtnycli, x86_64-i 1 cfg-t 2-n 1-o 0x14-w 02140002-f 1 is: the configuration data of which the offset value of the 1 st page of the 2 nd type (BIOS configuration page) stored in the persistent configuration table of the NVSRAM persistent data area (denoted by 1) by the SAS controller 1 is 0x14 is modified to 02140002.
S102, determining a target configuration page in the persistent configuration page according to the type and the number of the configuration page, determining target data in the target configuration page by using the address information, and updating the target data by using the data to be updated.
As described above, the address information may be an offset value or a configuration page address, and these two may be present individually or in combination. When the offset value occurs alone, the meaning is: and taking the initial address of the target configuration page as a base address, and offsetting the corresponding digit backwards according to the offset value to obtain the corresponding data position of the target data in the target configuration page. When the address information is an offset value, the target data can be inquired only by determining the offset position of the target data according to the offset value.
In one possible case, the address information is an offset value, and determining target data in the target configuration page by using the address information includes:
step 21: and the SAS controller searches the offset position corresponding to the offset value in the target configuration page and sets the data in the offset position as target data.
Further, the configuration page address refers to a specific address of a certain register in the target configuration page, and when the configuration page address appears alone, the meaning is: and directly searching a data position corresponding to the configuration page address in the target configuration page. When the address information is a configuration page address, the target data can be directly inquired according to the address. It should be noted, of course, that the target data acquired here is all the configuration data contained in the corresponding register. Since a register may contain multiple bits of configuration data, if it is necessary to determine a certain bit of configuration data in the register, it is necessary to use the offset values in a further combination.
In one possible case, the address information is a configuration page address, the target configuration page contains configuration parameters of a plurality of objects, and determining target data in the target configuration page by using the address information includes:
step 31: the SAS controller inquires an object corresponding to the address of the configuration page in the target configuration page and sets all configuration parameters corresponding to the object as target data.
As described above, when the offset value and the configuration page address exist at the same time, the corresponding meaning is: and taking the configuration page address as a base address, and offsetting the corresponding digit backward according to the offset value to obtain the corresponding data position of the target data in the target configuration page. Therefore, the offset value and the configuration page address can be used in combination to achieve the data query effect of different finenesses.
S103, when the updating is successful, constructing a configuration success reply message by using the configuration page type, the configuration page number and the message state representing the updating success, and returning the configuration success reply message to the host device so that the host device determines that the data updating is successful.
Upon completion of the update, the SAS controller may construct a configuration success reply message (i.e., a configuration reply message having an operation type of "write NVSRAM configuration page" and containing a message status indicating a successful update) using the configuration reply message structure as described above and return it to the host device for the latter to determine that the data update was successful.
In one possible case, constructing a configuration success reply message using the configuration page type, the configuration page number, and the message status indicating that the update was successful comprises:
step 41: the SAS controller acquires a preset configuration reply message structure;
step 42: and writing the configuration page type, the configuration page number and the message state representing successful updating into a configuration reply message structure body to obtain a configuration successful reply message.
Of course, upon an update failure, the SAS controller may also construct a configuration failure reply message (i.e., a configuration reply message containing a message status indicating the update failure) to inform the host device that the current update operation failed. Of course, the status information in the configuration failure reply message may further include a failure reason, and the message may also further include log information corresponding to the failure operation, and may be set according to the actual application requirements.
In one possible case, after updating the target data with the data to be updated, the method may further include:
s104, when the updating fails, the SAS controller constructs a configuration failure reply message by using the type of the configuration page, the number of the configuration page and the state of the message indicating the updating failure, and returns the configuration failure reply message to the host device so that the host device determines that the data updating fails.
Further, given that the configuration data in the persistent configuration page is only validated upon loading into internal memory of the SAS controller, the host device may also control the SAS controller to reboot after the persistent configuration page update is completed, so that the latter loads the updated persistent configuration page into memory storage during the reboot.
In one possible case, after returning the configuration success reply message to the host device, the method may further include:
s105, when receiving a restart command sent by the host device, the SAS controller executes a restart operation, and loads the updated persistent configuration page to the internal memory in the restart process so as to enable the updated persistent configuration page to take effect.
It should be noted that the embodiments of the present invention are not limited to specific restart commands, and reference may be made to related technologies of SAS controllers. In one possible scenario, the restart command may be: xrtnycli. X86_64-i 1reset-c, where reset-c represents a restart.
Based on the above embodiment, in the present invention, the host device may directly send a parameter configuration message for updating the persistent configuration page in the NVSRAM to the SAS controller, and the latter may automatically extract the configuration page type, the configuration page number, the address information, and the data to be updated from the message when receiving the message; then, the SAS controller inquires a corresponding target configuration page in the persistent configuration page according to the type and the number of the configuration page, determines corresponding target data in the target configuration page by using the address information, and updates the target data by using the data to be updated, so that the SAS controller can be controlled to update the persistent configuration page on line, specific target data contained in the target configuration page in the persistent configuration page can be locally updated, and the updating efficiency of the persistent configuration page of the SAS controller can be remarkably improved; in addition, after determining that the update is successful, the SAS controller may further construct a configuration success reply message by using the configuration page type, the configuration page number, and the message status indicating that the update is successful, and return the configuration success reply message to the host device, so that the host device determines that the data update is successful, which may further facilitate the update process of the persistent configuration page.
Based on the above embodiments, in consideration that the data to be updated may be large or a large amount of data may be read from the target configuration page, the configuration request message may further include a "configuration page length" so that the SAS controller applies for a system memory space according to the length. The specific setting manner of the "configuration page length" and the specific response procedure of the SAS controller will be described below. In a possible case, writing the configuration page type, the configuration page number, the address information, and the data to be updated in the parameter configuration command into the configuration request message structure to obtain the parameter configuration message, may include:
step 51: the host equipment determines the type of the configuration page and the configuration page length of a target configuration page corresponding to the configuration page number according to preset configuration page structure parameters;
since the configuration page length of each configuration page belongs to the basic configuration page structure parameter of the persistent configuration page, it can be preset in the host device in advance. Furthermore, after acquiring the configuration page type and the configuration page number, the host device may search for the corresponding configuration page length in the configuration page structure parameter, and write the configuration page length into the parameter configuration message.
Step 52: and writing the type of the configuration page, the number of the configuration page, the length of the configuration page, the address information and the data to be updated into a configuration request message structure body to obtain a parameter configuration message.
Correspondingly, before determining the target configuration page in the persistent configuration page according to the configuration page type and the configuration page number, the method may further include:
step 53: and the SAS controller applies for the system memory space according to the length of the configuration page in the parameter configuration message and writes the data to be updated in the parameter configuration message into the system memory space.
Correspondingly, the updating of the target data by the data to be updated comprises the following steps:
step 54: the SAS controller updates the target data with the data to be updated in the system memory space.
Since the SAS controller has cached the data to be updated in the system memory space, it is only necessary to read the data to be updated from the space and update the target data accordingly.
Based on the above embodiment, a brief description is given below of the reading process of the persistent configuration page. In one possible case, the method may further comprise:
s201, when receiving a parameter reading message which is sent by a host device and used for reading a persistent configuration page, the SAS controller determines configuration page data in the persistent configuration page by using a configuration page type, a configuration page number and address information in the parameter reading message.
In the embodiment of the present invention, the parameter read message is a configuration request message whose operation type is "read NVSRAM configuration page", and the specific use manner of the parameter read message is substantially the same as that of the parameter configuration message. The configuration modes of the parameter reading message and the parameter configuration message are basically the same, and the difference is that the host device does not write data into the configuration page data field of the parameter reading message, but the SAS controller writes the read data into the configuration page data field of the parameter reading message.
As described above, in the process of generating the parameter reading message, the host device may perform a conversion process from a command to a message, that is, the user inputs the parameter reading command, and the host device writes valid data in the command into the configuration request message structure to obtain the parameter reading message. The embodiment of the invention does not limit the specific form of the parameter reading command, and can be designed correspondingly according to the form of the parameter configuration command. In one possible case, the basic form of the parameter read command may be:
./scrtnycli.x86_64-i<N>cfg-t<PageType>-n<PageNumber>-a[address]-f[region]
the content of a command fixed head is/scrtnycli.x86 _64, and can be changed arbitrarily according to actual application requirements; i is used to specify the SAS controller to which the command is specifically directed, starting at 1, e.g., N is 1; cfg is a function identifier used for indicating that the current command is used for executing the NVSRAM nonvolatile data configuration parameter function; t is used to specify a configuration page type (PageType); n is used to specify a configuration page number (PageNumber); a is used for designating the address value (address) of a register in a configuration page of the SAS controller; o specifies the address offset (offset) in a certain configuration page of the SAS controller; f specifies a storage region (region) of the SAS controller configuration page, such as the persistent data area of NVSRAM.
The parameter configuration command is described below as a specific example. In one possible case, the meaning of the command,/scrtnycli.x86 — 64-i 1 cfg-t 2-n 1 is: read SAS controller 1 saves all configuration data for type 2 (BIOS configuration page) page 1 in the NVSRAM persistent data area (denoted 1) persistent configuration table.
Further, it should be noted that, if the parameter read message includes the configuration page length, the SAS controller should apply for the system memory space by using the configuration page length before executing the read operation, then execute the read operation, and write the read configuration page data into the system memory space. And then, reading the configuration page data from the system memory space and writing the configuration page data into the parameter reading message.
S202, writing the configuration page data into the parameter reading message, and constructing a reading success reply message by using the configuration page type, the configuration page number and the message state indicating the reading success when the reading is successful.
In the embodiment of the present invention, the read success reply message is a configuration reply message whose operation type is "read NVSRAM configuration page" and includes a message status indicating that reading is successful, and its configuration manner may refer to the description in the above embodiment, and is not described herein again. It should be noted that since the read success reply message contains only the execution status of the read operation, but is not used as payload configuration page data, which is actually carried by the parameter read message, the SAS controller needs to return both the read success reply message and the parameter read message to the host device.
And S203, returning the read successful reply message and the written parameter reading message to the host equipment so that the host equipment can determine that the data is successfully read and acquire the configuration page data from the parameter reading message.
In the following, the parameter configuration system and the computer-readable storage medium provided by the embodiments of the present invention are introduced, and the parameter configuration system and the computer-readable storage medium described below and the parameter configuration method described above may be referred to correspondingly.
Referring to fig. 3, fig. 3 is a block diagram of a parameter configuration system according to an embodiment of the present invention, where the system may include: SAS controller 301 and host device 302, wherein,
the SAS controller 301 is configured to, when receiving a parameter configuration message sent by the host device 302 and used to update a persistent configuration page in the NVSRAM, extract a configuration page type, a configuration page number, address information, and data to be updated from the parameter configuration message; determining a target configuration page in the persistent configuration page according to the type and the number of the configuration page, determining target data in the target configuration page by using the address information, and updating the target data by using the data to be updated; when the update is successful, constructing a configuration success reply message by using the configuration page type, the configuration page number and the message state indicating the successful update, and returning the configuration success reply message to the host device 302;
host device 302 is configured to send a parameter configuration message to SAS controller 301 and to determine that the data update is successful upon receipt of a successful reply message.
Optionally, the host device 302 is further configured to, before receiving a parameter configuration message that is sent by the host device 302 and used to update a persistent configuration page in the NVSRAM, obtain a preset configuration request message structure when receiving a parameter configuration command; and writing the configuration page type, the configuration page number, the address information and the data to be updated in the parameter configuration command into the configuration request message structure to obtain the parameter configuration message.
Optionally, the host device 302 is further configured to determine a configuration page type and a configuration page length of a target configuration page corresponding to the configuration page number according to a preset configuration page structure parameter; writing the type, number, length, address information and data to be updated of the configuration page into a configuration request message structure to obtain a parameter configuration message;
correspondingly, the SAS controller 301 is further configured to apply for a system memory space according to the configuration page length in the parameter configuration message before determining the target configuration page in the persistent configuration page according to the configuration page type and the configuration page number, and write the data to be updated in the parameter configuration message into the system memory space;
accordingly, the SAS controller 301 is further configured to update the target data with the data to be updated in the system memory space.
Optionally, the SAS controller 301 is further configured to find a corresponding offset position of the offset value in the target configuration page, and set data in the offset position as target data.
Optionally, the SAS controller 301 is further configured to query, in the target configuration page, an object corresponding to the configuration page address, and set all configuration parameters corresponding to the object as target data.
Optionally, the SAS controller 301 is further configured to obtain a preset configuration reply message structure; and writing the configuration page type, the configuration page number and the message state representing successful updating into a configuration reply message structure body to obtain a configuration successful reply message.
Optionally, the SAS controller 301 is further configured to construct a configuration failure reply message using the configuration page type, the configuration page number, and the message status indicating the update failure when the update fails, and return the configuration failure reply message to the host device 302, so that the host device 302 determines that the data update fails.
Optionally, the SAS controller 301 is further configured to perform a reboot operation upon receiving a reboot command sent by the host device 302, and load the updated persistent configuration page into an internal memory during the reboot process, so that the updated persistent configuration page is validated.
Optionally, the SAS controller 301 is further configured to, when receiving a parameter reading message sent by the host device 302 for reading the persistent configuration page, determine configuration page data in the persistent configuration page by using the configuration page type, the configuration page number, and the address information in the parameter reading message; writing the configuration page data into the parameter reading message, and constructing a reading success reply message by using the configuration page type, the configuration page number and the message state representing the reading success when the reading is successful; the read successful reply message and the parameter read message completing the writing are returned to the host device 302, so that the host device 302 determines that the data reading is successful and acquires the configuration page data from the parameter read message.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the parameter configuration method in any of the embodiments described above are implemented.
Since the embodiment of the computer-readable storage medium portion corresponds to the embodiment of the parameter configuration method portion, please refer to the description of the embodiment of the parameter configuration method portion for the embodiment of the storage medium portion, which is not described herein again.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The parameter configuration method, system and computer-readable storage medium provided by the present invention are described in detail above. The principles and embodiments of the present invention are explained herein using specific examples, which are presented only to assist in understanding the method and its core concepts. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.

Claims (11)

1. A method for configuring parameters, comprising:
when receiving a parameter configuration message which is sent by host equipment and used for updating a persistent configuration page in an NVSRAM (network video random access memory), an SAS (serial attached SCSI) controller extracts a configuration page type, a configuration page number, address information and data to be updated from the parameter configuration message;
determining a target configuration page in the persistent configuration page according to the configuration page type and the configuration page number, determining target data in the target configuration page by using the address information, and updating the target data by using the data to be updated;
and when the updating is successful, constructing a configuration success reply message by using the configuration page type, the configuration page number and the message state representing the successful updating, and returning the configuration success reply message to the host equipment so that the host equipment determines that the data updating is successful.
2. The method according to claim 1, further comprising, before receiving a parameter configuration message sent by the host device for updating the persistent configuration page in the NVSRAM:
the method comprises the steps that when the host equipment receives a parameter configuration command, a preset configuration request message structure body is obtained;
and writing the configuration page type, the configuration page number, the address information and the data to be updated in the parameter configuration command into the configuration request message structure to obtain the parameter configuration message.
3. The method according to claim 1, wherein the writing the configuration page type, the configuration page number, the address information, and the data to be updated in the parameter configuration command into the configuration request message structure to obtain the parameter configuration message includes:
the host equipment determines the configuration page type and the configuration page length of a target configuration page corresponding to the configuration page number according to preset configuration page structure parameters;
writing the configuration page type, the configuration page number, the configuration page length, the address information and the data to be updated into the configuration request message structure to obtain the parameter configuration message;
correspondingly, before determining the target configuration page in the persistent configuration page according to the configuration page type and the configuration page number, the method further includes:
the SAS controller applies for a system memory space according to the length of the configuration page in the parameter configuration message and writes the data to be updated in the parameter configuration message into the system memory space;
correspondingly, the updating the target data by using the data to be updated includes:
and the SAS controller updates the target data by using the data to be updated in the system memory space.
4. The parameter configuration method according to claim 1, wherein the address information is an offset value, and the determining the target data in the target configuration page using the address information includes:
and the SAS controller searches a corresponding offset position of the offset value in the target configuration page and sets data in the offset position as the target data.
5. The method according to claim 1, wherein the address information is a configuration page address, the target configuration page contains configuration parameters of a plurality of objects, and the determining target data in the target configuration page using the address information comprises:
and the SAS controller inquires an object corresponding to the configuration page address in the target configuration page and sets all configuration parameters corresponding to the object as the target data.
6. The method according to claim 1, wherein the constructing a configuration success reply message by using the configuration page type, the configuration page number and the message status indicating successful update comprises:
the SAS controller acquires a preset configuration reply message structure;
and writing the configuration page type, the configuration page number and the message state representing successful updating into the configuration reply message structure body to obtain the configuration successful reply message.
7. The parameter configuration method according to claim 1, further comprising, after updating the target data with the data to be updated:
and when the updating fails, the SAS controller constructs a configuration failure reply message by using the configuration page type, the configuration page number and the message state representing the updating failure, and returns the configuration failure reply message to the host equipment so that the host equipment determines that the data updating fails.
8. The parameter configuration method according to claim 1, further comprising, after returning the configuration success reply message to the host device:
and the SAS controller executes the restarting operation when receiving the restarting command sent by the host equipment, and loads the updated persistent configuration page to an internal memory in the restarting process so as to enable the updated persistent configuration page to take effect.
9. The parameter configuration method according to any one of claims 1 to 8, further comprising:
when receiving a parameter reading message which is sent by the host equipment and used for reading the persistent configuration page, the SAS controller determines configuration page data in the persistent configuration page by using the configuration page type, the configuration page number and the address information in the parameter reading message;
writing the configuration page data into the parameter reading message, and when the reading is successful, constructing a reading success reply message by using the configuration page type, the configuration page number and the message state representing the successful reading;
and returning the successfully read reply message and the written parameter read message to the host equipment so that the host equipment determines that the data is successfully read and acquires the configuration page data from the parameter read message.
10. A parameter configuration system, comprising: an SAS controller and a host device, wherein,
the SAS controller is used for extracting a configuration page type, a configuration page number, address information and data to be updated from a parameter configuration message when the parameter configuration message which is sent by the host equipment and used for updating a persistent configuration page in the NVSRAM is received; determining a target configuration page in the persistent configuration page according to the configuration page type and the configuration page number, determining target data in the target configuration page by using the address information, and updating the target data by using the data to be updated; when the updating is successful, constructing a configuration success reply message by using the configuration page type, the configuration page number and the message state representing the successful updating, and returning the configuration success reply message to the host equipment;
and the host device is used for sending the parameter configuration message to the SAS controller and determining that the data updating is successful when the successful reply message is received.
11. A computer-readable storage medium having stored thereon computer-executable instructions that, when loaded and executed by a processor, carry out a parameter configuration method according to any one of claims 1 to 9.
CN202211156961.2A 2022-09-22 2022-09-22 Parameter configuration method, system and computer readable storage medium Pending CN115469911A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211156961.2A CN115469911A (en) 2022-09-22 2022-09-22 Parameter configuration method, system and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211156961.2A CN115469911A (en) 2022-09-22 2022-09-22 Parameter configuration method, system and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN115469911A true CN115469911A (en) 2022-12-13

Family

ID=84334257

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211156961.2A Pending CN115469911A (en) 2022-09-22 2022-09-22 Parameter configuration method, system and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN115469911A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117472049A (en) * 2023-10-25 2024-01-30 山东大学 Control method and system for movement device, storage medium and movement device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117472049A (en) * 2023-10-25 2024-01-30 山东大学 Control method and system for movement device, storage medium and movement device
CN117472049B (en) * 2023-10-25 2024-05-07 山东大学 Control method and system for movement device, storage medium and movement device

Similar Documents

Publication Publication Date Title
US8612722B2 (en) Determining an end of valid log in a log of write records
CN100458699C (en) Method and system for updating fastener
CN106648463B (en) Nand Flash block management method and system
WO2023116346A1 (en) Method and system for recovering trim data under abnormal power failure, and solid-state drive
CN115469911A (en) Parameter configuration method, system and computer readable storage medium
CN114860670A (en) File operation method of user space file system and user space file system
CN113064604A (en) Firmware upgrading method and device
JP5057887B2 (en) Data update device, data update method, and data update program
CN111026417A (en) Embedded equipment upgrading method and embedded equipment
US9235349B2 (en) Data duplication system, data duplication method, and program thereof
CN115686946A (en) Firmware updating method, firmware updating device and vehicle
CN111399759B (en) Method for reading data and writing data and object file system
CN109445686B (en) Storage disk and data access method
CN111506458A (en) Method and module for improving transaction performance of F2FS file system and storage system
JP4239754B2 (en) Nonvolatile memory system
CN115857834B (en) Method and device for checking read-write consistency of memory
JPH10307749A (en) Memory device
CN113703671B (en) Data block erasing method and related device
CN116126591B (en) Transaction mechanism of embedded system
CN113535204A (en) FPGA (field programmable Gate array) online upgrading method based on Flash reconstruction technology
CN113841116A (en) Arithmetic processing device, vehicle control device, and update method
EP4123470A1 (en) Data access method and apparatus
JP2007199846A (en) Memory control device and memory control method
JP4580724B2 (en) Nonvolatile memory control method
JP4575112B2 (en) Firmware rewriting method, disk drive device, and information processing system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination