svn commit: r358995 - head/sys/net

Patrick Kelsey pkelsey at FreeBSD.org
Sat Mar 14 19:43:45 UTC 2020


Author: pkelsey
Date: Sat Mar 14 19:43:44 2020
New Revision: 358995
URL: https://svnweb.freebsd.org/changeset/base/358995

Log:
  Fix iflib freelist state corruption
  
  This fixes a bug in iflib freelist management that breaks the required
  correspondence between freelist indexes and driver ring slots.
  
  PR:		243126, 243392, 240628
  Reported by:	avg, alexandr.oleynikov at gmail.com, Harald Schmalzbauer
  Reviewed by:	avg, gallatin
  MFC after:	1 week
  Differential Revision:	https://reviews.freebsd.org/D23943

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==============================================================================
--- head/sys/net/iflib.c	Sat Mar 14 18:35:44 2020	(r358994)
+++ head/sys/net/iflib.c	Sat Mar 14 19:43:44 2020	(r358995)
@@ -2072,7 +2072,9 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun
 	bus_dmamap_sync(fl->ifl_ifdi->idi_tag, fl->ifl_ifdi->idi_map,
 	    BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE);
 	ctx->isc_rxd_flush(ctx->ifc_softc, fl->ifl_rxq->ifr_id, fl->ifl_id, pidx);
-	fl->ifl_fragidx = frag_idx;
+	fl->ifl_fragidx = frag_idx + 1;
+	if (fl->ifl_fragidx == fl->ifl_size)
+		fl->ifl_fragidx = 0;
 
 	return (n == -1 ? 0 : IFLIB_RXEOF_EMPTY);
 }


More information about the svn-src-all mailing list