Jason Wang
2023-Mar-17 03:37 UTC
[PATCH RFC v2 virtio 3/7] pds_vdpa: virtio bar setup for vdpa
On Thu, Mar 16, 2023 at 11:25?AM Shannon Nelson <shannon.nelson at amd.com> wrote:> > On 3/15/23 12:05 AM, Jason Wang wrote: > > On Thu, Mar 9, 2023 at 9:31?AM Shannon Nelson <shannon.nelson at amd.com> wrote: > >> > >> The PDS vDPA device has a virtio BAR for describing itself, and > >> the pds_vdpa driver needs to access it. Here we copy liberally > >> from the existing drivers/virtio/virtio_pci_modern_dev.c as it > >> has what we need, but we need to modify it so that it can work > >> with our device id and so we can use our own DMA mask. > > > > By passing a pointer to a customized id probing routine to vp_modern_probe()? > > The only real differences are that we needed to cut out the device id > checks to use our vDPA VF device id, and remove > dma_set_mask_and_coherent() because we need a different DMA_BIT_MASK(). > > Maybe a function pointer to something that can validate the device id, > and a bitmask for setting DMA mapping; if they are 0/NULL, use the > default device id check and DMA mask. > > Adding them as extra arguments to the function call seems a bit messy, > maybe add them to the struct virtio_pci_modern_device and the caller can > set them as overrides if needed? > > struct virtio_pci_modern_device { > > ... > > int (*device_id_check_override(struct pci_dev *pdev)); > u64 dma_mask_override; > }Looks fine. Thanks
Maybe Matching Threads
- [PATCH v3 virtio 1/8] virtio: allow caller to override device id and DMA mask
- [PATCH v5 virtio 02/11] virtio: allow caller to override device DMA mask in vp_modern
- [PATCH v5 virtio 01/11] virtio: allow caller to override device id in vp_modern
- [PATCH RFC v2 virtio 2/7] pds_vdpa: get vdpa management info
- [PATCH virtio 1/4] pds_vdpa: reset to vdpa specified mac