From nobody Sun Sep 29 04:58:16 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 4XGX5h57h0z5X65R; Sun, 29 Sep 2024 04:58:16 +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 4XGX5h4bTkz4hjM; Sun, 29 Sep 2024 04:58:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727585896; 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=BfjuxQwnWfVnSAz9G3veODR0Y0f6sYo8LJhYqefaKwA=; b=kYdRck4cNhC/tdnDNSLhWcGZRO4ulzw8vseQMgXYkAZ7riV/nRk3bA+KsMx33JB9qNS/yz pSUhgq6cPvCYRnsiU2bApu74i0GQk07av1NClRAXb5mtKG401J6VaJLZauet3rE62EVjCz K1Oj/N0FBq7betmRVkz/SkM3MrrAI62j5/jAn+jtZsMiESEc12XMxovjxDv3CJSYXXAKi/ LxszY9P6HlfMSKlA2DRttvtyvGgjrBJsiIVixPJmIKCyNfe4Lex6B8DRbZefXpiEZayTgK iO4z8ryVeCFBj7pU0eENrUl22+1ipd266stKNpx2DxsAoyqL0CvSqOfouRN07Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727585896; 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=BfjuxQwnWfVnSAz9G3veODR0Y0f6sYo8LJhYqefaKwA=; b=RcEriVMefaT/sEwK/63TOAvZTjqrbQc3Bkx0qoEpVgJGawGaQAfnSMm98H8UMHdi5D0Ko4 Brv7OkouqB6A9E/mk0BMAV4r55oX/7I8P65wX9kSzv9V928wXwadLG7oYtCncfccAs6Uo6 BZaHydeLoyEpdDrchJ7mcslaKiN9AbisUKRunxoCLoLbtvVFVuc/XrLlkuFC0FtsLK1zGh oV0xWMkXNNiFTXqLg41S8dw0uNWY74cVZqRs2WSBEGunyOH4VEPxHM6q0tV9rsai0PVhyj B6qkPDi9tQhLLP4Fz2OAOD33mFRVf5TB3JM+3V5UjOXYvmlUAzDBLY0CMkMnfQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727585896; a=rsa-sha256; cv=none; b=qCxp76hDC1x9gcKvCvpV8eVFFV5RrOLnVvb0suE4XAd/u44/itDjstBGYsfa2LXpS5QaPi O27OnhC+asjw/cqhPl2mXMuTv0rcp4tcD+J+BGDSO+t0TNeKW2YDlADpIvV//OIqKCawfU /lqL1yvsjQI2x4LxuGPVDm9CclsU42T58+m+73coCrwUxZk27ijCfYqHlD3wCEIC0BEIfc NK4PzSvAul5fMu3KjePdqpBwTQZA4qFpL1af34X9Yn9SWnAv6vLpOjxSPSAOoj8zl+R0eH FME1BdpuTgtTD1DhhK1cY2TzMc21RUYkLd7GcJvOKscX3a3iqM3AiUPJj84hzA== 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 4XGX5h4BqZzvXf; Sun, 29 Sep 2024 04:58:16 +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 48T4wGjx064637; Sun, 29 Sep 2024 04:58:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48T4wG7F064634; Sun, 29 Sep 2024 04:58:16 GMT (envelope-from git) Date: Sun, 29 Sep 2024 04:58:16 GMT Message-Id: <202409290458.48T4wG7F064634@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: a40ecb6f7405 - main - 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/main X-Git-Reftype: branch X-Git-Commit: a40ecb6f740530fb7e6a95e702113aa3fe24d975 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=a40ecb6f740530fb7e6a95e702113aa3fe24d975 commit a40ecb6f740530fb7e6a95e702113aa3fe24d975 Author: Kevin Bowling AuthorDate: 2024-09-29 04:32:49 +0000 Commit: Kevin Bowling CommitDate: 2024-09-29 04:57:37 +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. MFC after: 1 week Sponsored by: BBOX.io --- 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 bfa33c82f7ba..c78edab5e38a 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 *); @@ -211,12 +208,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 @@ -229,22 +220,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"); @@ -536,29 +511,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; @@ -2015,12 +1967,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; @@ -2717,61 +2663,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 0c22ce9f76f4..92865b5b9eb1 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 */