From nobody Fri Sep 18 23:14:41 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 4hmpNy20yzz6t7JP for ; Fri, 18 Sep 2026 23:14:42 +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 4hmpNx6fD2z3J9Y for ; Fri, 18 Sep 2026 23:14:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789773281; 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=LEk96rYPiCZfch6QZfpa/5zrTKDR+7Xy2bvVEaaxx3w=; b=aw/Wgo/l+SWGcBWzOw8loQ+avWc61m3SXT9Sk/EXz77F0NixEK0oP/AT946B20C0hgjavX Iw6frs17x/R5RkiRtDtykwvcH89LFmTBecu+CLZ/OxfLQFlI/bBpFQLyb4AiE5fhFJSNSJ gC7b5O71yrz0YDihm3V4KsSKL2YcNtWnCr0Q0bJaEFz9rwerpwzb54MynOTpuKOzO0v2Jl tmhGioybH5WqCsS5TUWjPwBS7mTmAapvlLu1nq9dnK77KlMAkyQzZiKRO4thjAreEDoUL/ XHNiEoz4MbeDVu1RGY9MT4XZkehnl20Q4WZsbsnnODxD+UL4mwszSLp6ceC7tw== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1789773281; b=Ngj8R21ScXgomI3E3Uu6NFk2gddk2fpLXxaXMDJvBrxyCaadz2Ym/J+/eivWA8B6iF8wvq KRXJhe//YFx/HeDRWEVBZAEaNa4/4CvBze3tIqE67KOrB+2RSyfWxMvvXPfcaguLcm4tlz 9OyNYoy6WnUt+kPBefow3+F+s1XzyvZWm8BlK6z+x2IeZjT6muz0IZGX8iYKYBV+0hwLew dboqqLeu2ck8xELLnpGlBbnJxPjkYpZW9CJfCFtoNeHjuBISxtX4vdXyLPF2UXhWYUdy0b 7+rlzvSlpJjGvenTOkttLzpH5B5Q/MUgzbw3JKmN4BX7dkYMgf82tDeQ7cz9Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789773281; 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=LEk96rYPiCZfch6QZfpa/5zrTKDR+7Xy2bvVEaaxx3w=; b=Aekta1F1nZgY1PHSeS7iYfji58i5iT/9DLTC7R4dT2Bwr7yo834fnkI/uc8fHLRUIBlwvo PrTodCLSry1fmgV7wf8BTmxCDES2zMAy75dDyNvZADNnKXzJAI1l3tsHKHEcR/Fshigu5k YygMKJP/S//cp4R6KihdMVaMIKehiEzXaDgHLW8ZMBNEvngWXFvyPwiGnRwFjHPZ4Ssx0O wgo6+3JgL6vxU06TiUnAySXyEAyYHKJFMiHIPfyAWQ2mLwNOAGfjHD0yzbuurQVpYQk7yI alJ6c96YfbhQb5EpVpwVe9LvGqUhCp4KQTtTZzkcM/nrotJyNgq4ERIm1dAxuw== 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 4hmpNx5kQRzh3v for ; Fri, 18 Sep 2026 23:14:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 2533f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 18 Sep 2026 23:14:41 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kevin Bowling Subject: git: 9d48fd452ed2 - main - qlnx: Report the programmed RSS key and hash types 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: 9d48fd452ed20746e468dd986fa6b54ca20350a6 Auto-Submitted: auto-generated Date: Fri, 18 Sep 2026 23:14:41 +0000 Message-Id: <6aadc5e1.2533f.6a61401@gitrepo.freebsd.org> The branch main has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=9d48fd452ed20746e468dd986fa6b54ca20350a6 commit 9d48fd452ed20746e468dd986fa6b54ca20350a6 Author: Kevin Bowling AuthorDate: 2026-09-18 10:11:36 +0000 Commit: Kevin Bowling CommitDate: 2026-09-18 23:13:43 +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 MFC after: 2 weeks Sponsored by: BBOX.io Differential Revision: https://reviews.freebsd.org/D59810 --- 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);