mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-21 06:33:31 +00:00
5e5fe7291a
The commit adds support to throttle the rate of the RX IRQs to a specified value. The effect is, that no RX IRQs below the time threshold will fire and therefore the CPU load gets reduced on the host. Trade-off gaming between cpu load, throughput, overload. Modular Sculpt 23.10 on S938 as testcase. In brackets the CPU affinity is denoted. ipxe (0,0) -> nic_router (1,0) -> Debian VM vbox6 (3,0) and (3,1) VM: iperf -C X.X.X.X -t 60 -R iperf server X.X.X.X is outside Sculpt and sends data due to '-R' to VM Non representative measure points: cpu load - ipxe - nic_router - iperf throughput -------------------------------------------------- w/o patch - ~80% - ~50% - ~706 MBit/s - 0 -> throttling off by default on S938 patch 651 - ~20% - ~35% - ~763 MBit/s - 651 -> 0.166ms throttle RX IRQ patch 5580 - ~15% - ~25% - ~650 MBit/s - 5580 -> 1.4ms throttle RX IRQ Issue #5149
43 lines
1.2 KiB
Diff
43 lines
1.2 KiB
Diff
--- a/src/drivers/net/intel.c
|
|
+++ b/src/drivers/net/intel.c
|
|
@@ -681,6 +681,27 @@
|
|
intel->force_icr = INTEL_IRQ_RXT0;
|
|
}
|
|
|
|
+ /*
|
|
+ * Intel PCI/PCI-X family of Gigabit Ethernet control Software Developers's
|
|
+ * Manual Rev 4.0
|
|
+ *
|
|
+ * 13.4.18 Interrupt Throttling Register
|
|
+ * advises - 651 to 5580 - for "optimal performance setting"
|
|
+ */
|
|
+
|
|
+ uint32_t const throttle_before = readl ( intel->regs + INTEL_ITR );
|
|
+ uint32_t const throttle = 651; /* 651 * 256µs -> 0.166 ms */
|
|
+
|
|
+ writel( throttle, intel->regs + INTEL_ITR );
|
|
+
|
|
+ uint64_t const value = readl ( intel->regs + INTEL_ITR );
|
|
+
|
|
+ dde_printf("throttle RX interrupt %luµs%s -> %luµs - %s\n",
|
|
+ 256ul * throttle_before / 1000ul,
|
|
+ throttle_before ? "" : "(off)",
|
|
+ 256ul * value / 1000ul,
|
|
+ value == throttle ? "succeeded" : "failed");
|
|
+
|
|
return 0;
|
|
|
|
intel_destroy_ring ( intel, &intel->rx );
|
|
--- a/src/drivers/net/intel.h
|
|
+++ b/src/drivers/net/intel.h
|
|
@@ -102,6 +102,9 @@
|
|
#define INTEL_IRQ_RXO 0x00000040UL /**< Receive overrun */
|
|
#define INTEL_IRQ_RXT0 0x00000080UL /**< Receive timer */
|
|
|
|
+/** Interrupt throttling Register */
|
|
+#define INTEL_ITR 0x000C4UL
|
|
+
|
|
/** Interrupt Mask Set/Read Register */
|
|
#define INTEL_IMS 0x000d0UL
|
|
|