CN112363670A - SATA NCQ command scheduling method - Google Patents

SATA NCQ command scheduling method Download PDF

Info

Publication number
CN112363670A
CN112363670A CN202011099189.6A CN202011099189A CN112363670A CN 112363670 A CN112363670 A CN 112363670A CN 202011099189 A CN202011099189 A CN 202011099189A CN 112363670 A CN112363670 A CN 112363670A
Authority
CN
China
Prior art keywords
fis
queue
command
sending
fpdma
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011099189.6A
Other languages
Chinese (zh)
Other versions
CN112363670B (en
Inventor
刘超
杨硕
杨阳
王晓璐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianjin Jinhang Computing Technology Research Institute
Original Assignee
Tianjin Jinhang Computing Technology Research Institute
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 Tianjin Jinhang Computing Technology Research Institute filed Critical Tianjin Jinhang Computing Technology Research Institute
Priority to CN202011099189.6A priority Critical patent/CN112363670B/en
Publication of CN112363670A publication Critical patent/CN112363670A/en
Application granted granted Critical
Publication of CN112363670B publication Critical patent/CN112363670B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • G06F3/0607Improving or facilitating administration, e.g. storage management by facilitating the process of upgrading existing storage systems, e.g. for improving compatibility between host and storage device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0674Disk device
    • G06F3/0676Magnetic disk device
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to a method for scheduling SATA NCQ commands, belonging to the field of hard disk reading and writing. In the invention, a Device receives a Read or Write FPDMA (fast Data memory access) queue command with a TAG (TAG of 0), then responds to a Register FIS (field-of-interest) from the corresponding Device to Host, and adds a DMA Setup FIS, a Data FIS and a Set Device Bits FIS corresponding to the command into a sending queue; and when a Read or Write FPDMA queue command is received subsequently, inserting a Register FIS from Device to Host corresponding to the new command into the forefront of the sending queue, and sequentially adding a DMA Setup FIS, a Data FIS and a Set Device Bits FIS to the tail end of the sending queue. The invention can enable the SATA Device to respond to the Register FIS from Device to Host corresponding to the Read FPDMA queue or Write FPDMA queue command in time; and can manage FIS that Device needs to transmit using the transmit queue.

Description

SATA NCQ command scheduling method
Technical Field
The invention belongs to the field of hard disk reading and writing, and particularly relates to a method for scheduling SATA NCQ commands.
Background
NCQ is a command protocol in SATA, allowing multiple commands to be executed in a hard disk drive at the same time. When an application program of a Host (Host) sends a plurality of commands to a hard disk Device (Device), the execution sequence of the commands can be optimized by using NCQ, so that the total time for completing the commands is reduced, and the performance of the system is improved.
An NCQ function is defined in the SATA protocol: First-Party DMA (FPDMA). The SATA allows the hard disk end to directly send a data transmission request to the Host controller through the DMA setup FIS, the DMA engine of the Host can directly transmit data, and the intervention of Host end software is not needed in the process. In the response process of the Device to the two SATA NCQ commands of Read FPDMA queue and Write FPDMA queue, after the Device receives the Host to Device Register FIS with the Read FPDMA queue command or the Write FPDMA queue command, the Device needs to immediately respond to a Device to Host Register FIS. If Device inserts other types of FIS in the Register FIS that sends Device to Host, Host will report an error.
Disclosure of Invention
Technical problem to be solved
The technical problem to be solved by the invention is how to provide a method for scheduling SATA NCQ commands, so as to solve the problem that command execution errors are caused when a Device to Host Register FIS of a SATA Host is not timely replied by a hard disk Device in the process of responding to continuous NCQ commands by a hard disk.
(II) technical scheme
In order to solve the above technical problem, the present invention provides a SATA NCQ command scheduling method, which includes the following steps:
s1, the Device receives a Read FPDMA queue command with TAG 0, then the Device responds to the Register FIS corresponding to the Device to Host, and adds DMA Setup FIS, Data FIS and Set Device Bits FIS corresponding to the command into a sending queue;
s2, in the process of sequentially executing the sending queue, if the Device receives a Read FPDMA queue command with TAG 1, suspending the sending execution process of the current queue, inserting a Device-Host Register FIS corresponding to the Read FPDMA queue command with TAG 1 into the forefront of the sending queue, and sending the Device-Host Register FIS to the Host first; simultaneously, sequentially adding a Read FPDMA queue command with TAG of 1 to the tail end of the sending queue corresponding to DMA Setup FIS, Data FIS and Set Device Bits FIS;
s3, in the process of sending queue to execute in sequence, if the Device receives new Read FPDMA queue command, then executing according to the operation in step S2.
The invention also provides a SATA NCQ command scheduling method, which comprises the following steps:
the T1, the Device receives the Write FPDMA queue command with TAG 0, then the Device responds to the corresponding Register FIS from the Device to the Host, and adds the DMA Setup FIS, DMA Activate FIS and Set Device Bits FIS corresponding to the command into the sending queue;
t2, in the process of sequentially executing the sending queue, if the Device receives the Write FPDMA queue command with TAG 1, suspending the sending execution process of the current queue, inserting the Device-Host Register FIS corresponding to the Write FPDMA queue command with TAG 1 into the forefront of the sending queue, and sending the Device-Host Register FIS to the Host first; simultaneously, sequentially adding a Write FPDMA queue command with TAG of 1 to the tail end of the sending queue corresponding to DMA Setup FIS, Data FIS and Set Device Bits FIS;
t3, in the same way, in the process of the sending queue executing in sequence, if the Device receives a new Write FPDMA queue command, the operation is executed according to the step T2.
(III) advantageous effects
The invention provides a SATA NCQ command scheduling method, which has the advantages that:
the SATA Device can respond to Device to Host Register FIS corresponding to Read FPDMA queue or Write FPDMA queue commands in time;
the FIS that the Device needs to transmit is managed using the transmit queue.
Detailed Description
In order to make the objects, contents and advantages of the present invention clearer, the following detailed description of the embodiments of the present invention will be given in conjunction with examples.
The invention provides a method for processing two SATA NCQ commands of Read FPDMA queue and Write FPDMA queue in a Device, which can enable the Device to respond to the Register FIS from the Device to the Host corresponding to the received NCQ command in time.
The following is a description of the inventive content in Read FPDMA queue. The invention comprises the following steps:
s1, the Device receives a Read FPDMA queue command with TAG 0, then the Device responds to the Register FIS corresponding to the Device to Host, and adds DMA Setup FIS, Data FIS and Set Device Bits FIS corresponding to the command into a sending queue;
s2, in the process of sequentially executing the sending queue, if the Device receives a Read FPDMA queue command with TAG 1, suspending the sending execution process of the current queue, inserting a Register FIS from the Device to the Host corresponding to the Read FPDMA queue command with TAG 1 into the forefront of the sending queue, and sending the Register FIS from the Device to the Host firstly. Simultaneously, sequentially adding a Read FPDMA queue command with TAG of 1 to the tail end of the sending queue corresponding to DMA Setup FIS, Data FIS and Set Device Bits FIS;
s3, in the process of sequentially executing the transmission queue, if the Device receives a new Read FPDMA queue command, the operation is executed according to the step S2.
The following is a description of the inventive content in Write FPDMA queue. The invention comprises the following steps:
the T1, the Device receives the Write FPDMA queue command with TAG 0, then the Device responds to the corresponding Register FIS from the Device to the Host, and adds the DMA Setup FIS, DMA Activate FIS and Set Device Bits FIS corresponding to the command into the sending queue;
and T2, in the process of sequentially executing the sending queue, if the Device receives a Write FPDMA queue command with TAG 1, suspending the sending execution process of the current queue, inserting a Device-Host Register FIS corresponding to the Write FPDMA queue command with TAG 1 into the forefront of the sending queue, and sending the Device-Host Register FIS to the Host first. Simultaneously, sequentially adding a Write FPDMA queue command with TAG of 1 to the tail end of the sending queue corresponding to DMA Setup FIS, Data FIS and Set Device Bits FIS;
t3, in the same way, in the process of the sending queue executing in sequence, if the Device receives a new Write FPDMA queue command, the operation is executed according to the step T2.
The above description is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, several modifications and variations can be made without departing from the technical principle of the present invention, and these modifications and variations should also be regarded as the protection scope of the present invention.

Claims (2)

1. A SATA NCQ command scheduling method is characterized by comprising the following steps:
s1, the Device receives a Read FPDMA (fast Data memory access) Queued command with TAG 0, then the Device responds to a corresponding Register FIS from the Device to the Host, and adds a DMA Setup FIS, a Data FIS and a Set Device Bits FIS corresponding to the command into a sending queue;
s2, in the process of sequentially executing the sending queue, if the Device receives a Read FPDMA queue command with TAG 1, suspending the sending execution process of the current queue, inserting a Device-Host Register FIS corresponding to the Read FPDMA queue command with TAG 1 into the forefront of the sending queue, and sending the Device-Host Register FIS to the Host first; simultaneously, adding a Read FPDMA queue command with TAG of 1 corresponding to DMA Setup FIS, Data FIS and Set Device Bits FIS to the tail end of the sending queue in sequence;
s3, in the process of sending queue to execute in sequence, if the Device receives new Read FPDMA queue command, then executing according to the operation in step S2.
2. A SATA NCQ command scheduling method is characterized by comprising the following steps:
the T1, the Device receives the Write FPDMA queue command with TAG 0, then the Device responds to the corresponding Device to Host Register FIS, and adds the DMA Setup FIS, DMA Activate FIS and Set Device Bits FIS corresponding to the command into the sending queue;
t2, in the process of sequentially executing the sending queue, if the Device receives the Write FPDMA queue command with TAG 1, suspending the sending execution process of the current queue, inserting the Device-Host Register FIS corresponding to the Write FPDMA queue command with TAG 1 into the forefront of the sending queue, and sending the Device-Host Register FIS to the Host first; simultaneously, sequentially adding a Write FPDMA queue command with TAG of 1 to the tail end of the sending queue, wherein the DMA Setup FIS, the Data FIS and the Set Device Bits FIS correspond to the DMA Setup FIS;
t3, in the same way, in the process of the sending queue executing in sequence, if the Device receives a new Write FPDMA queue command, the operation is executed according to the step T2.
CN202011099189.6A 2020-10-14 2020-10-14 SATA NCQ command scheduling method Active CN112363670B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011099189.6A CN112363670B (en) 2020-10-14 2020-10-14 SATA NCQ command scheduling method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011099189.6A CN112363670B (en) 2020-10-14 2020-10-14 SATA NCQ command scheduling method

Publications (2)

Publication Number Publication Date
CN112363670A true CN112363670A (en) 2021-02-12
CN112363670B CN112363670B (en) 2023-02-03

Family

ID=74506759

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011099189.6A Active CN112363670B (en) 2020-10-14 2020-10-14 SATA NCQ command scheduling method

Country Status (1)

Country Link
CN (1) CN112363670B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090006657A1 (en) * 2007-06-26 2009-01-01 Asad Azam Enabling consecutive command message transmission to different devices
JP2013041547A (en) * 2011-08-19 2013-02-28 Toshiba Corp Information processing apparatus, performance evaluation tool, and performance evaluation tool of external storage device
CN104412218A (en) * 2012-06-19 2015-03-11 株式会社东芝 Storage medium storing control program, method of controlling information processing device, information processing system, and information processing device
CN105224260A (en) * 2015-10-22 2016-01-06 湖南国科微电子股份有限公司 A kind of transmission method of ahci interface and system
CN108595111A (en) * 2018-03-14 2018-09-28 深圳忆联信息系统有限公司 A kind of method and solid state disk promoting solid state disk performance

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090006657A1 (en) * 2007-06-26 2009-01-01 Asad Azam Enabling consecutive command message transmission to different devices
JP2013041547A (en) * 2011-08-19 2013-02-28 Toshiba Corp Information processing apparatus, performance evaluation tool, and performance evaluation tool of external storage device
CN104412218A (en) * 2012-06-19 2015-03-11 株式会社东芝 Storage medium storing control program, method of controlling information processing device, information processing system, and information processing device
CN105224260A (en) * 2015-10-22 2016-01-06 湖南国科微电子股份有限公司 A kind of transmission method of ahci interface and system
CN108595111A (en) * 2018-03-14 2018-09-28 深圳忆联信息系统有限公司 A kind of method and solid state disk promoting solid state disk performance

Also Published As

Publication number Publication date
CN112363670B (en) 2023-02-03

Similar Documents

Publication Publication Date Title
US8751728B1 (en) Storage system bus transfer optimization
CN102171649B (en) Method and system for queuing transfers of multiple non-contiguous address ranges with a single command
US8195894B2 (en) Data processing apparatus of basic input/output system
US20070260756A1 (en) Method for Processing Command via SATA Interface
US11360705B2 (en) Method and device for queuing and executing operation commands on a hard disk
CN102866971A (en) Data transmission device, system and method
CN110941395B (en) Dynamic random access memory, memory management method, system and storage medium
US11010094B2 (en) Task management method and host for electronic storage device
CN110781120B (en) Method for realizing cross-4 KB transmission of AXI bus host equipment
CN105468300A (en) IP hard disc management method and device
US20130275652A1 (en) Methods and structure for transferring additional parameters through a communication interface with limited parameter passing features
TWI696078B (en) Memory device and method for operating the same
US20070083708A1 (en) Controller of redundant arrays of independent disks and operation method thereof
CN101447982A (en) Storage emulator and method thereof
CN112363670B (en) SATA NCQ command scheduling method
KR100843199B1 (en) High speed IDE interface device and method for the same
CN111176566B (en) eMMC read-write control method supporting queue command and storage medium
US20100325373A1 (en) Duplexing Apparatus and Duplexing Control Method
TWI676893B (en) Bridge device and data transferring method
US7831741B2 (en) Indexing device and method for data storage system
LU101773B1 (en) Method for improving sequential read performance of solid-state drive
CN104424124A (en) Memory device, electronic equipment and method for controlling memory device
CN110083311B (en) SSD descriptor-based software and hardware interaction issuing method and system
US20070174504A1 (en) Method and Apparatus for Advanced Technology Attachment Packet Interface Native Command Queuing
US8667188B2 (en) Communication between a computer and a data storage device

Legal Events

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