]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i40e: Temporary workaround for DMA map issue
authorTushar Dave <tushar.n.dave@oracle.com>
Thu, 10 Dec 2015 01:16:25 +0000 (17:16 -0800)
committerAllen Pais <allen.pais@oracle.com>
Tue, 15 Dec 2015 12:28:33 +0000 (17:58 +0530)
This is a quick temporary workaround for Bug 22107931.

iommu DMA map failure occurs when i40e saturate iommu with large number
of DMA map requests. e.g. System running 128 CPUs can maximum have 256K-1
entries in iommu table considering 8K page size and 32bit iommu (i.e.
2^31/PAGE_SIZE). On this system, i40e driver by default has 128 Queue Pairs
(QP) per interface. For each Rx queues, i40e by default, allocates 512 Rx
buffers which generates 64K DMA map requests. Four i40e interfaces will
generates total of 256K DMA map requests. That is beyond iommu can
accommodate and therefor results into DMA map failure.

The correct fix would be that i40e driver should not saturate iommu
resources and graciously bailout when DMA map failure occurs.

However, due severity of the issue and complexity involved implementing
correct resolution, this patch provides quick temporary workaround by
just limiting number of QP not to exceed 32.

For the record, QP equals 32 chosen because QP has to be power of 2 and we
can't have QP equals 64 because in that case number of DMA map requests for
Rx and Tx will be 256K and iommu can only accommodate 256K-1.
i.e.
 64 RX queues * 512 RX buffers = 32K , for 4 interfaces = 128K
 64 TX queues * 512 TX buffers = 32K , for 4 interfaces = 128K

When an appropriate fix (as mentioned above) is ready, this quick temporary
workaround will be removed.

Note:this temporary workaround can have negative impact on i40e network
performance.

Signed-off-by: Tushar Dave <tushar.n.dave@oracle.com>
drivers/net/ethernet/intel/i40e/i40e_main.c

index 36d55f0bff97f8bce02f6eea935a1c048bfe2572..eeddad8956e27d879052ea48b04193481dddc6eb 100644 (file)
@@ -1604,6 +1604,13 @@ static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi,
                        vsi->num_queue_pairs = pf->num_lan_msix;
        }
 
+#ifdef CONFIG_SPARC
+       if (vsi->num_queue_pairs > 32) {
+               dev_warn(&pf->pdev->dev, "default QP is %d, limiting QP to 32\n",
+                        vsi->num_queue_pairs);
+               vsi->num_queue_pairs = 32;
+       }
+#endif
        /* Scheduler section valid can only be set for ADD VSI */
        if (is_add) {
                sections |= I40E_AQ_VSI_PROP_SCHED_VALID;