From nobody Mon Sep 30 05:08:29 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 4XH8H24tl1z5Xltd; Mon, 30 Sep 2024 05:08:30 +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 4XH8H15y3Bz4XJc; Mon, 30 Sep 2024 05:08:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727672909; 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=3Dd0Zw0s8CMkb/YVA2XmWlMR0iVSP5apJksKRcTrXig=; b=YECyy4P/N7UhsNqkbZJVAtTJ5Sa6flsYll5Hns2Pur0uk5N/AhvBHGFM7CWvq0XYvrBSxe iWM5lrdp3ntC/wL6Usrd29kqJxS51g1DTiFpFSusotCV9FNZSPJTrXWQ0fQbUMUEmyhq/T J/EOxApuzy91Egs36Jk9hnNCyUrpKiz42dXxlrCdQiK7k6NvdRCbD04nV1GBgBuywtxxoK K72py6VzYKSfHYdFmGqVp4sR/ZJP7tWcDWZ5QhUVAY4EAKGKDs9HCSggYWISRzmHE4/lzL s52+ldfLRmshiTsOhgwewFWUMgpboaiPOwl7DeZzhu4pQfRpx9sEsBlIdFhdFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727672909; 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=3Dd0Zw0s8CMkb/YVA2XmWlMR0iVSP5apJksKRcTrXig=; b=QLj59G1TcRAxQv4eGUKUKAr1QDaZgXI2s0FIAwwfxvhYo2UlhmcX/16JwXN8brExbC/F9z 7irilks74RIMvEPsIvF7BYnP7gkcnRa+OfQkBRnEgTXpV0jrZfucsnHI/sVs2skVWI/aWy kgNRwSyX0L7J6ic5zM4Is8dQK73RdGNdm/UljnRYPRfwVlnCQiidVfoYuik/+OQBvGukVG 0Lw5afYj1ECByHGudiTDoN1h6wkrC594n0y+sKD1PrmEf67dVQ6LFisz2oToTyTHWuWG3s gHl/6nAs7mrO1vfhfE0+B7yQ2ITM/oOryMPtyd1oQumi88seb3tf/rCyGkd52Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727672909; a=rsa-sha256; cv=none; b=weHGW7blWzBYwQ4VsWEqEOutymYRPauRE5uLn44GZugnErYk2H6f9VLdDbX7gia/LR3dQ3 eBLC/WmXg/IHfpfhQeRQ2SOPD5/8uejb8m5wZl1BnfSEVcSakzYAqrZUkgo7SlQduhXLa4 jOKIR7sY9QVRpcIIkZAH2mS90xWbshWhsdvxYz+FH2XTwUDqJvirNwAjVxgovDW5Pac0/g m61KGXav18VmHdRVl1OJG+h4+xcyY0dA4C0c4Qe8DaZCdaM4g6IAPlrnGXr+ZCpIGl/tFT K0oe90IpXS+q6OknIn94wN8YdQx4TxGXgzXaQxC5jEptBOb9eFH5LTFST1lrRA== 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 4XH8H15YCPzfx9; Mon, 30 Sep 2024 05:08:29 +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 48U58T7q025314; Mon, 30 Sep 2024 05:08:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48U58Tmp025311; Mon, 30 Sep 2024 05:08:29 GMT (envelope-from git) Date: Mon, 30 Sep 2024 05:08:29 GMT Message-Id: <202409300508.48U58Tmp025311@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: 438e078d3166 - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 438e078d3166feafa4e7887471faa1da3e70a74a Auto-Submitted: auto-generated The branch stable/13 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=438e078d3166feafa4e7887471faa1da3e70a74a commit 438e078d3166feafa4e7887471faa1da3e70a74a Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:29 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-30 05:05:37 +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) (cherry picked from commit bb8c6f43256d234d492c267d74526fc62102b23d) --- 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 0fb1ba0158f1..0f9efc3ec6cf 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 05574efe62ce..455da99ea8d2 100644 --- a/sys/dev/ice/if_ice_iflib.c +++ b/sys/dev/ice/if_ice_iflib.c @@ -638,12 +638,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); @@ -3525,12 +3521,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 */