From nobody Tue Jul 26 19:33:34 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 4LsnC24Scdz4WxNd; Tue, 26 Jul 2022 19:33:34 +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 4LsnC22SHxz487y; Tue, 26 Jul 2022 19:33:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658864014; 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=Zv+r534E+nlgh3GMVFBkoYVzKjv2DXRxIAn71QQTJOI=; b=M29ryAFMmmPzlMq+74EVRWydsVyKZZwLJ0Gx9DvIFnwHVkgfM7/syStIlj4vovPsHs5LE4 EoD0W0MhD15TyOrVwLgVxSLc1P5LL2aW5sVZgdbwT3rvQRk2xNUaucmHqomTcn8/ntiVHy CibrlJjaYN6tf3XPTDnmgpgEBXjFaVwdv53vkHvs8Fsd10PIXrPRe++/JxQVHpUd8so4iJ ueaykG/DGqGg49MJGy/0axAC18I68ZtiQfAN9nkEeoiihwsAAIWEdd2Ef5MKnOHzaqZzfT tdlmt1EEYCzQe9uPilw/l/c9t34FvNSauaxlk/Z5ZUA2WP04BTqTcafPWxRl9w== 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 4LsnC21YL9zplM; Tue, 26 Jul 2022 19:33:34 +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 26QJXYJj034032; Tue, 26 Jul 2022 19:33:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26QJXYfr034031; Tue, 26 Jul 2022 19:33:34 GMT (envelope-from git) Date: Tue, 26 Jul 2022 19:33:34 GMT Message-Id: <202207261933.26QJXYfr034031@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marcin Wojtas Subject: git: 5393b9247fb0 - stable/12 - ena: Make first_interrupt a uint8_t 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: mw X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 5393b9247fb0262441c21534e2f9d41cff81fc4d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658864014; 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=Zv+r534E+nlgh3GMVFBkoYVzKjv2DXRxIAn71QQTJOI=; b=xMiuSjnjW5vAuLAGz0ehFAQ25RQvvJfPdYzJEd4Km1cAK5qu986lQHZtYPOslIoilG+g1z 6dvizsDoz7GPaNFNFyvoe/YPIPjGPJjMuLWnP2+2MUrVsz13B/EXBomwSMMLnY/X2nK2Ru n5xcgzMUjaH2REZ3ojWPlP755EOeswsUWfMLv1YJl1LhN60UHdPDF3JPREsOE23GYnHd29 osgeqqkku8ToGnN/zOncNkpTtKZcHLfnukN+ozAiwqaEKp/rgbyEAllP8cdIx6LhgR/VeY E3bqXnX6xoQzYTZw3RRXaiW0dV5L3LSvJpR8rU//jgePJ9uM1EONAeV78csPfg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658864014; a=rsa-sha256; cv=none; b=YtE0ZvL227oyvU7kIQ1gtWNrO8EkqVRA2L7XSfFCrR+r24E/wG3PWwGhSN0xtXvAkh9l7s yxSXokAxIAt6pK1zx/YL2xnv1uxsGCNZXuvqjosygx2Mz+vWxZrx5ouE+LhS0KozxQsK4a UTy8QTtCpldcV2+Dh10vJDiVldtSACwPPKgz9orb8zcPV0ym1vxTjry2PFKOGJZXsjD1pK +5rHQ4MUaOWkYNOtFoUU55mXNiqa9Nr3kBWOAJeWRcfhPSVfF/SUeTPw49jK/KnuFVh/ps jAIbhDLNzVOPhmnnurZ32IBQ7Yv3qNtXjr3uAbYRWGCUg8kyk6nphjQOqMeRPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=5393b9247fb0262441c21534e2f9d41cff81fc4d commit 5393b9247fb0262441c21534e2f9d41cff81fc4d Author: Mark Johnston AuthorDate: 2022-06-30 18:49:46 +0000 Commit: Marcin Wojtas CommitDate: 2022-07-26 19:33:05 +0000 ena: Make first_interrupt a uint8_t We do not have atomic(9) routines for bools, and it is not guaranteed that sizeof(bool) is 1. This fixes the KASAN and KMSAN kernel builds, which fail because the compiler refuses to silently cast a _Bool * to a uint8_t * when calling the atomic(9) sanitizer interceptors. Reviewed by: Dawid Górecki MFC after: 2 weeks Fixes: 0ac122c388d9 ("ena: Use atomic_load/store functions for first_interrupt variable") Differential Revision: https://reviews.freebsd.org/D35683 (cherry picked from commit b72f1f4516896ad6da0ea74d146a56045de171f7) --- sys/dev/ena/ena.c | 2 +- sys/dev/ena/ena.h | 2 +- sys/dev/ena/ena_datapath.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index a7d177454075..3efc0021a746 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -376,7 +376,7 @@ ena_init_io_rings_common(struct ena_adapter *adapter, struct ena_ring *ring, ring->qid = qid; ring->adapter = adapter; ring->ena_dev = adapter->ena_dev; - atomic_store_8(&ring->first_interrupt, false); + atomic_store_8(&ring->first_interrupt, 0); ring->no_interrupt_event_cnt = 0; } diff --git a/sys/dev/ena/ena.h b/sys/dev/ena/ena.h index 013b7f0360cc..b6cf9b8d3758 100644 --- a/sys/dev/ena/ena.h +++ b/sys/dev/ena/ena.h @@ -328,7 +328,7 @@ struct ena_ring { uint16_t rx_mbuf_sz; }; - bool first_interrupt; + uint8_t first_interrupt; uint16_t no_interrupt_event_cnt; struct ena_com_rx_buf_info ena_bufs[ENA_PKT_MAX_BUFS]; diff --git a/sys/dev/ena/ena_datapath.c b/sys/dev/ena/ena_datapath.c index a5c4eec43f67..9b41f4bcc773 100644 --- a/sys/dev/ena/ena_datapath.c +++ b/sys/dev/ena/ena_datapath.c @@ -91,8 +91,8 @@ ena_cleanup(void *arg, int pending) ena_qid = ENA_IO_TXQ_IDX(qid); io_cq = &adapter->ena_dev->io_cq_queues[ena_qid]; - atomic_store_8(&tx_ring->first_interrupt, true); - atomic_store_8(&rx_ring->first_interrupt, true); + atomic_store_8(&tx_ring->first_interrupt, 1); + atomic_store_8(&rx_ring->first_interrupt, 1); for (i = 0; i < ENA_CLEAN_BUDGET; ++i) { rxc = ena_rx_cleanup(rx_ring);