Skip to content

Commit 5c669c4

Browse files
r-c-nmstsirkin
authored andcommitted
virtio: kerneldocs fixes and enhancements
Fix variable names in some kerneldocs, naming in others. Add kerneldocs for struct vring_desc and vring_interrupt. Signed-off-by: Ricardo Cañuelo <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Reviewed-by: Cornelia Huck <[email protected]>
1 parent 9993a4f commit 5c669c4

File tree

4 files changed

+25
-11
lines changed

4 files changed

+25
-11
lines changed

drivers/virtio/virtio_ring.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2426,6 +2426,14 @@ static inline bool more_used(const struct vring_virtqueue *vq)
24262426
return vq->packed_ring ? more_used_packed(vq) : more_used_split(vq);
24272427
}
24282428

2429+
/**
2430+
* vring_interrupt - notify a virtqueue on an interrupt
2431+
* @irq: the IRQ number (ignored)
2432+
* @_vq: the struct virtqueue to notify
2433+
*
2434+
* Calls the callback function of @_vq to process the virtqueue
2435+
* notification.
2436+
*/
24292437
irqreturn_t vring_interrupt(int irq, void *_vq)
24302438
{
24312439
struct vring_virtqueue *vq = to_vvq(_vq);

include/linux/virtio.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <linux/gfp.h>
1212

1313
/**
14-
* virtqueue - a queue to register buffers for sending or receiving.
14+
* struct virtqueue - a queue to register buffers for sending or receiving.
1515
* @list: the chain of virtqueues for this device
1616
* @callback: the function to call when buffers are consumed (can be NULL).
1717
* @name: the name of this virtqueue (mainly for debugging)
@@ -97,7 +97,7 @@ int virtqueue_resize(struct virtqueue *vq, u32 num,
9797
void (*recycle)(struct virtqueue *vq, void *buf));
9898

9999
/**
100-
* virtio_device - representation of a device using virtio
100+
* struct virtio_device - representation of a device using virtio
101101
* @index: unique position on the virtio bus
102102
* @failed: saved value for VIRTIO_CONFIG_S_FAILED bit (for restore)
103103
* @config_enabled: configuration change reporting enabled
@@ -156,7 +156,7 @@ size_t virtio_max_dma_size(struct virtio_device *vdev);
156156
list_for_each_entry(vq, &vdev->vqs, list)
157157

158158
/**
159-
* virtio_driver - operations for a virtio I/O driver
159+
* struct virtio_driver - operations for a virtio I/O driver
160160
* @driver: underlying device driver (populate name and owner).
161161
* @id_table: the ids serviced by this driver.
162162
* @feature_table: an array of feature numbers supported by this driver.

include/linux/virtio_config.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ int virtio_find_vqs_ctx(struct virtio_device *vdev, unsigned nvqs,
239239

240240
/**
241241
* virtio_synchronize_cbs - synchronize with virtqueue callbacks
242-
* @vdev: the device
242+
* @dev: the virtio device
243243
*/
244244
static inline
245245
void virtio_synchronize_cbs(struct virtio_device *dev)
@@ -258,7 +258,7 @@ void virtio_synchronize_cbs(struct virtio_device *dev)
258258

259259
/**
260260
* virtio_device_ready - enable vq use in probe function
261-
* @vdev: the device
261+
* @dev: the virtio device
262262
*
263263
* Driver must call this to use vqs in the probe function.
264264
*
@@ -306,7 +306,7 @@ const char *virtio_bus_name(struct virtio_device *vdev)
306306
/**
307307
* virtqueue_set_affinity - setting affinity for a virtqueue
308308
* @vq: the virtqueue
309-
* @cpu: the cpu no.
309+
* @cpu_mask: the cpu mask
310310
*
311311
* Pay attention the function are best-effort: the affinity hint may not be set
312312
* due to config support, irq type and sharing.

include/uapi/linux/virtio_ring.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,21 @@
9393
#define VRING_USED_ALIGN_SIZE 4
9494
#define VRING_DESC_ALIGN_SIZE 16
9595

96-
/* Virtio ring descriptors: 16 bytes. These can chain together via "next". */
96+
/**
97+
* struct vring_desc - Virtio ring descriptors,
98+
* 16 bytes long. These can chain together via @next.
99+
*
100+
* @addr: buffer address (guest-physical)
101+
* @len: buffer length
102+
* @flags: descriptor flags
103+
* @next: index of the next descriptor in the chain,
104+
* if the VRING_DESC_F_NEXT flag is set. We chain unused
105+
* descriptors via this, too.
106+
*/
97107
struct vring_desc {
98-
/* Address (guest-physical). */
99108
__virtio64 addr;
100-
/* Length. */
101109
__virtio32 len;
102-
/* The flags as indicated above. */
103110
__virtio16 flags;
104-
/* We chain unused descriptors via this, too */
105111
__virtio16 next;
106112
};
107113

0 commit comments

Comments
 (0)