From nobody Fri Jul 18 19:16:15 2025 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 4bkKJw103Rz62g59; Fri, 18 Jul 2025 19:16:16 +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 4bkKJv5nV5z42LB; Fri, 18 Jul 2025 19:16:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752866175; 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=85aj+FgqhIPhQTpl95/sjhey+5EJEhmg4OeXC4YlX6A=; b=e9CU8osaVY+yXelwMEiboDQVO+6G5NoCnXUyNNyDSnUkjLC3IyukIrh934+luCPgCmFtGw /qrCXE/8uFx2gU8exxTft6FFz0OiLF6fjMFCwpRgIUxwgLUpifg7QN+1bcNGth00qxNd/W +if5Am/+lFqjVq7BWQBdbIOQLlptgFQgHtSqM/O6lvY99Np1XjUuxmk68yIQckeJ3D9VMf /oRvnjXvRb+92GQWEx0wDP7VKbNv105SmFbnvizHKHsV4BjdYFc4n0eG5UmxuSAQhaHXy/ 7eGVDtlSv/o3gq1kezNWl0Jutj+1+xR/QdlpN6iJZQvz7JaV1LEUSkkx0rKZUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752866175; 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=85aj+FgqhIPhQTpl95/sjhey+5EJEhmg4OeXC4YlX6A=; b=WCT5odMenBRX7sFde3Mk4gu4sZK2dFxz07AthqPG03rRFSYsL6E44x5FOJcQXuEMISOGCu jFpLI8E0VklrUsf9xY8uGdAf3dByNqktzuHMGYb5V5fMii5RRcP3vrwlpKCKmbK4Rv1z9V mP1hjXqY3IkHg3IqvYtdQRs82jZawvUKlvnO1r68HbszZfDI0WSsUlY/Fyc8sCuldNllGi MNCOW0E0CdzdjOe0YN5WnVgAh+ugxoPRb2Z7OmLx4ZqFFekdVkdFB30Z4LFVcUK9yCuVxQ 2rRB2zDZneL/y77d2T3/WSBxTHluXaWDnBz6lXyMOjy8HSWMo4ULmWqrHVt56w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752866175; a=rsa-sha256; cv=none; b=OyRhfffgDcCPGthm/fsiIu8r7Y6Luo39HDjJ6AeXX+BNSZ8h/m+XW+MM4NvlfhdouX/0Y4 2N5rJ+qg2NrBngnsF1TTrpfeKE4Jdj2wdw4i1M9lgmz7ttQfycEWFt6G6KonnpcAQbnuyM Ia7GHQWIj5s6r+LqzlT21Qb0shLilWChpYAm3zjJQ0jGKqQsl1Seki7Nvvq8CBs/fG50jS Jd9aCfTXXtgkB3Ghlq8NqOGIlet1quQrjdX0vJOZxYcY0lJ+q6he7EH8oo2u/9Gqf7rKYx S8p2FuL6lqyF9rU5Pa6Nv8Y/aIOEKszqmaQV4wuEJlr+qXhOoGLAkU/uog/84Q== 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 4bkKJv52m7zt81; Fri, 18 Jul 2025 19:16:15 +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 56IJGFlg000951; Fri, 18 Jul 2025 19:16:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56IJGFj3000949; Fri, 18 Jul 2025 19:16:15 GMT (envelope-from git) Date: Fri, 18 Jul 2025 19:16:15 GMT Message-Id: <202507181916.56IJGFj3000949@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 21f339571328 - main - ice(4): Fix panic when VF uses less queues then available 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 21f33957132876c8a5815b793fd72e8310230caf Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=21f33957132876c8a5815b793fd72e8310230caf commit 21f33957132876c8a5815b793fd72e8310230caf Author: Krzysztof Galazka AuthorDate: 2025-02-12 13:41:01 +0000 Commit: Warner Losh CommitDate: 2025-07-18 19:16:16 +0000 ice(4): Fix panic when VF uses less queues then available VF driver may request to configure MSI-X vectors for less queues than assigned by PF. Don't try to configure unassigned vectors to avoid panic. While at that make the loop process whole array of vectors received in a VIRTCHNL_OP_CFG_IRQ_MAP message from a VF. It's not guarantied that vector '0', which is used for other interrupt causes and is not mapped to a queue, will be always on the last position. Condition inside the loop already handles that vector correctly. Signed-off-by: Krzysztof Galazka Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1573 --- sys/dev/ice/ice_iov.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/dev/ice/ice_iov.c b/sys/dev/ice/ice_iov.c index 0d04c06b3140..b11fb225f30a 100644 --- a/sys/dev/ice/ice_iov.c +++ b/sys/dev/ice/ice_iov.c @@ -1242,7 +1242,7 @@ ice_vc_cfg_irq_map_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) vvm = vimi->vecmap; /* Save off information from message */ - for (int i = 0; i < vimi->num_vectors - 1; i++, vvm++) { + for (int i = 0; i < vimi->num_vectors; i++, vvm++) { struct ice_tx_queue *txq; struct ice_rx_queue *rxq; int bit; @@ -1305,12 +1305,14 @@ ice_vc_cfg_irq_map_msg(struct ice_softc *sc, struct ice_vf *vf, u8 *msg_buf) /* Write to T/RQCTL registers to actually map vectors to queues */ for (int i = 0; i < vf->vsi->num_rx_queues; i++) - ice_configure_rxq_interrupt(hw, vsi->rx_qmap[i], - vsi->rx_queues[i].irqv->me, vsi->rx_queues[i].itr_idx); + if (vsi->rx_queues[i].irqv != NULL) + ice_configure_rxq_interrupt(hw, vsi->rx_qmap[i], + vsi->rx_queues[i].irqv->me, vsi->rx_queues[i].itr_idx); for (int i = 0; i < vf->vsi->num_tx_queues; i++) - ice_configure_txq_interrupt(hw, vsi->tx_qmap[i], - vsi->tx_queues[i].irqv->me, vsi->tx_queues[i].itr_idx); + if (vsi->tx_queues[i].irqv != NULL) + ice_configure_txq_interrupt(hw, vsi->tx_qmap[i], + vsi->tx_queues[i].irqv->me, vsi->tx_queues[i].itr_idx); ice_flush(hw);