From nobody Tue Oct 29 00:29:29 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 4Xcrjk0lgpz5by7J; Tue, 29 Oct 2024 00:29:30 +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 4Xcrjk07jtz42JT; Tue, 29 Oct 2024 00:29:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730161770; 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=K1ImerrhC14ZhDjnqQfLPaQx52ru1QxGgt0L/4nDilI=; b=vuRhxj4svEObc/Ux1NEZ/fTQx4KjOoiMfaJ41xnbdqr0pFAnCSqT980dS4o1yTb4ge04pG Wu5+qEfYkTDy2aSto8S/XmZgjojKvb8XhQ8UwnFrX3/wsaKhh6OrQTaypcshTMVKuK42+w 5DukNkX9iGylSV4mjxMkN01sncVLoAzjDDZ8DRMA3l88pb0GHNhJbXcdcTpUJt8iOCZo9q 3JwjYE2PHt42bNP48gX2ZaU/tFdp7ryipNlPApOAW5qaMj+uISQka1BL0fzSyeZo+pRiuW KVo+ORs8qIvjxWrMeDI5lU5+ADaWP1WHpCvTZ2hXOndfoYOwTgkSCbBpQEEyIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730161770; 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=K1ImerrhC14ZhDjnqQfLPaQx52ru1QxGgt0L/4nDilI=; b=eGn9Cd6P5LDvkZTPtFAsGCVIZGw3F1LS6RPABp8u4p7DVt9TYrzjGQ0Vz3wbwD3yhxbENy mPLLmb6aN/dY0InuXuXJpotjC9wbn+/s26vR/nSvWGYJ6mCUUAzBaPqrUASe6HwmZKZ+WL lwu3FkEPn8fbRqOUsU5W5iSpcanwbXJZPPMlLzlelOl2WvkPtkC7zeLIgl3bkZG0Y84OQ3 BiR7YcOCO81XbswC8oGSChW4e2R1/fwwwmu/exOLuS8gfgDRA+3rwBfLT/YBmS0x9h3dTV Q+RgSfQmAPQHnHRvSQhLwf8ekymt/QCe3mFQ1wSMWm4ehzMRvoodEAvVMrGFmw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730161770; a=rsa-sha256; cv=none; b=T1x7iI7ST8tQaBbOHaw7O0yBViZLn7cVzjAWpU98LtR5NBgrLHVAH84potbFDiRTQOq63B oEAonsBYbDJf20etXqnZqeIaIwExWD7osuNzDjSTpZDQGPR6RkWUBQC8Gv//5lmMU1c/QX uqkl9zco6xfL5klKtLWAFiWbtigqKdLM/H2BCBR/s5BXw37foayegpm4jXfmTRFU+dXg+I nguT4aYPnp/e/SAW/o6/p7h7btNhtWc5d963LXBAsWwKNikjPSoDrneqdnKZff85+sajRI 29K9aOpsBG+NoWjUgUgkBi8bFA/l+KAwg3M35zUlwzEIhT+WO5UaSW0fQuYWsQ== 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 4Xcrjj6sH2z11xR; Tue, 29 Oct 2024 00:29:29 +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 49T0TTfS073188; Tue, 29 Oct 2024 00:29:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49T0TTng073185; Tue, 29 Oct 2024 00:29:29 GMT (envelope-from git) Date: Tue, 29 Oct 2024 00:29:29 GMT Message-Id: <202410290029.49T0TTng073185@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: 9679df8eea14 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 9679df8eea14a5f707aa870328d9bb211f12c570 Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=9679df8eea14a5f707aa870328d9bb211f12c570 commit 9679df8eea14a5f707aa870328d9bb211f12c570 Author: Kevin Bowling AuthorDate: 2024-10-26 21:34:30 +0000 Commit: Kevin Bowling CommitDate: 2024-10-29 00:29:03 +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 66a1e4fe2df1..d5fe1a5c6b30 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 (if_getmtu(ifp) > 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