From nobody Sat Oct 26 21:37:45 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 4XbY0T2qC4z5bCbc; Sat, 26 Oct 2024 21:37:45 +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 4XbY0T21d9z4Hrj; Sat, 26 Oct 2024 21:37:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729978665; 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=vuPCSAepbSvQK8HmJxMh/3+v5ixpSNQdUbuVNMv2ihI=; b=RENLeM1cL6XKaePirTNNTv9ucy7AFZZuwruzblIxLRmtCe2QdyLLegssGwtN4h0611yZvQ p2qDNHDKJbBBapmyOG6FTd+W0yo0hAlKYcE2w1aoTe8vh0bq5tYPHbUlA75cRKM0EQzRfj wd9c3vChDGIBZqkzIy/DCyWWMnzUytv3pxWWaIrvILjqZZKnTGgyyQLFucBe0HYLc6tH9/ W+T15A9Liw6XvejsVpPOmBP/cp4fdkaOB1lCQH43s1VBZ8S2GAyuO1/43TvHOzy/Y6YkTF Q+GLTCvRx0eABfFCQqoGEulaZV2PXsQnOPJWScaWsYufDN/WR9WAllWQ/s067A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729978665; 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=vuPCSAepbSvQK8HmJxMh/3+v5ixpSNQdUbuVNMv2ihI=; b=ef+nBRwbImasBhtmwHKE3Bl9S7xmA/Q5tBzQW6EjPxRy++XGUewlDBjc8CM+YF+PojGhrq qMbyF+kkv9rlJOGSXpQt9oLbCf13+knI2SR5tBHcUCxPPM7gRExhZBSRBf6ToCV8Shfg29 UhcwFV1IqsxvZElWpQJ5zWaDDswb0vYuXm/Z3JUb0emwVTTwfxNbbzExwbcWIzdWw+4c// 2ISS8DezXbY4Dddqbqjkc8q+Vr3T6Br1L60e4VnEcxKD+dAgpyWgPYiXOmxURqKSe7CJLk gtaQcLHhSVcnvGO+XH7m1MBa4kx24oCm8t6TVz3wd8gdk00orikKMudULCtrIw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729978665; a=rsa-sha256; cv=none; b=UOghmg/ojHwpq1J9qJboQgYccimJFXsQn1j4d/x4mfu0aaXIRxZQ2lcKrvh/CTPX+KDqp9 c7BsZstjx3Xxqe8sn1o/ew4yWztMTA46r9dS4SeOx6yyrOHce2usys5QfL6x0sl1KzrDnZ NNUee0v6vPGZOAvJu53GhqEcZiSfiBFLMyS+J8yGcJzaBx8q3R2f/1d3GAA4Gvme9BsBp2 Vw0MVFYq8eI27Vv+gpJiEq82hqCl04j5JHTRKhwWYvSgVNbMHCAKJWFfNxSQvObt/TvfyF /MLiaxMcl/dhwuAG9bTd2JuAdmTQfU865dzs7JcmMXd1M6Dva1A0LXgcEsteZg== 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 4XbY0T1HvhzRbq; Sat, 26 Oct 2024 21:37:45 +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 49QLbjNS022824; Sat, 26 Oct 2024 21:37:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49QLbj0a022821; Sat, 26 Oct 2024 21:37:45 GMT (envelope-from git) Date: Sat, 26 Oct 2024 21:37:45 GMT Message-Id: <202410262137.49QLbj0a022821@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: cdbe3de53837 - main - 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/main X-Git-Reftype: branch X-Git-Commit: cdbe3de5383706da0f6d3c29f1ec2dcfed366bf1 Auto-Submitted: auto-generated The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=cdbe3de5383706da0f6d3c29f1ec2dcfed366bf1 commit cdbe3de5383706da0f6d3c29f1ec2dcfed366bf1 Author: Kevin Bowling AuthorDate: 2024-10-26 21:34:30 +0000 Commit: Kevin Bowling CommitDate: 2024-10-26 21:36:48 +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 MFC after: 3 days Sponsored by: BBOX.io --- 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