From owner-svn-src-head@freebsd.org Tue Aug 21 23:33:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F78E1082D3C; Tue, 21 Aug 2018 23:33:39 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55E3773BEE; Tue, 21 Aug 2018 23:33:39 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F3532D58; Tue, 21 Aug 2018 23:33:39 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7LNXcQB046049; Tue, 21 Aug 2018 23:33:38 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7LNXcHX046047; Tue, 21 Aug 2018 23:33:38 GMT (envelope-from np@FreeBSD.org) Message-Id: <201808212333.w7LNXcHX046047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 21 Aug 2018 23:33:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338166 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 338166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2018 23:33:39 -0000 Author: np Date: Tue Aug 21 23:33:38 2018 New Revision: 338166 URL: https://svnweb.freebsd.org/changeset/base/338166 Log: cxgbe(4): Be explicit about ignoring the return value of cmpset in some cases. Reported by: Coverity (CIDs 1009398, 1009400, 1009401, 1357325, 1394783). All false positives. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_netmap.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Tue Aug 21 23:12:46 2018 (r338165) +++ head/sys/dev/cxgbe/t4_netmap.c Tue Aug 21 23:33:38 2018 (r338166) @@ -385,7 +385,7 @@ cxgbe_netmap_on(struct adapter *sc, struct vi_info *vi t4_write_reg(sc, sc->sge_kdoorbell_reg, nm_rxq->fl_db_val | V_PIDX(j)); - atomic_cmpset_int(&nm_rxq->nm_state, NM_OFF, NM_ON); + (void) atomic_cmpset_int(&nm_rxq->nm_state, NM_OFF, NM_ON); } for_each_nm_txq(vi, i, nm_txq) { Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Tue Aug 21 23:12:46 2018 (r338165) +++ head/sys/dev/cxgbe/t4_sge.c Tue Aug 21 23:33:38 2018 (r338166) @@ -1383,7 +1383,7 @@ t4_intr_evt(void *arg) if (atomic_cmpset_int(&iq->state, IQS_IDLE, IQS_BUSY)) { service_iq(iq, 0); - atomic_cmpset_int(&iq->state, IQS_BUSY, IQS_IDLE); + (void) atomic_cmpset_int(&iq->state, IQS_BUSY, IQS_IDLE); } } @@ -1397,7 +1397,7 @@ t4_intr(void *arg) if (atomic_cmpset_int(&iq->state, IQS_IDLE, IQS_BUSY)) { service_iq_fl(iq, 0); - atomic_cmpset_int(&iq->state, IQS_BUSY, IQS_IDLE); + (void) atomic_cmpset_int(&iq->state, IQS_BUSY, IQS_IDLE); } } @@ -1412,7 +1412,7 @@ t4_nm_intr(void *arg) if (atomic_cmpset_int(&nm_rxq->nm_state, NM_ON, NM_BUSY)) { service_nm_rxq(nm_rxq); - atomic_cmpset_int(&nm_rxq->nm_state, NM_BUSY, NM_ON); + (void) atomic_cmpset_int(&nm_rxq->nm_state, NM_BUSY, NM_ON); } } @@ -1498,7 +1498,7 @@ service_iq(struct sge_iq *iq, int budget) if (atomic_cmpset_int(&q->state, IQS_IDLE, IQS_BUSY)) { if (service_iq_fl(q, q->qsize / 16) == 0) { - atomic_cmpset_int(&q->state, + (void) atomic_cmpset_int(&q->state, IQS_BUSY, IQS_IDLE); } else { STAILQ_INSERT_TAIL(&iql, q, @@ -1546,7 +1546,7 @@ service_iq(struct sge_iq *iq, int budget) q = STAILQ_FIRST(&iql); STAILQ_REMOVE_HEAD(&iql, link); if (service_iq_fl(q, q->qsize / 8) == 0) - atomic_cmpset_int(&q->state, IQS_BUSY, IQS_IDLE); + (void) atomic_cmpset_int(&q->state, IQS_BUSY, IQS_IDLE); else STAILQ_INSERT_TAIL(&iql, q, link); }