From b3a73d663461e77b1d2e50adc830bdd5a28fbd5f Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Wed, 12 Jun 2024 15:30:14 +0000 Subject: [PATCH] virtio-devices: fix documentation formatting Signed-off-by: Wei Liu --- .../src/transport/pci_common_config.rs | 34 ++++++++++--------- virtio-devices/src/vsock/packet.rs | 1 + virtio-devices/src/vsock/unix/muxer_rxq.rs | 1 + 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/virtio-devices/src/transport/pci_common_config.rs b/virtio-devices/src/transport/pci_common_config.rs index e732ebd17..2e78b13c0 100644 --- a/virtio-devices/src/transport/pci_common_config.rs +++ b/virtio-devices/src/transport/pci_common_config.rs @@ -32,24 +32,26 @@ pub struct VirtioPciCommonConfigState { /// device. /// /// * Registers: +/// /// ** About the whole device. -/// le32 device_feature_select; // 0x00 // read-write -/// le32 device_feature; // 0x04 // read-only for driver -/// le32 driver_feature_select; // 0x08 // read-write -/// le32 driver_feature; // 0x0C // read-write -/// le16 msix_config; // 0x10 // read-write -/// le16 num_queues; // 0x12 // read-only for driver -/// u8 device_status; // 0x14 // read-write (driver_status) -/// u8 config_generation; // 0x15 // read-only for driver +/// le32 device_feature_select; // 0x00 // read-write +/// le32 device_feature; // 0x04 // read-only for driver +/// le32 driver_feature_select; // 0x08 // read-write +/// le32 driver_feature; // 0x0C // read-write +/// le16 msix_config; // 0x10 // read-write +/// le16 num_queues; // 0x12 // read-only for driver +/// u8 device_status; // 0x14 // read-write (driver_status) +/// u8 config_generation; // 0x15 // read-only for driver +/// /// ** About a specific virtqueue. -/// le16 queue_select; // 0x16 // read-write -/// le16 queue_size; // 0x18 // read-write, power of 2, or 0. -/// le16 queue_msix_vector; // 0x1A // read-write -/// le16 queue_enable; // 0x1C // read-write (Ready) -/// le16 queue_notify_off; // 0x1E // read-only for driver -/// le64 queue_desc; // 0x20 // read-write -/// le64 queue_avail; // 0x28 // read-write -/// le64 queue_used; // 0x30 // read-write +/// le16 queue_select; // 0x16 // read-write +/// le16 queue_size; // 0x18 // read-write, power of 2, or 0. +/// le16 queue_msix_vector; // 0x1A // read-write +/// le16 queue_enable; // 0x1C // read-write (Ready) +/// le16 queue_notify_off; // 0x1E // read-only for driver +/// le64 queue_desc; // 0x20 // read-write +/// le64 queue_avail; // 0x28 // read-write +/// le64 queue_used; // 0x30 // read-write pub struct VirtioPciCommonConfig { pub access_platform: Option>, pub driver_status: u8, diff --git a/virtio-devices/src/vsock/packet.rs b/virtio-devices/src/vsock/packet.rs index f39374f5d..852cabf6d 100644 --- a/virtio-devices/src/vsock/packet.rs +++ b/virtio-devices/src/vsock/packet.rs @@ -7,6 +7,7 @@ //! virtio queue: //! - the packet header; and //! - the packet data/buffer. +//! //! There is a 1:1 relation between descriptor chains and packets: the first (chain head) holds //! the header, and an optional second descriptor holds the data. The second descriptor is only //! present for data packets (VSOCK_OP_RW). diff --git a/virtio-devices/src/vsock/unix/muxer_rxq.rs b/virtio-devices/src/vsock/unix/muxer_rxq.rs index d33ff32bd..5cdbb0e72 100644 --- a/virtio-devices/src/vsock/unix/muxer_rxq.rs +++ b/virtio-devices/src/vsock/unix/muxer_rxq.rs @@ -71,6 +71,7 @@ impl MuxerRxQ { /// A push will fail when: /// - trying to push a connection key onto an out-of-sync, or full queue; or /// - trying to push an RST onto a queue already full of RSTs. + /// /// RSTs take precedence over connections, because connections can always be queried for /// pending RX data later. Aside from this queue, there is no other storage for RSTs, so /// failing to push one means that we have to drop the packet.