search for: dma_unmap_single

Displaying 20 results from an estimated 106 matches for "dma_unmap_single".

2019 Oct 13
2
[PATCH] tools/virtio: Fix build
...le mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tools/virtio/linux/dma-mapping.h b/tools/virtio/linux/dma-mapping.h index f91aeb5fe571..db96cb4bf877 100644 --- a/tools/virtio/linux/dma-mapping.h +++ b/tools/virtio/linux/dma-mapping.h @@ -29,4 +29,6 @@ enum dma_data_direction { #define dma_unmap_single(...) do { } while (0) #define dma_unmap_page(...) do { } while (0) +#define dma_max_mapping_size(d) 0 + #endif diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h index 6683b4a70b05..ccf321173210 100644 --- a/tools/virtio/linux/kernel.h +++ b/tools/virtio/linux/kernel.h @@ -14...
2019 Oct 13
2
[PATCH] tools/virtio: Fix build
...le mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tools/virtio/linux/dma-mapping.h b/tools/virtio/linux/dma-mapping.h index f91aeb5fe571..db96cb4bf877 100644 --- a/tools/virtio/linux/dma-mapping.h +++ b/tools/virtio/linux/dma-mapping.h @@ -29,4 +29,6 @@ enum dma_data_direction { #define dma_unmap_single(...) do { } while (0) #define dma_unmap_page(...) do { } while (0) +#define dma_max_mapping_size(d) 0 + #endif diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h index 6683b4a70b05..ccf321173210 100644 --- a/tools/virtio/linux/kernel.h +++ b/tools/virtio/linux/kernel.h @@ -14...
2013 Aug 23
1
[PATCH] VMXNET3: Add support for virtual IOMMU
...0644 --- a/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/drivers/net/vmxnet3/vmxnet3_drv.c @@ -313,10 +313,10 @@ vmxnet3_unmap_tx_buf(struct vmxnet3_tx_buf_info *tbi, struct pci_dev *pdev) { if (tbi->map_type == VMXNET3_MAP_SINGLE) - pci_unmap_single(pdev, tbi->dma_addr, tbi->len, + dma_unmap_single(&pdev->dev, tbi->dma_addr, tbi->len, PCI_DMA_TODEVICE); else if (tbi->map_type == VMXNET3_MAP_PAGE) - pci_unmap_page(pdev, tbi->dma_addr, tbi->len, + dma_unmap_page(&pdev->dev, tbi->dma_addr, tbi->len, PCI_DMA_TODEVICE); else BUG_ON(tbi-&...
2013 Aug 23
1
[PATCH] VMXNET3: Add support for virtual IOMMU
...0644 --- a/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/drivers/net/vmxnet3/vmxnet3_drv.c @@ -313,10 +313,10 @@ vmxnet3_unmap_tx_buf(struct vmxnet3_tx_buf_info *tbi, struct pci_dev *pdev) { if (tbi->map_type == VMXNET3_MAP_SINGLE) - pci_unmap_single(pdev, tbi->dma_addr, tbi->len, + dma_unmap_single(&pdev->dev, tbi->dma_addr, tbi->len, PCI_DMA_TODEVICE); else if (tbi->map_type == VMXNET3_MAP_PAGE) - pci_unmap_page(pdev, tbi->dma_addr, tbi->len, + dma_unmap_page(&pdev->dev, tbi->dma_addr, tbi->len, PCI_DMA_TODEVICE); else BUG_ON(tbi-&...
2014 Sep 02
1
[PATCH] VMXNET3: Check for map error in vmxnet3_set_mc
...amp; VMXNET3_RXM_MCAST)) { rxConf->mfTableLen = 0; rxConf->mfTablePA = 0; @@ -2091,11 +2093,11 @@ vmxnet3_set_mc(struct net_device *netdev) VMXNET3_CMD_UPDATE_MAC_FILTERS); spin_unlock_irqrestore(&adapter->cmd_lock, flags); - if (new_table) { + if (new_table_pa) dma_unmap_single(&adapter->pdev->dev, new_table_pa, rxConf->mfTableLen, PCI_DMA_TODEVICE); + if (new_table) kfree(new_table); - } } void diff --git a/drivers/net/vmxnet3/vmxnet3_int.h b/drivers/net/vmxnet3/vmxnet3_int.h index 29ee77f2..3759479 100644 --- a/drivers/net/vmxnet3/vmxnet3_int.h...
2014 Sep 02
1
[PATCH] VMXNET3: Check for map error in vmxnet3_set_mc
...amp; VMXNET3_RXM_MCAST)) { rxConf->mfTableLen = 0; rxConf->mfTablePA = 0; @@ -2091,11 +2093,11 @@ vmxnet3_set_mc(struct net_device *netdev) VMXNET3_CMD_UPDATE_MAC_FILTERS); spin_unlock_irqrestore(&adapter->cmd_lock, flags); - if (new_table) { + if (new_table_pa) dma_unmap_single(&adapter->pdev->dev, new_table_pa, rxConf->mfTableLen, PCI_DMA_TODEVICE); + if (new_table) kfree(new_table); - } } void diff --git a/drivers/net/vmxnet3/vmxnet3_int.h b/drivers/net/vmxnet3/vmxnet3_int.h index 29ee77f2..3759479 100644 --- a/drivers/net/vmxnet3/vmxnet3_int.h...
2017 Feb 08
0
FW: Question about /patch/9251925/
..._single(tx_ring->dev, skb->data, size, DMA_TO_DEVICE); ...... dma = skb_frag_dma_map(tx_ring->dev, frag, 0, size, DMA_TO_DEVICE); ...... } i40e_clean_tx_irq() { ...... /* unmap skb header data */ dma_unmap_single(tx_ring->dev, dma_unmap_addr(tx_buf, dma), dma_unmap_len(tx_buf, len), DMA_TO_DEVICE); /* clear tx_buffer data */ tx_buf->skb = NULL; dma_unmap_len_set(tx_buf, len, 0); .........
2017 Feb 08
0
FW: Question about /patch/9251925/
..._single(tx_ring->dev, skb->data, size, DMA_TO_DEVICE); ...... dma = skb_frag_dma_map(tx_ring->dev, frag, 0, size, DMA_TO_DEVICE); ...... } i40e_clean_tx_irq() { ...... /* unmap skb header data */ dma_unmap_single(tx_ring->dev, dma_unmap_addr(tx_buf, dma), dma_unmap_len(tx_buf, len), DMA_TO_DEVICE); /* clear tx_buffer data */ tx_buf->skb = NULL; dma_unmap_len_set(tx_buf, len, 0); .........
2023 Feb 20
2
[PATCH vhost 01/10] virtio_ring: split: refactor virtqueue_add_split() for premapped
...scatterlist *sg; > + unsigned int n; > + > + for (n = 0; n < out_sgs; n++) { > + for (sg = sgs[n]; sg; sg = sg_next(sg)) { > + if (!sg->dma_address) > + return; > + > + dma_unmap_single(vring_dma_dev(vq), sg->dma_address, > + sg->length, DMA_TO_DEVICE); > + } > + } > + for (; n < (out_sgs + in_sgs); n++) { > + for (sg = sgs[n]; sg; sg = sg_next(sg)) { > +...
2018 Nov 27
2
[PATCH v5 5/7] iommu: Add virtio-iommu driver
...gt; sleep in the iommu_map() or iommu_unmap() path. > > The problem is the same > for all IOMMU drivers. That's because the DMA API allows drivers to call > some functions with interrupts disabled. For example > Documentation/DMA-API-HOWTO.txt allows dma_alloc_coherent() and > dma_unmap_single() to be called in interrupt context. In fact I don't really understand how it's supposed to work at all: you only sync when ring is full. So host may not have seen your map request if ring is not full. Why is it safe to use the address with a device then? > > As kick is vm exit, ki...
2018 Nov 27
2
[PATCH v5 5/7] iommu: Add virtio-iommu driver
...gt; sleep in the iommu_map() or iommu_unmap() path. > > The problem is the same > for all IOMMU drivers. That's because the DMA API allows drivers to call > some functions with interrupts disabled. For example > Documentation/DMA-API-HOWTO.txt allows dma_alloc_coherent() and > dma_unmap_single() to be called in interrupt context. In fact I don't really understand how it's supposed to work at all: you only sync when ring is full. So host may not have seen your map request if ring is not full. Why is it safe to use the address with a device then? > > As kick is vm exit, ki...
2018 Dec 07
0
[RFC 3/3] virtio_ring: use new vring flags
...rtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -371,17 +371,17 @@ static void vring_unmap_one_split(const struct vring_virtqueue *vq, flags = virtio16_to_cpu(vq->vq.vdev, desc->flags); - if (flags & VRING_DESC_F_INDIRECT) { + if (flags & BIT(VRING_SPLIT_DESC_F_INDIRECT)) { dma_unmap_single(vring_dma_dev(vq), virtio64_to_cpu(vq->vq.vdev, desc->addr), virtio32_to_cpu(vq->vq.vdev, desc->len), - (flags & VRING_DESC_F_WRITE) ? + (flags & BIT(VRING_SPLIT_DESC_F_WRITE)) ? DMA_FROM_DEVICE : DMA_TO_DEVICE); } else { dma_unmap_page(vring_dma_d...
2018 Nov 27
2
[PATCH v5 5/7] iommu: Add virtio-iommu driver
...t; >> > >> The problem is the same > >> for all IOMMU drivers. That's because the DMA API allows drivers to call > >> some functions with interrupts disabled. For example > >> Documentation/DMA-API-HOWTO.txt allows dma_alloc_coherent() and > >> dma_unmap_single() to be called in interrupt context. > > > > In fact I don't really understand how it's supposed to > > work at all: you only sync when ring is full. > > So host may not have seen your map request if ring > > is not full. > > Why is it safe to use the ad...
2018 Nov 27
2
[PATCH v5 5/7] iommu: Add virtio-iommu driver
...t; >> > >> The problem is the same > >> for all IOMMU drivers. That's because the DMA API allows drivers to call > >> some functions with interrupts disabled. For example > >> Documentation/DMA-API-HOWTO.txt allows dma_alloc_coherent() and > >> dma_unmap_single() to be called in interrupt context. > > > > In fact I don't really understand how it's supposed to > > work at all: you only sync when ring is full. > > So host may not have seen your map request if ring > > is not full. > > Why is it safe to use the ad...
2019 Oct 13
2
[PATCH] tools/virtio: Fix build
...t; diff --git a/tools/virtio/linux/dma-mapping.h b/tools/virtio/linux/dma-mapping.h >> index f91aeb5fe571..db96cb4bf877 100644 >> --- a/tools/virtio/linux/dma-mapping.h >> +++ b/tools/virtio/linux/dma-mapping.h >> @@ -29,4 +29,6 @@ enum dma_data_direction { >> #define dma_unmap_single(...) do { } while (0) >> #define dma_unmap_page(...) do { } while (0) >> >> +#define dma_max_mapping_size(d) 0 >> + >> #endif >> diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h >> index 6683b4a70b05..ccf321173210 100644 >> ---...
2019 Oct 13
2
[PATCH] tools/virtio: Fix build
...t; diff --git a/tools/virtio/linux/dma-mapping.h b/tools/virtio/linux/dma-mapping.h >> index f91aeb5fe571..db96cb4bf877 100644 >> --- a/tools/virtio/linux/dma-mapping.h >> +++ b/tools/virtio/linux/dma-mapping.h >> @@ -29,4 +29,6 @@ enum dma_data_direction { >> #define dma_unmap_single(...) do { } while (0) >> #define dma_unmap_page(...) do { } while (0) >> >> +#define dma_max_mapping_size(d) 0 >> + >> #endif >> diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h >> index 6683b4a70b05..ccf321173210 100644 >> ---...
2018 Nov 08
0
[PATCH net-next v2 3/5] virtio_ring: add packed ring support
...t; + struct vring_desc_state_packed *state) > > +{ > > + u16 flags; > > + > > + if (!vring_use_dma_api(vq->vq.vdev)) > > + return; > > + > > + flags = state->flags; > > + > > + if (flags & VRING_DESC_F_INDIRECT) { > > + dma_unmap_single(vring_dma_dev(vq), > > + state->addr, state->len, > > + (flags & VRING_DESC_F_WRITE) ? > > + DMA_FROM_DEVICE : DMA_TO_DEVICE); > > + } else { > > + dma_unmap_page(vring_dma_dev(vq), > > + state->addr, state->len, > > +...
2018 Nov 07
2
[PATCH net-next v2 3/5] virtio_ring: add packed ring support
..._state_packed(const struct vring_virtqueue *vq, > + struct vring_desc_state_packed *state) > +{ > + u16 flags; > + > + if (!vring_use_dma_api(vq->vq.vdev)) > + return; > + > + flags = state->flags; > + > + if (flags & VRING_DESC_F_INDIRECT) { > + dma_unmap_single(vring_dma_dev(vq), > + state->addr, state->len, > + (flags & VRING_DESC_F_WRITE) ? > + DMA_FROM_DEVICE : DMA_TO_DEVICE); > + } else { > + dma_unmap_page(vring_dma_dev(vq), > + state->addr, state->len, > + (flags & VRING_DESC_F_...
2018 Nov 07
2
[PATCH net-next v2 3/5] virtio_ring: add packed ring support
..._state_packed(const struct vring_virtqueue *vq, > + struct vring_desc_state_packed *state) > +{ > + u16 flags; > + > + if (!vring_use_dma_api(vq->vq.vdev)) > + return; > + > + flags = state->flags; > + > + if (flags & VRING_DESC_F_INDIRECT) { > + dma_unmap_single(vring_dma_dev(vq), > + state->addr, state->len, > + (flags & VRING_DESC_F_WRITE) ? > + DMA_FROM_DEVICE : DMA_TO_DEVICE); > + } else { > + dma_unmap_page(vring_dma_dev(vq), > + state->addr, state->len, > + (flags & VRING_DESC_F_...
2018 Dec 10
1
[PATCH v5 5/7] iommu: Add virtio-iommu driver
...oblem is the same > >>>> for all IOMMU drivers. That's because the DMA API allows drivers to call > >>>> some functions with interrupts disabled. For example > >>>> Documentation/DMA-API-HOWTO.txt allows dma_alloc_coherent() and > >>>> dma_unmap_single() to be called in interrupt context. > >>> > >>> In fact I don't really understand how it's supposed to > >>> work at all: you only sync when ring is full. > >>> So host may not have seen your map request if ring > >>> is not full....