|
5 | 5 |
|
6 | 6 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
7 | 7 |
|
8 | | -#ifdef CONFIG_RFS_ACCEL |
9 | | -#include <linux/cpu_rmap.h> |
10 | | -#endif /* CONFIG_RFS_ACCEL */ |
11 | 8 | #include <linux/ethtool.h> |
12 | 9 | #include <linux/kernel.h> |
13 | 10 | #include <linux/module.h> |
@@ -162,30 +159,6 @@ int ena_xmit_common(struct ena_adapter *adapter, |
162 | 159 | return 0; |
163 | 160 | } |
164 | 161 |
|
165 | | -static int ena_init_rx_cpu_rmap(struct ena_adapter *adapter) |
166 | | -{ |
167 | | -#ifdef CONFIG_RFS_ACCEL |
168 | | - u32 i; |
169 | | - int rc; |
170 | | - |
171 | | - adapter->netdev->rx_cpu_rmap = alloc_irq_cpu_rmap(adapter->num_io_queues); |
172 | | - if (!adapter->netdev->rx_cpu_rmap) |
173 | | - return -ENOMEM; |
174 | | - for (i = 0; i < adapter->num_io_queues; i++) { |
175 | | - int irq_idx = ENA_IO_IRQ_IDX(i); |
176 | | - |
177 | | - rc = irq_cpu_rmap_add(adapter->netdev->rx_cpu_rmap, |
178 | | - pci_irq_vector(adapter->pdev, irq_idx)); |
179 | | - if (rc) { |
180 | | - free_irq_cpu_rmap(adapter->netdev->rx_cpu_rmap); |
181 | | - adapter->netdev->rx_cpu_rmap = NULL; |
182 | | - return rc; |
183 | | - } |
184 | | - } |
185 | | -#endif /* CONFIG_RFS_ACCEL */ |
186 | | - return 0; |
187 | | -} |
188 | | - |
189 | 162 | static void ena_init_io_rings_common(struct ena_adapter *adapter, |
190 | 163 | struct ena_ring *ring, u16 qid) |
191 | 164 | { |
@@ -1596,7 +1569,7 @@ static int ena_enable_msix(struct ena_adapter *adapter) |
1596 | 1569 | adapter->num_io_queues = irq_cnt - ENA_ADMIN_MSIX_VEC; |
1597 | 1570 | } |
1598 | 1571 |
|
1599 | | - if (ena_init_rx_cpu_rmap(adapter)) |
| 1572 | + if (netif_enable_cpu_rmap(adapter->netdev, adapter->num_io_queues)) |
1600 | 1573 | netif_warn(adapter, probe, adapter->netdev, |
1601 | 1574 | "Failed to map IRQs to CPUs\n"); |
1602 | 1575 |
|
@@ -1742,13 +1715,6 @@ static void ena_free_io_irq(struct ena_adapter *adapter) |
1742 | 1715 | struct ena_irq *irq; |
1743 | 1716 | int i; |
1744 | 1717 |
|
1745 | | -#ifdef CONFIG_RFS_ACCEL |
1746 | | - if (adapter->msix_vecs >= 1) { |
1747 | | - free_irq_cpu_rmap(adapter->netdev->rx_cpu_rmap); |
1748 | | - adapter->netdev->rx_cpu_rmap = NULL; |
1749 | | - } |
1750 | | -#endif /* CONFIG_RFS_ACCEL */ |
1751 | | - |
1752 | 1718 | for (i = ENA_IO_IRQ_FIRST_IDX; i < ENA_MAX_MSIX_VEC(io_queue_count); i++) { |
1753 | 1719 | irq = &adapter->irq_tbl[i]; |
1754 | 1720 | irq_set_affinity_hint(irq->vector, NULL); |
@@ -4131,13 +4097,6 @@ static void __ena_shutoff(struct pci_dev *pdev, bool shutdown) |
4131 | 4097 | ena_dev = adapter->ena_dev; |
4132 | 4098 | netdev = adapter->netdev; |
4133 | 4099 |
|
4134 | | -#ifdef CONFIG_RFS_ACCEL |
4135 | | - if ((adapter->msix_vecs >= 1) && (netdev->rx_cpu_rmap)) { |
4136 | | - free_irq_cpu_rmap(netdev->rx_cpu_rmap); |
4137 | | - netdev->rx_cpu_rmap = NULL; |
4138 | | - } |
4139 | | - |
4140 | | -#endif /* CONFIG_RFS_ACCEL */ |
4141 | 4100 | /* Make sure timer and reset routine won't be called after |
4142 | 4101 | * freeing device resources. |
4143 | 4102 | */ |
|
0 commit comments