From nobody Fri Feb 17 17:08:16 2023 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 4PJJDJ6kn5z3r9gH; Fri, 17 Feb 2023 17:08:16 +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 4PJJDJ6HRYz3lrP; Fri, 17 Feb 2023 17:08:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676653696; 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=brXXyyxypg75ADlxP1qptJUaervDmqpbqNdHL+9KioE=; b=P8NsMhCT08JFLx9w2Hkq9RV9DJlQrKcjIQ+RqGt6VymTA711owoMUykmQEkzepjvyw1+MI EyUexW57cCnN05nK7u86XvuA86JtGtEgl3zCBZCxnAxjv3+zWAdp2rr6gzFhhwEFantfPo XLYlFCTLwM2VkRTlxn4N6OBIdcJIFu7VwnUegrLlRAgeIfl8+Hyk+6dvpLgESOUPEkum2u V2vhCWtcR2ZP9TrpxfDRQBFrzzqnENiDKOTHr1hx5aWEd7rJa3sb1kZY/vH7F3cmSQAko3 B/ki1s7KgOhxASXfCkeZRhOlRkvV88ejCtXRT6hL1vDGJTJf+y2ifdeSOz1FFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1676653696; 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=brXXyyxypg75ADlxP1qptJUaervDmqpbqNdHL+9KioE=; b=v8q4Ugf5f0WjJzDtPkYoQz+lkFJZqwEdXQlPWvXZ/xq7pPFRZFOqKod6nI+zFm3zm00j/s WX4lMACbweWstb1I81/oW3XyJUQ0NZIKVKrC3hO98h/D1RyOmx6QeG5yWwotEh+u9bcNcm jK0jTbFUL/YPalwtOcllpfoqUQNquU4iGvfLVSLQvEC/pvpceaGvVrC7zDiOkAH0HMkGid MS/nlKiOTlO/q+cXVpwN1aZ2GxEL3mRv5UWDiVJrOJ/jJexU5rhHavTDuMuLS2YH46snAP ZhouVWazHHQ0XDANfwDS1DMJidUjxpuXF5s0TCgtYxbxC1RJSMPDhjYPWVsfZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1676653696; a=rsa-sha256; cv=none; b=SbF3Ni6DAuvYi1miSJAvHEjXSyugXHhC8fr4x0zxV77rDC8SHjoVMmGXAW4nVFsLRnmWaC rx8Xz/pEsr385gQXcsTm9Sm5uYi5T9kTNCaJOCheCuz4XoMt/rTQPoxzdU60M5Wlb4eDne LGN/BMWIxpmpl8GhIjMbeqXFzTF0KyZ2yo3xf3Mdd0SYWqECVVd82HCCSBwLMrKT2UbDwu r5px4+fYOWAmPk6mXJ4A/wWIPRb195IcIiaebOQz0i4vJrgm/cqOF0b3+9jFzwf9ZJVtlD CXY+9ShpMMcO12NiKaiXJIJ6kzNv1krpcR4Zqu6akWwoQw5AA1+UsZoNZPkkNw== 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 4PJJDJ5Kq2zr7l; Fri, 17 Feb 2023 17:08:16 +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 31HH8GZ0054931; Fri, 17 Feb 2023 17:08:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31HH8GCO054930; Fri, 17 Feb 2023 17:08:16 GMT (envelope-from git) Date: Fri, 17 Feb 2023 17:08:16 GMT Message-Id: <202302171708.31HH8GCO054930@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 8afd23de9276 - main - cxgbe: Allow parse_pkt to internally queue a packet. 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8afd23de92768ed4c80f0c3913bf30f72635d13d Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=8afd23de92768ed4c80f0c3913bf30f72635d13d commit 8afd23de92768ed4c80f0c3913bf30f72635d13d Author: John Baldwin AuthorDate: 2023-02-17 17:03:23 +0000 Commit: John Baldwin CommitDate: 2023-02-17 17:03:23 +0000 cxgbe: Allow parse_pkt to internally queue a packet. If parse_pkt returns EINPROGRESS, return from cxgbe_transmit without queueing the packet in a txq. Use this to move the call to ethofld_transmit for packet pacing into parse_pkt. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D38577 --- sys/dev/cxgbe/adapter.h | 1 - sys/dev/cxgbe/t4_main.c | 12 ++++++------ sys/dev/cxgbe/t4_sge.c | 9 ++++++--- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 5460462c5f51..b470d1a6461c 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -1404,7 +1404,6 @@ void t4_register_fw_msg_handler(int, fw_msg_handler_t); void t4_register_cpl_handler(int, cpl_handler_t); void t4_register_shared_cpl_handler(int, cpl_handler_t, int); #ifdef RATELIMIT -int ethofld_transmit(struct ifnet *, struct mbuf *); void send_etid_flush_wr(struct cxgbe_rate_tag *); #endif diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 33d372f575d0..71ee366e04e0 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -3062,16 +3062,16 @@ cxgbe_transmit(struct ifnet *ifp, struct mbuf *m) rc = parse_pkt(&m, vi->flags & TX_USES_VM_WR); if (__predict_false(rc != 0)) { + if (__predict_true(rc == EINPROGRESS)) { + /* queued by parse_pkt */ + MPASS(m != NULL); + return (0); + } + MPASS(m == NULL); /* was freed already */ atomic_add_int(&pi->tx_parse_error, 1); /* rare, atomic is ok */ return (rc); } -#ifdef RATELIMIT - if (m->m_pkthdr.csum_flags & CSUM_SND_TAG) { - if (m->m_pkthdr.snd_tag->sw->type == IF_SND_TAG_TYPE_RATE_LIMIT) - return (ethofld_transmit(ifp, m)); - } -#endif /* Select a txq. */ sc = vi->adapter; diff --git a/sys/dev/cxgbe/t4_sge.c b/sys/dev/cxgbe/t4_sge.c index 88a7f44cadb7..ad3cb63dade4 100644 --- a/sys/dev/cxgbe/t4_sge.c +++ b/sys/dev/cxgbe/t4_sge.c @@ -345,6 +345,7 @@ static inline u_int txpkt_eo_len16(u_int, u_int, u_int); #endif static int ethofld_fw4_ack(struct sge_iq *, const struct rss_header *, struct mbuf *); +static int ethofld_transmit(struct ifnet *, struct mbuf *); #endif static counter_u64_t extfree_refs; @@ -2960,6 +2961,10 @@ restart: set_mbuf_eo_nsegs(m0, nsegs); set_mbuf_eo_len16(m0, txpkt_eo_len16(nsegs, immhdrs, needs_tso(m0))); + rc = ethofld_transmit(mst->ifp, m0); + if (rc != 0) + goto fail; + return (EINPROGRESS); } #endif #endif @@ -6847,7 +6852,7 @@ ethofld_tx(struct cxgbe_rate_tag *cst) } } -int +static int ethofld_transmit(struct ifnet *ifp, struct mbuf *m0) { struct cxgbe_rate_tag *cst; @@ -6903,8 +6908,6 @@ ethofld_transmit(struct ifnet *ifp, struct mbuf *m0) done: mtx_unlock(&cst->lock); - if (__predict_false(rc != 0)) - m_freem(m0); return (rc); }