CN118689827A - Storage expansion system and resource configuration method thereof - Google Patents
Storage expansion system and resource configuration method thereof Download PDFInfo
- Publication number
- CN118689827A CN118689827A CN202310785708.1A CN202310785708A CN118689827A CN 118689827 A CN118689827 A CN 118689827A CN 202310785708 A CN202310785708 A CN 202310785708A CN 118689827 A CN118689827 A CN 118689827A
- Authority
- CN
- China
- Prior art keywords
- pcie
- storage expansion
- expansion
- interfaces
- storage
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 42
- 238000013507 mapping Methods 0.000 claims abstract description 29
- 230000008569 process Effects 0.000 claims abstract description 18
- 230000002093 peripheral effect Effects 0.000 claims description 4
- 238000013468 resource allocation Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 6
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 5
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 5
- PCHJSUWPFVWCPO-UHFFFAOYSA-N gold Chemical compound [Au] PCHJSUWPFVWCPO-UHFFFAOYSA-N 0.000 description 5
- 239000010931 gold Substances 0.000 description 5
- 229910052737 gold Inorganic materials 0.000 description 5
- 238000011144 upstream manufacturing Methods 0.000 description 5
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 1
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 1
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 1
- 230000002411 adverse Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000000060 site-specific infrared dichroism spectroscopy Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4282—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Bus Control (AREA)
- Stored Programmes (AREA)
Abstract
本发明提供一种存储扩充系统与其资源配置方法。PCIe扩充卡适于通过M个接口直接或间接连接N个存储扩充设备。主机设备包括PCIe插槽、快闪存储器以及处理器。快闪存储器用以记录BIOS。处理器执行BIOS以:判断插接于PCIe插槽的PCIe扩充卡的次要厂商识别码与次要设备识别码是否符合BIOS指定的特定识别码;当插接于PCIe插槽的PCIe扩充卡的次要厂商识别码与次要设备识别码符合BIOS指定的次要厂商识别码与次要设备识别码,于列举过程中停止扫描PCIe插槽对应的根桥接器下的任何PCIe装置,并根据扩充支援数量配置存储器对映I/O资源给根桥接器;以及将存储器对映I/O资源分配给PCIe扩充卡的M个接口。借此,可避免热拔插事件导致存储扩充设备无法获取足够存储器对映I/O资源与总线资源。
The present invention provides a storage expansion system and a resource configuration method thereof. A PCIe expansion card is suitable for directly or indirectly connecting N storage expansion devices through M interfaces. A host device includes a PCIe slot, a flash memory and a processor. The flash memory is used to record BIOS. The processor executes BIOS to: determine whether the secondary vendor identification code and the secondary device identification code of the PCIe expansion card plugged into the PCIe slot conform to the specific identification code specified by the BIOS; when the secondary vendor identification code and the secondary device identification code of the PCIe expansion card plugged into the PCIe slot conform to the secondary vendor identification code and the secondary device identification code specified by the BIOS, stop scanning any PCIe device under the root bridge corresponding to the PCIe slot during the enumeration process, and configure the memory mapping I/O resources to the root bridge according to the expansion support quantity; and allocate the memory mapping I/O resources to the M interfaces of the PCIe expansion card. In this way, it can be avoided that the storage expansion device cannot obtain sufficient memory mapping I/O resources and bus resources due to hot plug events.
Description
技术领域Technical Field
本发明涉及一种存储系统,尤其涉及一种存储扩充系统与其资源配置方法。The present invention relates to a storage system, and in particular to a storage expansion system and a resource configuration method thereof.
背景技术Background Art
电脑系统中有各种总线用于将主处理器和其它装置连接起来并相互传输资料。总线不仅可用于耦接主处理器,随机存取快闪存储器(Flash memory)与主存储器(DDR),总线更可用于耦接其他外部设备。目前来说,外设组件互连扩展(Peripheral ComponentInterconnect Express,PCIe)总线已广泛应用于当今市场上的电脑系统中,例如个人电脑或服务器等等。PCIe是一种新开发的工业总线标准,是PCI(Peripheral ComponentInterconnect)的改良。PCIe总线标准是由外设组件互连特别兴趣小组(PeripheralComponent Interconnect Special Interest Group,PCI-SIG)来制定和维护。There are various buses in computer systems that are used to connect the main processor and other devices and transfer data between them. The bus can be used not only to couple the main processor, random access flash memory (Flash memory) and main memory (DDR), but also to couple other external devices. Currently, the Peripheral Component Interconnect Express (PCIe) bus has been widely used in computer systems on the market today, such as personal computers or servers. PCIe is a newly developed industrial bus standard, which is an improvement on PCI (Peripheral Component Interconnect). The PCIe bus standard is developed and maintained by the Peripheral Component Interconnect Special Interest Group (PCI-SIG).
现有的电脑系统可支援一或多个PCIe插槽,好让用户可依照不同需求插入各种接口卡至此些PCIe插槽上,从而扩充电脑系统的功能。目前来说,为了使插接至PCIe插槽的接口卡可以正常运作,电脑系统的基本输入输出系统(BIOS)需要对PCIe资源进行适当的配置。在适当配置PCIe资源的条件下,电脑系统的作业系统才可与PCIe插槽后端的扩充硬件装置进行有效沟通,以使这些扩充硬件装置的功能可以正常发挥。反面来说,当PCIe插槽后端的扩充硬件装置没有分配到适当的PCIe资源(例如因为热插拔行为而无法分配到适当的PCIe资源),则不仅可能导致扩充硬件装置无法发正常功能或传输速度降低,还可能导致电脑系统死机。尤其是,当PCIe插槽后端的扩充硬件装置的串接数目或实际连接时机是不可确定因素时,现有BIOS可能配置不足够的PCIe资源至PCIe插槽,进而导致PCIe插槽后端的扩充硬件装置无法获取适当的PCIe资源的情况发生。Existing computer systems can support one or more PCIe slots, so that users can insert various interface cards into these PCIe slots according to different needs, thereby expanding the functions of the computer system. At present, in order for the interface card plugged into the PCIe slot to operate normally, the basic input and output system (BIOS) of the computer system needs to properly configure the PCIe resources. Under the condition of properly configuring the PCIe resources, the operating system of the computer system can effectively communicate with the expansion hardware devices at the rear end of the PCIe slot so that the functions of these expansion hardware devices can be performed normally. On the other hand, when the expansion hardware device at the rear end of the PCIe slot is not allocated with appropriate PCIe resources (for example, due to hot plugging, the appropriate PCIe resources cannot be allocated), it may not only cause the expansion hardware device to fail to function normally or the transmission speed to decrease, but also cause the computer system to freeze. In particular, when the number of expansion hardware devices connected in series or the actual connection timing behind the PCIe slot are uncertain factors, the existing BIOS may allocate insufficient PCIe resources to the PCIe slot, thereby causing the expansion hardware device behind the PCIe slot to be unable to obtain appropriate PCIe resources.
发明内容Summary of the invention
本发明有关于一种本发明实施例提供一种存储扩充系统与其资源配置方法,可让经由PCIe扩充卡以及PCIe插槽与主机设备相连的存储扩充设备被配置有适当的PCIe资源。The present invention relates to an embodiment of the present invention to provide a storage expansion system and a resource configuration method thereof, which can configure a storage expansion device connected to a host device via a PCIe expansion card and a PCIe slot with appropriate PCIe resources.
本发明实施例提供一种存储扩充系统,其包括(但不仅限于)N个存储扩充设备、PCIe扩充卡,以及主机设备。N为大于0的整数。PCIe扩充卡具有M个接口,并适于通过M个接口直接或间接连接N个存储扩充设备,其中M为大于0的整数。主机设备包括PCIe插槽、快闪存储器,主存储器(DDR)以及处理器。快闪存储器用以记录与存放BIOS。处理器耦接PCIe插槽、主存储器与快闪存储器,并执行BIOS以判断插接于PCIe插槽的PCIe扩充卡的次要厂商识别码与次要设备识别码是否符合BIOS指定的次要厂商识别码与次要设备识别码;当插接于PCIe插槽的PCIe扩充卡的次要厂商识别码与所述次要设备识别码符合BIOS指定的次要厂商识别码与次要设备识别码,于列举(enumeration)过程中停止扫描PCIe插槽对应的根桥接器下的任何PCIe装置,并根据扩充支援数量配置存储器对映输入输出(Memory-mappedInput/Output,MMI/O)资源给根桥接器;以及将存储器对映I/O资源分配给PCIe扩充卡的M个接口。An embodiment of the present invention provides a storage expansion system, which includes (but is not limited to) N storage expansion devices, a PCIe expansion card, and a host device. N is an integer greater than 0. The PCIe expansion card has M interfaces and is suitable for directly or indirectly connecting the N storage expansion devices through the M interfaces, where M is an integer greater than 0. The host device includes a PCIe slot, a flash memory, a main memory (DDR) and a processor. The flash memory is used to record and store BIOS. The processor is coupled to the PCIe slot, the main memory and the flash memory, and executes the BIOS to determine whether the secondary vendor identification code and the secondary device identification code of the PCIe expansion card inserted in the PCIe slot are consistent with the secondary vendor identification code and the secondary device identification code specified by the BIOS; when the secondary vendor identification code and the secondary device identification code of the PCIe expansion card inserted in the PCIe slot are consistent with the secondary vendor identification code and the secondary device identification code specified by the BIOS, stop scanning any PCIe device under the root bridge corresponding to the PCIe slot during the enumeration process, and configure memory-mapped input/output (MMI/O) resources to the root bridge according to the expansion support quantity; and allocate the memory-mapped I/O resources to M interfaces of the PCIe expansion card.
本发明实施例提供一种存储系统的资源配置方法,而此存储扩充系统包括PCIe扩充卡、主机装置与N个存储扩充设备。PCIe扩充卡具有M个接口,主机设备具有PCIe插槽。存储系统的资源配置方法包括(但不仅限于):于BIOS的执行期间,判断插接于PCIe插槽的PCIe扩充卡的次要厂商识别码与所述次要设备识别码是否符合BIOS指定的次要厂商识别码与次要设备识别码;当插接于PCIe插槽的PCIe扩充卡的次要厂商识别码与所述次要设备识别码符合BIOS指定的次要厂商识别码与次要设备识别码,于列举过程中停止扫描PCIe插槽对应的根桥接器下的任何PCIe装置,并根据扩充支援数量配置存储器对映I/O资源给根桥接器;以及将存储器对映I/O资源分配给PCIe扩充卡的M个接口。An embodiment of the present invention provides a method for configuring resources of a storage system, and the storage expansion system includes a PCIe expansion card, a host device, and N storage expansion devices. The PCIe expansion card has M interfaces, and the host device has a PCIe slot. The method for configuring resources of the storage system includes (but is not limited to): during the execution of the BIOS, determining whether the secondary vendor identification code and the secondary device identification code of the PCIe expansion card plugged into the PCIe slot are consistent with the secondary vendor identification code and the secondary device identification code specified by the BIOS; when the secondary vendor identification code and the secondary device identification code of the PCIe expansion card plugged into the PCIe slot are consistent with the secondary vendor identification code and the secondary device identification code specified by the BIOS, stopping scanning any PCIe device under the root bridge corresponding to the PCIe slot during the enumeration process, and configuring the memory mapping I/O resources to the root bridge according to the expansion support quantity; and allocating the memory mapping I/O resources to the M interfaces of the PCIe expansion card.
基于上述,于本发明的实施例中,于BIOS的执行期间,主机设备会判断PCIe插槽是否插接用以连接存储扩充设备的PCIe扩充卡。当PCIe插槽插接此PCIe扩充卡时,可预留足够的存储器对映I/O资源给PCIe插槽对应的根桥接器,并将预留的存储器对映I/O资源向下分配给PCIe扩充卡的M个接口。藉此,无论存储扩充设备的实际连接时机为何,可让与PCIe扩充卡直接或间接相连的存储扩充设备被配置适当的存储器对映I/O资源,以使存储扩充设备可以正常发挥功能。Based on the above, in an embodiment of the present invention, during the execution of BIOS, the host device determines whether the PCIe slot is plugged into a PCIe expansion card for connecting a storage expansion device. When the PCIe slot is plugged into the PCIe expansion card, sufficient memory mapping I/O resources can be reserved for the root bridge corresponding to the PCIe slot, and the reserved memory mapping I/O resources can be distributed downward to the M interfaces of the PCIe expansion card. In this way, regardless of the actual connection timing of the storage expansion device, the storage expansion device directly or indirectly connected to the PCIe expansion card can be configured with appropriate memory mapping I/O resources so that the storage expansion device can function normally.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是依据本发明一实施例的存储扩充系统的示意图;FIG1 is a schematic diagram of a storage expansion system according to an embodiment of the present invention;
图2是依据本发明一实施例的PCIe扩充卡的示意图;FIG2 is a schematic diagram of a PCIe expansion card according to an embodiment of the present invention;
图3A与图3B是依据本发明一实施例的存储扩充系统的资源配置方法的流程图;3A and 3B are flow charts of a resource configuration method of a storage expansion system according to an embodiment of the present invention;
图4是依据本发明一实施例的PCIe拓朴的示意图;FIG4 is a schematic diagram of a PCIe topology according to an embodiment of the present invention;
图5是依据本发明一实施例的传送存在讯号与硬件重置讯号的示意图;5 is a schematic diagram of transmitting a presence signal and a hardware reset signal according to an embodiment of the present invention;
图6是依据本发明一实施例的存储扩充系统的资源配置方法的流程图。FIG. 6 is a flow chart of a resource configuration method of a storage expansion system according to an embodiment of the present invention.
附图标记说明Description of Reference Numerals
10:存储扩充系统;10: Storage expansion system;
110_1~110_N,150,160:存储扩充设备;110_1~110_N, 150, 160: storage expansion equipment;
120:PCIe扩充卡;120: PCIe expansion card;
130:主机设备;130: host device;
DP1_1~DP1_M:接口;DP1_1~DP1_M: interface;
131:PCIe插槽;131: PCIe slot;
132:快闪存储器;132: flash memory;
133:处理器;133: processor;
134:主存储器;134: main memory;
B1:基本输入输出系统;B1: Basic Input and Output System;
S_1~S_P:存储装置;S_1~S_P: storage device;
121:金手指;121: Gold Finger;
RB1:根桥接器;RB1: root bridge;
DP4_1,DP2_1,DP3_1,DP5_1:下行接口;DP4_1, DP2_1, DP3_1, DP5_1: Downstream interface;
P1~P6:针脚;P1~P6: pins;
UP1~UP2:上行接口;UP1~UP2: Uplink interface;
R1,R2:硬件重置讯号;R1, R2: Hardware reset signal;
NP1,NP2:存在讯号;NP1, NP2: signal exists;
S302~S346、S602~S606:步骤。S302~S346, S602~S606: steps.
具体实施方式DETAILED DESCRIPTION
现将详细地参考本发明的示范性实施例,示范性实施例的实例说明于附图中。只要有可能,相同组件符号在附图和描述中用来表示相同或相似部分。Reference will now be made in detail to exemplary embodiments of the present invention, examples of which are illustrated in the accompanying drawings. Whenever possible, the same reference numerals are used in the drawings and the description to refer to the same or like parts.
图1是依据本发明一实施例的存储系统的方块图。请参照图1,存储扩充系统10包括N个存储扩充设备110_1~110_N、PCIe扩充卡120,以及主机设备130。N为大于0的整数。FIG1 is a block diagram of a storage system according to an embodiment of the present invention. Referring to FIG1 , the storage expansion system 10 includes N storage expansion devices 110_1 to 110_N, a PCIe expansion card 120, and a host device 130. N is an integer greater than 0.
PCIe扩充卡120可实施为包括PCIe交换器(switch)的接口卡。PCIe扩充卡120具有M个接口DP1_1~DP1_M。PCIe扩充卡120适于通过M个接口DP1_1~DP1_M直接或间接连接N个存储扩充设备110_1~110_N,其中M为大于0的整数。更具体而言,M个接口DP1_1~DP1_M可为支援PCIe标准的下行接口(downstream port)。此外,PCIe扩充卡120还可包括用以连接至PCIe插槽131的上行接口(upstream port)。The PCIe expansion card 120 may be implemented as an interface card including a PCIe switch. The PCIe expansion card 120 has M interfaces DP1_1 to DP1_M. The PCIe expansion card 120 is suitable for directly or indirectly connecting N storage expansion devices 110_1 to 110_N through the M interfaces DP1_1 to DP1_M, where M is an integer greater than 0. More specifically, the M interfaces DP1_1 to DP1_M may be downstream ports supporting the PCIe standard. In addition, the PCIe expansion card 120 may also include an upstream port for connecting to the PCIe slot 131.
举例而言,图2是依据本发明一实施例的PCIe扩充卡的示意图。请参照图2,以M=2为范例说明,PCIe扩充卡120可具有两个接口DP1_1~DP1_2与支援PCIe标准的金手指121。本发明对金手指121的PCIe通道数并不限制。金手指121适于插入主机设备130的PCIe插槽131中。另外,接口DP1_1~DP1_2用来分别经由缆线直接连接至对应的存储扩充设备。For example, FIG. 2 is a schematic diagram of a PCIe expansion card according to an embodiment of the present invention. Referring to FIG. 2 , taking M=2 as an example, a PCIe expansion card 120 may have two interfaces DP1_1-DP1_2 and a gold finger 121 supporting the PCIe standard. The present invention does not limit the number of PCIe channels of the gold finger 121. The gold finger 121 is suitable for being inserted into a PCIe slot 131 of a host device 130. In addition, the interfaces DP1_1-DP1_2 are used to directly connect to corresponding storage expansion devices via cables.
值得一提的是,PCIe扩充卡120可直接或间接连接N个存储扩充设备110_1~110_N。如图1的范例所示,存储扩充设备110_1可直接连接至PCIe扩充卡120的接口DP1_1。存储扩充设备110_N可直接连接至PCIe扩充卡120的接口DP1_2。须注意的是,于本发明实施例中,N个存储扩充设备110_1~110_N具有彼此串接的功能。如图2范例所示,存储扩充设备110_2可串接于存储扩充设备110_1,以使存储扩充设备110_2间接连接至PCIe扩充卡120的接口DP1_1。然而,图1中存储扩充设备110_1~110_N的连接方式仅为示范性说明,并非用以限定本发明,It is worth mentioning that the PCIe expansion card 120 can directly or indirectly connect to N storage expansion devices 110_1~110_N. As shown in the example of Figure 1, the storage expansion device 110_1 can be directly connected to the interface DP1_1 of the PCIe expansion card 120. The storage expansion device 110_N can be directly connected to the interface DP1_2 of the PCIe expansion card 120. It should be noted that in an embodiment of the present invention, the N storage expansion devices 110_1~110_N have the function of being connected in series with each other. As shown in the example of Figure 2, the storage expansion device 110_2 can be connected in series to the storage expansion device 110_1, so that the storage expansion device 110_2 is indirectly connected to the interface DP1_1 of the PCIe expansion card 120. However, the connection method of the storage expansion devices 110_1~110_N in Figure 1 is only an exemplary description and is not used to limit the present invention.
于一些实施例中,存储扩充设备110_1~110_N可实施为磁盘簇(Just aBunch OfDisks,JBOD)装置,其可包括P个存储装置S_1~S_P。P为大于0的整数。存储装置S_1~S_P例如为固态硬盘(Solid State Drive,SSD)或/与硬式磁盘(Hard Disk Drive,HDD),本发明对此不限制。各个存储扩充设备110_1~110_N可包括用以连接上一级装置(即PCIe扩充卡120或其他存储扩充设备)且支援PCIe标准的上行接口,以及包括用以连接下一级装置(即其他存储扩充设备)与存储装置S_1~S_P且支援PCIe标准的下行接口。于一些实施例中,由于各个存储扩充设备110_1~110_N可包括用以连接下一级装置(即其他存储扩充设备)的下行接口,因此存储扩充设备110_1~110_N可透过缆线彼此串接。举例而言,存储扩充设备110_1~110_N可支援菊链式串接(Daisy-chain)。In some embodiments, the storage expansion devices 110_1-110_N may be implemented as a Just a Bunch Of Disks (JBOD) device, which may include P storage devices S_1-S_P. P is an integer greater than 0. The storage devices S_1-S_P are, for example, solid state drives (SSD) and/or hard disk drives (HDD), but the present invention is not limited thereto. Each storage expansion device 110_1-110_N may include an upstream interface for connecting to an upper-level device (i.e., a PCIe expansion card 120 or other storage expansion device) and supporting the PCIe standard, and a downstream interface for connecting to a lower-level device (i.e., other storage expansion devices) and the storage devices S_1-S_P and supporting the PCIe standard. In some embodiments, since each storage expansion device 110_1-110_N may include a downstream interface for connecting to a lower-level device (ie, other storage expansion devices), the storage expansion devices 110_1-110_N may be connected in series via cables. For example, the storage expansion devices 110_1-110_N may support daisy-chain connection.
主机设备130包括PCIe插槽131、快闪存储器132、处理器133,以及主存储器134。于一些实施例中,主机设备130可实施为网路附接存储(Network Attached Storage,NAS)装置或其他种类的电脑系统。具有PCIe金手指的接口卡(例如PCIe扩充卡或其他种类的扩充卡)可插接于PCIe插槽131。本发明对PCIe插槽131的PCIe通道数并不限制。The host device 130 includes a PCIe slot 131, a flash memory 132, a processor 133, and a main memory 134. In some embodiments, the host device 130 can be implemented as a network attached storage (NAS) device or other types of computer systems. An interface card with a PCIe gold finger (such as a PCIe expansion card or other types of expansion cards) can be plugged into the PCIe slot 131. The present invention does not limit the number of PCIe channels of the PCIe slot 131.
快闪存储器132(flash memory)用以记录与存放基本输入输出系统(BIOS)B1。BIOS B1是在主机设备130启动后,于启动程序中所使用的固件。此外,主机设备130具有处理器133可存取的主存储器134(DDR)或其他存储器元件。The flash memory 132 is used to record and store the basic input and output system (BIOS) B1. The BIOS B1 is a firmware used in the boot process after the host device 130 is booted. In addition, the host device 130 has a main memory 134 (DDR) or other memory elements that can be accessed by the processor 133.
处理器133耦接PCIe插槽131与快闪存储器132,其可以是中央处理单元(CentralProcessing Unit,CPU)、通用处理器或其他类似元件或上述元件的组合。处理器133可执行记录(存放)于快闪存储器132中的BIOS B1与作业系统,以实现本发明实施例中的资源配置方法。The processor 133 is coupled to the PCIe slot 131 and the flash memory 132, and can be a central processing unit (CPU), a general purpose processor, or other similar components or a combination of the above components. The processor 133 can execute the BIOS B1 and the operating system recorded (stored) in the flash memory 132 to implement the resource configuration method in the embodiment of the present invention.
于一些实施例中,于BIOS的执行期间,处理器133可判断PCIe插槽131是否插接用以连接N个存储扩充设备110_1~110_N的PCIe扩充卡120。当PCIe插槽131插接PCIe扩充卡120,处理器133于列举(enumeration)过程中停止扫描PCIe插槽131对应的根桥接器下的任何PCIe装置,并根据扩充支援数量配置存储器对映I/O资源给根桥接器。In some embodiments, during the execution of the BIOS, the processor 133 may determine whether the PCIe slot 131 is plugged with a PCIe expansion card 120 for connecting the N storage expansion devices 110_1-110_N. When the PCIe slot 131 is plugged with a PCIe expansion card 120, the processor 133 stops scanning any PCIe device under the root bridge corresponding to the PCIe slot 131 during the enumeration process, and allocates memory mapping I/O resources to the root bridge according to the expansion support quantity.
也就是说,在没有对描PCIe插槽131对应的根桥接器下的PCIe装置进行扫描的情况,处理器133可直接根据扩充支援数量预留足够的存储器对映I/O资源给PCIe插槽131对应的根桥接器。接着,处理器133可将存储器对映I/O资源分配给PCIe扩充卡120的M个接口DP1_1~DP1_M,以使连接PCIe扩充卡120的各个存储扩充设备110_1~110_N可顺利获取配置给此根桥接器的存储器对映I/O资源的一部分。That is, in the case where the PCIe device under the root bridge corresponding to the PCIe slot 131 is not scanned, the processor 133 can directly reserve sufficient memory mapping I/O resources for the root bridge corresponding to the PCIe slot 131 according to the expansion support quantity. Then, the processor 133 can allocate the memory mapping I/O resources to the M interfaces DP1_1~DP1_M of the PCIe expansion card 120, so that each storage expansion device 110_1~110_N connected to the PCIe expansion card 120 can successfully obtain a part of the memory mapping I/O resources configured for this root bridge.
于一些实施例中,上述的存储器对映I/O资源可为存储器映射输入输出(memorymapped input/output,MMI/O)空间。此外,除了存储器对映I/O资源,处理器133还可预先配置足够的总线资源给PCIe插槽131对应的根桥接器,以使连接PCIe扩充卡120的各个存储扩充设备110_1~110_N可顺利获取配置给此根桥接器的总线资源的一部分。以下将列举实施例来清楚说明。In some embodiments, the memory-mapped I/O resources may be memory-mapped input/output (MMI/O) space. In addition to the memory-mapped I/O resources, the processor 133 may also pre-configure sufficient bus resources to the root bridge corresponding to the PCIe slot 131, so that each storage expansion device 110_1 to 110_N connected to the PCIe expansion card 120 may successfully obtain a portion of the bus resources configured for the root bridge. The following examples are listed to clearly illustrate.
图3A与图3B是依据本发明一实施例的存储扩充系统的资源配置方法的流程图。请参照图3A与图3B,本实施例的方法可由图1的存储扩充系统10执行,以下即搭配图1所示的元件说明图3A与图3B各步骤的细节。3A and 3B are flow charts of a method for resource allocation of a storage expansion system according to an embodiment of the present invention. Referring to FIG3A and FIG3B , the method of this embodiment can be executed by the storage expansion system 10 of FIG1 , and the following will describe the details of each step of FIG3A and FIG3B with the components shown in FIG1 .
于步骤S302,主机设备130上电(power on),且处理器133开始执行BIOS B1。于步骤S304,处理器133开始执行BIOS B1中的PCI总线驱动(PCI bus driver)。于步骤S306,处理器133于列举过程中检查多个根桥接器后端的PCIe装置。这些根桥接器包括对应于PCIe插槽131的根桥接器。PCIe的列举过程用以建构PCIe拓朴与配置PCIe资源(亦即MMI/O空间或总线号)给PCIe装置。于此,PCIe装置可包括PCIe端点装置、PCIe桥接器或PCIe交换器等等。In step S302, the host device 130 is powered on, and the processor 133 starts to execute BIOS B1. In step S304, the processor 133 starts to execute the PCI bus driver in BIOS B1. In step S306, the processor 133 checks the PCIe devices behind multiple root bridges during the enumeration process. These root bridges include the root bridge corresponding to the PCIe slot 131. The PCIe enumeration process is used to construct the PCIe topology and allocate PCIe resources (i.e., MMI/O space or bus number) to the PCIe devices. Here, the PCIe device may include a PCIe endpoint device, a PCIe bridge, or a PCIe switch, etc.
于步骤S308,处理器133判断插接于PCIe插槽131的PCIe扩充卡120的次要厂商识别码与次要设备识别码是否符合BIOS B1指定的次要厂商识别码与次要设备识别码。详细来说,处理器133可判断PCIe扩充卡120中的寄存器(Standard registers of PCIConfiguration Space Header)中次要厂商识别码(Subsystem Identification,SSID)或/与次要设备识别码(Subsystem Vendor Identification,SVID)是否符合BIOS设定的特定识别码,以判断PCIe插槽131是否插接适于连接N个存储扩充设备110_1~110_N的PCIe扩充卡120。换言之,处理器133不仅判断是否有接口卡插入PCIe插槽131,更透过次要厂商识别码与所述次要设备识别码判断插接至PCIe插槽131的接口卡的种类。任何支援PCIe的接口卡(包括PCIe扩充卡120)皆可插接至PCIe插槽131。In step S308, the processor 133 determines whether the secondary vendor identification code and the secondary device identification code of the PCIe expansion card 120 inserted into the PCIe slot 131 conform to the secondary vendor identification code and the secondary device identification code specified by BIOS B1. Specifically, the processor 133 can determine whether the secondary vendor identification code (SSID) or/and the secondary device identification code (SVID) in the register (Standard registers of PCI Configuration Space Header) of the PCIe expansion card 120 conform to the specific identification code set by BIOS, so as to determine whether the PCIe slot 131 is inserted with the PCIe expansion card 120 suitable for connecting the N storage expansion devices 110_1 to 110_N. In other words, the processor 133 not only determines whether an interface card is inserted into the PCIe slot 131, but also determines the type of the interface card inserted into the PCIe slot 131 through the secondary vendor identification code and the secondary device identification code. Any interface card supporting PCIe (including the PCIe expansion card 120 ) can be plugged into the PCIe slot 131 .
若步骤S308判断为是,于步骤S310,当插接于PCIe插槽131的PCIe扩充卡120的次要厂商识别码与次要设备识别码符合BIOS B1指定的次要厂商识别码与次要设备识别码,处理器133于列举过程中停止扫描PCIe插槽131对应的根桥接器下的任何PCIe装置,并根据扩充支援数量配置存储器对映I/O资源给PCIe插槽131对应的根桥接器。也就是说,当PCIe插槽131插接用以连接N个存储扩充设备110_1~110_N的PCIe扩充卡120时,处理器133并不会向下扫描串接于PCIe插槽131后端的任何PCIe装置,但可预留与直接配置存储器对映I/O资源给PCIe插槽131对应的根桥接器。If the judgment in step S308 is yes, in step S310, when the secondary vendor ID and the secondary device ID of the PCIe expansion card 120 inserted into the PCIe slot 131 match the secondary vendor ID and the secondary device ID specified by BIOS B1, the processor 133 stops scanning any PCIe device under the root bridge corresponding to the PCIe slot 131 during the enumeration process, and configures the memory mapping I/O resources to the root bridge corresponding to the PCIe slot 131 according to the expansion support quantity. In other words, when the PCIe expansion card 120 for connecting N storage expansion devices 110_1 to 110_N is inserted into the PCIe slot 131, the processor 133 does not scan down any PCIe device serially connected to the back end of the PCIe slot 131, but can reserve and directly configure the memory mapping I/O resources to the root bridge corresponding to the PCIe slot 131.
于步骤S312,处理器133将MMI/O空间的位址范围写入PCIe插槽131对应的根桥接器的寄存器中。关于将MMI/O空间的位址范围写入根桥接器的寄存器的详细操作已经规定于PCIe标准。具体来说,处理器133可将MMI/O空间的起始位址写入PCIe插槽131对应的根桥接器的配置空间中的内存基底寄存器(memory base register),并可将MMI/O空间的结束位址写入PCIe插槽131对应的根桥接器的配置空间中的内存限制寄存器(memory limitregister)。In step S312, the processor 133 writes the address range of the MMI/O space into the register of the root bridge corresponding to the PCIe slot 131. The detailed operation of writing the address range of the MMI/O space into the register of the root bridge has been specified in the PCIe standard. Specifically, the processor 133 may write the starting address of the MMI/O space into the memory base register in the configuration space of the root bridge corresponding to the PCIe slot 131, and may write the ending address of the MMI/O space into the memory limit register in the configuration space of the root bridge corresponding to the PCIe slot 131.
为使本发明的概念更易于理解,请参照图4,其是依据本发明一实施例的PCIe拓朴的示意图。于图4的范例中,为使本发明的概念更易于理解,以M=2且N=2为范例进行说明,但本发明不限制于此。To make the concept of the present invention easier to understand, please refer to FIG. 4, which is a schematic diagram of a PCIe topology according to an embodiment of the present invention. In the example of FIG. 4, to make the concept of the present invention easier to understand, M=2 and N=2 are used as an example for description, but the present invention is not limited thereto.
PCIe插槽131对应至根桥接器RB1,此根桥接器RB1连接至PCIe插槽131的下行接口DP4_1。PCIe插槽131经由下行接口DP4_1连接至PCIe扩充卡120。PCIe扩充卡120后端串接有存储扩充设备110_1、110_2。存储扩充设备110_2可串接至存储扩充设备110_1的下行接口DP2_1,而间接连接至PCIe扩充卡120的接口DP1_1。相似的,存储扩充设备110_2亦具有用以连接至其他存储扩充设备的下行接口DP3_1。于列举过程中,当处理器133发现PCIe扩充卡120插接于PCIe插槽131中,处理器133将不依循深度优先顺序而停止继续向下扫描PCIe插槽131后端的其他PCIe装置。亦即,处理器133不向下扫描PCIe扩充卡120与存储扩充设备110_1、110_2。并且,处理器133可根据扩充支援数量配置足够的MMI/O空间给根桥接器RB1。The PCIe slot 131 corresponds to the root bridge RB1, which is connected to the downstream interface DP4_1 of the PCIe slot 131. The PCIe slot 131 is connected to the PCIe expansion card 120 via the downstream interface DP4_1. The storage expansion devices 110_1 and 110_2 are serially connected to the rear end of the PCIe expansion card 120. The storage expansion device 110_2 can be serially connected to the downstream interface DP2_1 of the storage expansion device 110_1, and indirectly connected to the interface DP1_1 of the PCIe expansion card 120. Similarly, the storage expansion device 110_2 also has a downstream interface DP3_1 for connecting to other storage expansion devices. During the enumeration process, when the processor 133 finds that the PCIe expansion card 120 is plugged into the PCIe slot 131, the processor 133 will not follow the depth-first order and stop scanning other PCIe devices at the rear end of the PCIe slot 131. That is, the processor 133 does not scan the PCIe expansion card 120 and the storage expansion devices 110_1 and 110_2. In addition, the processor 133 can allocate enough MMI/O space to the root bridge RB1 according to the expansion support quantity.
于一些实施例中,上述的扩充支援数量为N个存储扩充设备110_1~110_N的最大串接数量。亦即,最大串接数量代表PCIe扩充卡120最多可以串接几台存储扩充设备。最大串接数量可以为预设数值,此预设数值可视实际需求来设计,本发明对此不限制。举例而言,假设PCIe扩充卡120可设计为最多串接16台存储扩充设备110_1~110_16,则扩充支援数量为16。在此情况下,处理器133可配置足够16台存储扩充设备110_1~110_16使用的存储器对映I/O资源至PCIe插槽131对应的根桥接器。举例而言,假设一台存储扩充设备需要Abyte的MMI/O空间,则处理器133可配置至少16*A byte的MMI/O空间至PCIe插槽131对应的根桥接器RB1。处理器133可将16*Abyte的MMI/O空间记录于根桥接器RB1的配置空间中的内存基底寄存器(memory base register)与内存限制寄存器(memory limit register)。In some embodiments, the above expansion support quantity is the maximum serial connection quantity of N storage expansion devices 110_1~110_N. That is, the maximum serial connection quantity represents the maximum number of storage expansion devices that can be serially connected to the PCIe expansion card 120. The maximum serial connection quantity can be a preset value, and this preset value can be designed according to actual needs, and the present invention is not limited to this. For example, assuming that the PCIe expansion card 120 can be designed to serially connect up to 16 storage expansion devices 110_1~110_16, the expansion support quantity is 16. In this case, the processor 133 can configure memory mapping I/O resources sufficient for 16 storage expansion devices 110_1~110_16 to the root bridge corresponding to the PCIe slot 131. For example, assuming that a storage expansion device requires Abyte of MMI/O space, the processor 133 can configure at least 16*A byte of MMI/O space to the root bridge RB1 corresponding to the PCIe slot 131. The processor 133 may record the 16*Abyte MMI/O space in a memory base register and a memory limit register in the configuration space of the root bridge RB1 .
另一方面,若步骤S308判断为否,于步骤S316,处理器133扫描根桥接器后端的所有PCIe装置,并计算根桥接器需要的MMI/O空间与总线资源。也就是说,当PCIe插槽131是插接其他接口卡,处理器133可按深度优先顺序来扫描根桥接器后端的所有PCIe装置,并计算根桥接器后端的所有PCIe装置所需要的MMI/O空间与总线资源。On the other hand, if the determination result of step S308 is no, in step S316, the processor 133 scans all PCIe devices at the back end of the root bridge and calculates the MMI/O space and bus resources required by the root bridge. That is, when the PCIe slot 131 is plugged with other interface cards, the processor 133 can scan all PCIe devices at the back end of the root bridge in a depth-first order and calculate the MMI/O space and bus resources required by all PCIe devices at the back end of the root bridge.
于步骤S318,处理器133将根桥接器需要的总线资源写入至根桥接器的寄存器中。关于将总线资源写入根桥接器的寄存器的详细操作已经规定于PCIe标准。具体来说,处理器133可将根桥接器需要的总线资源写入至根桥接器的配置空间中的下属总线号寄存器(Subordinate bus number register)以及次要总线号寄存器(Secondary bus numberregister)。之后,于步骤S320,处理器133将MMI/O空间的位址范围写入根桥接器的寄存器中。于步骤S322,处理器133将MMI/O空间的位址范围写入其他接口卡的寄存器。具体而言,处理器133可将MMI/O空间的位址范围写入至其他接口卡的基址寄存器(Base addressregister,BAR)中。In step S318, the processor 133 writes the bus resources required by the root bridge into the register of the root bridge. The detailed operation of writing the bus resources into the register of the root bridge has been specified in the PCIe standard. Specifically, the processor 133 can write the bus resources required by the root bridge into the subordinate bus number register (Subordinate bus number register) and the secondary bus number register (Secondary bus number register) in the configuration space of the root bridge. Thereafter, in step S320, the processor 133 writes the address range of the MMI/O space into the register of the root bridge. In step S322, the processor 133 writes the address range of the MMI/O space into the registers of other interface cards. Specifically, the processor 133 can write the address range of the MMI/O space into the base address register (Base address register, BAR) of other interface cards.
由此可知,步骤S316至步骤S322即为针对一般其他接口卡实施的步骤,其更详细操作内容可参照PCIe标准。须注意的是,步骤S310至步骤S312是为针对用以可串接多台存储扩充设备的PCIe扩充卡120实施的步骤。It can be seen that steps S316 to S322 are steps implemented for other common interface cards, and the detailed operation contents can refer to the PCIe standard. It should be noted that steps S310 to S312 are steps implemented for the PCIe expansion card 120 that can connect multiple storage expansion devices in series.
之后,于步骤S314,处理器133判断是否列举到最后PCIe装置。若步骤S314判断为否,回到步骤S306,处理器133继续对下一个根桥接器进行扫描操作。若步骤S314判断为是,于步骤S324,处理器133结束执行BIOS B1中的PCI总线驱动。于步骤S326,处理器133开始执行BIOS B1中的存储扩充装置驱动。Afterwards, in step S314, the processor 133 determines whether the last PCIe device is enumerated. If the determination in step S314 is no, the process returns to step S306, and the processor 133 continues to scan the next root bridge. If the determination in step S314 is yes, in step S324, the processor 133 ends the execution of the PCI bus driver in BIOS B1. In step S326, the processor 133 starts the execution of the storage expansion device driver in BIOS B1.
接着,请参照图3B,于步骤S328,处理器133判断插接于PCIe插槽131的PCIe扩充卡120的次要厂商识别码与次要设备识别码是否符合BIOS B1指定的次要厂商识别码与次要设备识别码。若步骤S328判断为否,于步骤S330,处理器133结束执行BIOS B1中的存储扩充装置驱动。于步骤S332,处理器133启动作业系统。Next, referring to FIG. 3B , in step S328, the processor 133 determines whether the secondary vendor ID and the secondary device ID of the PCIe expansion card 120 plugged into the PCIe slot 131 match the secondary vendor ID and the secondary device ID specified by BIOS B1. If the determination in step S328 is no, in step S330, the processor 133 ends executing the storage expansion device driver in BIOS B1. In step S332, the processor 133 starts the operating system.
另一方面,若步骤S328判断为是,于步骤S334,处理器133收集PCIe插槽131对应的根桥接器的相关信息。于步骤S336,当PCIe插槽131插接PCIe扩充卡120,处理器133在列举过程完毕之后计算一可用总线数量。换言之,在列举过程完毕之后,处理器133可计算剩余可用的总线数量与总线号。基于PCIe标准支持最多256条总线,总线数量最大值为256,其分别可对应为总线号”0”至总线号”255”。假设在列举过程完毕之后,已经有j条总线被使用,则还剩下256-j条可以配置给PCIe插槽131对应的根桥接器。On the other hand, if the judgment in step S328 is yes, in step S334, the processor 133 collects the relevant information of the root bridge corresponding to the PCIe slot 131. In step S336, when the PCIe slot 131 is plugged with the PCIe expansion card 120, the processor 133 calculates the number of available buses after the enumeration process is completed. In other words, after the enumeration process is completed, the processor 133 can calculate the number of remaining available buses and bus numbers. Based on the PCIe standard supporting up to 256 buses, the maximum number of buses is 256, which can correspond to bus numbers "0" to "255" respectively. Assuming that after the enumeration process is completed, j buses have been used, there are 256-j buses left that can be configured to the root bridge corresponding to the PCIe slot 131.
于步骤S338,在分配总线资源与存储器对映I/O资源给PCIe扩充卡的所述M个接口之前,处理器133可清除N个存储扩充设备110_1~110_N上的资源配置设定。进一步来说,为了确保可将正确地资源配置设定写入N个存储扩充设备110_1~110_N的配置空间中,处理器133可先清除N个存储扩充设备110_1~110_N的配置空间中的资源配置设定。像是,处理器133可先清除N个存储扩充设备110_1~110_N的配置空间中基址寄存器(Base addressregister,BAR)的记录值。In step S338, before allocating bus resources and memory-mapped I/O resources to the M interfaces of the PCIe expansion card, the processor 133 may clear resource configuration settings on the N storage expansion devices 110_1 to 110_N. Specifically, in order to ensure that the correct resource configuration settings can be written into the configuration spaces of the N storage expansion devices 110_1 to 110_N, the processor 133 may first clear the resource configuration settings in the configuration spaces of the N storage expansion devices 110_1 to 110_N. For example, the processor 133 may first clear the record value of the base address register (BAR) in the configuration spaces of the N storage expansion devices 110_1 to 110_N.
于步骤S340,处理器133根据可用总线数量与扩充支援数量配置总线资源给PCIe扩充卡120对应的根桥接器,并将总线资源分配给PCIe扩充卡120的M个接口DP1_1~DP1_M。如同前述,扩充支援数量可为N个存储扩充设备110_1~110_N的最大串接数量。举例而言,假设一台存储扩充设备需要B个总线号且扩充支援数量为16,则处理器133可配置至少16*B个总线号至PCIe插槽131对应的根桥接器。由此可知,即便PCIe扩充卡120后方没有串接任何存储扩充设备,处理器133依然依据扩充支援数量配置存储器对映I/O资源与总线资源至PCIe扩充卡120对应的根桥接器。接着,处理器133会将配置给PCIe扩充卡120对应的根桥接器的总线资源分配给PCIe扩充卡120的M个接口DP1_1~DP1_M。之后,于步骤S342,处理器133将配置给PCIe扩充卡120对应的根桥接器的MMI/O空间分配给PCIe扩充卡120的M个接口DP1_1~DP1_M。In step S340, the processor 133 configures bus resources to the root bridge corresponding to the PCIe expansion card 120 according to the number of available buses and the expansion support number, and allocates the bus resources to the M interfaces DP1_1~DP1_M of the PCIe expansion card 120. As mentioned above, the expansion support number can be the maximum serial connection number of N storage expansion devices 110_1~110_N. For example, assuming that a storage expansion device requires B bus numbers and the expansion support number is 16, the processor 133 can configure at least 16*B bus numbers to the root bridge corresponding to the PCIe slot 131. It can be seen that even if there is no storage expansion device connected in series behind the PCIe expansion card 120, the processor 133 still configures the memory mapping I/O resources and bus resources to the root bridge corresponding to the PCIe expansion card 120 according to the expansion support number. Next, the processor 133 allocates the bus resources of the root bridge corresponding to the PCIe expansion card 120 to the M interfaces DP1_1-DP1_M of the PCIe expansion card 120. Afterwards, in step S342, the processor 133 allocates the MMI/O space of the root bridge corresponding to the PCIe expansion card 120 to the M interfaces DP1_1-DP1_M of the PCIe expansion card 120.
于一些实施例中,处理器133可将存储器对映I/O资源平均分配给PCIe扩充卡120的M个接口DP1_1~DP1_M,其中各M个接口DP1_1~DP1_M获取存储器对映I/O资源的M分之一。此外,处理器133可将总线资源平均分配给PCIe扩充卡120的M个接口DP1_1~DP1_M,其中各M个接口DP1_1~DP1_M获取总线资源的M分之一。举例而言,假设处理器133配置16*B个总线号与16*A byte的MMI/O空间给PCIe扩充卡120对应的根桥接器,处理器133可分配16*B/M个总线号与16*A/M byte的MMI/O空间给各个接口DP1_1~DP1_M。或者,于另一些实施例中,处理器133可将总线资源与存储器对映I/O资源不平均分配给PCIe扩充卡120的M个接口DP1_1~DP1_M。亦即,各个接口DP1_1~DP1_M获取的总线资源与存储器对映I/O资源的数量可以不相同。In some embodiments, the processor 133 may evenly distribute the memory-mapped I/O resources to the M interfaces DP1_1 to DP1_M of the PCIe expansion card 120, wherein each of the M interfaces DP1_1 to DP1_M obtains one-Mth of the memory-mapped I/O resources. In addition, the processor 133 may evenly distribute the bus resources to the M interfaces DP1_1 to DP1_M of the PCIe expansion card 120, wherein each of the M interfaces DP1_1 to DP1_M obtains one-Mth of the bus resources. For example, assuming that the processor 133 configures 16*B bus numbers and 16*A bytes of MMI/O space to the root bridge corresponding to the PCIe expansion card 120, the processor 133 may allocate 16*B/M bus numbers and 16*A/M bytes of MMI/O space to each interface DP1_1 to DP1_M. Alternatively, in some other embodiments, the processor 133 may unequally distribute bus resources and memory-mapped I/O resources to the M interfaces DP1_1-DP1_M of the PCIe expansion card 120. That is, the number of bus resources and memory-mapped I/O resources obtained by each interface DP1_1-DP1_M may be different.
为使本发明的概念更易于理解,请再参照图4。在处理器133根据扩充支援数量将MMI/O空间与总线资源直接配置给根桥接器RB1之后,处理器133可将配置给根桥接器RB1的MMI/O空间与总线资源分配给接口DP1_1、DP1_2。处理器133可将MMI/O空间与总线资源对称分配给接口DP1_1、DP1_2,以使接口DP1_1、DP1_2被配置相同的MMI/O空间与总线资源。举例来说,假设处理器133将X byte的MMI/O空间与Y个总线号直接配置给根桥接器RB1,接口DP1_1、DP1_2可分别获取X/2byte的MMI/O空间与Y/2个总线号。或者,处理器133可将MMI/O空间与总线资源不对称分配给接口DP1_1、DP1_2,以使接口DP1_1、DP1_2被配置相异的MMI/O空间与总线资源。举例来说,假设处理器133将X byte的MMI/O空间与Y个总线号直接配置给根桥接器RB1,接口DP1_1可获取k byte的MMI/O空间与q个总线号,而接口DP1_1可获取(X-k)byte的MMI/O空间与(Y-q)个总线号。To make the concept of the present invention easier to understand, please refer to FIG. 4 again. After the processor 133 directly allocates the MMI/O space and bus resources to the root bridge RB1 according to the expansion support quantity, the processor 133 may allocate the MMI/O space and bus resources allocated to the root bridge RB1 to the interfaces DP1_1 and DP1_2. The processor 133 may symmetrically allocate the MMI/O space and bus resources to the interfaces DP1_1 and DP1_2, so that the interfaces DP1_1 and DP1_2 are allocated the same MMI/O space and bus resources. For example, assuming that the processor 133 directly allocates X bytes of MMI/O space and Y bus numbers to the root bridge RB1, the interfaces DP1_1 and DP1_2 may respectively obtain X/2 bytes of MMI/O space and Y/2 bus numbers. Alternatively, the processor 133 may allocate the MMI/O space and bus resources to the interfaces DP1_1 and DP1_2 asymmetrically, so that the interfaces DP1_1 and DP1_2 are configured with different MMI/O spaces and bus resources. For example, assuming that the processor 133 directly allocates X bytes of MMI/O space and Y bus numbers to the root bridge RB1, the interface DP1_1 may obtain k bytes of MMI/O space and q bus numbers, and the interface DP1_2 may obtain (X-k) bytes of MMI/O space and (Y-q) bus numbers.
之后,于步骤S344,处理器133结束执行BIOS B1中的存储扩充装置驱动。于步骤S346,处理器133启动作业系统OS。在启动作业系统之后,处理器133执行OS指令可将接口DP1_1~DP1_M各自获取的存储器对映I/O资源与总线资源配置给存储扩充设备110_1~110_N。举例来说,请再参照图4,在启动作业系统之后,处理器133执行OS指令可将接口DP1_1获取的MMI/O空间与总线号分配给存储扩充设备110_1、110_2。Afterwards, in step S344, the processor 133 ends executing the storage expansion device driver in BIOS B1. In step S346, the processor 133 starts the operating system OS. After starting the operating system, the processor 133 executes OS instructions to allocate the memory mapping I/O resources and bus resources obtained by the interfaces DP1_1 to DP1_M to the storage expansion devices 110_1 to 110_N. For example, referring to FIG. 4 again, after starting the operating system, the processor 133 executes OS instructions to allocate the MMI/O space and bus number obtained by the interface DP1_1 to the storage expansion devices 110_1 and 110_2.
须特别说明的是,处理器133执行BIOS指令已经预先配置足够的存储器对映I/O资源与总线资源给PCIe插槽131对应的根桥接器,并将配置给PCIe插槽131对应的根桥接器的存储器对映I/O资源与总线资源分配给M个接口DP1_1~DP1_M。因此,若有另一存储扩充设备在启动作业系统之后可热插拔地连接至M个接口DP1_1~DP1_M其中之一,此另一存储扩充设备依然可透过作业系统成功地被配置到存储器对映I/O资源与总线资源。It should be particularly noted that the processor 133 has pre-configured sufficient memory-mapped I/O resources and bus resources to the root bridge corresponding to the PCIe slot 131 by executing the BIOS instructions, and distributes the memory-mapped I/O resources and bus resources configured to the root bridge corresponding to the PCIe slot 131 to the M interfaces DP1_1~DP1_M. Therefore, if another storage expansion device can be hot-plugged and connected to one of the M interfaces DP1_1~DP1_M after starting the operating system, the other storage expansion device can still be successfully configured with the memory-mapped I/O resources and bus resources through the operating system.
需注意的是,于一些实施例中,当另一存储扩充设备于作业系统的执行期间可热插拔地连接至M个接口DP1_1~DP1_M其中之一时,另一存储扩充设备可执行一硬件重置操作。在硬件重置操作之后,另一存储扩充设备作业系统获取配置给所述M个接口DP1_1~DP1_M其中之一的总线资源的一部分与配置给M个接口DP1_1~DP1_M其中之一的存储器对映I/O资源的一部分。具体而言,在另一存储扩充设备执行硬件重置操作之后,处理器133执行OS指令可将另一存储扩充设备所连接的接口DP1_1~DP1_M其中之一被配置的存储器对映I/O资源与总线资源分配给另一存储扩充设备。It should be noted that, in some embodiments, when another storage expansion device is hot-pluggably connected to one of the M interfaces DP1_1 to DP1_M during the execution of the operating system, the other storage expansion device may perform a hardware reset operation. After the hardware reset operation, the operating system of the other storage expansion device obtains a portion of the bus resources allocated to one of the M interfaces DP1_1 to DP1_M and a portion of the memory-mapped I/O resources allocated to one of the M interfaces DP1_1 to DP1_M. Specifically, after the other storage expansion device performs the hardware reset operation, the processor 133 executes OS instructions to allocate the memory-mapped I/O resources and bus resources allocated to one of the interfaces DP1_1 to DP1_M to which the other storage expansion device is connected to the other storage expansion device.
图5是依据本发明一实施例的传送存在讯号与硬件重置讯号的示意图。请参照图5,在启动作业系统之后,处理器133已经将存储器对映I/O资源与总线资源分配至所有接口DP1_1~DP1_M。在启动作业系统之后,另一存储扩充设备150可热插拔地连接至PCIe扩充卡120的接口DP1_2。FIG5 is a schematic diagram of transmitting a presence signal and a hardware reset signal according to an embodiment of the present invention. Referring to FIG5, after starting the operating system, the processor 133 has allocated memory-mapped I/O resources and bus resources to all interfaces DP1_1 to DP1_M. After starting the operating system, another storage expansion device 150 can be hot-pluggably connected to the interface DP1_2 of the PCIe expansion card 120.
当另一存储扩充设备150连接至M个接口DP1_1~DP1_M其中之一(例如图5范例所示的接口DP1_2)时,另一存储扩充设备150透过上行接口UP1的针脚(Pin)P3提供存在讯号NP1给PCIe扩充卡120,以使PCIe扩充卡120透过接口DP1_2的针脚P2发送硬件重置讯号R1给另一存储扩充设备150。进一步来说,PCIe扩充卡120可透过接口DP1_2的针脚P1来侦测存储扩充设备150是否连接至接口DP1_2。于一些实施例中,当用以侦测连接状态的针脚P1具有低准位时,PCIe扩充卡120可判断存储扩充设备150已经连接至PCIe扩充卡120。当用以侦测连接状态的针脚P1具有高准位时,PCIe扩充卡120可判断接口DP1_2尚未连接至任何存储扩充设备。When another storage expansion device 150 is connected to one of the M interfaces DP1_1 to DP1_M (e.g., interface DP1_2 shown in the example of FIG. 5 ), the other storage expansion device 150 provides a presence signal NP1 to the PCIe expansion card 120 through the pin P3 of the upstream interface UP1, so that the PCIe expansion card 120 sends a hardware reset signal R1 to the other storage expansion device 150 through the pin P2 of the interface DP1_2. Further, the PCIe expansion card 120 can detect whether the storage expansion device 150 is connected to the interface DP1_2 through the pin P1 of the interface DP1_2. In some embodiments, when the pin P1 used to detect the connection status has a low level, the PCIe expansion card 120 can determine that the storage expansion device 150 has been connected to the PCIe expansion card 120. When the pin P1 for detecting the connection status has a high level, the PCIe expansion card 120 can determine that the interface DP1_2 has not been connected to any storage expansion device.
当另一存储扩充设备150收到硬件重置讯号R1,另一存储扩充设备150将根据硬件重置讯号R1执行硬件重置操作。在存储扩充设备150完成硬件重置操作之后,PCIe扩充卡120可与存储扩充设备150进行PCIe标准定义的连线动作,以使存储扩充设备150可获取配置给接口DP1_2的总线号的一部分与配置给接口DP1_2的MMI/O空间的一部分。更详细来说,存储扩充设备150内的PCIe交换器、PCIe桥接器与PCIe端点装置都可被配置适当的MMI/O空间与总线号。When another storage expansion device 150 receives the hardware reset signal R1, the other storage expansion device 150 will perform a hardware reset operation according to the hardware reset signal R1. After the storage expansion device 150 completes the hardware reset operation, the PCIe expansion card 120 can perform a connection operation defined by the PCIe standard with the storage expansion device 150, so that the storage expansion device 150 can obtain a portion of the bus number configured for the interface DP1_2 and a portion of the MMI/O space configured for the interface DP1_2. In more detail, the PCIe switch, PCIe bridge, and PCIe endpoint device in the storage expansion device 150 can be configured with appropriate MMI/O space and bus number.
之后,另一存储扩充设备160可热插拔地串连至存储扩充设备150的接口DP5_1。同理,当另一存储扩充设备160连接至存储扩充设备150的接口DP5_1时,另一存储扩充设备160透过上行接口UP2的针脚P4提供存在讯号NP2给存储扩充设备150。对应的,当存储扩充设备150收到存在讯号NP2,存储扩充设备150透过接口DP5_1的针脚P5发送硬件重置讯号R2给另一存储扩充设备160。进一步来说,存储扩充设备150可透过接口DP5_1的针脚P6来侦测存储扩充设备160是否连接至接口DP5_1。在存储扩充设备160响应于硬件重置讯号R2完成硬件重置操作之后,存储扩充设备150可与存储扩充设备160进行PCIE标准定义的连线动作,存储扩充设备160内的PCIe交换器、PCIe桥接器与PCIe端点装置都可被配置适当的MMI/O空间与总线号。Afterwards, another storage expansion device 160 can be hot-pluggably connected to the interface DP5_1 of the storage expansion device 150. Similarly, when another storage expansion device 160 is connected to the interface DP5_1 of the storage expansion device 150, the other storage expansion device 160 provides a presence signal NP2 to the storage expansion device 150 through the pin P4 of the upstream interface UP2. Correspondingly, when the storage expansion device 150 receives the presence signal NP2, the storage expansion device 150 sends a hardware reset signal R2 to the other storage expansion device 160 through the pin P5 of the interface DP5_1. Further, the storage expansion device 150 can detect whether the storage expansion device 160 is connected to the interface DP5_1 through the pin P6 of the interface DP5_1. After the storage expansion device 160 completes the hardware reset operation in response to the hardware reset signal R2, the storage expansion device 150 can perform a connection operation defined by the PCIE standard with the storage expansion device 160, and the PCIe switch, PCIe bridge and PCIe endpoint device in the storage expansion device 160 can be configured with appropriate MMI/O space and bus number.
此外,基于上述说明可知,于一些实施例中,当另一存储扩充设备连接至N个存储扩充设备110_1~110_N其中之一的接口时,另一存储扩充设备可透过其上行接口的一针脚提供存在讯号给N个存储扩充设备110_1~110_N其中之一,以使N个存储扩充设备110_1~110_N其中之一可透过针脚发送硬件重置讯号给另一存储扩充设备。于是,另一存储扩充设备可根据硬件重置讯号执行硬件重置操作。In addition, based on the above description, it can be known that in some embodiments, when another storage expansion device is connected to an interface of one of the N storage expansion devices 110_1-110_N, the other storage expansion device can provide a presence signal to one of the N storage expansion devices 110_1-110_N through a pin of its upstream interface, so that one of the N storage expansion devices 110_1-110_N can send a hardware reset signal to the other storage expansion device through the pin. Then, the other storage expansion device can perform a hardware reset operation according to the hardware reset signal.
图6是依据本发明一实施例的存储扩充系统的资源配置方法的流程图。于步骤S602,于BIOS的执行期间,判断插接于PCIe插槽的PCIe扩充卡的次要厂商识别码与所述次要设备识别码是否符合BIOS指定的特定识别码。于步骤S604,当插接于PCIe插槽的PCIe扩充卡的次要厂商识别码与所述次要设备识别码符合BIOS指定的次要厂商识别码与次要设备识别码,于列举过程中停止扫描PCIe插槽对应的根桥接器下的任何PCIe装置,并根据扩充支援数量配置存储器对映I/O资源给根桥接器。于步骤S606,将存储器对映I/O资源分配给PCIe扩充卡的M个接口。然而,图6中各步骤已详细说明如上,在此便不再赘述。FIG. 6 is a flow chart of a resource configuration method of a storage expansion system according to an embodiment of the present invention. In step S602, during the execution of the BIOS, it is determined whether the secondary vendor identification code and the secondary device identification code of the PCIe expansion card plugged into the PCIe slot meet the specific identification code specified by the BIOS. In step S604, when the secondary vendor identification code and the secondary device identification code of the PCIe expansion card plugged into the PCIe slot meet the secondary vendor identification code and the secondary device identification code specified by the BIOS, the scanning of any PCIe device under the root bridge corresponding to the PCIe slot is stopped during the enumeration process, and the memory mapping I/O resources are configured to the root bridge according to the expansion support quantity. In step S606, the memory mapping I/O resources are allocated to the M interfaces of the PCIe expansion card. However, each step in FIG. 6 has been described in detail as above, and will not be repeated here.
需说明的是,可以至少一个处理器执行之资源配置方法的处理程序并不限于上述实施形态之例。举例而言,可省略上述步骤之一部分,亦可以其他顺序执行各步骤。又,可组合上述步骤中之任二个以上的步骤,亦可修正或删除步骤之一部分。或者,亦可除了上述各步骤外还执行其他步骤。It should be noted that the processing program of the resource allocation method that can be executed by at least one processor is not limited to the above-mentioned embodiments. For example, a part of the above-mentioned steps can be omitted, and the steps can be executed in other orders. In addition, any two or more of the above-mentioned steps can be combined, and a part of the steps can be modified or deleted. Alternatively, other steps can be executed in addition to the above-mentioned steps.
综上所述,于BIOS的执行期间,主机设备会判断PCIe插槽是否插接用以连接存储扩充设备的PCIe扩充卡。当PCIe插槽插接此PCIe扩充卡时,可预留足够的存储器对映I/O资源与总线资源给PCIe插槽对应的根桥接器,并将预留的存储器对映I/O资源与总线资源向下分配给PCIe扩充卡的M个接口。藉此,无论存储扩充设备的实际连接时机为何,可让与PCIe扩充卡直接或间接相连的存储扩充设备被配置适当的存储器对映I/O资源与总线资源。如此一来,存储扩充设备可以正常发挥功能,而可避免热拔插事件导致存储扩充设备无法获取足够存储器对映I/O资源与总线资源。In summary, during the execution of BIOS, the host device will determine whether the PCIe slot is plugged into a PCIe expansion card for connecting a storage expansion device. When the PCIe slot is plugged into this PCIe expansion card, sufficient memory mapping I/O resources and bus resources can be reserved for the root bridge corresponding to the PCIe slot, and the reserved memory mapping I/O resources and bus resources can be distributed downward to the M interfaces of the PCIe expansion card. In this way, regardless of the actual connection timing of the storage expansion device, the storage expansion device directly or indirectly connected to the PCIe expansion card can be configured with appropriate memory mapping I/O resources and bus resources. In this way, the storage expansion device can function normally, and the hot plug event can be avoided so that the storage expansion device cannot obtain sufficient memory mapping I/O resources and bus resources.
此外,当有存储扩充设备可热插拔地连接至存储扩充系统,透过存在讯号与硬件重置讯号可让该存储扩充设备进行硬件重置操作,以使完成硬件重置操作的存储扩充设备可顺利被配置适当的存储器对映I/O资源与总线资源。如此一来,可避免热拔插事件造成系统死机或其他不良结果。此外,本发明实施例的存储扩充系统可针对一般PCIe接口卡与用以连接存储扩充设备的PCIe扩充卡进行不同的资运配置操作,而不会影响其他一般PCIe接口卡的资源配置操作。藉此,不仅可大幅提升资源配置的弹性,还具有高度的相容性。In addition, when a storage expansion device is hot-pluggable and connected to the storage expansion system, the storage expansion device can be allowed to perform a hardware reset operation through the presence signal and the hardware reset signal, so that the storage expansion device that has completed the hardware reset operation can be smoothly configured with appropriate memory mapping I/O resources and bus resources. In this way, hot plug events can be avoided from causing system freezes or other adverse results. In addition, the storage expansion system of the embodiment of the present invention can perform different resource configuration operations for general PCIe interface cards and PCIe expansion cards used to connect storage expansion devices without affecting the resource configuration operations of other general PCIe interface cards. In this way, not only can the flexibility of resource configuration be greatly improved, but also high compatibility is achieved.
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims (18)
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW112110455 | 2023-03-21 | ||
TW112110455A TWI831654B (en) | 2023-03-21 | 2023-03-21 | Storage expansion system and resource configuration method thereof |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118689827A true CN118689827A (en) | 2024-09-24 |
Family
ID=90824571
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310785708.1A Pending CN118689827A (en) | 2023-03-21 | 2023-06-29 | Storage expansion system and resource configuration method thereof |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN118689827A (en) |
TW (1) | TWI831654B (en) |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR102111229B1 (en) * | 2014-10-05 | 2020-05-14 | 아마존 테크놀로지스, 인크. | Emulated endpoint configuration |
TWI566103B (en) * | 2015-11-16 | 2017-01-11 | 宇瞻科技股份有限公司 | Pcie bridge transformation device and method thereof |
TWI596484B (en) * | 2016-12-22 | 2017-08-21 | 財團法人工業技術研究院 | Ring network system using peripheral component interconnect express and setting method thereof |
TWI631468B (en) * | 2017-11-07 | 2018-08-01 | 和碩聯合科技股份有限公司 | Bonding area impedance detection method and system thereof |
-
2023
- 2023-03-21 TW TW112110455A patent/TWI831654B/en active
- 2023-06-29 CN CN202310785708.1A patent/CN118689827A/en active Pending
Also Published As
Publication number | Publication date |
---|---|
TWI831654B (en) | 2024-02-01 |
TW202439154A (en) | 2024-10-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US12174776B2 (en) | System and method for supporting multi-mode and/or multi-speed non-volatile memory (NVM) express (NVMe) over fabrics (NVMe-oF) devices | |
US11507421B2 (en) | Information handling system and method to allocate peripheral component interconnect express (PCIe) bus resources | |
US7457897B1 (en) | PCI express-compatible controller and interface for flash memory | |
US7206875B2 (en) | Expander device capable of persistent reservations and persistent affiliations | |
US5948076A (en) | Method and system for changing peripheral component interconnect configuration registers | |
US20210216388A1 (en) | Method and System to Detect Failure in PCIe Endpoint Devices | |
US9946552B2 (en) | System and method for detecting redundant array of independent disks (RAID) controller state from baseboard management controller (BMC) | |
CN110765032A (en) | Method for reading and writing I2C memory based on system management bus interface | |
US7080164B2 (en) | Peripheral device having a programmable identification configuration register | |
CN118689819A (en) | A data processing method, system and computing device based on complex programmable logic device CPLD | |
US7130929B2 (en) | Method for configuring system adapters | |
CN118467434B (en) | Service system, input and output chassis, equipment chassis and chassis identification method | |
US10853299B2 (en) | Hot-plugged PCIe device configuration system | |
US11372792B1 (en) | Automatic bus resource adjustment in a multiple root bridge computing system | |
WO2024239573A1 (en) | Hot swapping method and computer system | |
CN118689827A (en) | Storage expansion system and resource configuration method thereof | |
US20080148104A1 (en) | Detecting an Agent Generating a Parity Error on a PCI-Compatible Bus | |
CN107340815A (en) | Mobile server configuration system and method | |
CN116627472A (en) | Firmware program upgrading method and server of high-speed peripheral component equipment | |
US6970986B1 (en) | Software based system and method for I/O chip hiding of processor based controllers from operating system | |
TWI822503B (en) | Bus address setting method | |
TWI810032B (en) | Usb integrated circuit, operation method of usb integrated circuit and usb device | |
KR101265233B1 (en) | Production and testing the initial storage host bus adapter | |
US12169465B2 (en) | Peripheral component interconnect express device and operating method thereof | |
CN102375794B (en) | Method for adjusting connection speed and computer system thereof |
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 |