net: mvpp2: handle cases where more CPUs are available than s/w threads
The Marvell PPv2 network controller has 9 internal threads. The driver works fine when there are less CPUs available than threads. This isn't true if more CPUs are available. As this is a valid use case, handle this particular case. Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
074c74dfcb
commit
e531f76757
@@ -736,6 +736,11 @@ struct mvpp2 {
|
||||
int port_count;
|
||||
struct mvpp2_port *port_list[MVPP2_MAX_PORTS];
|
||||
|
||||
/* Number of Tx threads used */
|
||||
unsigned int nthreads;
|
||||
/* Map of threads needing locking */
|
||||
unsigned long lock_map;
|
||||
|
||||
/* Aggregated TXQs */
|
||||
struct mvpp2_tx_queue *aggr_txqs;
|
||||
|
||||
@@ -814,9 +819,6 @@ struct mvpp2_port {
|
||||
void __iomem *base;
|
||||
void __iomem *stats_base;
|
||||
|
||||
/* Number of threads used on the port */
|
||||
unsigned int nthreads;
|
||||
|
||||
struct mvpp2_rx_queue **rxqs;
|
||||
unsigned int nrxqs;
|
||||
struct mvpp2_tx_queue **txqs;
|
||||
@@ -828,6 +830,12 @@ struct mvpp2_port {
|
||||
/* Per-CPU port control */
|
||||
struct mvpp2_port_pcpu __percpu *pcpu;
|
||||
|
||||
/* Protect the BM refills and the Tx paths when a thread is used on more
|
||||
* than a single CPU.
|
||||
*/
|
||||
spinlock_t bm_lock[MVPP2_MAX_THREADS];
|
||||
spinlock_t tx_lock[MVPP2_MAX_THREADS];
|
||||
|
||||
/* Flags */
|
||||
unsigned long flags;
|
||||
|
||||
|
Reference in New Issue
Block a user