From nobody Sun Mar 20 15:38:09 2022 X-Original-To: dev-commits-src-branches@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 1256E1A24121; Sun, 20 Mar 2022 15:38:10 +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 4KM22T73xCz3kgX; Sun, 20 Mar 2022 15:38:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647790690; 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=12MOnQYd24Wyp00TxxyKBpQzzrWNEjXBwGHP9/juMCk=; b=MyrxGaFkPIAT5gFSNs2/yrGMagyKkIV/qm4/lphKPyhXZZ3Yu8Z0yPBOlzR0GW+64v+0He 38MSIGfQieIX29XInow7ir5sjEI+9fYxd70WslI+SINypx+coQSns3Buc04PtDB4Foe/W9 ZZdP8jjzEj95yvZG7oYsbfmNK6LLQzG/7ys3IOPWMy5/lcW/Wy/A+Z/3Ry3A1xUq48GbT4 yZQjI6JR6qwBM8Edj9sKelEJ4WPdl9IFK3C4uwdSkfXG9+Fj3z14DDTjZchxm7nO8mJtb4 xn4N+CE/vF85iQgbgR24TSfJ6acbutU8ce2AmUGAdmb2tT4gAYwRTEfZ6Q/4NQ== 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 CEA341928; Sun, 20 Mar 2022 15:38:09 +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 22KFc9f9053844; Sun, 20 Mar 2022 15:38:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22KFc9XU053843; Sun, 20 Mar 2022 15:38:09 GMT (envelope-from git) Date: Sun, 20 Mar 2022 15:38:09 GMT Message-Id: <202203201538.22KFc9XU053843@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 81c1d7c9c727 - releng/13.1 - if_epair: build fix List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.1 X-Git-Reftype: branch X-Git-Commit: 81c1d7c9c727184dacb31df563fb42d208ccde46 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647790690; 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=12MOnQYd24Wyp00TxxyKBpQzzrWNEjXBwGHP9/juMCk=; b=HO1rUKiLQtAOJahvWDn2lKrCVqYzFeoP8UpZwzPMg4gFyS57y67c0fM4dPTNzaFyqf4FrJ 1RtuHJ7qcDZLdPKzWIl+oZWj+jU1cMhapVvz3wsP2mbyhDJEr17eKAMfSfXh38VJFmkHWx Vb5deVO0PCo1wvcv/V7PWcKNaGhU7Eza+Bp+TLCISt38NH/CjTxsZfIgyyxPgYBGWc+lsZ bphjByfjTZ3a1+qUI++YMXZEZW2qNBPT5ry2cxwkfgwI7H24OMElyu1YGf+VYCqSlnCwPM /eL/yJh68c5XfPv9+vZ8zCZE2IdPGYv7Mdm5D4q4XNpsf1xCa+e5NQ5dgXcXqg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647790690; a=rsa-sha256; cv=none; b=QBRC/wZGNQtLzFngCJwpec3KN9JbfLxO9dtSvgtDb+tq2jHoP8/QVJ/x5++RanqOmdBA/S xd74aNq/uZ5uFMn625BcJrtOHqzawOBNWyeQdM1Pw0M8bLLbNXH4rifa2YDatp+C1K5vmY o6xGraOnY/FGo2GH/PSkNWkk79cLPZXqwygPFK9GIDDzewZdpkLIagyAN3xnK+D9ApUspp 9oDnAcXEGYuoyg8Y/ItxgjbtslU4Cbu9G7XzgQXckxYbOQsGz5FETp0obnBcbyR6/KH0U2 kbHoI0/+TwrHmO5vNJ1xigghnvCDg2beN0MMqYhWEpfU8YkmAZYN8F6TPLyXLw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch releng/13.1 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=81c1d7c9c727184dacb31df563fb42d208ccde46 commit 81c1d7c9c727184dacb31df563fb42d208ccde46 Author: Kristof Provost AuthorDate: 2022-03-17 02:35:13 +0000 Commit: Kristof Provost CommitDate: 2022-03-20 15:25:40 +0000 if_epair: build fix 66acf7685b failed to build on riscv (and mips). This is because the atomic_testandset_int() (and friends) functions do not exist there. Happily those platforms do have the long variant, so switch to that. PR: 262571 MFC after: 3 days Approved by: re (gjb) (cherry picked from commit 0bf7acd6b7047537a38e2de391a461e4e8956630) --- sys/net/if_epair.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/net/if_epair.c b/sys/net/if_epair.c index 16e7f602edee..23f7f6da6846 100644 --- a/sys/net/if_epair.c +++ b/sys/net/if_epair.c @@ -106,7 +106,7 @@ struct epair_queue { int id; struct buf_ring *rxring[2]; volatile int ridx; /* 0 || 1 */ - volatile int state; /* taskqueue coordination */ + volatile long state; /* taskqueue coordination */ struct task tx_task; struct epair_softc *sc; }; @@ -175,8 +175,8 @@ epair_tx_start_deferred(void *arg, int pending) } while (!atomic_fcmpset_int(&q->ridx, &ridx, nidx)); epair_if_input(sc, q, ridx); - atomic_clear_int(&q->state, (1 << BIT_QUEUE_TASK)); - if (atomic_testandclear_int(&q->state, BIT_MBUF_QUEUED)) + atomic_clear_long(&q->state, (1 << BIT_QUEUE_TASK)); + if (atomic_testandclear_long(&q->state, BIT_MBUF_QUEUED)) taskqueue_enqueue(epair_tasks.tq[q->id], &q->tx_task); if_rele(sc->ifp); @@ -238,7 +238,7 @@ epair_menq(struct mbuf *m, struct epair_softc *osc) #endif q = &osc->queues[bucket]; - atomic_set_int(&q->state, (1 << BIT_MBUF_QUEUED)); + atomic_set_long(&q->state, (1 << BIT_MBUF_QUEUED)); ridx = atomic_load_int(&q->ridx); ret = buf_ring_enqueue(q->rxring[ridx], m); if (ret != 0) { @@ -260,7 +260,7 @@ epair_menq(struct mbuf *m, struct epair_softc *osc) /* Someone else received the packet. */ if_inc_counter(oifp, IFCOUNTER_IPACKETS, 1); - if (!atomic_testandset_int(&q->state, BIT_QUEUE_TASK)) + if (!atomic_testandset_long(&q->state, BIT_QUEUE_TASK)) taskqueue_enqueue(epair_tasks.tq[bucket], &q->tx_task); return (0);