From owner-svn-src-all@freebsd.org Tue Mar 10 21:44:21 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 D98AC270F9A; Tue, 10 Mar 2020 21:44:21 +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) server-signature RSA-PSS (4096 bits) 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 48cTBX5jclz4PdM; Tue, 10 Mar 2020 21:44:20 +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 956AC2040; Tue, 10 Mar 2020 21:44:20 +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 02ALiK65078923; Tue, 10 Mar 2020 21:44:20 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 02ALiKx6078922; Tue, 10 Mar 2020 21:44:20 GMT (envelope-from np@FreeBSD.org) Message-Id: <202003102144.02ALiKx6078922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 10 Mar 2020 21:44:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r358859 - 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: 358859 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.29 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: Tue, 10 Mar 2020 21:44:22 -0000 Author: np Date: Tue Mar 10 21:44:20 2020 New Revision: 358859 URL: https://svnweb.freebsd.org/changeset/base/358859 Log: cxgbe(4): Do not try to use 0 as an rx buffer address when the driver is already allocating from the safe zone and the allocation fails. This bug was introduced in r357481. MFC after: 3 days 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 Tue Mar 10 20:30:21 2020 (r358858) +++ head/sys/dev/cxgbe/t4_sge.c Tue Mar 10 21:44:20 2020 (r358859) @@ -4382,10 +4382,12 @@ refill_fl(struct adapter *sc, struct sge_fl *fl, int n MPASS(sd->cl == NULL); rxb = &sc->sge.rx_buf_info[fl->zidx]; cl = uma_zalloc(rxb->zone, M_NOWAIT); - if (__predict_false(cl == NULL) && fl->zidx != fl->safe_zidx) { - rxb = &sc->sge.rx_buf_info[fl->safe_zidx]; - cl = uma_zalloc(rxb->zone, M_NOWAIT); - if (__predict_false(cl == NULL)) + if (__predict_false(cl == NULL)) { + if (fl->zidx != fl->safe_zidx) { + rxb = &sc->sge.rx_buf_info[fl->safe_zidx]; + cl = uma_zalloc(rxb->zone, M_NOWAIT); + } + if (cl == NULL) break; } fl->cl_allocated++;