From nobody Thu Sep 17 00:20:29 2026 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 4hlbxp0TYqz6sXtg for ; Thu, 17 Sep 2026 00:20: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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hlbxn586Qz4P6t for ; Thu, 17 Sep 2026 00:20:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789604429; 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=2EDuvfYBzDnSzeqX3HJulc/VuDXGad8R8evv6fz7Hpg=; b=IZoszY9HG8M/zpwGlvU2sUcb+8mmykk1Elk+iEXKHeSWzL3wwgGFJe6iO37JgG/z6vPB3e ojEScLp0Pcuq4RRwoTvSz5WWLPJKQjEEu2VaK2ITz6gl5RntS0mRlIhkaZic9oeND5YVWg 7JgYTGIPM9Js2zOPYon7fcBxuSXOPK+T9aIIEhlJbQ8eddS3yp0BDsp1DQdkZ7NdRTgTUN hN2+Btt7oEz2EVUTo4F1pHHxfsGbowsqBqDjF48MuDM2IWcmLvqvfmILONPX3KN3ghBP2V 1TeZfSiklD19YOifWQvnQzg8P4sSd8mhRucQ8JqJlzf1ICzO/bUGg0pb74ZYPw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1789604429; b=vKWPsalTINAmJHzYcsNFl6hrXbniaabs0WLHq9Fw+TWlkDjU82QnY0HusFJbJFVIi4NDbq 1R2/azvNBKcDul9anIKebve74blI98jsGUOI6Ofo9mvtWt6O3X+M9nntWHeuYYimNc7WFQ 5NdQI3wXVVCg0U3eG5CNt0nf9/pzeiU0mNgAxgiXtV7JQZIkDrcB+nKn8RMei3Pk585DDV 8O1d1Z9OCk739jsyKsDHpyGSlTpI5P/+zruG68gnpgcrJq83ElRwQvK10yVhEsFN0uE+kB cibjK6y56YwZGJouZ7qxrRiT/8MoPnPVOdGTd+N5SzZPt9i6kAeI81/stRx0CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789604429; 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=2EDuvfYBzDnSzeqX3HJulc/VuDXGad8R8evv6fz7Hpg=; b=Zwv+VA8/jwBBaUxwePHlayA2i9NmGkFqX/qqUftftCA7J+VcvLEBZzHK1hYyk/L8O9xA0L kMbiL+/VtzIXc7Ut2S1R4geGR0I4RSg77V5u7wYnu7xl/LBJVDVQ2oyjLSB7ZzMOwX4K3m 1dJw/qnWipC12QNpDAI2/CgM31EjwlnnJiQL4J1t9rHYU/e0ZXxtD0C5ikK2iulPWEZCto SjY1rwEmULiFaxUL0CKFyweP1fSJL9WkBW1r4RYoRRST63mnm0y5xT8eTCXXcU1TIkceJe nhq6my5m+rCoxbjb+pYz9Z9aki0ra+NUti8mp8NAFK+uzS5n3IevGpxGuPcPJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hlbxn3gkgz17xW for ; Thu, 17 Sep 2026 00:20:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 30cca by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 17 Sep 2026 00:20:29 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: f908fbb9b267 - main - iavf: Honor PF-negotiated RSS sizes 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list 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: f908fbb9b2671cbc6cf366c8287899940e3c88b5 Auto-Submitted: auto-generated Date: Thu, 17 Sep 2026 00:20:29 +0000 Message-Id: <6aab324d.30cca.6ebc7a89@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=f908fbb9b2671cbc6cf366c8287899940e3c88b5 commit f908fbb9b2671cbc6cf366c8287899940e3c88b5 Author: Kevin Bowling AuthorDate: 2026-09-16 23:34:27 +0000 Commit: Kevin Bowling CommitDate: 2026-09-17 00:20:23 +0000 iavf: Honor PF-negotiated RSS sizes Use the key and lookup table lengths returned by GET_VF_RESOURCES when configuring RSS through virtchnl, as DPDK does. The Windows E835 PF advertises a 40-byte key and rejects our fixed 52-byte CONFIG_RSS_KEY request, leaving receive traffic on queue zero. Validate the negotiated lengths before constructing AdminQ messages and publish the lookup table size to iflib. Preserve register-mode RSS selection and its fixed hardware sizes. Use aligned, zero initialized key storage so an RSS kernel's 40-byte key does not leave an uninitialized tail when the PF requests 52 bytes. Validation: normal and RSS enabled iavf module builds passed. On an E835 VF under Hyper-V Server 2025, repeated IPv4 and IPv6 receive tests used all three configured guest RX queues in both transparent hn and non-transparent lagg modes. The RSS key rejection disappeared, IPv4 transmit tests passed, and no TX watchdog fired. Each traffic case used three runs of 16 streams. Obtained from: DPDK (negotiated RSS sizing) MFC after: 2 weeks Sponsored by: BBOX.io --- sys/dev/iavf/iavf_lib.c | 15 ++++++++++++++- sys/dev/iavf/iavf_vc_common.c | 8 ++++---- sys/dev/iavf/if_iavf_iflib.c | 3 +++ 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/sys/dev/iavf/iavf_lib.c b/sys/dev/iavf/iavf_lib.c index e7cd9222bd68..9d6d64829268 100644 --- a/sys/dev/iavf/iavf_lib.c +++ b/sys/dev/iavf/iavf_lib.c @@ -520,6 +520,19 @@ iavf_get_vsi_res_from_vf_res(struct iavf_sc *sc) device_t dev = sc->dev; sc->vsi_res = NULL; + /* Bound PF-sized messages and preserve iflib's table-mask assumption. */ + if ((sc->vf_res->vf_cap_flags & (VIRTCHNL_VF_OFFLOAD_RSS_REG | + VIRTCHNL_VF_OFFLOAD_RSS_PF)) == VIRTCHNL_VF_OFFLOAD_RSS_PF && + (sc->vf_res->rss_key_size == 0 || + sc->vf_res->rss_key_size > IAVF_RSS_KEY_SIZE || + sc->vf_res->rss_lut_size == 0 || + sc->vf_res->rss_lut_size > IAVF_AQ_BUF_SZ - + sizeof(struct virtchnl_rss_lut) + 1 || + !powerof2(sc->vf_res->rss_lut_size))) { + device_printf(dev, "Unsupported PF RSS sizes: key %u lut %u\n", + sc->vf_res->rss_key_size, sc->vf_res->rss_lut_size); + return (EINVAL); + } for (int i = 0; i < sc->vf_res->num_vsis; i++) { /* XXX: We only use the first VSI we find */ @@ -1090,7 +1103,7 @@ iavf_config_rss_reg(struct iavf_sc *sc) u32 lut = 0; u64 set_hena = 0, hena; int i, j, que_id; - u32 rss_seed[IAVF_RSS_KEY_SIZE_REG]; + u32 rss_seed[IAVF_RSS_KEY_SIZE_REG] = {0}; u32 rss_hash_config; /* Don't set up RSS if using a single queue */ diff --git a/sys/dev/iavf/iavf_vc_common.c b/sys/dev/iavf/iavf_vc_common.c index 37b085f7ef08..9470d764d610 100644 --- a/sys/dev/iavf/iavf_vc_common.c +++ b/sys/dev/iavf/iavf_vc_common.c @@ -724,17 +724,17 @@ iavf_config_rss_key(struct iavf_sc *sc) { struct virtchnl_rss_key *rss_key_msg; int msg_len, key_length; - u8 rss_seed[IAVF_RSS_KEY_SIZE]; + u32 rss_seed[IAVF_RSS_KEY_SIZE_REG] = {0}; #ifdef RSS /* Fetch the configured RSS key */ rss_getkey((uint8_t *) &rss_seed); #else - iavf_get_default_rss_key((u32 *)rss_seed); + iavf_get_default_rss_key(rss_seed); #endif /* Send the fetched key */ - key_length = IAVF_RSS_KEY_SIZE; + key_length = sc->vf_res->rss_key_size; msg_len = sizeof(struct virtchnl_rss_key) + (sizeof(u8) * key_length) - 1; rss_key_msg = (struct virtchnl_rss_key *) malloc(msg_len, M_IAVF, M_NOWAIT | M_ZERO); @@ -804,7 +804,7 @@ iavf_config_rss_lut(struct iavf_sc *sc) u32 lut; int i, que_id; - lut_length = IAVF_RSS_VSI_LUT_SIZE; + lut_length = sc->vf_res->rss_lut_size; msg_len = sizeof(struct virtchnl_rss_lut) + (lut_length * sizeof(u8)) - 1; rss_lut_msg = (struct virtchnl_rss_lut *) malloc(msg_len, M_IAVF, M_NOWAIT | M_ZERO); diff --git a/sys/dev/iavf/if_iavf_iflib.c b/sys/dev/iavf/if_iavf_iflib.c index 25aee839648a..0838eabbec1f 100644 --- a/sys/dev/iavf/if_iavf_iflib.c +++ b/sys/dev/iavf/if_iavf_iflib.c @@ -401,6 +401,9 @@ iavf_if_attach_pre(if_ctx_t ctx) scctx->isc_tx_tso_size_max = IAVF_TSO_SIZE; scctx->isc_tx_tso_segsize_max = IAVF_MAX_DMA_SEG_SIZE; scctx->isc_rss_table_size = IAVF_RSS_VSI_LUT_SIZE; + if ((sc->vf_res->vf_cap_flags & (VIRTCHNL_VF_OFFLOAD_RSS_REG | + VIRTCHNL_VF_OFFLOAD_RSS_PF)) == VIRTCHNL_VF_OFFLOAD_RSS_PF) + scctx->isc_rss_table_size = sc->vf_res->rss_lut_size; scctx->isc_capabilities = scctx->isc_capenable = IAVF_CAPS; scctx->isc_tx_csum_flags = CSUM_OFFLOAD;