From nobody Sun Oct 06 03:50:59 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XLpGr1hbmz5YCMZ; Sun, 06 Oct 2024 03:51:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XLpGq6whtz4GNV; Sun, 6 Oct 2024 03:50:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728186660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e7Z4uQmadT7Qtuwh3mQ1Z+Plb36+nOc2bQx4Xlmb4Ok=; b=WTW17bYpsnYUF7QSjxbyX9jYPGow7TOoTERbBSiFZ4M2Bt/ydm7ZtIE8+6GYnW7rqnoDkv IyfRo3uXoBM7dAOQw9ekffpoZSJLkU0xnL4d7wRKv/WHgW6TyPA2FFmOnKTgjDEHTjJ9k+ biSED4dJ8N7QXWk+MtyZLyG2RzkAcbI6ISBC/GHE2mBTjj+5NjLg8yyQX4NL8O8d3RfCUj vFgW/Ps6jjCKtdQbMW1um/eSx5WSW5KqwyAFE102rHc12MNBHnI5BTkemoqc3+K8ZZHJNW DSZw7DsJ6ikh/gibv6wiSfvXaZhpa/maCqSkpMTarFHN9GcpAF90llRpl1JQdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728186660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=e7Z4uQmadT7Qtuwh3mQ1Z+Plb36+nOc2bQx4Xlmb4Ok=; b=hCGHQSgN3WsFGnuqSGGQmwqeQ3t6nPkD+Q7l/7zTPgQEhfQ2tGckoJ2yI9jld8cUCiZcu9 vypeyXyLe21uUBm6Q3UJ4pqP1YkDLX5rWZkSPY1GXLmex85H4uKPUZe7zTXmMzxz0MPw2D lXKwd4H5Tt02xqvYR94h0bcYcFy7FzEXNNfJpZxbjOG6IdA5KT7MG28DvBcxiDOmeOLFwB aiZjzedHQ9nEDmpnQtO7Li2vU0SjQNq+4CARZ+DcRuW/u2axG2RAwuwGhOKOPREglBAPii cS2pK0W6+wkKT0Q6O4tGP4MCPPccMvoOMjscI2Ozs7NsX/Eb7Ddhms5ZqfVjIg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728186660; a=rsa-sha256; cv=none; b=BYtVP34AdBq5d0AsFDs3BPuaJfeHK6+2RhtUXlEhWeUZDXY66yvFfGGGisuomnf0nJq6IF TKDId4xx1VjcL6DblAHVFkS01qSC1lZ64cMfwkrjTn4hq8AJFM3fRMpDd3wV4jqtX1tP2K SnKj0qoQ/NeFoj5ESCWQ6aJKkNs8F0kSpQhuJIJ7bUhczRBhoh7+yZDojyCDNGjtvreblt vQPwmubk0mtpiK7DUNcWgiHfGU9p8f48rDHkHxXl2ybwd5za3RLOUS19JRag980gs4/hab A9wq/7FkMWWNydX60Ffcvm1FV86FI1VkRy4BeHt2BamOcDlG3T30kxATQj9X4Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XLpGq6PmXzmMy; Sun, 6 Oct 2024 03:50:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4963oxj1003164; Sun, 6 Oct 2024 03:50:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4963ox3g003161; Sun, 6 Oct 2024 03:50:59 GMT (envelope-from git) Date: Sun, 6 Oct 2024 03:50:59 GMT Message-Id: <202410060350.4963ox3g003161@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 98e48cd46046 - stable/13 - igc: Remove non-existent legacy absolute and packet timers List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 98e48cd460465b12c39434430c3c35a6f907acb6 Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=98e48cd460465b12c39434430c3c35a6f907acb6 commit 98e48cd460465b12c39434430c3c35a6f907acb6 Author: Kevin Bowling AuthorDate: 2024-09-29 04:32:49 +0000 Commit: Kevin Bowling CommitDate: 2024-10-06 03:50:02 +0000 igc: Remove non-existent legacy absolute and packet timers igc, derived from igb, does not use these registers. All interrupt timing is governed by EITR or LLI and driven by write-back. Sponsored by: BBOX.io (cherry picked from commit a40ecb6f740530fb7e6a95e702113aa3fe24d975) --- sys/dev/igc/if_igc.c | 109 ------------------------------------------------- sys/dev/igc/if_igc.h | 59 -------------------------- sys/dev/igc/igc_regs.h | 5 --- 3 files changed, 173 deletions(-) diff --git a/sys/dev/igc/if_igc.c b/sys/dev/igc/if_igc.c index 8de044169269..19bedd52a1bc 100644 --- a/sys/dev/igc/if_igc.c +++ b/sys/dev/igc/if_igc.c @@ -121,9 +121,6 @@ static int igc_sysctl_debug_info(SYSCTL_HANDLER_ARGS); static int igc_get_rs(SYSCTL_HANDLER_ARGS); static void igc_print_debug_info(struct igc_adapter *); static int igc_is_valid_ether_addr(u8 *); -static int igc_sysctl_int_delay(SYSCTL_HANDLER_ARGS); -static void igc_add_int_delay_sysctl(struct igc_adapter *, const char *, - const char *, struct igc_int_delay_info *, int, int); /* Management and WOL Support */ static void igc_get_hw_control(struct igc_adapter *); static void igc_release_hw_control(struct igc_adapter *); @@ -212,12 +209,6 @@ static driver_t igc_if_driver = { * Tunable default values. *********************************************************************/ -#define IGC_TICKS_TO_USECS(ticks) ((1024 * (ticks) + 500) / 1000) -#define IGC_USECS_TO_TICKS(usecs) ((1000 * (usecs) + 512) / 1024) - -#define MAX_INTS_PER_SEC 8000 -#define DEFAULT_ITR (1000000000/(MAX_INTS_PER_SEC * 256)) - /* Allow common code without TSO */ #ifndef CSUM_TSO #define CSUM_TSO 0 @@ -230,22 +221,6 @@ static int igc_disable_crc_stripping = 0; SYSCTL_INT(_hw_igc, OID_AUTO, disable_crc_stripping, CTLFLAG_RDTUN, &igc_disable_crc_stripping, 0, "Disable CRC Stripping"); -static int igc_tx_int_delay_dflt = IGC_TICKS_TO_USECS(IGC_TIDV_VAL); -static int igc_rx_int_delay_dflt = IGC_TICKS_TO_USECS(IGC_RDTR_VAL); -SYSCTL_INT(_hw_igc, OID_AUTO, tx_int_delay, CTLFLAG_RDTUN, &igc_tx_int_delay_dflt, - 0, "Default transmit interrupt delay in usecs"); -SYSCTL_INT(_hw_igc, OID_AUTO, rx_int_delay, CTLFLAG_RDTUN, &igc_rx_int_delay_dflt, - 0, "Default receive interrupt delay in usecs"); - -static int igc_tx_abs_int_delay_dflt = IGC_TICKS_TO_USECS(IGC_TADV_VAL); -static int igc_rx_abs_int_delay_dflt = IGC_TICKS_TO_USECS(IGC_RADV_VAL); -SYSCTL_INT(_hw_igc, OID_AUTO, tx_abs_int_delay, CTLFLAG_RDTUN, - &igc_tx_abs_int_delay_dflt, 0, - "Default transmit interrupt delay limit in usecs"); -SYSCTL_INT(_hw_igc, OID_AUTO, rx_abs_int_delay, CTLFLAG_RDTUN, - &igc_rx_abs_int_delay_dflt, 0, - "Default receive interrupt delay limit in usecs"); - static int igc_smart_pwr_down = false; SYSCTL_INT(_hw_igc, OID_AUTO, smart_pwr_down, CTLFLAG_RDTUN, &igc_smart_pwr_down, 0, "Set to true to leave smart power down enabled on newer adapters"); @@ -537,29 +512,6 @@ igc_if_attach_pre(if_ctx_t ctx) igc_setup_msix(ctx); igc_get_bus_info(hw); - /* Set up some sysctls for the tunable interrupt delays */ - igc_add_int_delay_sysctl(adapter, "rx_int_delay", - "receive interrupt delay in usecs", &adapter->rx_int_delay, - IGC_REGISTER(hw, IGC_RDTR), igc_rx_int_delay_dflt); - igc_add_int_delay_sysctl(adapter, "tx_int_delay", - "transmit interrupt delay in usecs", &adapter->tx_int_delay, - IGC_REGISTER(hw, IGC_TIDV), igc_tx_int_delay_dflt); - igc_add_int_delay_sysctl(adapter, "rx_abs_int_delay", - "receive interrupt delay limit in usecs", - &adapter->rx_abs_int_delay, - IGC_REGISTER(hw, IGC_RADV), - igc_rx_abs_int_delay_dflt); - igc_add_int_delay_sysctl(adapter, "tx_abs_int_delay", - "transmit interrupt delay limit in usecs", - &adapter->tx_abs_int_delay, - IGC_REGISTER(hw, IGC_TADV), - igc_tx_abs_int_delay_dflt); - igc_add_int_delay_sysctl(adapter, "itr", - "interrupt delay limit in usecs/4", - &adapter->tx_itr, - IGC_REGISTER(hw, IGC_ITR), - DEFAULT_ITR); - hw->mac.autoneg = DO_AUTO_NEG; hw->phy.autoneg_wait_to_complete = false; hw->phy.autoneg_advertised = AUTONEG_ADV_DEFAULT; @@ -2016,12 +1968,6 @@ igc_initialize_receive_unit(if_ctx_t ctx) if (!igc_disable_crc_stripping) rctl |= IGC_RCTL_SECRC; - /* - * Set the interrupt throttling rate. Value is calculated - * as DEFAULT_ITR = 1/(MAX_INTS_PER_SEC * 256ns) - */ - IGC_WRITE_REG(hw, IGC_ITR, DEFAULT_ITR); - rxcsum = IGC_READ_REG(hw, IGC_RXCSUM); if (if_getcapenable(ifp) & IFCAP_RXCSUM) { rxcsum |= IGC_RXCSUM_CRCOFL; @@ -2718,61 +2664,6 @@ igc_print_nvm_info(struct igc_adapter *adapter) printf("\n"); } -static int -igc_sysctl_int_delay(SYSCTL_HANDLER_ARGS) -{ - struct igc_int_delay_info *info; - struct igc_adapter *adapter; - u32 regval; - int error, usecs, ticks; - - info = (struct igc_int_delay_info *) arg1; - usecs = info->value; - error = sysctl_handle_int(oidp, &usecs, 0, req); - if (error != 0 || req->newptr == NULL) - return (error); - if (usecs < 0 || usecs > IGC_TICKS_TO_USECS(65535)) - return (EINVAL); - info->value = usecs; - ticks = IGC_USECS_TO_TICKS(usecs); - if (info->offset == IGC_ITR) /* units are 256ns here */ - ticks *= 4; - - adapter = info->adapter; - - regval = IGC_READ_OFFSET(&adapter->hw, info->offset); - regval = (regval & ~0xffff) | (ticks & 0xffff); - /* Handle a few special cases. */ - switch (info->offset) { - case IGC_RDTR: - break; - case IGC_TIDV: - if (ticks == 0) { - adapter->txd_cmd &= ~IGC_TXD_CMD_IDE; - /* Don't write 0 into the TIDV register. */ - regval++; - } else - adapter->txd_cmd |= IGC_TXD_CMD_IDE; - break; - } - IGC_WRITE_OFFSET(&adapter->hw, info->offset, regval); - return (0); -} - -static void -igc_add_int_delay_sysctl(struct igc_adapter *adapter, const char *name, - const char *description, struct igc_int_delay_info *info, - int offset, int value) -{ - info->adapter = adapter; - info->offset = offset; - info->value = value; - SYSCTL_ADD_PROC(device_get_sysctl_ctx(adapter->dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(adapter->dev)), - OID_AUTO, name, CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, - info, 0, igc_sysctl_int_delay, "I", description); -} - /* * Set flow control using sysctl: * Flow control values: diff --git a/sys/dev/igc/if_igc.h b/sys/dev/igc/if_igc.h index fde9429b5360..a34aa53581ba 100644 --- a/sys/dev/igc/if_igc.h +++ b/sys/dev/igc/if_igc.h @@ -131,65 +131,6 @@ #define IGC_DEFAULT_MULTI_RXD 4096 #define IGC_MAX_RXD 4096 -/* - * IGC_TIDV_VAL - Transmit Interrupt Delay Value - * Valid Range: 0-65535 (0=off) - * Default Value: 64 - * This value delays the generation of transmit interrupts in units of - * 1.024 microseconds. Transmit interrupt reduction can improve CPU - * efficiency if properly tuned for specific network traffic. If the - * system is reporting dropped transmits, this value may be set too high - * causing the driver to run out of available transmit descriptors. - */ -#define IGC_TIDV_VAL 64 - -/* - * IGC_TADV_VAL - Transmit Absolute Interrupt Delay Value - * Valid Range: 0-65535 (0=off) - * Default Value: 64 - * This value, in units of 1.024 microseconds, limits the delay in which a - * transmit interrupt is generated. Useful only if IGC_TIDV is non-zero, - * this value ensures that an interrupt is generated after the initial - * packet is sent on the wire within the set amount of time. Proper tuning, - * along with IGC_TIDV_VAL, may improve traffic throughput in specific - * network conditions. - */ -#define IGC_TADV_VAL 64 - -/* - * IGC_RDTR_VAL - Receive Interrupt Delay Timer (Packet Timer) - * Valid Range: 0-65535 (0=off) - * Default Value: 0 - * This value delays the generation of receive interrupts in units of 1.024 - * microseconds. Receive interrupt reduction can improve CPU efficiency if - * properly tuned for specific network traffic. Increasing this value adds - * extra latency to frame reception and can end up decreasing the throughput - * of TCP traffic. If the system is reporting dropped receives, this value - * may be set too high, causing the driver to run out of available receive - * descriptors. - * - * CAUTION: When setting IGC_RDTR to a value other than 0, adapters - * may hang (stop transmitting) under certain network conditions. - * If this occurs a WATCHDOG message is logged in the system - * event log. In addition, the controller is automatically reset, - * restoring the network connection. To eliminate the potential - * for the hang ensure that IGC_RDTR is set to 0. - */ -#define IGC_RDTR_VAL 0 - -/* - * Receive Interrupt Absolute Delay Timer - * Valid Range: 0-65535 (0=off) - * Default Value: 64 - * This value, in units of 1.024 microseconds, limits the delay in which a - * receive interrupt is generated. Useful only if IGC_RDTR is non-zero, - * this value ensures that an interrupt is generated after the initial - * packet is received within the set amount of time. Proper tuning, - * along with IGC_RDTR, may improve traffic throughput in specific network - * conditions. - */ -#define IGC_RADV_VAL 64 - /* * This parameter controls whether or not autonegotation is enabled. * 0 - Disable autonegotiation diff --git a/sys/dev/igc/igc_regs.h b/sys/dev/igc/igc_regs.h index f4ded07ce6ab..26614dc33df6 100644 --- a/sys/dev/igc/igc_regs.h +++ b/sys/dev/igc/igc_regs.h @@ -27,7 +27,6 @@ #define IGC_CONNSW 0x00034 /* Copper/Fiber switch control - RW */ #define IGC_VET 0x00038 /* VLAN Ether Type - RW */ #define IGC_ICR 0x01500 /* Intr Cause Read - RC/W1C */ -#define IGC_ITR 0x000C4 /* Interrupt Throttling Rate - RW */ #define IGC_ICS 0x01504 /* Intr Cause Set - WO */ #define IGC_IMS 0x01508 /* Intr Mask Set/Read - RW */ #define IGC_IMC 0x0150C /* Intr Mask Clear - WO */ @@ -78,8 +77,6 @@ #define IGC_FCRTV 0x02460 /* Flow Control Refresh Timer Value - RW */ /* Split and Replication Rx Control - RW */ #define IGC_RXPBS 0x02404 /* Rx Packet Buffer Size - RW */ -#define IGC_RDTR 0x02820 /* Rx Delay Timer - RW */ -#define IGC_RADV 0x0282C /* Rx Interrupt Absolute Delay Timer - RW */ /* Shadow Ram Write Register - RW */ #define IGC_SRWR 0x12018 #define IGC_EEC_REG 0x12010 @@ -148,8 +145,6 @@ #define IGC_FFVT_REG(_i) (0x09800 + ((_i) * 8)) #define IGC_FFLT_REG(_i) (0x05F00 + ((_i) * 8)) #define IGC_TXPBS 0x03404 /* Tx Packet Buffer Size - RW */ -#define IGC_TIDV 0x03820 /* Tx Interrupt Delay Value - RW */ -#define IGC_TADV 0x0382C /* Tx Interrupt Absolute Delay Val - RW */ /* Statistics Register Descriptions */ #define IGC_CRCERRS 0x04000 /* CRC Error Count - R/clr */ #define IGC_ALGNERRC 0x04004 /* Alignment Error Count - R/clr */