From nobody Sun May 15 17:04:52 2022 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 B139F1AD9455; Sun, 15 May 2022 17:04:52 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4L1TJh4FTXz3jBN; Sun, 15 May 2022 17:04:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652634292; 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=LrJTs1GSHPzzQqyWDDKIU2cSQs5Tvpzpe8x/qv3u6XU=; b=AaewmdjOcHNuF4dHQ0+0Yx2r4RwNDkrvvIxA7RSJRJ564XDIzbqQioEbs+AabRQocer9Sf 6MGz4f6G4t9wp9Y3xoGQgtqGi9F3GhHOdxLgSDsp4jUVt5884CzD2Rcx1u0Um4AtlQAFgv 8sZHUZ7TCYVRmtHGSjlDlMUvmJhwOrfY+QeIChfsYy/FKZ7hCexFbKVuzhnfcGZmHrjs8V DSSFfBS1SVtC+Z5TTZhRCO8Y4xdkp5+9Uof89yPtGd8XJHoYEb369u6Iru9KJRYvQrMhP6 fCgTt7tUqBPHsm5FUdCLN3qP/cLA3wM+Su36oxVjwIvpnOXNn1IK2q4zPVwVXw== 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 72FA37C1A; Sun, 15 May 2022 17:04:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 24FH4q4p087431; Sun, 15 May 2022 17:04:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24FH4qlt087430; Sun, 15 May 2022 17:04:52 GMT (envelope-from git) Date: Sun, 15 May 2022 17:04:52 GMT Message-Id: <202205151704.24FH4qlt087430@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: f4262a065dcf - stable/12 - e1000: Increase rx_buffer_size to 32b 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/12 X-Git-Reftype: branch X-Git-Commit: f4262a065dcf32169d2e8b5434a5030bf60f1ae3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652634292; 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=LrJTs1GSHPzzQqyWDDKIU2cSQs5Tvpzpe8x/qv3u6XU=; b=hGxWxhqWcUmk1TCYJtY+vMeH9i+zDs/nF2N/dXJYrdJGipVD2ENM642LU0cikZY1ki9Sz1 GCZw+xGkBJmABExhy22xcZR6U02SUWzztifK1WHXLW+EwwcJeBywJjjy2RhKo4CXK0xkY/ BDtICg/Jx9mIhe50+N0ijOCS22lMzCHs0KK6LIxgbrjuihfj+E2YNxBuC4wmc+XUvHY6V9 8NB7JvQydi0MQWr4oty3j1KR7ftz2K2Uo4ZkSN5cZg6uu5y9Hw1paIqOXr9GOGEodoJ1Q6 xeAowY6fbfEksiQLpdMKr5V+CU6CdFTVirMvOxjGZMH9lSiPz6is5e1jgmY3Aw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652634292; a=rsa-sha256; cv=none; b=xA6czF4vD53C0tirZxFMaXabpnWJWNR3IiRTkdXuJF4VRg+YvvwfR2Ti3QCDVYhjMSUQuR ea//wuOW4k204j32he3WWn+1LS4oPMETST22Sid4f20LTE+as/YBx3d2Ji2y5VCvefppBB amLVH1bNQvi2Ec3oTbhjfWBEWP5Pi7ML5sI/a1uYsGyhMedd8MVO328ihxC5FUFBdiv6B4 I3OeGpkyXYxWwwna3zjJYn+6y1dT9j0S046ORoJI1nuSs0jyBGIFHvI2vaKBfKfoPFfZD7 8IDuXvPtDcY7N5kAAKNm0xcHH4pcKrA2krjwMHjFexLDSAGUexUtgl353461xQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kbowling (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=f4262a065dcf32169d2e8b5434a5030bf60f1ae3 commit f4262a065dcf32169d2e8b5434a5030bf60f1ae3 Author: Kevin Bowling AuthorDate: 2022-05-12 15:38:09 +0000 Commit: Kevin Bowling CommitDate: 2022-05-15 17:04:38 +0000 e1000: Increase rx_buffer_size to 32b Extend the size of the local rx_buffer_size variable to account for larger buffer sizes possible on 82580, i350 chips. From i350 datasheet, 6.2.10 Initialization Control 4 (LAN Base Address + Offset 0x13): When 4 ports are enabled maximum buffer size is 36 KB. When 2 ports are enabled maximum buffer size is 72 KB. When only a single port is enabled maximum buffer size is 144 KB. and 8.3: The overall available internal buffer size in the I350 for all ports is 144 KB for receive buffers and 80 KB for transmit Buffers. Disabled ports memory can be shared between active ports and sharing can be asymmetric. The default buffer size for each port is loaded from the EEPROM on initialization. From the reporter: But for I350 when only 2 ports are used PBA size can be set as 72KB (see datasheet RXPbsize or e1000_rxpbs_adjust_82580 function in e1000_82575.c). In this case calculating the rx_buffer_size overflows as 0x0048 << 10 = 73728 or 0x12000 pushed into u16. It is then set as 0x2000 or 8192. PR: 263896 Reported by: hannula@gmail.com Tested by: hannula@gmail.com Approved by: markj Differential Revision: https://reviews.freebsd.org/D35167 (cherry picked from commit 6987c47569b377f4b6eba9966afdedfb1b39fca8) --- sys/dev/e1000/if_em.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index 7e854514aafb..821bb87f0ff3 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -2467,7 +2467,7 @@ em_reset(if_ctx_t ctx) struct e1000_softc *sc = iflib_get_softc(ctx); struct ifnet *ifp = iflib_get_ifp(ctx); struct e1000_hw *hw = &sc->hw; - u16 rx_buffer_size; + u32 rx_buffer_size; u32 pba; INIT_DEBUGOUT("em_reset: begin");