mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:37:46 +00:00
Kernel: Add polling support to NVMe
Add polling support to NVMe so that it does not use interrupt to complete a IO but instead actively polls for completion. This probably is not very efficient in terms of CPU usage but it does not use interrupts to complete a IO which is beneficial at the moment as there is no MSI(X) support and it can reduce the latency of an IO in a very fast NVMe device. The NVMeQueue class has been made the base class for NVMeInterruptQueue and NVMePollQueue. The factory function `NVMeQueue::try_create` will return the appropriate queue to the controller based on the polling boot parameter. The polling mode can be enabled by adding an extra boot parameter: `nvme_poll`.
This commit is contained in:
parent
aa832ee251
commit
d234e6b801
13 changed files with 211 additions and 83 deletions
|
@ -26,8 +26,8 @@ namespace Kernel {
|
|||
class NVMeController : public PCI::Device
|
||||
, public StorageController {
|
||||
public:
|
||||
static ErrorOr<NonnullRefPtr<NVMeController>> try_initialize(PCI::DeviceIdentifier const&);
|
||||
ErrorOr<void> initialize();
|
||||
static ErrorOr<NonnullRefPtr<NVMeController>> try_initialize(PCI::DeviceIdentifier const&, bool is_queue_polled);
|
||||
ErrorOr<void> initialize(bool is_queue_polled);
|
||||
explicit NVMeController(PCI::DeviceIdentifier const&);
|
||||
RefPtr<StorageDevice> device(u32 index) const override;
|
||||
size_t devices_count() const override;
|
||||
|
@ -58,8 +58,8 @@ public:
|
|||
private:
|
||||
ErrorOr<void> identify_and_init_namespaces();
|
||||
Tuple<u64, u8> get_ns_features(IdentifyNamespace& identify_data_struct);
|
||||
ErrorOr<void> create_admin_queue(u8 irq);
|
||||
ErrorOr<void> create_io_queue(u8 irq, u8 qid);
|
||||
ErrorOr<void> create_admin_queue(Optional<u8> irq);
|
||||
ErrorOr<void> create_io_queue(u8 qid, Optional<u8> irq);
|
||||
void calculate_doorbell_stride()
|
||||
{
|
||||
m_dbl_stride = (m_controller_regs->cap >> CAP_DBL_SHIFT) & CAP_DBL_MASK;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue