From nobody Thu Feb 2 07:39:37 2023 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 4P6rK61sZXz3c8gq; Thu, 2 Feb 2023 07:39:38 +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 4P6rK60Xmdz3Cbv; Thu, 2 Feb 2023 07:39:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675323578; 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=iPw0xZDDLDrJgr+4Th58TK+8HpKOwbBnWAv2ZyJntDg=; b=LIN/G7T5Tg5UtTPyhQJxidqnkvTFpPiE9a/1uPGZWwQtLjqtp9FxE0MFh3XygAmCbyhGhq wqSUgjPbXTkioyWUXmdkjCZXlXLFxj4d7ZfDlXDtuwtZkD1TnUoyVLQX61tJUjeRpb/jxp 78eaSivt5P8tCikf+MA9gDqLWIkxCWihpPxRL7SQR1nmafM4HWtSRMYR8ldsQ/PTBXgrZ4 1hI4SKGR3cgbIqj4xE2vRJPw+4VkmdqdNeY08hA281kB2d+HxupbPXBxteI463+ITgzdXF W1rVTSiFOvEbDI4TTXnRy4kEj7x/oBqNPuJpOH4GcnFV6hlMAhR+TxTcWlUPmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675323578; 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=iPw0xZDDLDrJgr+4Th58TK+8HpKOwbBnWAv2ZyJntDg=; b=JmGi/AZ36nqaR/frbkCwH1S4NhXkVg8WN386QZ8pqq+xV20uJn/PZnCbdUIC+PXIRHRPnk KJvqM9aTy+AvvFhaIrN/7I4ryznD3m00fZl3xcqdv2zOAu4l1XJTPO4LRhKGgZVYy1k7f/ OkLqwcCSSL+y+8g8jRJgUWDn0XGF7MkdLSHLysvx39JbbgHWcWAArnuDzPXvC1+XIHLo32 u1LDFMuQZBAIkL1zSN7QBvsfVOP7RgzXnXUvOZgsxBIdM614ejgUN/BuPe2WI4XtBZrlKN T0wVeGEaDuolHguYIywoKWvo7wqJuYi1iHB8OKrifhM5W8884oFrNmq6wZ4cug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675323578; a=rsa-sha256; cv=none; b=q71zHH1eZ5FgwhJxak+GJj6v/EdU4sQce7I3otcC+h7vFxL/2Sm/rkd5yg4frqQKCtAZks WyNv3mgfIA+znJowYTSTtaC2167yATXzKVl5JoNZsH4oTcPbQOaWFMESzjx3papdeygwYZ Axy4ug4m+OwEFNiiPoBpUGXlsirCq/VxxNZaqPA7bl7vEoIso6O4bwYakN21VFkCPTXrva Qjaf4AC37lzodLJWvkpGtNSayNB759PJ1irsDK4vtfzGF8uYEauY7LcliygJV1TDMuQomA kuXmcd4RmogHGyO7BeM1IouJHA81/go2n2SszI7f0QnqVu7+E1sX1ozDYeyXlg== 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 4P6rK56dylzmJW; Thu, 2 Feb 2023 07:39:37 +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 3127dboQ062164; Thu, 2 Feb 2023 07:39:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 3127dbqF062163; Thu, 2 Feb 2023 07:39:37 GMT (envelope-from git) Date: Thu, 2 Feb 2023 07:39:37 GMT Message-Id: <202302020739.3127dbqF062163@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Navdeep Parhar Subject: git: af0f5fe24c9b - stable/13 - cxgbe(4): Specify the ingress queue's type when creating it. 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: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: af0f5fe24c9b16341ee9c981d572150b74c41fa9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=af0f5fe24c9b16341ee9c981d572150b74c41fa9 commit af0f5fe24c9b16341ee9c981d572150b74c41fa9 Author: Navdeep Parhar AuthorDate: 2022-09-08 18:47:38 +0000 Commit: Navdeep Parhar CommitDate: 2023-02-02 07:18:45 +0000 cxgbe(4): Specify the ingress queue's type when creating it. The firmware takes the type into account when setting up the PCIe channel for the queue. Sponsored by: Chelsio Communications (cherry picked from commit c387ff0045d620d60ed8250360d4196a4c962a13) --- sys/dev/cxgbe/adapter.h | 8 +++++++- sys/dev/cxgbe/t4_netmap.c | 1 + sys/dev/cxgbe/t4_sge.c | 16 ++++++++++------ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index f59fe4e7c4e4..afb571323419 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -377,6 +377,11 @@ struct iq_desc { CTASSERT(sizeof(struct iq_desc) == IQ_ESIZE); enum { + /* iq type */ + IQ_OTHER = FW_IQ_IQTYPE_OTHER, + IQ_ETH = FW_IQ_IQTYPE_NIC, + IQ_OFLD = FW_IQ_IQTYPE_OFLD, + /* iq flags */ IQ_SW_ALLOCATED = (1 << 0), /* sw resources allocated */ IQ_HAS_FL = (1 << 1), /* iq associated with a freelist */ @@ -420,7 +425,8 @@ typedef int (*fw_msg_handler_t)(struct adapter *, const __be64 *); * Ingress Queue: T4 is producer, driver is consumer. */ struct sge_iq { - uint32_t flags; + uint16_t flags; + uint8_t qtype; volatile int state; struct adapter *adapter; struct iq_desc *desc; /* KVA of descriptor ring */ diff --git a/sys/dev/cxgbe/t4_netmap.c b/sys/dev/cxgbe/t4_netmap.c index 75953b1b516b..1ac24e75e733 100644 --- a/sys/dev/cxgbe/t4_netmap.c +++ b/sys/dev/cxgbe/t4_netmap.c @@ -326,6 +326,7 @@ alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq *nm_rxq, int cong) } c.iqns_to_fl0congen |= htobe32(V_FW_IQ_CMD_FL0HOSTFCMODE(X_HOSTFCMODE_NONE) | + V_FW_IQ_CMD_IQTYPE(FW_IQ_IQTYPE_NIC) | F_FW_IQ_CMD_FL0FETCHRO | F_FW_IQ_CMD_FL0DATARO | (fl_pad ? F_FW_IQ_CMD_FL0PADEN : 0) | (black_hole == 2 ? F_FW_IQ_CMD_FL0PACKEN : 0)); diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 1a291af2a24d..e485ca8736a7 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -235,7 +235,7 @@ static struct mbuf *get_fl_payload(struct adapter *, struct sge_fl *, uint32_t); static int eth_rx(struct adapter *, struct sge_rxq *, const struct iq_desc *, u_int); static inline void init_iq(struct sge_iq *, struct adapter *, int, int, int, - int, int); + int, int, int); static inline void init_fl(struct adapter *, struct sge_fl *, int, int, char *); static inline void init_eq(struct adapter *, struct sge_eq *, int, int, uint8_t, struct sge_iq *, char *); @@ -3387,7 +3387,7 @@ send_txpkts: static inline void init_iq(struct sge_iq *iq, struct adapter *sc, int tmr_idx, int pktc_idx, - int qsize, int intr_idx, int cong) + int qsize, int intr_idx, int cong, int qtype) { KASSERT(tmr_idx >= 0 && tmr_idx < SGE_NTIMERS, @@ -3396,10 +3396,13 @@ init_iq(struct sge_iq *iq, struct adapter *sc, int tmr_idx, int pktc_idx, ("%s: bad pktc_idx %d", __func__, pktc_idx)); KASSERT(intr_idx >= -1 && intr_idx < sc->intr_count, ("%s: bad intr_idx %d", __func__, intr_idx)); + KASSERT(qtype == FW_IQ_IQTYPE_OTHER || qtype == FW_IQ_IQTYPE_NIC || + qtype == FW_IQ_IQTYPE_OFLD, ("%s: bad qtype %d", __func__, qtype)); iq->flags = 0; iq->state = IQS_DISABLED; iq->adapter = sc; + iq->qtype = qtype; iq->intr_params = V_QINTR_TIMER_IDX(tmr_idx); iq->intr_pktc_idx = SGE_NCOUNTERS - 1; if (pktc_idx >= 0) { @@ -3615,8 +3618,9 @@ alloc_iq_fl_hwq(struct vi_info *vi, struct sge_iq *iq, struct sge_fl *fl) V_FW_IQ_CMD_IQESIZE(ilog2(IQ_ESIZE) - 4)); c.iqsize = htobe16(iq->qsize); c.iqaddr = htobe64(iq->ba); + c.iqns_to_fl0congen = htobe32(V_FW_IQ_CMD_IQTYPE(iq->qtype)); if (iq->cong >= 0) - c.iqns_to_fl0congen = htobe32(F_FW_IQ_CMD_IQFLINTCONGEN); + c.iqns_to_fl0congen |= htobe32(F_FW_IQ_CMD_IQFLINTCONGEN); if (fl) { bzero(fl->desc, fl->sidx * EQ_ESIZE + sc->params.sge.spg_len); @@ -3832,7 +3836,7 @@ alloc_fwq(struct adapter *sc) intr_idx = 0; else intr_idx = sc->intr_count > 1 ? 1 : 0; - init_iq(fwq, sc, 0, 0, FW_IQ_QSIZE, intr_idx, -1); + init_iq(fwq, sc, 0, 0, FW_IQ_QSIZE, intr_idx, -1, IQ_OTHER); rc = alloc_iq_fl(vi, fwq, NULL, &sc->ctx, sc->fwq_oid); if (rc != 0) { CH_ERR(sc, "failed to allocate fwq: %d\n", rc); @@ -3986,7 +3990,7 @@ alloc_rxq(struct vi_info *vi, struct sge_rxq *rxq, int idx, int intr_idx, "rx queue"); init_iq(&rxq->iq, sc, vi->tmr_idx, vi->pktc_idx, vi->qsize_rxq, - intr_idx, tnl_cong(vi->pi, cong_drop)); + intr_idx, tnl_cong(vi->pi, cong_drop), IQ_ETH); #if defined(INET) || defined(INET6) if (ifp->if_capenable & IFCAP_LRO) rxq->iq.flags |= IQ_LRO_ENABLED; @@ -4109,7 +4113,7 @@ alloc_ofld_rxq(struct vi_info *vi, struct sge_ofld_rxq *ofld_rxq, int idx, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "offload rx queue"); init_iq(&ofld_rxq->iq, sc, vi->ofld_tmr_idx, vi->ofld_pktc_idx, - vi->qsize_rxq, intr_idx, 0); + vi->qsize_rxq, intr_idx, 0, IQ_OFLD); snprintf(name, sizeof(name), "%s ofld_rxq%d-fl", device_get_nameunit(vi->dev), idx); init_fl(sc, &ofld_rxq->fl, vi->qsize_rxq / 8, maxp, name);