From nobody Tue Oct 29 00:31:25 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 4Xcrlx3rL6z5bxpr; Tue, 29 Oct 2024 00:31:25 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xcrlx1m0Tz43g8; Tue, 29 Oct 2024 00:31:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730161885; 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=qu6PAGYqPB3P0etkEG7YzIBGc0EuII4DI7DXqo8bJwY=; b=flGVRpcX+sCkIb0UeC2G74848T1TvTxWOiL7R9/uWKKfee+Ph3MNF21F1gcAinMPQucee2 ZVB6xago3rFmzGDpBJrPkUbFtRHTF6IwMbIpMpKLGpFbku89EMBtXuCeZHYtCOgjyKYPVE znb/8l3Ij7RcK/2r8tXMXFXiTpoVg2Zm8BC4lx6XpeQvKLCnnbHz3oZQBqL9arQEi6D5n2 GBgI1KUr9OXV+g8L+LrPD5pyrx/W3mB/wO2bMtCRRzn0m5snpfUyJw4CK6+Et3YCukTqdB kd6CDJBMtiK9S2XknTtES4ZSdtACzzz4RoAxyMQ4Us5sW1awXN2pR44v2sakzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730161885; 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=qu6PAGYqPB3P0etkEG7YzIBGc0EuII4DI7DXqo8bJwY=; b=kZ0VpP9sFNZBFkKip1wbwLAzMnm+13VJPdr6GtNX3yCWSbmndS/uqEh+eC/cEA0xea3dJE dLVGfaAd9jEeZzNJGX3Bj1hoJmsGXELeDJmzyBxbsKCFUAZ5b0LrkuwUdXUuPLeaUH63UD DUP/0Lytzr5HjeWA8HYRvsh8jBvV+nRuV70fSOPde6YXZ8e6RPHLKean6VlpoBIFp7h0Kd +cen3z0vUJz/6eVpkrjttFbjpQOHelNwq7IP/Zxoxx7s/iByGdFT/t6RPRYbtbIj+DSFve julxNSf4Y7B3rzXfahvOKMt99ctUcaWNkq4UHiS1vIXvlIQlyaFMH1R132li7Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730161885; a=rsa-sha256; cv=none; b=KkUoajuQR+9vxLtznxN681uVFJ0zjqQbwQEpdlsJ2xYAV/xBxfvxutMjh6+EjxSNBOSLv4 Efzj0uk+GxCkTDOjxir7pGXcLGE6MArFWfbdttcQ7/9qNj7r/FCeyAUDeyQZm1GmIsCfn/ ygW7gPGF2CWzMWoLMCpttdpjUBtNcJBB+E4b6RwqKHBeHq+xuwTwDgHl6HaAwn8l514z4w xhup39+0JnLesSLVdyhVkqFAJVLYEzsM6KVUQcW1AnVKgncl8CdzXtupyhSI/PdOKQ3vop LhWG3+OEEl2GCT+3W4XFm/e7k6tAs6SgXmRv7qzm8PgOxIUQtICBDqk3gN6HSg== 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 4Xcrlx1JRWz10l9; Tue, 29 Oct 2024 00:31:25 +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 49T0VPLZ087062; Tue, 29 Oct 2024 00:31:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49T0VPa8087059; Tue, 29 Oct 2024 00:31:25 GMT (envelope-from git) Date: Tue, 29 Oct 2024 00:31:25 GMT Message-Id: <202410290031.49T0VPa8087059@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: 33557727b593 - stable/13 - ixv: Dynamically size the receive packet size 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: 33557727b5936a235506b500a57ecf8239ffae4d Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=33557727b5936a235506b500a57ecf8239ffae4d commit 33557727b5936a235506b500a57ecf8239ffae4d Author: Kevin Bowling AuthorDate: 2024-10-26 21:34:30 +0000 Commit: Kevin Bowling CommitDate: 2024-10-29 00:31:00 +0000 ixv: Dynamically size the receive packet size If MTU of the if_ixv VF driver is configured between 1501 and 2030, and if a peer box have bigger MTU and sends a packet bigger than MTU into this guest, kernel could crash. Dynamically calculate the receive packet size on rx_mbuf_sz as ix(4) does. PR: 268092 Reported by: Kumara Babu Sponsored by: BBOX.io (cherry picked from commit cdbe3de5383706da0f6d3c29f1ec2dcfed366bf1) --- sys/dev/ixgbe/if_ixv.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/dev/ixgbe/if_ixv.c b/sys/dev/ixgbe/if_ixv.c index fe23ea226348..7535d8c15204 100644 --- a/sys/dev/ixgbe/if_ixv.c +++ b/sys/dev/ixgbe/if_ixv.c @@ -1363,7 +1363,7 @@ ixv_initialize_rss_mapping(struct ixgbe_softc *sc) IXGBE_WRITE_REG(hw, IXGBE_VFMRQC, mrqc); } /* ixv_initialize_rss_mapping */ - +#define BSIZEPKT_ROUNDUP ((1<rx_queues; u32 bufsz, psrtype; - if (ifp->if_mtu > ETHERMTU) - bufsz = 4096 >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; - else - bufsz = 2048 >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; + bufsz = (sc->rx_mbuf_sz + BSIZEPKT_ROUNDUP) >> + IXGBE_SRRCTL_BSIZEPKT_SHIFT; psrtype = IXGBE_PSRTYPE_TCPHDR | IXGBE_PSRTYPE_UDPHDR