From nobody Mon Jan 10 20:23:52 2022 X-Original-To: dev-commits-src-main@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 87EAF193AEB3; Mon, 10 Jan 2022 20:23:52 +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 4JXlf02Bxdz3sw3; Mon, 10 Jan 2022 20:23:52 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 2B5193C3C; Mon, 10 Jan 2022 20:23:52 +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 20AKNqMD050896; Mon, 10 Jan 2022 20:23:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20AKNqlA050895; Mon, 10 Jan 2022 20:23:52 GMT (envelope-from git) Date: Mon, 10 Jan 2022 20:23:52 GMT Message-Id: <202201102023.20AKNqlA050895@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Navdeep Parhar Subject: git: 6792568fe268 - main - cxgb(4): Fix "set but not used [-Wunused-but-set-variable]" warnings. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: np X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 6792568fe2687db960cb02cfc744b2e87947d38b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1641846232; 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=czV9HbifR71imfVbYfHpYIrZVjCw8nKInnVC2Tngxms=; b=H9a8khqSSZiR6VHbqF37eYp00QAOvuHeWhacOBxg+ZlpD62gexuyVGCMsWnOswkM4hqV3+ LYGvpLCFvmwCxVO7y8C+MP93WnoMyHeAF2yt5rmYG0M/9TA0Y4mnepxgEBpHlqxP9dGfJc dQqAiU4Y0EF5EFBrT1bnU/+EdApO6u3PGimTgPi7H8Z7mp48uLTYFBUUFzgzw6O954chl4 lOYmGwQSj1SUc2y/kpFKlY/dFqkJ2NI0ooG7/M3igJweZMGGr2RBSBc5mx3CJkNGvkQZOc NQRncFC+6Tnx065P/uQSrPs9GkcMq3j0874DBy+VYmBXFgfPeyh6SNXA9+ikOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1641846232; a=rsa-sha256; cv=none; b=VIX+3ABDxlw4qlid+ZTidTSgzzGTd1VuGft5BWPwgX/npyDZU0Hjafr5zRylGXMWBdIovL Za7xY7ks8hr/LsIbZtBjBWLXMkg3Jq9g5HSHzXWCRpg5e/UoHUjdvD99Gta8u3jWUlmqg1 xN/67og0uSq4++0JTbhfuy/f9C85ah58zOyLocWatxiTkW58jyyyjDopKpcbdTr7neKmdi xHQCnODJp33RxG/pVALonyF7epi4Op0e6hfgQOl+G0k3RR4OcZX0DA2F3iIIcaG7nJfe4F 12HZppKL64sIhT7D726LqpT6RYC7l9PCqm7ZepW90k5ZAlEK+264F04NfxQXrg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=6792568fe2687db960cb02cfc744b2e87947d38b commit 6792568fe2687db960cb02cfc744b2e87947d38b Author: Navdeep Parhar AuthorDate: 2022-01-10 19:18:38 +0000 Commit: Navdeep Parhar CommitDate: 2022-01-10 20:15:12 +0000 cxgb(4): Fix "set but not used [-Wunused-but-set-variable]" warnings. MFC after: 1 week Sponsored by: Chelsio Communications --- sys/dev/cxgb/cxgb_adapter.h | 2 +- sys/dev/cxgb/cxgb_osdep.h | 15 +++------------ sys/dev/cxgb/cxgb_sge.c | 27 +++------------------------ sys/dev/cxgb/cxgb_t3fw.c | 15 +++++---------- sys/dev/cxgb/sys/uipc_mvec.c | 2 -- 5 files changed, 12 insertions(+), 49 deletions(-) diff --git a/sys/dev/cxgb/cxgb_adapter.h b/sys/dev/cxgb/cxgb_adapter.h index 97e7d96ec7aa..ae5fa9f357c8 100644 --- a/sys/dev/cxgb/cxgb_adapter.h +++ b/sys/dev/cxgb/cxgb_adapter.h @@ -117,7 +117,7 @@ struct port_info { #define PORT_NAME_LEN 32 char lockbuf[PORT_LOCK_NAME_LEN]; char namebuf[PORT_NAME_LEN]; -} __aligned(L1_CACHE_BYTES); +} __aligned(CACHE_LINE_SIZE); enum { /* adapter flags */ diff --git a/sys/dev/cxgb/cxgb_osdep.h b/sys/dev/cxgb/cxgb_osdep.h index ceccbe4178df..e3f745fee020 100644 --- a/sys/dev/cxgb/cxgb_osdep.h +++ b/sys/dev/cxgb/cxgb_osdep.h @@ -94,28 +94,19 @@ struct t3_mbuf_hdr { #define TX_WR_COUNT_MAX 7 /* the maximum total number of packets that can be * aggregated into a single TX WR */ -#if defined(__i386__) || defined(__amd64__) -static __inline -void prefetch(void *x) -{ - __asm volatile("prefetcht0 %0" :: "m" (*(unsigned long *)x)); -} +#define prefetch(x) __builtin_prefetch(x) +#if defined(__i386__) || defined(__amd64__) #define smp_mb() mb() - -#define L1_CACHE_BYTES 128 #define WARN_ON(condition) do { \ if (__predict_false((condition)!=0)) { \ log(LOG_WARNING, "BUG: warning at %s:%d/%s()\n", __FILE__, __LINE__, __FUNCTION__); \ kdb_backtrace(); \ } \ } while (0) - -#else +#else #define smp_mb() -#define prefetch(x) -#define L1_CACHE_BYTES 32 #endif #define DBG_RX (1 << 0) diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c index eb9d8f51dcd3..dbc0ddea6b7c 100644 --- a/sys/dev/cxgb/cxgb_sge.c +++ b/sys/dev/cxgb/cxgb_sge.c @@ -2105,27 +2105,8 @@ t3_sge_start(adapter_t *sc) void t3_sge_stop(adapter_t *sc) { - int i, nqsets; - - t3_set_reg_field(sc, A_SG_CONTROL, F_GLOBALENABLE, 0); - if (sc->tq == NULL) - return; - - for (nqsets = i = 0; i < (sc)->params.nports; i++) - nqsets += sc->port[i].nqsets; -#ifdef notyet - /* - * - * XXX - */ - for (i = 0; i < nqsets; ++i) { - struct sge_qset *qs = &sc->sge.qs[i]; - - taskqueue_drain(sc->tq, &qs->txq[TXQ_OFLD].qresume_task); - taskqueue_drain(sc->tq, &qs->txq[TXQ_CTRL].qresume_task); - } -#endif + t3_set_reg_field(sc, A_SG_CONTROL, F_GLOBALENABLE, 0); } /** @@ -2337,11 +2318,9 @@ restart_offloadq(void *data, int npending) struct sge_qset *qs = data; struct sge_txq *q = &qs->txq[TXQ_OFLD]; adapter_t *adap = qs->port->adapter; - int cleaned; - - TXQ_LOCK(qs); -again: cleaned = reclaim_completed_tx(qs, 16, TXQ_OFLD); + TXQ_LOCK(qs); +again: while ((m = mbufq_first(&q->sendq)) != NULL) { unsigned int gen, pidx; struct ofld_hdr *oh = mtod(m, struct ofld_hdr *); diff --git a/sys/dev/cxgb/cxgb_t3fw.c b/sys/dev/cxgb/cxgb_t3fw.c index 44a41031aaa6..a084cae0f971 100644 --- a/sys/dev/cxgb/cxgb_t3fw.c +++ b/sys/dev/cxgb/cxgb_t3fw.c @@ -19,7 +19,7 @@ __FBSDID("$FreeBSD$"); static int cxgb_t3fw_modevent(module_t mod, int type, void *unused) { - const struct firmware *fp, *parent; + const struct firmware *fp; int error; switch (type) { case MOD_LOAD: @@ -29,7 +29,6 @@ cxgb_t3fw_modevent(module_t mod, int type, void *unused) 0, NULL); if (fp == NULL) goto fail_0; - parent = fp; return (0); fail_0: return (ENXIO); @@ -52,7 +51,7 @@ MODULE_DEPEND(cxgb_t3fw, firmware, 1, 1, 1); static int cxgb_t3b_protocol_sram_modevent(module_t mod, int type, void *unused) { - const struct firmware *fp, *parent; + const struct firmware *fp; int error; switch (type) { case MOD_LOAD: @@ -62,7 +61,6 @@ cxgb_t3b_protocol_sram_modevent(module_t mod, int type, void *unused) 0, NULL); if (fp == NULL) goto fail_0; - parent = fp; return (0); fail_0: return (ENXIO); @@ -85,7 +83,7 @@ MODULE_DEPEND(cxgb_t3b_protocol_sram, firmware, 1, 1, 1); static int cxgb_t3b_tp_eeprom_modevent(module_t mod, int type, void *unused) { - const struct firmware *fp, *parent; + const struct firmware *fp; int error; switch (type) { case MOD_LOAD: @@ -95,7 +93,6 @@ cxgb_t3b_tp_eeprom_modevent(module_t mod, int type, void *unused) 0, NULL); if (fp == NULL) goto fail_0; - parent = fp; return (0); fail_0: return (ENXIO); @@ -118,7 +115,7 @@ MODULE_DEPEND(cxgb_t3b_tp_eeprom, firmware, 1, 1, 1); static int cxgb_t3c_protocol_sram_modevent(module_t mod, int type, void *unused) { - const struct firmware *fp, *parent; + const struct firmware *fp; int error; switch (type) { case MOD_LOAD: @@ -128,7 +125,6 @@ cxgb_t3c_protocol_sram_modevent(module_t mod, int type, void *unused) 0, NULL); if (fp == NULL) goto fail_0; - parent = fp; return (0); fail_0: return (ENXIO); @@ -151,7 +147,7 @@ MODULE_DEPEND(cxgb_t3c_protocol_sram, firmware, 1, 1, 1); static int cxgb_t3c_tp_eeprom_modevent(module_t mod, int type, void *unused) { - const struct firmware *fp, *parent; + const struct firmware *fp; int error; switch (type) { case MOD_LOAD: @@ -161,7 +157,6 @@ cxgb_t3c_tp_eeprom_modevent(module_t mod, int type, void *unused) 0, NULL); if (fp == NULL) goto fail_0; - parent = fp; return (0); fail_0: return (ENXIO); diff --git a/sys/dev/cxgb/sys/uipc_mvec.c b/sys/dev/cxgb/sys/uipc_mvec.c index 02f437079468..2ee01324f1da 100644 --- a/sys/dev/cxgb/sys/uipc_mvec.c +++ b/sys/dev/cxgb/sys/uipc_mvec.c @@ -57,13 +57,11 @@ busdma_map_sg_collapse(bus_dma_tag_t tag, bus_dmamap_t map, { struct mbuf *n = *m; int seg_count, defragged = 0, err = 0; - bus_dma_segment_t *psegs; KASSERT(n->m_pkthdr.len, ("packet has zero header len")); if (n->m_pkthdr.len <= PIO_LEN) return (0); retry: - psegs = segs; seg_count = 0; err = bus_dmamap_load_mbuf_sg(tag, map, *m, segs, &seg_count, 0); if (seg_count == 0) {