Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

be2net: enable IOMMU pass through for be2net

This patch sets the coherent DMA mask to 64-bit after the be2net driver has
been acknowledged that the system is 64-bit DMA capable. The coherent DMA
mask is examined by the Intel IOMMU driver to determine whether to allow
pass through context mapping for all devices. With this patch, the be2net
driver combined with be2net compatible hardware provides comparable
performance to the case where vt-d is disabled. The main use-case for this
change is to decrease the time necessary to copy virtual machine memory
during KVM live migration instantiations.

This patch was tested on a system that enables the IOMMU in non-coherent
mode. Two DMA remapper issues were encountered in the previous version and
both patches have been committed.
    commit ea2447f
    commit 2e12bc2

Signed-off-by: Craig Hada <craig.hada@hp.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information...
commit 2bd92cd2a5f96458519ed4cbbf90d9bd108edcc6 1 parent a05f99d
Craig Hada authored davem330 committed

Showing 1 changed file with 5 additions and 0 deletions. Show diff stats Hide diff stats

  1. +5 0 drivers/net/ethernet/emulex/benet/be_main.c
5 drivers/net/ethernet/emulex/benet/be_main.c
@@ -4134,6 +4134,11 @@ static int be_probe(struct pci_dev *pdev, const struct pci_device_id *pdev_id)
4134 4134
4135 4135 status = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
4136 4136 if (!status) {
  4137 + status = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
  4138 + if (status < 0) {
  4139 + dev_err(&pdev->dev, "dma_set_coherent_mask failed\n");
  4140 + goto free_netdev;
  4141 + }
4137 4142 netdev->features |= NETIF_F_HIGHDMA;
4138 4143 } else {
4139 4144 status = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));

0 comments on commit 2bd92cd

Please sign in to comment.
Something went wrong with that request. Please try again.