Skip to content

Commit

Permalink
net: mvpp2: make sure we don't spread load on disabled CPUs
Browse files Browse the repository at this point in the history
When filling the RSS table, we have to make sure that the rx queue is
attached to an online CPU.

This patch is not a full support for cpu_hotplug, but rather a way to
make sure that we don't break network on system booted with the maxcpus
parameter.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Maxime Chevallier authored and David S. Miller committed Jul 13, 2018
1 parent 662ae3f commit 2a2f467
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,17 @@ void mvpp2_cls_oversize_rxq_set(struct mvpp2_port *port)

static inline u32 mvpp22_rxfh_indir(struct mvpp2_port *port, u32 rxq)
{
int nrxqs, cpus = num_possible_cpus();
int nrxqs, cpu, cpus = num_possible_cpus();

/* Number of RXQs per CPU */
nrxqs = port->nrxqs / cpus;

/* CPU that will handle this rx queue */
cpu = rxq / nrxqs;

if (!cpu_online(cpu))
return port->first_rxq;

/* Indirection to better distribute the paquets on the CPUs when
* configuring the RSS queues.
*/
Expand Down

0 comments on commit 2a2f467

Please sign in to comment.