From nobody Fri Sep 27 03:41:43 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 4XFGVJ1JTmz5XQg2; Fri, 27 Sep 2024 03:41:44 +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 4XFGVH6N7Rz4sLB; Fri, 27 Sep 2024 03:41:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727408503; 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=YoAimCH19Ld6c1l3vBrh9AZRa64J4cDMdfFsk7x5Pn8=; b=PMP2vlrqn8QguAINCzjm6ZWFBcwmYJRl3dZcjiluC0XB9rhO4SKFztmgessL/Klg80iwKB nNZX06wLvBdPD/3IuGhwprEEAJOXA7cWX7kJ5xa2zXb4ouyIai+htWkpZSwsiJPyAKwDjb l1ABURxPgt5ApCDYra0R3KAlZIA2ElGrNFrNCFr79Tv5KP416Uzs7DsOx6oZVhkdmv5o0O m7Y4ikkFQ+JC+D0X0MySex7uHyymPs8yUs8xSWpOHsK14T/xB/kvtu2KF5iFCeAYVX6bc/ WqVv6msZhn7iCatMeRpfpWTvMnifO54dj/7Q/6p9+e62OpZ6XIZUAbAvjxzhJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727408503; 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=YoAimCH19Ld6c1l3vBrh9AZRa64J4cDMdfFsk7x5Pn8=; b=pCX7g7YsJh+eJw5qiJskr6r3WnUE/5qXLjmFuYA34d901rS/xl5oWW9EJ+0A5OlIiFqug6 wKLLk2zTxurpuAVRCphJ1zciOVlO85Cs1dGJDMhiUlL9pJtrv363dphby309efYo3ykSzw TpdOYxoRiSdvp4SqihsMgkc6sP8lLGjlC3lgB5kEBOHubnec/NnPHg0/li2NB40Qy/wZnN 7hFDYByfWB8tNZ0pqv2zQD73uiTzAF678URgtgXppubWTS8DPExOLzdYd2iBUh/fkLGBg9 bqML3jMHeP8F5pBpjtumVqZHObsthSrwFqZ8xyXTGbd88AVL4OEu5iPnvxOmyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727408503; a=rsa-sha256; cv=none; b=WVhmEaKnthACUXXadxJTgCXZU8Lt23wJ9c3RNCazj6lrMwbu90knpXOSJnzEYyPEPGUocC MTS7XALrLeI38CpKCoib9qYYbH2FhU0bjJVevWBK1fyvToqwxwJu2ppmVsezw0xw55Dmxw uvuf7bgQ9aHwyKxDtcpGsMxKA6MfKSHWyk2ampBLxxmSiXxgHxtGoqrZNbZtyAf6LYSJA7 BwXSSCQwcsay7d9EiVVuD0IlnFkPRzYFJVt73QANWyi7A1Y6mpPO3MR+Nkr7i/welFaOU6 rbrGfxHRBgSUhjLBUmxEpFkaFHMq3lXcvVEChnOOGG2Gq6bdRAxFof6NV2ujyw== 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 4XFGVH5syczPJj; Fri, 27 Sep 2024 03:41:43 +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 48R3fhEV055623; Fri, 27 Sep 2024 03:41:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48R3fhWM055620; Fri, 27 Sep 2024 03:41:43 GMT (envelope-from git) Date: Fri, 27 Sep 2024 03:41:43 GMT Message-Id: <202409270341.48R3fhWM055620@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: e4b9ac53e3ae - stable/13 - ixgbe: improve Atom C3000 SWFW semaphore acq 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: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e4b9ac53e3ae3d8c36d8a19e5ed826bcac90faa4 Auto-Submitted: auto-generated The branch stable/13 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=e4b9ac53e3ae3d8c36d8a19e5ed826bcac90faa4 commit e4b9ac53e3ae3d8c36d8a19e5ed826bcac90faa4 Author: Barbara Skobiej AuthorDate: 2024-09-20 03:29:36 +0000 Commit: Kevin Bowling CommitDate: 2024-09-27 03:40:32 +0000 ixgbe: improve Atom C3000 SWFW semaphore acq DPDK commit message net/ixgbe/base: improve SWFW semaphore acquisition HWSW semaphore acquisition in Atom C3000 NIC is a two stage process. Each time two semaphore acquisitions are required. Each second semaphore failure requires re-acquisition of first semaphore. This patch decouples the two acquisitions preventing potentially hundreds of thousands of unnecessary loop iterations. Signed-off-by: Barbara Skobiej Obtained from: DPDK (99f960c) (cherry picked from commit cc9944183187308a71489651b11342d293aac7d1) --- sys/dev/ixgbe/ixgbe_x550.c | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/sys/dev/ixgbe/ixgbe_x550.c b/sys/dev/ixgbe/ixgbe_x550.c index 275a3ff8c808..2c9ead8fd247 100644 --- a/sys/dev/ixgbe/ixgbe_x550.c +++ b/sys/dev/ixgbe/ixgbe_x550.c @@ -4242,36 +4242,39 @@ static s32 ixgbe_acquire_swfw_sync_X550a(struct ixgbe_hw *hw, u32 mask) DEBUGFUNC("ixgbe_acquire_swfw_sync_X550a"); - while (--retries) { - status = IXGBE_SUCCESS; - if (hmask) - status = ixgbe_acquire_swfw_sync_X540(hw, hmask); - if (status) { - DEBUGOUT1("Could not acquire SWFW semaphore, Status = %d\n", - status); - return status; - } - if (!(mask & IXGBE_GSSR_TOKEN_SM)) - return IXGBE_SUCCESS; + status = IXGBE_SUCCESS; + if (hmask) + status = ixgbe_acquire_swfw_sync_X540(hw, hmask); + + if (status) { + DEBUGOUT1("Could not acquire SWFW semaphore, Status = %d\n", status); + return status; + } + + if (!(mask & IXGBE_GSSR_TOKEN_SM)) + return IXGBE_SUCCESS; + while (--retries) { status = ixgbe_get_phy_token(hw); - if (status == IXGBE_ERR_TOKEN_RETRY) - DEBUGOUT1("Could not acquire PHY token, Status = %d\n", - status); if (status == IXGBE_SUCCESS) return IXGBE_SUCCESS; - if (hmask) - ixgbe_release_swfw_sync_X540(hw, hmask); - if (status != IXGBE_ERR_TOKEN_RETRY) { - DEBUGOUT1("Unable to retry acquiring the PHY token, Status = %d\n", - status); + DEBUGOUT1("Retry acquiring the PHY token failed, Status = %d\n", status); + if (hmask) + ixgbe_release_swfw_sync_X540(hw, hmask); return status; } + + if (status == IXGBE_ERR_TOKEN_RETRY) + DEBUGOUT1("Could not acquire PHY token, Status = %d\n", + status); } + if (hmask) + ixgbe_release_swfw_sync_X540(hw, hmask); + DEBUGOUT1("Semaphore acquisition retries failed!: PHY ID = 0x%08X\n", hw->phy.id); return status;