* [PATCH net-next] virtio: kdoc for struct virtio_pci_modern_device
@ 2023-09-11 21:31 Shannon Nelson via Virtualization
2023-09-12 4:20 ` Jason Wang
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Shannon Nelson via Virtualization @ 2023-09-11 21:31 UTC (permalink / raw)
To: kuba, davem, jasowang, mst, virtualization, shannon.nelson,
brett.creeley, netdev
Cc: simon.horman, drivers, eperezma
Finally following up to Simon's suggestion for some kdoc attention
on struct virtio_pci_modern_device.
Link: https://lore.kernel.org/netdev/ZE%2FQS0lnUvxFacjf@corigine.com/
Cc: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
Acked-by: Eugenio Pérez <eperezma@redhat.com>
---
include/linux/virtio_pci_modern.h | 34 ++++++++++++++++++++-----------
1 file changed, 22 insertions(+), 12 deletions(-)
diff --git a/include/linux/virtio_pci_modern.h b/include/linux/virtio_pci_modern.h
index 067ac1d789bc..a38c729d1973 100644
--- a/include/linux/virtio_pci_modern.h
+++ b/include/linux/virtio_pci_modern.h
@@ -12,37 +12,47 @@ struct virtio_pci_modern_common_cfg {
__le16 queue_reset; /* read-write */
};
+/**
+ * struct virtio_pci_modern_device - info for modern PCI virtio
+ * @pci_dev: Ptr to the PCI device struct
+ * @common: Position of the common capability in the PCI config
+ * @device: Device-specific data (non-legacy mode)
+ * @notify_base: Base of vq notifications (non-legacy mode)
+ * @notify_pa: Physical base of vq notifications
+ * @isr: Where to read and clear interrupt
+ * @notify_len: So we can sanity-check accesses
+ * @device_len: So we can sanity-check accesses
+ * @notify_map_cap: Capability for when we need to map notifications per-vq
+ * @notify_offset_multiplier: Multiply queue_notify_off by this value
+ * (non-legacy mode).
+ * @modern_bars: Bitmask of BARs
+ * @id: Device and vendor id
+ * @device_id_check: Callback defined before vp_modern_probe() to be used to
+ * verify the PCI device is a vendor's expected device rather
+ * than the standard virtio PCI device
+ * Returns the found device id or ERRNO
+ * @dma_mask: Optional mask instead of the traditional DMA_BIT_MASK(64),
+ * for vendor devices with DMA space address limitations
+ */
struct virtio_pci_modern_device {
struct pci_dev *pci_dev;
struct virtio_pci_common_cfg __iomem *common;
- /* Device-specific data (non-legacy mode) */
void __iomem *device;
- /* Base of vq notifications (non-legacy mode). */
void __iomem *notify_base;
- /* Physical base of vq notifications */
resource_size_t notify_pa;
- /* Where to read and clear interrupt */
u8 __iomem *isr;
- /* So we can sanity-check accesses. */
size_t notify_len;
size_t device_len;
- /* Capability for when we need to map notifications per-vq. */
int notify_map_cap;
- /* Multiply queue_notify_off by this value. (non-legacy mode). */
u32 notify_offset_multiplier;
-
int modern_bars;
-
struct virtio_device_id id;
- /* optional check for vendor virtio device, returns dev_id or -ERRNO */
int (*device_id_check)(struct pci_dev *pdev);
-
- /* optional mask for devices with limited DMA space */
u64 dma_mask;
};
--
2.17.1
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH net-next] virtio: kdoc for struct virtio_pci_modern_device
2023-09-11 21:31 [PATCH net-next] virtio: kdoc for struct virtio_pci_modern_device Shannon Nelson via Virtualization
@ 2023-09-12 4:20 ` Jason Wang
2023-09-12 20:53 ` Michael S. Tsirkin
2023-09-12 20:54 ` Michael S. Tsirkin
2 siblings, 0 replies; 4+ messages in thread
From: Jason Wang @ 2023-09-12 4:20 UTC (permalink / raw)
To: Shannon Nelson
Cc: brett.creeley, mst, netdev, virtualization, eperezma,
simon.horman, kuba, drivers, davem
On Tue, Sep 12, 2023 at 5:31 AM Shannon Nelson <shannon.nelson@amd.com> wrote:
>
> Finally following up to Simon's suggestion for some kdoc attention
> on struct virtio_pci_modern_device.
>
> Link: https://lore.kernel.org/netdev/ZE%2FQS0lnUvxFacjf@corigine.com/
> Cc: Simon Horman <simon.horman@corigine.com>
> Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
> Acked-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Thanks
> ---
> include/linux/virtio_pci_modern.h | 34 ++++++++++++++++++++-----------
> 1 file changed, 22 insertions(+), 12 deletions(-)
>
> diff --git a/include/linux/virtio_pci_modern.h b/include/linux/virtio_pci_modern.h
> index 067ac1d789bc..a38c729d1973 100644
> --- a/include/linux/virtio_pci_modern.h
> +++ b/include/linux/virtio_pci_modern.h
> @@ -12,37 +12,47 @@ struct virtio_pci_modern_common_cfg {
> __le16 queue_reset; /* read-write */
> };
>
> +/**
> + * struct virtio_pci_modern_device - info for modern PCI virtio
> + * @pci_dev: Ptr to the PCI device struct
> + * @common: Position of the common capability in the PCI config
> + * @device: Device-specific data (non-legacy mode)
> + * @notify_base: Base of vq notifications (non-legacy mode)
> + * @notify_pa: Physical base of vq notifications
> + * @isr: Where to read and clear interrupt
> + * @notify_len: So we can sanity-check accesses
> + * @device_len: So we can sanity-check accesses
> + * @notify_map_cap: Capability for when we need to map notifications per-vq
> + * @notify_offset_multiplier: Multiply queue_notify_off by this value
> + * (non-legacy mode).
> + * @modern_bars: Bitmask of BARs
> + * @id: Device and vendor id
> + * @device_id_check: Callback defined before vp_modern_probe() to be used to
> + * verify the PCI device is a vendor's expected device rather
> + * than the standard virtio PCI device
> + * Returns the found device id or ERRNO
> + * @dma_mask: Optional mask instead of the traditional DMA_BIT_MASK(64),
> + * for vendor devices with DMA space address limitations
> + */
> struct virtio_pci_modern_device {
> struct pci_dev *pci_dev;
>
> struct virtio_pci_common_cfg __iomem *common;
> - /* Device-specific data (non-legacy mode) */
> void __iomem *device;
> - /* Base of vq notifications (non-legacy mode). */
> void __iomem *notify_base;
> - /* Physical base of vq notifications */
> resource_size_t notify_pa;
> - /* Where to read and clear interrupt */
> u8 __iomem *isr;
>
> - /* So we can sanity-check accesses. */
> size_t notify_len;
> size_t device_len;
>
> - /* Capability for when we need to map notifications per-vq. */
> int notify_map_cap;
>
> - /* Multiply queue_notify_off by this value. (non-legacy mode). */
> u32 notify_offset_multiplier;
> -
> int modern_bars;
> -
> struct virtio_device_id id;
>
> - /* optional check for vendor virtio device, returns dev_id or -ERRNO */
> int (*device_id_check)(struct pci_dev *pdev);
> -
> - /* optional mask for devices with limited DMA space */
> u64 dma_mask;
> };
>
> --
> 2.17.1
>
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH net-next] virtio: kdoc for struct virtio_pci_modern_device
2023-09-11 21:31 [PATCH net-next] virtio: kdoc for struct virtio_pci_modern_device Shannon Nelson via Virtualization
2023-09-12 4:20 ` Jason Wang
@ 2023-09-12 20:53 ` Michael S. Tsirkin
2023-09-12 20:54 ` Michael S. Tsirkin
2 siblings, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2023-09-12 20:53 UTC (permalink / raw)
To: Shannon Nelson
Cc: brett.creeley, netdev, virtualization, eperezma, simon.horman,
kuba, drivers, davem
On Mon, Sep 11, 2023 at 02:31:04PM -0700, Shannon Nelson wrote:
> Finally following up to Simon's suggestion for some kdoc attention
> on struct virtio_pci_modern_device.
>
> Link: https://lore.kernel.org/netdev/ZE%2FQS0lnUvxFacjf@corigine.com/
> Cc: Simon Horman <simon.horman@corigine.com>
> Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
> Acked-by: Eugenio Pérez <eperezma@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> include/linux/virtio_pci_modern.h | 34 ++++++++++++++++++++-----------
> 1 file changed, 22 insertions(+), 12 deletions(-)
>
> diff --git a/include/linux/virtio_pci_modern.h b/include/linux/virtio_pci_modern.h
> index 067ac1d789bc..a38c729d1973 100644
> --- a/include/linux/virtio_pci_modern.h
> +++ b/include/linux/virtio_pci_modern.h
> @@ -12,37 +12,47 @@ struct virtio_pci_modern_common_cfg {
> __le16 queue_reset; /* read-write */
> };
>
> +/**
> + * struct virtio_pci_modern_device - info for modern PCI virtio
> + * @pci_dev: Ptr to the PCI device struct
> + * @common: Position of the common capability in the PCI config
> + * @device: Device-specific data (non-legacy mode)
> + * @notify_base: Base of vq notifications (non-legacy mode)
> + * @notify_pa: Physical base of vq notifications
> + * @isr: Where to read and clear interrupt
> + * @notify_len: So we can sanity-check accesses
> + * @device_len: So we can sanity-check accesses
> + * @notify_map_cap: Capability for when we need to map notifications per-vq
> + * @notify_offset_multiplier: Multiply queue_notify_off by this value
> + * (non-legacy mode).
> + * @modern_bars: Bitmask of BARs
> + * @id: Device and vendor id
> + * @device_id_check: Callback defined before vp_modern_probe() to be used to
> + * verify the PCI device is a vendor's expected device rather
> + * than the standard virtio PCI device
> + * Returns the found device id or ERRNO
> + * @dma_mask: Optional mask instead of the traditional DMA_BIT_MASK(64),
> + * for vendor devices with DMA space address limitations
> + */
> struct virtio_pci_modern_device {
> struct pci_dev *pci_dev;
>
> struct virtio_pci_common_cfg __iomem *common;
> - /* Device-specific data (non-legacy mode) */
> void __iomem *device;
> - /* Base of vq notifications (non-legacy mode). */
> void __iomem *notify_base;
> - /* Physical base of vq notifications */
> resource_size_t notify_pa;
> - /* Where to read and clear interrupt */
> u8 __iomem *isr;
>
> - /* So we can sanity-check accesses. */
> size_t notify_len;
> size_t device_len;
>
> - /* Capability for when we need to map notifications per-vq. */
> int notify_map_cap;
>
> - /* Multiply queue_notify_off by this value. (non-legacy mode). */
> u32 notify_offset_multiplier;
> -
> int modern_bars;
> -
> struct virtio_device_id id;
>
> - /* optional check for vendor virtio device, returns dev_id or -ERRNO */
> int (*device_id_check)(struct pci_dev *pdev);
> -
> - /* optional mask for devices with limited DMA space */
> u64 dma_mask;
> };
>
> --
> 2.17.1
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH net-next] virtio: kdoc for struct virtio_pci_modern_device
2023-09-11 21:31 [PATCH net-next] virtio: kdoc for struct virtio_pci_modern_device Shannon Nelson via Virtualization
2023-09-12 4:20 ` Jason Wang
2023-09-12 20:53 ` Michael S. Tsirkin
@ 2023-09-12 20:54 ` Michael S. Tsirkin
2 siblings, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2023-09-12 20:54 UTC (permalink / raw)
To: Shannon Nelson
Cc: brett.creeley, netdev, virtualization, eperezma, simon.horman,
kuba, drivers, davem
On Mon, Sep 11, 2023 at 02:31:04PM -0700, Shannon Nelson wrote:
> Finally following up to Simon's suggestion for some kdoc attention
> on struct virtio_pci_modern_device.
>
> Link: https://lore.kernel.org/netdev/ZE%2FQS0lnUvxFacjf@corigine.com/
> Cc: Simon Horman <simon.horman@corigine.com>
> Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
> Acked-by: Eugenio Pérez <eperezma@redhat.com>
not sure why this is net material though.
I think I will take it in virtio tree.
> ---
> include/linux/virtio_pci_modern.h | 34 ++++++++++++++++++++-----------
> 1 file changed, 22 insertions(+), 12 deletions(-)
>
> diff --git a/include/linux/virtio_pci_modern.h b/include/linux/virtio_pci_modern.h
> index 067ac1d789bc..a38c729d1973 100644
> --- a/include/linux/virtio_pci_modern.h
> +++ b/include/linux/virtio_pci_modern.h
> @@ -12,37 +12,47 @@ struct virtio_pci_modern_common_cfg {
> __le16 queue_reset; /* read-write */
> };
>
> +/**
> + * struct virtio_pci_modern_device - info for modern PCI virtio
> + * @pci_dev: Ptr to the PCI device struct
> + * @common: Position of the common capability in the PCI config
> + * @device: Device-specific data (non-legacy mode)
> + * @notify_base: Base of vq notifications (non-legacy mode)
> + * @notify_pa: Physical base of vq notifications
> + * @isr: Where to read and clear interrupt
> + * @notify_len: So we can sanity-check accesses
> + * @device_len: So we can sanity-check accesses
> + * @notify_map_cap: Capability for when we need to map notifications per-vq
> + * @notify_offset_multiplier: Multiply queue_notify_off by this value
> + * (non-legacy mode).
> + * @modern_bars: Bitmask of BARs
> + * @id: Device and vendor id
> + * @device_id_check: Callback defined before vp_modern_probe() to be used to
> + * verify the PCI device is a vendor's expected device rather
> + * than the standard virtio PCI device
> + * Returns the found device id or ERRNO
> + * @dma_mask: Optional mask instead of the traditional DMA_BIT_MASK(64),
> + * for vendor devices with DMA space address limitations
> + */
> struct virtio_pci_modern_device {
> struct pci_dev *pci_dev;
>
> struct virtio_pci_common_cfg __iomem *common;
> - /* Device-specific data (non-legacy mode) */
> void __iomem *device;
> - /* Base of vq notifications (non-legacy mode). */
> void __iomem *notify_base;
> - /* Physical base of vq notifications */
> resource_size_t notify_pa;
> - /* Where to read and clear interrupt */
> u8 __iomem *isr;
>
> - /* So we can sanity-check accesses. */
> size_t notify_len;
> size_t device_len;
>
> - /* Capability for when we need to map notifications per-vq. */
> int notify_map_cap;
>
> - /* Multiply queue_notify_off by this value. (non-legacy mode). */
> u32 notify_offset_multiplier;
> -
> int modern_bars;
> -
> struct virtio_device_id id;
>
> - /* optional check for vendor virtio device, returns dev_id or -ERRNO */
> int (*device_id_check)(struct pci_dev *pdev);
> -
> - /* optional mask for devices with limited DMA space */
> u64 dma_mask;
> };
>
> --
> 2.17.1
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-09-12 20:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-11 21:31 [PATCH net-next] virtio: kdoc for struct virtio_pci_modern_device Shannon Nelson via Virtualization
2023-09-12 4:20 ` Jason Wang
2023-09-12 20:53 ` Michael S. Tsirkin
2023-09-12 20:54 ` Michael S. Tsirkin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).