Skip to contentSkip to conversation

igb: Change RXPBSIZE size when setting Qav mode

PATCH In review Vinicius Costa Gomes 2 participants 4 messages Nov 17, 2018 – Nov 30, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 igb: Change RXPBSIZE size when setting Qav mode

From: Jesus Sanchez-Palencia <[email protected]>

Section 4.5.9 of the datasheet says that the total size of all packet buffers combined (TxPB 0 + 1 + 2 + 3 + RxPB + BMC2OS + OS2BMC) must not exceed 60KB. Today we are configuring a total of 62KB, so reduce the RxPB from 32KB to 30KB in order to respect that.

The choice of changing RxPBSIZE here is mainly because it seems more correct to give more priority to the transmit packet buffers over the receiver ones when running in Qav mode. Also, the BMC2OS and OS2BMC sizes are already too short.

---
 drivers/net/ethernet/intel/igb/e1000_defines.h | 1 +
 drivers/net/ethernet/intel/igb/igb_main.c      | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/igb/e1000_defines.h +1 -0
index 8a28f3388f69..01fcfc6f3415 100644
@@ -334,6 +334,7 @@
 
 #define I210_RXPBSIZE_DEFAULT		0x000000A2 /* RXPBSIZE default */
 #define I210_RXPBSIZE_MASK		0x0000003F
+#define I210_RXPBSIZE_PB_30KB		0x0000001E
 #define I210_RXPBSIZE_PB_32KB		0x00000020
 #define I210_TXPBSIZE_DEFAULT		0x04000014 /* TXPBSIZE default */
 #define I210_TXPBSIZE_MASK		0xC0FFFFFF
drivers/net/ethernet/intel/igb/igb_main.c +1 -1
index bb4f3f64fbf0..e135adf46980 100644
@@ -1934,7 +1934,7 @@ static void igb_setup_tx_mode(struct igb_adapter *adapter)
 
 		val = rd32(E1000_RXPBS);
 		val &= ~I210_RXPBSIZE_MASK;
-		val |= I210_RXPBSIZE_PB_32KB;
+		val |= I210_RXPBSIZE_PB_30KB;
 		wr32(E1000_RXPBS, val);
 
 		/* Section 8.12.9 states that MAX_TPKT_SIZE from DTXMXPKTSZ
Signature · 1 line
2.19.1
#1 lore raw

PATCH 2/2 Documentation: igb: Add a section about CBS

Add some pointers to the definition of the CBS algorithm, and some notes about the limits of its implementation in the i210 family of controllers.

---
 Documentation/networking/igb.rst | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
Documentation/networking/igb.rst +19 -0
index ba16b86d5593..e87a4a72ea2d 100644
@@ -177,6 +177,25 @@ rate limit using the IProute2 tool. Download the latest version of the
 IProute2 tool from Sourceforge if your version does not have all the features
 you require.
 
+Credit Based Shaper (Qav Mode)
+------------------------------
+When enabling the CBS qdisc in the hardware offload mode, traffic shaping using
+the CBS (described in the IEEE 802.1Q-2018 Section 8.6.8.2 and discussed in the
+Annex L) algorithm will run in the i210 controller, so it's more accurate and
+uses less CPU.
+
+When using offloaded CBS, and the traffic rate obeys the configured rate
+(doesn't go above it), CBS should have little to no effect in the latency.
+
+The offloaded version of the algorithm has some limits, caused by how the idle
+slope is expressed in the adapter's registers. It can only represent idle slopes
+in 16.38431 kbps units, which means that if a idle slope of 2576kbps is
+requested, the controller will be configured to use a idle slope of ~2589 kbps,
+because the driver rounds the value up. For more details, see the comments on
+:c:func:`igb_config_tx_modes()`.
+
+NOTE: This feature is exclusive to i210 models.
+
 
 Support
 =======
Signature · 1 line
2.19.1
Tested-by on v1 2/2
#2 lore raw

RE: [Intel-wired-lan] [next-queue PATCH v1 2/2] Documentation: igb: Add a section about CBS

Quoted 8 lines

From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On Behalf Of Vinicius Costa Gomes
Sent: Friday, November 16, 2018 4:19 PM
To: intel-wired-lan at lists.osuosl.org
Cc: netdev at vger.kernel.org; jesus.s.palencia at gmail.com
Subject: [Intel-wired-lan] [next-queue PATCH v1 2/2] Documentation: igb:
Add a section about CBS

Quoted 9 lines

Add some pointers to the definition of the CBS algorithm, and some notes about the limits of its implementation in the i210 family of controllers.

---
 Documentation/networking/igb.rst | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
Tested-by on v1 1/2
#3 lore raw
In reply to Vinicius Costa Gomes
Quoted 22 lines

From: netdev-owner at vger.kernel.org [mailto:netdev-
owner at vger.kernel.org] On Behalf Of Vinicius Costa Gomes
Sent: Friday, November 16, 2018 4:19 PM
To: intel-wired-lan at lists.osuosl.org
Cc: Sanchez-Palencia, Jesus <[email protected]>; Kirsher, Jeffrey T <[email protected]>; netdev at vger.kernel.org; jesus.s.palencia at gmail.com
Subject: [next-queue PATCH v1 1/2] igb: Change RXPBSIZE size when setting Qav mode

From: Jesus Sanchez-Palencia <[email protected]>

Section 4.5.9 of the datasheet says that the total size of all packet buffers combined (TxPB 0 + 1 + 2 + 3 + RxPB + BMC2OS + OS2BMC) must not exceed 60KB. Today we are configuring a total of 62KB, so reduce the RxPB from 32KB to 30KB in order to respect that.

The choice of changing RxPBSIZE here is mainly because it seems more correct to give more priority to the transmit packet buffers over the receiver ones when running in Qav mode. Also, the BMC2OS and OS2BMC sizes are already too short.

Quoted 6 lines
---
 drivers/net/ethernet/intel/igb/e1000_defines.h | 1 +
 drivers/net/ethernet/intel/igb/igb_main.c      | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)