From nobody Thu Oct 29 06:49:10 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 4jFZZv6y5Bz6xvV7 for ; Thu, 29 Oct 2026 06:49:11 +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 4jFZZv0LTXz4BrM for ; Thu, 29 Oct 2026 06:49:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793256551; 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=oDUorbaHQAzLRxZcJc94ZKLCotBNXJf+Sa+8l74GXjE=; b=nNQ6M/QPY4mNqpIB4OSPKJT1uIKwlZJUyPrQPGbD7nssxqFb033mNc9KcuG9LTH0Pvdxx+ 9qFDArCWINAeuXabI9E+xpZq9k5hl3/q+re4XPP8ftA5bWFybAJ2k93swpPWUPkOyh5FPx 58/V3DzfElSXwu67mdtT/JnhrCmKaf3tyfFyYpHayu2xqnVqKNrPP6TyrpMDFTqs9CNqWZ fFwfoxOO6Te6BBWfjlSIaVvOHm7qFkDjB18C31u5B+CCxRVMY8ZL7IKWrA8NbbNB/gpn0m D5TNfGIYBQ7oFqmGjhXW/Oz299yo/5qE3h67jvd7hJUowonHAHMY/mPqhSwY8w== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1793256551; b=C6g1ByIlX3XwDVYxkSsaU7j+ifscQdrjuK3ejLyRUzMznNU0+SIbpba0ij/ESg3fSmeNBh fA2zPba5WwEtlO9fe/OPWImm+qrbMHe9iqEm1Qa4qE5i6a82CvsSpDWAjUI5TsdPMBkCjq ahk8+7rxYrxQLz1i2veitlYih6/mj24gZp642M/vYa8DGRKtRa8a2HMC8hFkpH55yqD6GW Ur2H3ahR9awO/ONLlcXi9mxrUd57VvoSpVLoQGVVD7F6+SOnJ2QjOFQZA38gZJefbMzLYc lwzXOQfTHha2TJ6yaWvfgfYu4rSYqz4FbWOgg64HiqGyPWX1qUniX2lie6n+PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1793256551; 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=oDUorbaHQAzLRxZcJc94ZKLCotBNXJf+Sa+8l74GXjE=; b=HwVPrimjf+TH7pQhpCGEbAgu8zzWtd9nSxvzSDqC4bWmcv8UXu9cKXZbfRnb2tmtudK7cY e8+OnBgvRjg+wNuORy92mqwneULla0NSc+E2uu0cBZE9uRjt8DdtdsCE7rkg9UopRpOWdB vKZwUg6trih0q6yt0TAh12X8itjkWotcDml3ats/ZZCS93jEgQqYw0HE/5tbvDnsH+HWI5 PwkReZ3J34ygirlKUYEVh22a8R5AhSm7QSopj7SNSJdfNWpnMupSdYO9NA6ssEikNHvoaB SA8n4z6vAzqULVrrzFQPTPDPOCSM54OgFzkL6J0jtfBHToj29K68wjMxxOeieA== 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 4jFZZt74lDzRr3 for ; Thu, 29 Oct 2026 06:49:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3e449 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 29 Oct 2026 06:49:10 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: 43a6b6d6b7fa - stable/15 - qlnx: Report the programmed RSS key and hash types 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: 43a6b6d6b7fa39e2968b4d9ea06ea574115899a4 Auto-Submitted: auto-generated Date: Thu, 29 Oct 2026 06:49:10 +0000 Message-Id: <6ae2ec66.3e449.6c62d96c@gitrepo.freebsd.org> The branch stable/15 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=43a6b6d6b7fa39e2968b4d9ea06ea574115899a4 commit 43a6b6d6b7fa39e2968b4d9ea06ea574115899a4 Author: Kevin Bowling AuthorDate: 2026-09-18 10:11:36 +0000 Commit: Kevin Bowling CommitDate: 2026-10-29 06:48:26 +0000 qlnx: Report the programmed RSS key and hash types Implement SIOCGIFRSSKEY and SIOCGIFRSSHASH for qlnxe and qlnxev using the cached vport RSS configuration. This lets hn(4) synchronize its synthetic RSS configuration with the VF without assuming that every driver programs all of the common RSS hash selections. Serialize the queries with the device lock and reject them while the interface is not running. Convert the firmware request's key words back into network byte order and translate the six representable IPv4/IPv6 TCP/UDP hash selections. Report no hashing when RSS is disabled, including the driver's single-queue configuration. For VFs, require a successful RSS extension response from every hardware function. The overall vport-update reply can succeed while its RSS TLV is missing or rejected; recording that result prevents reporting an unconfirmed configuration. Invalidate the confirmation before each RSS request. Leave existing vport-update return semantics, queue setup, and the receive datapath unchanged. Reviewed by: gallatin Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59810 (cherry picked from commit 9d48fd452ed20746e468dd986fa6b54ca20350a6) --- sys/dev/qlnx/qlnxe/ecore_vf.c | 5 +++ sys/dev/qlnx/qlnxe/ecore_vf.h | 3 ++ sys/dev/qlnx/qlnxe/qlnx_os.c | 84 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+) diff --git a/sys/dev/qlnx/qlnxe/ecore_vf.c b/sys/dev/qlnx/qlnxe/ecore_vf.c index a7b006b982de..fcde9d4046b7 100644 --- a/sys/dev/qlnx/qlnxe/ecore_vf.c +++ b/sys/dev/qlnx/qlnxe/ecore_vf.c @@ -1242,6 +1242,9 @@ ecore_vf_handle_vp_update_tlvs_resp(struct ecore_hwfn *p_hwfn, p_resp = (struct pfvf_def_resp_tlv *) ecore_iov_search_list_tlvs(p_hwfn, p_iov->pf2vf_reply, tlv); + if (tlv == CHANNEL_TLV_VPORT_UPDATE_RSS) + p_iov->rss_configured = p_resp && + p_resp->hdr.status == PFVF_STATUS_SUCCESS; if (p_resp && p_resp->hdr.status) DP_VERBOSE(p_hwfn, ECORE_MSG_IOV, "TLV[%d] type %s Configuration %s\n", @@ -1270,6 +1273,8 @@ enum _ecore_status_t ecore_vf_pf_vport_update(struct ecore_hwfn *p_hwfn, /* clear mailbox and prep header tlv */ ecore_vf_pf_prep(p_hwfn, CHANNEL_TLV_VPORT_UPDATE, sizeof(*req)); + if (p_params->rss_params) + p_iov->rss_configured = false; /* Prepare extended tlvs */ if (update_rx || update_tx) { diff --git a/sys/dev/qlnx/qlnxe/ecore_vf.h b/sys/dev/qlnx/qlnxe/ecore_vf.h index 5ae2fecfb0e7..c6481ec8be3b 100644 --- a/sys/dev/qlnx/qlnxe/ecore_vf.h +++ b/sys/dev/qlnx/qlnxe/ecore_vf.h @@ -82,6 +82,9 @@ struct ecore_vf_iov { * bar or via the doorbell bar. */ bool b_doorbell_bar; + + /* FreeBSD RSS queries require the RSS TLV itself to be accepted. */ + bool rss_configured; }; /** diff --git a/sys/dev/qlnx/qlnxe/qlnx_os.c b/sys/dev/qlnx/qlnxe/qlnx_os.c index 853bd4cb7108..6b896729bf67 100644 --- a/sys/dev/qlnx/qlnxe/qlnx_os.c +++ b/sys/dev/qlnx/qlnxe/qlnx_os.c @@ -58,6 +58,7 @@ #include "ecore_dbg_fw_funcs.h" #include "ecore_iov_api.h" #include "ecore_vf_api.h" +#include "ecore_vf.h" #include "qlnx_ioctl.h" #include "qlnx_def.h" @@ -2527,6 +2528,77 @@ _qlnx_set_promisc_allmulti(qlnx_host_t *ha, bool promisc, bool allmulti) return (rc); } +static int +qlnx_rss_query_status(qlnx_host_t *ha) +{ + int i; + + sx_assert(&ha->hw_lock, SA_XLOCKED); + if (ha->state != QLNX_STATE_OPEN || + (if_getdrvflags(ha->ifp) & IFF_DRV_RUNNING) == 0) + return (ENXIO); + if (IS_VF(&ha->cdev) && ha->rss_params.rss_enable) { + for (i = 0; i < ha->cdev.num_hwfns; i++) { + struct ecore_vf_iov *iov = ha->cdev.hwfns[i].vf_iov_info; + + if (iov == NULL || !iov->rss_configured) + return (ENXIO); + } + } + return (0); +} + +static int +qlnx_get_rss_key(qlnx_host_t *ha, struct ifrsskey *ifrk) +{ + const struct ecore_rss_params *rss = &ha->rss_params; + int error, i; + + error = qlnx_rss_query_status(ha); + if (error != 0) + return (error); + ifrk->ifrk_func = rss->rss_enable ? RSS_FUNC_TOEPLITZ : RSS_FUNC_NONE; + ifrk->ifrk_keylen = rss->rss_enable ? sizeof(rss->rss_key) : 0; + _Static_assert(sizeof(ifrk->ifrk_key) >= sizeof(rss->rss_key), + "RSS query buffer too small"); + bzero(ifrk->ifrk_key, sizeof(ifrk->ifrk_key)); + /* Undo the word conversion used when preparing the firmware request. */ + if (rss->rss_enable) { + for (i = 0; i < ECORE_RSS_KEY_SIZE; i++) + be32enc(ifrk->ifrk_key + i * sizeof(uint32_t), + rss->rss_key[i]); + } + return (0); +} + +static int +qlnx_get_rss_hash(qlnx_host_t *ha, struct ifrsshash *ifrh) +{ + const struct ecore_rss_params *rss = &ha->rss_params; + uint8_t caps; + int error; + + error = qlnx_rss_query_status(ha); + if (error != 0) + return (error); + ifrh->ifrh_func = rss->rss_enable ? RSS_FUNC_TOEPLITZ : RSS_FUNC_NONE; + ifrh->ifrh_types = 0; + caps = rss->rss_enable ? rss->rss_caps : 0; + if (caps & ECORE_RSS_IPV4) + ifrh->ifrh_types |= RSS_TYPE_IPV4; + if (caps & ECORE_RSS_IPV4_TCP) + ifrh->ifrh_types |= RSS_TYPE_TCP_IPV4; + if (caps & ECORE_RSS_IPV4_UDP) + ifrh->ifrh_types |= RSS_TYPE_UDP_IPV4; + if (caps & ECORE_RSS_IPV6) + ifrh->ifrh_types |= RSS_TYPE_IPV6; + if (caps & ECORE_RSS_IPV6_TCP) + ifrh->ifrh_types |= RSS_TYPE_TCP_IPV6; + if (caps & ECORE_RSS_IPV6_UDP) + ifrh->ifrh_types |= RSS_TYPE_UDP_IPV6; + return (0); +} + static int qlnx_ioctl(if_t ifp, u_long cmd, caddr_t data) { @@ -2538,6 +2610,18 @@ qlnx_ioctl(if_t ifp, u_long cmd, caddr_t data) ha = (qlnx_host_t *)if_getsoftc(ifp); switch (cmd) { + case SIOCGIFRSSKEY: + QLNX_LOCK(ha); + ret = qlnx_get_rss_key(ha, (struct ifrsskey *)data); + QLNX_UNLOCK(ha); + break; + + case SIOCGIFRSSHASH: + QLNX_LOCK(ha); + ret = qlnx_get_rss_hash(ha, (struct ifrsshash *)data); + QLNX_UNLOCK(ha); + break; + case SIOCSIFMTU: QL_DPRINT4(ha, "SIOCSIFMTU (0x%lx)\n", cmd);