From nobody Mon Sep 30 04:45:39 2024 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 4XH7mh51Syz5XkSW; Mon, 30 Sep 2024 04:45:40 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XH7mh0LKkz4Fb2; Mon, 30 Sep 2024 04:45:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727671540; 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=tB/1cMRaSjjZ0QT7ooNRA9pxfomrBfZL5pAZC+GtLUE=; b=Lm5uwkoedgCDISyMuPawLiyv6db+X5mGx0BrrYqlZPRML9w2ZQD3pNuYNRHoJujX6U34I9 mE3jKFXydsH2AJSJbxTmch7copLT5H54GIu6vbM9PY6T5A3Lrnep4er/9zaIBU5Y3Dhkhj aHoxjqD3uug60uui22js7SP/eDwz1pGjEd+ewbV1IUm6l79phXvSOL5JHvNjeRJQXyG848 AvtkdjSABcqsxIahXGOwNbss5AZS22GJuirbFeNliMze8sB9UVfgJcxdxMKV44svHHL0H1 NutmQCWj48MCLcBe65p1uK1nMURncpCRtTPvtHQqn8UjFPlmkj8LnEzw5/CXJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727671540; 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=tB/1cMRaSjjZ0QT7ooNRA9pxfomrBfZL5pAZC+GtLUE=; b=Dd+V+WvWwA7q07A2mWXQA9A/ua27JswZi7dIpT3rvEI+IG9mx4Ga0Pum48Y86G4eXzMLWx DST7zbAReJlwQu3h5YWgWBmj0cnlGDB67oXNQkrwUmo8DcfQQCjnsPQsAvR5UA4Sq4KUrq tA6/sLMdOYPGAyZO+GoHbQxhEWTgJsSCe0sBZUYX1Ck1EWyFVdB6NrELw7idX6OrvSQmzu g46VChJmaBW8lVInbh7QuIcSI1Ir/iieJqtBV/8s9EdGonG6Y8k+BvTdBCn2iDPf1/d/rs tFO5Zi808aH56TjF7UeDl+cYBpeezY9oA8lOMqvxOY4NoBulBfMi0MlKGU6fUw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727671540; a=rsa-sha256; cv=none; b=fe4h3VEYIWboov6auxOaf/qogmeOUwdzwSP1v6QtXuOiZaTpYRbWKprxp7yaB05pQeiGBX k0N7q9b6JIe2dapftDS3H/SJchG/SeeLOa+M/2+VE9tBoxDgxlWfzWJcGZ15Kxbv8NzGPf ppJW6/dtwIfzpEM7/KtmIkk4zW32s6RBdkw7HIqyd5vEc7nldXBbs5TJpkSNKcNuVvyI5j UBtL9sUnuFgYGoPM1qvwlOLEGloZ0Zv2OwQYEbOU1CuOse4pvYxBPfRiBY7sYUX5WyGgPR Wx0nNUhSdvxsN3EEH3kebCcrpHljLqS6r8d2lOoyY8USK2nEwILzjikYUXjmuw== 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 4XH7mg6Nj1zf9V; Mon, 30 Sep 2024 04:45:39 +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 48U4jdDT087585; Mon, 30 Sep 2024 04:45:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48U4jdgx087582; Mon, 30 Sep 2024 04:45:39 GMT (envelope-from git) Date: Mon, 30 Sep 2024 04:45:39 GMT Message-Id: <202409300445.48U4jdgx087582@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: bb8c6f43256d - stable/14 - ice(4): Stop checking for failures from malloc(M_WAITOK) 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bb8c6f43256d234d492c267d74526fc62102b23d Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=bb8c6f43256d234d492c267d74526fc62102b23d commit bb8c6f43256d234d492c267d74526fc62102b23d Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:29 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-30 04:44:23 +0000 ice(4): Stop checking for failures from malloc(M_WAITOK) As a consequence now ice_alloc_vsi_qmap() does not fail. Remove unneeded error checks. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 (cherry picked from commit 5f97656fa334b494d70866cb1bfff406d3efd92d) --- sys/dev/ice/ice_lib.c | 24 +++--------------------- sys/dev/ice/ice_lib.h | 2 +- sys/dev/ice/if_ice_iflib.c | 13 ++----------- 3 files changed, 6 insertions(+), 33 deletions(-) diff --git a/sys/dev/ice/ice_lib.c b/sys/dev/ice/ice_lib.c index 659412450fce..7077859cc877 100644 --- a/sys/dev/ice/ice_lib.c +++ b/sys/dev/ice/ice_lib.c @@ -426,31 +426,21 @@ ice_setup_pf_vsi(struct ice_softc *sc) * all queues for this VSI are not yet assigned an index and thus, * not ready for use. * - * Returns an error code on failure. */ -int +void ice_alloc_vsi_qmap(struct ice_vsi *vsi, const int max_tx_queues, const int max_rx_queues) { - struct ice_softc *sc = vsi->sc; int i; MPASS(max_tx_queues > 0); MPASS(max_rx_queues > 0); /* Allocate Tx queue mapping memory */ - if (!(vsi->tx_qmap = - (u16 *) malloc(sizeof(u16) * max_tx_queues, M_ICE, M_WAITOK))) { - device_printf(sc->dev, "Unable to allocate Tx qmap memory\n"); - return (ENOMEM); - } + vsi->tx_qmap = malloc(sizeof(u16) * max_tx_queues, M_ICE, M_WAITOK); /* Allocate Rx queue mapping memory */ - if (!(vsi->rx_qmap = - (u16 *) malloc(sizeof(u16) * max_rx_queues, M_ICE, M_WAITOK))) { - device_printf(sc->dev, "Unable to allocate Rx qmap memory\n"); - goto free_tx_qmap; - } + vsi->rx_qmap = malloc(sizeof(u16) * max_rx_queues, M_ICE, M_WAITOK); /* Mark every queue map as invalid to start with */ for (i = 0; i < max_tx_queues; i++) { @@ -459,14 +449,6 @@ ice_alloc_vsi_qmap(struct ice_vsi *vsi, const int max_tx_queues, for (i = 0; i < max_rx_queues; i++) { vsi->rx_qmap[i] = ICE_INVALID_RES_IDX; } - - return 0; - -free_tx_qmap: - free(vsi->tx_qmap, M_ICE); - vsi->tx_qmap = NULL; - - return (ENOMEM); } /** diff --git a/sys/dev/ice/ice_lib.h b/sys/dev/ice/ice_lib.h index cfd848d370bb..6c010cffc0fd 100644 --- a/sys/dev/ice/ice_lib.h +++ b/sys/dev/ice/ice_lib.h @@ -830,7 +830,7 @@ void ice_free_bar(device_t dev, struct ice_bar_info *bar); void ice_set_ctrlq_len(struct ice_hw *hw); void ice_release_vsi(struct ice_vsi *vsi); struct ice_vsi *ice_alloc_vsi(struct ice_softc *sc, enum ice_vsi_type type); -int ice_alloc_vsi_qmap(struct ice_vsi *vsi, const int max_tx_queues, +void ice_alloc_vsi_qmap(struct ice_vsi *vsi, const int max_tx_queues, const int max_rx_queues); void ice_free_vsi_qmaps(struct ice_vsi *vsi); int ice_initialize_vsi(struct ice_vsi *vsi); diff --git a/sys/dev/ice/if_ice_iflib.c b/sys/dev/ice/if_ice_iflib.c index 4e451bf3fb55..3de79787f6e8 100644 --- a/sys/dev/ice/if_ice_iflib.c +++ b/sys/dev/ice/if_ice_iflib.c @@ -631,12 +631,8 @@ reinit_hw: */ ice_setup_pf_vsi(sc); - err = ice_alloc_vsi_qmap(&sc->pf_vsi, scctx->isc_ntxqsets_max, + ice_alloc_vsi_qmap(&sc->pf_vsi, scctx->isc_ntxqsets_max, scctx->isc_nrxqsets_max); - if (err) { - device_printf(dev, "Unable to allocate VSI Queue maps\n"); - goto free_main_vsi; - } /* Allocate MSI-X vectors (due to isc_flags IFLIB_SKIP_MSIX) */ err = ice_allocate_msix(sc); @@ -3518,12 +3514,7 @@ ice_setup_mirror_vsi(struct ice_mirr_if *mif) mif->vsi = vsi; /* Reserve VSI queue allocation from PF queues */ - ret = ice_alloc_vsi_qmap(vsi, ICE_DEFAULT_VF_QUEUES, ICE_DEFAULT_VF_QUEUES); - if (ret) { - device_printf(dev, "%s: Unable to allocate mirror VSI queue maps (%d queues): %s\n", - __func__, ICE_DEFAULT_VF_QUEUES, ice_err_str(ret)); - goto release_vsi; - } + ice_alloc_vsi_qmap(vsi, ICE_DEFAULT_VF_QUEUES, ICE_DEFAULT_VF_QUEUES); vsi->num_tx_queues = vsi->num_rx_queues = ICE_DEFAULT_VF_QUEUES; /* Assign Tx queues from PF space */