Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Mar 2020 21:44:20 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r358859 - head/sys/dev/cxgbe
Message-ID:  <202003102144.02ALiKx6078922@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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++;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202003102144.02ALiKx6078922>