From 774168be397f4ddbfdcd049f06f364fa81eb03a2 Mon Sep 17 00:00:00 2001 From: Navdeep Parhar Date: Sun, 11 Sep 2016 16:06:17 +0000 Subject: [PATCH] cxgbe(4): Set up fl_starve_threshold2 accurately for T6. Sponsored by: Chelsio Communications --- sys/dev/cxgbe/common/t4_hw.c | 4 +++- sys/dev/cxgbe/common/t4vf_hw.c | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c index 77381b9014e..ebd4ae9a573 100644 --- a/sys/dev/cxgbe/common/t4_hw.c +++ b/sys/dev/cxgbe/common/t4_hw.c @@ -7866,8 +7866,10 @@ int t4_init_sge_params(struct adapter *adapter) sp->fl_starve_threshold = G_EGRTHRESHOLD(r) * 2 + 1; if (is_t4(adapter)) sp->fl_starve_threshold2 = sp->fl_starve_threshold; - else + else if (is_t5(adapter)) sp->fl_starve_threshold2 = G_EGRTHRESHOLDPACKING(r) * 2 + 1; + else + sp->fl_starve_threshold2 = G_T6_EGRTHRESHOLDPACKING(r) * 2 + 1; /* egress queues: log2 of # of doorbells per BAR2 page */ r = t4_read_reg(adapter, A_SGE_EGRESS_QUEUES_PER_PAGE_PF); diff --git a/sys/dev/cxgbe/common/t4vf_hw.c b/sys/dev/cxgbe/common/t4vf_hw.c index adbeb0e4caf..9c15c07c9fe 100644 --- a/sys/dev/cxgbe/common/t4vf_hw.c +++ b/sys/dev/cxgbe/common/t4vf_hw.c @@ -130,9 +130,10 @@ int t4vf_get_sge_params(struct adapter *adapter) sp->fl_starve_threshold = G_EGRTHRESHOLD(vals[5]) * 2 + 1; if (is_t4(adapter)) sp->fl_starve_threshold2 = sp->fl_starve_threshold; + else if (is_t5(adapter)) + sp->fl_starve_threshold2 = G_EGRTHRESHOLDPACKING(vals[5]) * 2 + 1; else - sp->fl_starve_threshold2 = G_EGRTHRESHOLDPACKING(vals[5]) * 2 + - 1; + sp->fl_starve_threshold2 = G_T6_EGRTHRESHOLDPACKING(vals[5]) * 2 + 1; /* * We need the Queues/Page and Host Page Size for our VF.