cxgb4vf: Read correct FL congestion threshold for T5 and T6
[cascardo/linux.git] / drivers / net / ethernet / chelsio / cxgb4vf / sge.c
index 1d5e77a..fa3786a 100644 (file)
@@ -2668,8 +2668,22 @@ int t4vf_sge_init(struct adapter *adapter)
         * give it more Free List entries.  (Note that the SGE's Egress
         * Congestion Threshold is in units of 2 Free List pointers.)
         */
-       s->fl_starve_thres
-               = EGRTHRESHOLD_G(sge_params->sge_congestion_control)*2 + 1;
+       switch (CHELSIO_CHIP_VERSION(adapter->params.chip)) {
+       case CHELSIO_T4:
+               s->fl_starve_thres =
+                  EGRTHRESHOLD_G(sge_params->sge_congestion_control);
+               break;
+       case CHELSIO_T5:
+               s->fl_starve_thres =
+                  EGRTHRESHOLDPACKING_G(sge_params->sge_congestion_control);
+               break;
+       case CHELSIO_T6:
+       default:
+               s->fl_starve_thres =
+                  T6_EGRTHRESHOLDPACKING_G(sge_params->sge_congestion_control);
+               break;
+       }
+       s->fl_starve_thres = s->fl_starve_thres * 2 + 1;
 
        /*
         * Set up tasklet timers.