From nobody Thu Jan 11 05:33:43 2024 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 4T9YHX1N2Pz56VZk; Thu, 11 Jan 2024 05:33:44 +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 4T9YHW6gwxz468V; Thu, 11 Jan 2024 05:33:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951223; 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=2uYY/V4YmXhg8tjUN9lmyYZjzAOtko+bGC5Exeos3kM=; b=Bwo048jOlJK5h+eEDFpKXQyHl+nZuWS/WzPr0zL5AXQh6wytF1Y45mZmegvxO+PBV9qYum OaKwHgA8sW6jrN5u19fEZy38LnSRWRPPSMSFhdxg0zHGHB5UAYNTs5ywf62pEKF1KyQwF7 lK5woJU0w0u5x5PDMcmfQVNxZWfsdui+Rtb3B6qic50bW939xGViQVUjpfJRGKqq0uBbKV Y68IClUBsEGGbDheJLezmdnd0oUiAB0Q+ELC7STg3jpP7ZAftDG/mEcNicqJDzrGHtQBUa QDJgA/dZf1txPhBJe8M1dj89l9JWOS4Bkn7s9tQwhvQDIuohUihdqFooz8efNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1704951223; 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=2uYY/V4YmXhg8tjUN9lmyYZjzAOtko+bGC5Exeos3kM=; b=iG0iJ844rNxFO1Tlsk0nwoV8T+L+9w9mYUSu0yf2w94fqtzPpEdRGnUmOqm7P6J2J3VGtB BCZnkZ2m7+HjZSQCfQL6cWJtSm6iNP8waxjSpxytoCe9wXj5FzsPPH5FY/ZuNa8hbFSDco bAWJESqZ1HmH+NBIDPOF7SyaXiK/gSxPs1y+IzASfupsP453I0KcPsv/AoSChtD7q+pIUk HOPdysD+L01Y1btB5iGNuDBjV++oEzXwm6n4j0WfxFQRjpfAiRgBtldWVpRKny6nakc1Wo uh9bwMhy6RBZ/KLWA4U8p3KDraMJLcQxJ3j7aNBk7DHKMC8JehUjX8EVshQYwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1704951223; a=rsa-sha256; cv=none; b=U3Nu3prVzxSl0uQlLJdfdtWf7UmIJaWkvGmX0FJmk95ltDE/VDe8R64tlzNO2VGNqLTNtV b/YMcG+us6Y8c/tsIQfxgQuXeEr8t/brGM17ADwPmIDwBnxLmhV2+iTxpZlOWKBowaABYC p6Gb3lRPsSfNzdWjo+fJzTI5BCZcUHpxpuIgqGypH6A6WlVwQIF3NSa4MJ1GF9ePVaahtu vu05u20X+v6oaSyXLhmps6+BpJnZmakUr2vwXVPkABALhrv9HObOtNtZK3m/lzQobJwGvI V+Njvul3UPdE8mjAF+on+utDDz4QA/GIJ6zy+dEgepPMeWXGP93Y8rSiSqXJdQ== 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 4T9YHW5lsDz15yx; Thu, 11 Jan 2024 05:33:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40B5Xhlg009369; Thu, 11 Jan 2024 05:33:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40B5Xheb009366; Thu, 11 Jan 2024 05:33:43 GMT (envelope-from git) Date: Thu, 11 Jan 2024 05:33:43 GMT Message-Id: <202401110533.40B5Xheb009366@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: c4bac077581e - stable/14 - cxgbe(4): Add support for netmap offsets. 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: np X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c4bac077581ee38a3c64cd3a76cb9dd974dd749b Auto-Submitted: auto-generated The branch stable/14 has been updated by np: URL: https://cgit.FreeBSD.org/src/commit/?id=c4bac077581ee38a3c64cd3a76cb9dd974dd749b commit c4bac077581ee38a3c64cd3a76cb9dd974dd749b Author: Navdeep Parhar AuthorDate: 2024-01-05 01:39:31 +0000 Commit: Navdeep Parhar CommitDate: 2024-01-11 05:22:31 +0000 cxgbe(4): Add support for netmap offsets. PR: 253069 Sponsored by: Chelsio Communications (cherry picked from commit df8a58b17a1907ed3b4597475d1cb8eacc9636de) --- sys/dev/cxgbe/t4_netmap.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/sys/dev/cxgbe/t4_netmap.c b/sys/dev/cxgbe/t4_netmap.c index 64fba4410364..0377f65acc3e 100644 --- a/sys/dev/cxgbe/t4_netmap.c +++ b/sys/dev/cxgbe/t4_netmap.c @@ -1003,7 +1003,7 @@ cxgbe_nm_tx(struct adapter *sc, struct sge_nm_txq *nm_txq, usgl->cmd_nsge = htobe32(V_ULPTX_CMD(ULP_TX_SC_DSGL) | V_ULPTX_NSGE(1)); usgl->len0 = htobe32(slot->len); - usgl->addr0 = htobe64(ba); + usgl->addr0 = htobe64(ba + nm_get_offset(kring, slot)); slot->flags &= ~(NS_REPORT | NS_BUF_CHANGED); cpl = (void *)(usgl + 1); @@ -1269,7 +1269,7 @@ cxgbe_nm_attach(struct vi_info *vi) bzero(&na, sizeof(na)); na.ifp = vi->ifp; - na.na_flags = NAF_BDG_MAYSLEEP; + na.na_flags = NAF_BDG_MAYSLEEP | NAF_OFFSETS; /* Netmap doesn't know about the space reserved for the status page. */ na.num_tx_desc = vi->qsize_txq - sc->params.sge.spg_len / EQ_ESIZE; @@ -1286,7 +1286,7 @@ cxgbe_nm_attach(struct vi_info *vi) na.nm_register = cxgbe_netmap_reg; na.num_tx_rings = vi->nnmtxq; na.num_rx_rings = vi->nnmrxq; - na.rx_buf_maxsize = MAX_MTU; + na.rx_buf_maxsize = MAX_MTU + sc->params.sge.fl_pktshift; netmap_attach(&na); /* This adds IFCAP_NETMAP to if_capabilities */ } @@ -1368,6 +1368,14 @@ service_nm_rxq(struct sge_nm_rxq *nm_rxq) handle_nm_sge_egr_update(sc, ifp, cpl); break; case CPL_RX_PKT: + /* + * Note that the application must have netmap + * offsets (NETMAP_REQ_OPT_OFFSETS) enabled on + * the ring or its rx will not work correctly + * when fl_pktshift > 0. + */ + nm_write_offset(kring, &ring->slot[fl_cidx], + sc->params.sge.fl_pktshift); ring->slot[fl_cidx].len = G_RSPD_LEN(lq) - sc->params.sge.fl_pktshift; ring->slot[fl_cidx].flags = 0;