From nobody Mon Dec 05 17:38:22 2022 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 4NQrPB51vvz4kFSm; Mon, 5 Dec 2022 17:38:22 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NQrPB4H41z4H54; Mon, 5 Dec 2022 17:38:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670261902; 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=7zUXfXpSPJlN2hecZdVDD4W1ZXlAQukA1kR3LspND0U=; b=Wp+MB+DDCVHnUAmPzVkYm4P2CLX4jMxcNnluHjwnkYgJI2RebD0hVmQx1uCF5XOWWzPjTn F7UjdGZRmH3UFCg8sp8syHO0t6s8+V5ZMs0f+q1u+ZB4XHxne4xNPqWZ3ZhnASjggPt94r Qh4lHaB/Cks59XFUkpYu5JLfdNmUHMmpirVch2i9DWaJ/hOrKx5YEkNlCQvglBESYVPpLY IOe/4+sl3CRqpeF8Rf3rMFstskfaHwXEmmyod6TpNwnw7cfjn1L/K05xwpe7evOrLIbcfu jPmY6fedL1aTRCEYiLi+xbvilcMMZlbaMItUdV0YmDPOK9+8gzRiOg/SnB74HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1670261902; 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=7zUXfXpSPJlN2hecZdVDD4W1ZXlAQukA1kR3LspND0U=; b=YPCBOEYgfm48FhmEMqsK3OtZMX2/wMk8/nC/IgmLbXp4AtZjCOMOlmKmxtS73Z/03PmrML GgeneeThcx3XGskdQ5uzlCXXSkcfWnpHfrOot19fhDlIrfcq7T3CEr7jUzZW+c/v/Ron8G lQZ2n1awu8MQfyISayg8gvmm+7bAmO1YT6SAoVitACkjxDJ51xHfyEUvr3Szi70BIilzPE 8frT1ACqOCYgsN4B8wIvS96pLt9QCOasfTInUx76BYD093aJg6ge2P2VaWjRZpT49fPX6O KrKCH+pGbY74YMspZXdxQsMpgCtXx7KvZulnZ1Ihdl4rt+cvuRxHhh2BAqy3wA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1670261902; a=rsa-sha256; cv=none; b=KoOT6dm9UfIWMoHjN6rWpW3s9MFVtQ7Jr6bCD3fUo6oaRxwKQCxPdIw4V0jmBZm+kuYHKA 9M/dd1W5xx/sskG/E8ckSAQfHR7Xq1gPFxmGZJK0tv3Ll82k1AJVQMXtcrq+T0E64aTl8V Bp7/TMzWrGYKE82/yK021iLGdR32PALaRGGOaqG6caiILEOQzjZ/cieeDyqtwYa0IlaSFG K+mPFrdp79NB+PTQJICPM1Nk5QphIKZleYcNHlA35nDcRlae1hUGunM8tFfUifuwT3SoK8 +t0F+3YYc7DcRQZTkO4DBTbs6BDKyGkUoPwXdfAXmVI+rmsS5gOyiZNRPh9r+g== 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 4NQrPB3Jt3z15sn; Mon, 5 Dec 2022 17:38:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2B5HcMPa027113; Mon, 5 Dec 2022 17:38:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2B5HcMrW027112; Mon, 5 Dec 2022 17:38:22 GMT (envelope-from git) Date: Mon, 5 Dec 2022 17:38:22 GMT Message-Id: <202212051738.2B5HcMrW027112@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 09d7f260d4cd - main - cxgbe: stop open-coding kref access 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 09d7f260d4cd77be3c517b1fa2b70df6c137e158 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=09d7f260d4cd77be3c517b1fa2b70df6c137e158 commit 09d7f260d4cd77be3c517b1fa2b70df6c137e158 Author: Mateusz Guzik AuthorDate: 2022-12-05 17:35:08 +0000 Commit: Mateusz Guzik CommitDate: 2022-12-05 17:38:17 +0000 cxgbe: stop open-coding kref access Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h | 6 +++--- sys/dev/cxgbe/iw_cxgbe/qp.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h b/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h index 03d3b2b0ad38..8e33e2d04597 100644 --- a/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h +++ b/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h @@ -680,14 +680,14 @@ enum c4iw_mmid_state { #define c4iw_put_ep(ep) { \ CTR4(KTR_IW_CXGBE, "put_ep (%s:%u) ep %p, refcnt %d", \ - __func__, __LINE__, ep, atomic_read(&(ep)->kref.refcount)); \ - WARN_ON(atomic_read(&(ep)->kref.refcount) < 1); \ + __func__, __LINE__, ep, kref_read(&(ep)->kref)); \ + WARN_ON(kref_read(&(ep)->kref) < 1); \ kref_put(&((ep)->kref), _c4iw_free_ep); \ } #define c4iw_get_ep(ep) { \ CTR4(KTR_IW_CXGBE, "get_ep (%s:%u) ep %p, refcnt %d", \ - __func__, __LINE__, ep, atomic_read(&(ep)->kref.refcount)); \ + __func__, __LINE__, ep, kref_read(&(ep)->kref)); \ kref_get(&((ep)->kref)); \ } diff --git a/sys/dev/cxgbe/iw_cxgbe/qp.c b/sys/dev/cxgbe/iw_cxgbe/qp.c index d3d4c0573a6f..3b6c4c489414 100644 --- a/sys/dev/cxgbe/iw_cxgbe/qp.c +++ b/sys/dev/cxgbe/iw_cxgbe/qp.c @@ -1536,7 +1536,7 @@ int c4iw_modify_qp(struct c4iw_dev *rhp, struct c4iw_qp *qhp, case C4IW_QP_STATE_RTS: switch (attrs->next_state) { case C4IW_QP_STATE_CLOSING: - BUG_ON(atomic_read(&qhp->ep->com.kref.refcount) < 2); + BUG_ON(kref_read(&qhp->ep->com.kref) < 2); t4_set_wq_in_error(&qhp->wq); set_state(qhp, C4IW_QP_STATE_CLOSING); ep = qhp->ep;