diff --git a/repos/dde_ipxe/patches/intel_rx_throttle.patch b/repos/dde_ipxe/patches/intel_rx_throttle.patch new file mode 100644 index 0000000000..7d3518d753 --- /dev/null +++ b/repos/dde_ipxe/patches/intel_rx_throttle.patch @@ -0,0 +1,42 @@ +--- 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 + diff --git a/repos/dde_ipxe/ports/dde_ipxe.hash b/repos/dde_ipxe/ports/dde_ipxe.hash index 17cbf4fa29..931410cb53 100644 --- a/repos/dde_ipxe/ports/dde_ipxe.hash +++ b/repos/dde_ipxe/ports/dde_ipxe.hash @@ -1 +1 @@ -c20a39b17bca4d9cefcee43f366f5c23296396e0 +a7206d6c2a1b2de7fa7fde6733a3500411a64de2 diff --git a/repos/dde_ipxe/ports/dde_ipxe.port b/repos/dde_ipxe/ports/dde_ipxe.port index 426ec7c82b..797c63f30d 100644 --- a/repos/dde_ipxe/ports/dde_ipxe.port +++ b/repos/dde_ipxe/ports/dde_ipxe.port @@ -11,7 +11,8 @@ PATCHES := patches/dde_ipxe.patch \ patches/intel_update.patch \ patches/tg3.patch \ patches/realtek.patch \ - patches/intel_tx_batch.patch + patches/intel_tx_batch.patch \ + patches/intel_rx_throttle.patch PATCH_OPT := -p1 -d ${DIR(ipxe)}