From nobody Thu Oct 29 06:35:03 2026 X-Original-To: dev-commits-src-branches@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 4jFZGc0PWNz6xtFt for ; Thu, 29 Oct 2026 06:35:04 +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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jFZGb5nzDz5767 for ; Thu, 29 Oct 2026 06:35:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793255703; 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=vyU2FsHs92iMDX2dVITRGmvxmHiA79dQ2dwq8ZdQ588=; b=ek5pDu6g/kCIOO84Nz2QTzbMAfyMEEUZYTbTWryMiUzP/94XFy06/qrgjPT5RNemfvJQaT wDIui+AOCljo/nMeY7iYOsAuN4PhDEhqeKurPs1iZdTKfcwSLjmGH4sAvayeUY+DLa9QUe sxgVm4j6jMxrO9fnSn5ZowFdCZzV/cQAfLO2WXbKyCuIqDRf6EAyYcsT+t7WY7B4YOn8VZ IcKmj3iSkFwztfh2YM8d8RwKihLSOoLTvlVCxBxty5Hud45pZ/eZjva/dFq2UKvluv/j2O hHrp/Q044n6+t2YTt6lDWiJH0Zm7wrErLousTbu1MRW0wPdu7SUFS+vJlM2TlA== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793255703; b=o+9QBFi4/U6PhBjHEoDz58xc7dwbXedH0+N9vMkmyQud59TucAsKTYRteUh46CFzYbWYbL Nj2jWgdCv6pXFt+lokIRsuGArjzdiPjOFEC47eV5ar5sTGJuiM7iGbAA6ctNf4tp3UffyQ IdRT/SWo/Yl7iQkDVPoS691uxyxMAk7dE0jSAvsXPHdFczvc4uHrujv6BiyTf0GH5bVQ0O NOrC6nYwJvxK/IzEm9iPSnJnRwNXqQam2irKOO9v8BJDWOTpxOLqTOi00U0DELEZtTgOnp FhsdSCG12C1u4HyhMeKieZTWdvwkiH5T1HJHS8DGQQpR+hjT/OzgBGMBeSCdjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793255703; 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=vyU2FsHs92iMDX2dVITRGmvxmHiA79dQ2dwq8ZdQ588=; b=YURx15P/sVDD33EREjrPLuQ89W5674I8JvsecY4wnEqyL18fmHVPG2xA6L2T7YNs5Hx/QS CBiityA0P4sT8BZDRtKN9FGr9/WVqt1gkcWcA5i43C+lp0PJheXsOcFCWuFLghPoaWfu+E 4BcZlAVi7QhdN0u1BdaUbuzqeQp8L5AOWneJfYrV/Bczv3Ag0H2uSWgIho0QBT+zQ/6+9q Edyba0e/4EU7kly1+YrYoxRynXgElVv3079wwM+oeec/CaOAwq1cptGyKp/UmFyOZODCDL 1QRJSCp915Cflil9vRVl6uou8khvfrXS2K0oo63IJFyBQQT9U5ahWraJ/Wf5lQ== 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 4jFZGb5BhzzRWD for ; Thu, 29 Oct 2026 06:35:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3cbf8 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 29 Oct 2026 06:35:03 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 75137399399d - stable/15 - iavf: Honor PF-negotiated RSS sizes List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: Commits to the stable branches of the FreeBSD src repository 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/stable/15 X-Git-Reftype: branch X-Git-Commit: 75137399399dc4e6235a9fdc9edff4a724efd746 Auto-Submitted: auto-generated Date: Thu, 29 Oct 2026 06:35:03 +0000 Message-Id: <6ae2e917.3cbf8.3ac11a06@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=75137399399dc4e6235a9fdc9edff4a724efd746 commit 75137399399dc4e6235a9fdc9edff4a724efd746 Author: Kevin Bowling AuthorDate: 2026-09-16 23:34:27 +0000 Commit: Kevin Bowling CommitDate: 2026-10-29 06:19:18 +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) Sponsored by: BBOX.io (cherry picked from commit f908fbb9b2671cbc6cf366c8287899940e3c88b5) --- 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;