From nobody Sun Mar 20 05:20:54 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 B8FD01A1C6DC; Sun, 20 Mar 2022 05:20:54 +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 4KLmLG3DLjz4VwQ; Sun, 20 Mar 2022 05:20:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647753654; 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=8goal5q4AfV2VmGBfeGO1WtyVZeO2LHYbTzKSoI6wu8=; b=uvQn92C48a40YehXdfM97Fd7byGjuTr9WJCjCA25GWjHWnl2KqVIxxonlrc8Q1Xr1rQNQS BTbNKl+QtLZRR+M95RlPzbWyso6GlIBigEMCpjzYK77W00ekU0jFpWMYTzqA1FuOcKkGwn Ky1inrXMw7Qqjl9TrQ+l0olH63nFo4CqpgSSq2U/nXmd+buHHdR0hIf5ZbZ+ClHivON9gM uIVYVk736Mi6o3ATHoaeoeS00kGvlyf83a6aSrVaXwdbHkfvrX0cIBcnuKRt5+fEL8ImYS gH2moPXS3FOfeTwRN95MaH5LtRVZgjaV5ESKCZhAWPWHNFJHnVLYaT1YBwQUag== 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 24EF42116A; Sun, 20 Mar 2022 05:20:54 +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 22K5KsuX030012; Sun, 20 Mar 2022 05:20:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 22K5KsjQ030011; Sun, 20 Mar 2022 05:20:54 GMT (envelope-from git) Date: Sun, 20 Mar 2022 05:20:54 GMT Message-Id: <202203200520.22K5KsjQ030011@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: b1a3f8dccb62 - stable/12 - 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/stable/12 X-Git-Reftype: branch X-Git-Commit: b1a3f8dccb6203036b7ee81201fd5b5a8de36f0d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1647753654; 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=8goal5q4AfV2VmGBfeGO1WtyVZeO2LHYbTzKSoI6wu8=; b=ur+t7PIq/qkfB0v4kv0L102mJzMOoMUvHL9mHTJ/Ur8ZMdbM/EFTB+VPYpIWiF4Y3Hfi4m dRB6vXUaGNzE6LyFd6KqH0ZrQvapWr9wpLH7FBCTsn6U2KQPAtXDWAcp4BviWNjPm8STxn MyzWp+J5cJ4eKfVCHPE1FHDJIOZ8WtCzZWkDHnBEcyw8m+fHXoRhdZwJ37uWRqF5H7ZO4c co1/ugLgxXf3FhFhIuZ8FoFsg4O7pS5wo5EmyTNPr+Ewtqo8vHRC2LpDEka5/rd5Xq29Cu YcvpYldNBzhNFyeYn+sAAO3cvFDlMlpBGFjf+07ddR8e/efHzp4w60U/yELk4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1647753654; a=rsa-sha256; cv=none; b=cmEPU9rjLw8Q/jd1yM09LzDUjSDNZUgn040x+2Ga/Ji+Gger1AdKr7YCoVVyeSsEMmQL95 sqEL0RZxwLaYp2bVos3YtSYsord6UC59djxjUH/JlWTOqteRfu9vsEGYOPuw64xbczs2QA mAsogejrdZLn4I5WWO+obSnUVUQajc7CZpootlG1QVnrDJ0XSwvQaw5e9g5o+ylEx5n1yA k1K3bMS2EWYRiznYV3BbrQjJ7+CjF8mDyLurvqSouVN/riCKETRV8+fuKJU7/6Ry02/XND AhJD20SfbTSsMJe/MvvbnvItUkc61WwCKi9ae1kykDirWY+QqHnxVGRyX+3JIA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b1a3f8dccb6203036b7ee81201fd5b5a8de36f0d commit b1a3f8dccb6203036b7ee81201fd5b5a8de36f0d Author: Kristof Provost AuthorDate: 2022-03-17 02:35:13 +0000 Commit: Kristof Provost CommitDate: 2022-03-20 00:25:06 +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 (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 64c9af521a39..4b01e97c354d 100644 --- a/sys/net/if_epair.c +++ b/sys/net/if_epair.c @@ -113,7 +113,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; }; @@ -177,8 +177,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); @@ -244,7 +244,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) { @@ -266,7 +266,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);