Skip to content

Commit ea6f82f

Browse files
Hariprasad Shenaidavem330
authored andcommitted
cxgb4vf: Read correct FL congestion threshold for T5 and T6
VF driver was reading incorrect freelist congestion notification threshold for FLM queues when packing is enabled for T5 and T6 adapter. Fixing it now. Signed-off-by: Hariprasad Shenai <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e0910ba commit ea6f82f

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

drivers/net/ethernet/chelsio/cxgb4/t4_regs.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,11 @@
338338
#define EGRTHRESHOLDPACKING_G(x) \
339339
(((x) >> EGRTHRESHOLDPACKING_S) & EGRTHRESHOLDPACKING_M)
340340

341+
#define T6_EGRTHRESHOLDPACKING_S 16
342+
#define T6_EGRTHRESHOLDPACKING_M 0xffU
343+
#define T6_EGRTHRESHOLDPACKING_G(x) \
344+
(((x) >> T6_EGRTHRESHOLDPACKING_S) & T6_EGRTHRESHOLDPACKING_M)
345+
341346
#define SGE_TIMESTAMP_LO_A 0x1098
342347
#define SGE_TIMESTAMP_HI_A 0x109c
343348

drivers/net/ethernet/chelsio/cxgb4vf/sge.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2668,8 +2668,22 @@ int t4vf_sge_init(struct adapter *adapter)
26682668
* give it more Free List entries. (Note that the SGE's Egress
26692669
* Congestion Threshold is in units of 2 Free List pointers.)
26702670
*/
2671-
s->fl_starve_thres
2672-
= EGRTHRESHOLD_G(sge_params->sge_congestion_control)*2 + 1;
2671+
switch (CHELSIO_CHIP_VERSION(adapter->params.chip)) {
2672+
case CHELSIO_T4:
2673+
s->fl_starve_thres =
2674+
EGRTHRESHOLD_G(sge_params->sge_congestion_control);
2675+
break;
2676+
case CHELSIO_T5:
2677+
s->fl_starve_thres =
2678+
EGRTHRESHOLDPACKING_G(sge_params->sge_congestion_control);
2679+
break;
2680+
case CHELSIO_T6:
2681+
default:
2682+
s->fl_starve_thres =
2683+
T6_EGRTHRESHOLDPACKING_G(sge_params->sge_congestion_control);
2684+
break;
2685+
}
2686+
s->fl_starve_thres = s->fl_starve_thres * 2 + 1;
26732687

26742688
/*
26752689
* Set up tasklet timers.

0 commit comments

Comments
 (0)