Skip to content

Commit 2707df9

Browse files
vcgomesJeff Kirsher
authored andcommitted
igb: Fix the transmission mode of queue 0 for Qav mode
When Qav mode is enabled, queue 0 should be kept on Stream Reservation mode. From the i210 datasheet, section 8.12.19: "Note: Queue0 QueueMode must be set to 1b when TransmitMode is set to Qav." ("QueueMode 1b" represents the Stream Reservation mode) The solution is to give queue 0 the all the credits it might need, so it has priority over queue 1. A situation where this can happen is when cbs is "installed" only on queue 1, leaving queue 0 alone. For example: $ tc qdisc replace dev enp2s0 handle 100: parent root mqprio num_tc 3 \ map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 queues 1@0 1@1 2@2 hw 0 $ tc qdisc replace dev enp2s0 parent 100:2 cbs locredit -1470 \ hicredit 30 sendslope -980000 idleslope 20000 offload 1 Signed-off-by: Vinicius Costa Gomes <[email protected]> Tested-by: Aaron Brown <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 39035bf commit 2707df9

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

drivers/net/ethernet/intel/igb/igb_main.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1700,7 +1700,22 @@ static void igb_configure_cbs(struct igb_adapter *adapter, int queue,
17001700
WARN_ON(hw->mac.type != e1000_i210);
17011701
WARN_ON(queue < 0 || queue > 1);
17021702

1703-
if (enable) {
1703+
if (enable || queue == 0) {
1704+
/* i210 does not allow the queue 0 to be in the Strict
1705+
* Priority mode while the Qav mode is enabled, so,
1706+
* instead of disabling strict priority mode, we give
1707+
* queue 0 the maximum of credits possible.
1708+
*
1709+
* See section 8.12.19 of the i210 datasheet, "Note:
1710+
* Queue0 QueueMode must be set to 1b when
1711+
* TransmitMode is set to Qav."
1712+
*/
1713+
if (queue == 0 && !enable) {
1714+
/* max "linkspeed" idleslope in kbps */
1715+
idleslope = 1000000;
1716+
hicredit = ETH_FRAME_LEN;
1717+
}
1718+
17041719
set_tx_desc_fetch_prio(hw, queue, TX_QUEUE_PRIO_HIGH);
17051720
set_queue_mode(hw, queue, QUEUE_MODE_STREAM_RESERVATION);
17061721

0 commit comments

Comments
 (0)