From f7a203bc215c102506447e4d8f90eece3ce7440d Mon Sep 17 00:00:00 2001 From: Navdeep Parhar Date: Thu, 10 May 2018 06:33:54 +0000 Subject: [PATCH] cxgbe(4): Disable write-combined doorbells by default. This had been the default behavior but was changed accidentally as part of the recent iw_cxgbe+OFED overhaul. Fix another bug in that change while here: the global knob affects all the adapters in the system and should be left alone by per-adapter code. MFC after: 3 days Sponsored by: Chelsio Communications --- sys/dev/cxgbe/t4_main.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 338e357fe02..6e4dd4b01a7 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -455,7 +455,7 @@ TUNABLE_INT("hw.cxgbe.iscsicaps_allowed", &t4_iscsicaps_allowed); static int t4_fcoecaps_allowed = 0; TUNABLE_INT("hw.cxgbe.fcoecaps_allowed", &t4_fcoecaps_allowed); -static int t5_write_combine = 1; +static int t5_write_combine = 0; TUNABLE_INT("hw.cxl.write_combine", &t5_write_combine); static int t4_num_vis = 1; @@ -2292,7 +2292,6 @@ t4_map_bar_2(struct adapter *sc) setbit(&sc->doorbells, DOORBELL_WCWR); setbit(&sc->doorbells, DOORBELL_UDBWC); } else { - t5_write_combine = 0; device_printf(sc->dev, "couldn't enable write combining: %d\n", rc); @@ -2302,11 +2301,9 @@ t4_map_bar_2(struct adapter *sc) t4_write_reg(sc, A_SGE_STAT_CFG, V_STATSOURCE_T5(7) | mode); } -#else - t5_write_combine = 0; #endif - sc->iwt.wc_en = t5_write_combine; } + sc->iwt.wc_en = isset(&sc->doorbells, DOORBELL_UDBWC) ? 1 : 0; return (0); }