Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 6 Feb 2014 03:21:43 +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: r261536 - head/sys/dev/cxgbe
Message-ID:  <201402060321.s163Lhgp098830@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: np
Date: Thu Feb  6 03:21:43 2014
New Revision: 261536
URL: http://svnweb.freebsd.org/changeset/base/261536

Log:
  cxgbe(4): The T5 allows for a different freelist starvation threshold
  for queues with buffer packing.  Use the correct value to calculate a
  freelist's low water mark.
  
  MFC after:	1 week

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/adapter.h
==============================================================================
--- head/sys/dev/cxgbe/adapter.h	Thu Feb  6 02:54:04 2014	(r261535)
+++ head/sys/dev/cxgbe/adapter.h	Thu Feb  6 03:21:43 2014	(r261536)
@@ -517,6 +517,7 @@ struct sge {
 	int timer_val[SGE_NTIMERS];
 	int counter_val[SGE_NCOUNTERS];
 	int fl_starve_threshold;
+	int fl_starve_threshold2;
 	int eq_s_qpp;
 	int iq_s_qpp;
 

Modified: head/sys/dev/cxgbe/t4_sge.c
==============================================================================
--- head/sys/dev/cxgbe/t4_sge.c	Thu Feb  6 02:54:04 2014	(r261535)
+++ head/sys/dev/cxgbe/t4_sge.c	Thu Feb  6 03:21:43 2014	(r261536)
@@ -569,6 +569,10 @@ t4_read_chip_settings(struct adapter *sc
 
 	r = t4_read_reg(sc, A_SGE_CONM_CTRL);
 	s->fl_starve_threshold = G_EGRTHRESHOLD(r) * 2 + 1;
+	if (is_t4(sc))
+		s->fl_starve_threshold2 = s->fl_starve_threshold;
+	else
+		s->fl_starve_threshold2 = G_EGRTHRESHOLDPACKING(r) * 2 + 1;
 
 	/* egress queues: log2 of # of doorbells per BAR2 page */
 	r = t4_read_reg(sc, A_SGE_EGRESS_QUEUES_PER_PAGE_PF);
@@ -2233,7 +2237,9 @@ alloc_iq_fl(struct port_info *pi, struct
 			return (rc);
 		}
 		fl->needed = fl->cap;
-		fl->lowat = roundup2(sc->sge.fl_starve_threshold, 8);
+		fl->lowat = fl->flags & FL_BUF_PACKING ?
+		    roundup2(sc->sge.fl_starve_threshold2, 8) :
+		    roundup2(sc->sge.fl_starve_threshold, 8);
 
 		c.iqns_to_fl0congen |=
 		    htobe32(V_FW_IQ_CMD_FL0HOSTFCMODE(X_HOSTFCMODE_NONE) |



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