History

Merge branch 'mvpp2-Add-txq-to-CPU-mapping'

Maxime Chevallier says: ==================== net: mvpp2: Add txq to CPU mapping This short series adds XPS support to the mvpp2 driver, by mapping txqs and CPUs. This comes with a patch using round-robin scheduling for the HW to pick the next txq to transmit from, instead of the default fixed-priority scheduling. ====================

David S. Miller committed 8 years ago

Commit 7ff2ea02 parents 12ba7e1 4251ea52 files · +9 −1Browse files

Unified · Split

2 files
  1. drivers/net/ethernet/marvell/mvpp2/mvpp2.h +1 −0
  2. drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +8 −1
drivers/net/ethernet/marvell/mvpp2/mvpp2.h+1−0
@@ -331,6 +331,7 @@ · 330 unmodified lines
331331 #define MVPP2_TXP_SCHED_ENQ_MASK 0xff
332332 #define MVPP2_TXP_SCHED_DISQ_OFFSET 8
333333 #define MVPP2_TXP_SCHED_CMD_1_REG 0x8010
334+#define MVPP2_TXP_SCHED_FIXED_PRIO_REG 0x8014
334335 #define MVPP2_TXP_SCHED_PERIOD_REG 0x8018
335336 #define MVPP2_TXP_SCHED_MTU_REG 0x801c
336337 #define MVPP2_TXP_MTU_MAX 0x7FFFF
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c+8−1
@@ -1448,6 +1448,9 @@ static void mvpp2_defaults_set(struct mvpp2_port *port) · 1447 unmodified lines
14481448 tx_port_num);
14491449 mvpp2_write(port->priv, MVPP2_TXP_SCHED_CMD_1_REG, 0);
14501450
1451+ /* Set TXQ scheduling to Round-Robin */
1452+ mvpp2_write(port->priv, MVPP2_TXP_SCHED_FIXED_PRIO_REG, 0);
1453+
14511454 /* Close bandwidth for all queues */
14521455 for (queue = 0; queue < MVPP2_MAX_TXQ; queue++) {
14531456 ptxq = mvpp2_txq_phys(port->id, queue);
@@ -2423,13 +2426,17 @@ err_cleanup: · 969 unmodified lines
24232426 static int mvpp2_setup_txqs(struct mvpp2_port *port)
24242427 {
24252428 struct mvpp2_tx_queue *txq;
2426− int queue, err;
2429+ int queue, err, cpu;
24272430
24282431 for (queue = 0; queue < port->ntxqs; queue++) {
24292432 txq = port->txqs[queue];
24302433 err = mvpp2_txq_init(port, txq);
24312434 if (err)
24322435 goto err_cleanup;
2436+
2437+ /* Assign this queue to a CPU */
2438+ cpu = queue % num_present_cpus();
2439+ netif_set_xps_queue(port->dev, cpumask_of(cpu), queue);
24332440 }
24342441
24352442 if (port->has_tx_irqs) {