Skip to content

Commit de340d8

Browse files
azaki1kuba-moo
authored andcommitted
net: ena: use napi's aRFS rmap notifers
Use the core's rmap notifiers and delete our own. Acked-by: David Arinzon <[email protected]> Signed-off-by: Ahmed Zaki <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent bd7c006 commit de340d8

File tree

1 file changed

+1
-42
lines changed

1 file changed

+1
-42
lines changed

drivers/net/ethernet/amazon/ena/ena_netdev.c

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55

66
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
77

8-
#ifdef CONFIG_RFS_ACCEL
9-
#include <linux/cpu_rmap.h>
10-
#endif /* CONFIG_RFS_ACCEL */
118
#include <linux/ethtool.h>
129
#include <linux/kernel.h>
1310
#include <linux/module.h>
@@ -162,30 +159,6 @@ int ena_xmit_common(struct ena_adapter *adapter,
162159
return 0;
163160
}
164161

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-
189162
static void ena_init_io_rings_common(struct ena_adapter *adapter,
190163
struct ena_ring *ring, u16 qid)
191164
{
@@ -1596,7 +1569,7 @@ static int ena_enable_msix(struct ena_adapter *adapter)
15961569
adapter->num_io_queues = irq_cnt - ENA_ADMIN_MSIX_VEC;
15971570
}
15981571

1599-
if (ena_init_rx_cpu_rmap(adapter))
1572+
if (netif_enable_cpu_rmap(adapter->netdev, adapter->num_io_queues))
16001573
netif_warn(adapter, probe, adapter->netdev,
16011574
"Failed to map IRQs to CPUs\n");
16021575

@@ -1742,13 +1715,6 @@ static void ena_free_io_irq(struct ena_adapter *adapter)
17421715
struct ena_irq *irq;
17431716
int i;
17441717

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-
17521718
for (i = ENA_IO_IRQ_FIRST_IDX; i < ENA_MAX_MSIX_VEC(io_queue_count); i++) {
17531719
irq = &adapter->irq_tbl[i];
17541720
irq_set_affinity_hint(irq->vector, NULL);
@@ -4131,13 +4097,6 @@ static void __ena_shutoff(struct pci_dev *pdev, bool shutdown)
41314097
ena_dev = adapter->ena_dev;
41324098
netdev = adapter->netdev;
41334099

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 */
41414100
/* Make sure timer and reset routine won't be called after
41424101
* freeing device resources.
41434102
*/

0 commit comments

Comments
 (0)