Skip to content

Commit 2bc7ee8

Browse files
mawilli1Jeff Kirsher
authored andcommitted
i40e: enable packet split only when IOMMU present
When an IOMMU is in use, the packet split receive path shows a distinct advantage over the single-buffer path because it minimizes DMA mapping and unmapping. However, this is not an advantage for systems with no IOMMU. At init time, check to see if an IOMMU is enabled and enable packet split receives. Change-ID: I4f70d2e9c31bbea3dc8fd0c5734959a6e6602210 Signed-off-by: Mitch Williams <[email protected]> Tested-by: Jim Young <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 0e88898 commit 2bc7ee8

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

drivers/net/ethernet/intel/i40e/i40e.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <linux/aer.h>
3737
#include <linux/netdevice.h>
3838
#include <linux/ioport.h>
39+
#include <linux/iommu.h>
3940
#include <linux/slab.h>
4041
#include <linux/list.h>
4142
#include <linux/string.h>

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7279,8 +7279,12 @@ static int i40e_sw_init(struct i40e_pf *pf)
72797279
/* Set default capability flags */
72807280
pf->flags = I40E_FLAG_RX_CSUM_ENABLED |
72817281
I40E_FLAG_MSI_ENABLED |
7282-
I40E_FLAG_MSIX_ENABLED |
7283-
I40E_FLAG_RX_PS_ENABLED;
7282+
I40E_FLAG_MSIX_ENABLED;
7283+
7284+
if (iommu_present(&pci_bus_type))
7285+
pf->flags |= I40E_FLAG_RX_PS_ENABLED;
7286+
else
7287+
pf->flags |= I40E_FLAG_RX_1BUF_ENABLED;
72847288

72857289
/* Set default ITR */
72867290
pf->rx_itr_default = I40E_ITR_DYNAMIC | I40E_ITR_RX_DEF;

0 commit comments

Comments
 (0)