From owner-svn-src-all@freebsd.org Mon Aug 31 22:45:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1DCF53D055A; Mon, 31 Aug 2020 22:45:00 +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.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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BgQJC75m2z4F5B; Mon, 31 Aug 2020 22:44:59 +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 D706AF14C; Mon, 31 Aug 2020 22:44:59 +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 07VMixmF081649; Mon, 31 Aug 2020 22:44:59 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 07VMixcV081648; Mon, 31 Aug 2020 22:44:59 GMT (envelope-from np@FreeBSD.org) Message-Id: <202008312244.07VMixcV081648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 31 Aug 2020 22:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365014 - 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: 365014 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Aug 2020 22:45:00 -0000 Author: np Date: Mon Aug 31 22:44:59 2020 New Revision: 365014 URL: https://svnweb.freebsd.org/changeset/base/365014 Log: cxgbe(4): Check for descriptors before writing a TLS or raw work request. This fixes a regression in r362905. Submitted by: jhb@ Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Aug 31 21:57:01 2020 (r365013) +++ head/sys/dev/cxgbe/t4_sge.c Mon Aug 31 22:44:59 2020 (r365014) @@ -3004,6 +3004,14 @@ eth_tx(struct mp_ring *r, u_int cidx, u_int pidx, bool MPASS(rc != 0 && rc != EAGAIN); MPASS(txp->npkt == 0); + + n = tx_len16_to_desc(mbuf_len16(m0)); + if (__predict_false(avail < n)) { + avail += reclaim_tx_descs(txq, min(n, 32)); + if (avail < n) + break; /* out of descriptors */ + } + wr = &eq->desc[eq->pidx]; if (mbuf_cflags(m0) & MC_RAW_WR) { n = write_raw_wr(txq, wr, m0, avail); @@ -3014,12 +3022,6 @@ eth_tx(struct mp_ring *r, u_int cidx, u_int pidx, bool avail); #endif } else { - n = tx_len16_to_desc(mbuf_len16(m0)); - if (__predict_false(avail < n)) { - avail += reclaim_tx_descs(txq, 32); - if (avail < n) - break; /* out of descriptors */ - } ETHER_BPF_MTAP(ifp, m0); if (sc->flags & IS_VF) n = write_txpkt_vm_wr(sc, txq, m0);