Lines Matching refs:dcb
49 struct port_dcb_info *dcb = &pi->dcb; in cxgb4_dcb_state_init() local
50 int version_temp = dcb->dcb_version; in cxgb4_dcb_state_init()
52 memset(dcb, 0, sizeof(struct port_dcb_info)); in cxgb4_dcb_state_init()
53 dcb->state = CXGB4_DCB_STATE_START; in cxgb4_dcb_state_init()
55 dcb->dcb_version = version_temp; in cxgb4_dcb_state_init()
64 struct port_dcb_info *dcb = &pi->dcb; in cxgb4_dcb_version_init() local
69 dcb->dcb_version = FW_PORT_DCB_VER_AUTO; in cxgb4_dcb_version_init()
76 struct port_dcb_info *dcb = &pi->dcb; in cxgb4_dcb_cleanup_apps() local
85 if (!dcb->app_priority[i].protocolid) in cxgb4_dcb_cleanup_apps()
88 app.protocol = dcb->app_priority[i].protocolid; in cxgb4_dcb_cleanup_apps()
90 if (dcb->dcb_version == FW_PORT_DCB_VER_IEEE) { in cxgb4_dcb_cleanup_apps()
91 app.priority = dcb->app_priority[i].user_prio_map; in cxgb4_dcb_cleanup_apps()
92 app.selector = dcb->app_priority[i].sel_field + 1; in cxgb4_dcb_cleanup_apps()
95 app.selector = !!(dcb->app_priority[i].sel_field); in cxgb4_dcb_cleanup_apps()
102 dcb_ver_array[dcb->dcb_version], app.selector, in cxgb4_dcb_cleanup_apps()
115 struct port_dcb_info *dcb = &pi->dcb; in cxgb4_dcb_state_fsm() local
117 enum cxgb4_dcb_state current_state = dcb->state; in cxgb4_dcb_state_fsm()
120 __func__, dcb->state, transition_to, dev->name); in cxgb4_dcb_state_fsm()
127 dcb->state = CXGB4_DCB_STATE_HOST; in cxgb4_dcb_state_fsm()
128 dcb->supported = CXGB4_DCBX_HOST_SUPPORT; in cxgb4_dcb_state_fsm()
134 dcb->state = CXGB4_DCB_STATE_FW_INCOMPLETE; in cxgb4_dcb_state_fsm()
135 dcb->supported = DCB_CAP_DCBX_LLD_MANAGED; in cxgb4_dcb_state_fsm()
136 if (dcb->dcb_version == FW_PORT_DCB_VER_IEEE) in cxgb4_dcb_state_fsm()
137 dcb->supported |= DCB_CAP_DCBX_VER_IEEE; in cxgb4_dcb_state_fsm()
139 dcb->supported |= DCB_CAP_DCBX_VER_CEE; in cxgb4_dcb_state_fsm()
149 dcb->state = CXGB4_DCB_STATE_FW_ALLSYNCED; in cxgb4_dcb_state_fsm()
172 dcb->state = CXGB4_DCB_STATE_FW_ALLSYNCED; in cxgb4_dcb_state_fsm()
173 dcb->enabled = 1; in cxgb4_dcb_state_fsm()
199 dcb->state = CXGB4_DCB_STATE_FW_INCOMPLETE; in cxgb4_dcb_state_fsm()
200 dcb->supported = CXGB4_DCBX_FW_SUPPORT; in cxgb4_dcb_state_fsm()
210 dcb->enabled = 1; in cxgb4_dcb_state_fsm()
254 const union fw_port_dcb *fwdcb = &pcmd->u.dcb; in cxgb4_dcb_handle_fw_update()
258 struct port_dcb_info *dcb = &pi->dcb; in cxgb4_dcb_handle_fw_update() local
259 int dcb_type = pcmd->u.dcb.pgid.type; in cxgb4_dcb_handle_fw_update()
267 ((pcmd->u.dcb.control.all_syncd_pkd & in cxgb4_dcb_handle_fw_update()
272 if (dcb->dcb_version != FW_PORT_DCB_VER_UNKNOWN) { in cxgb4_dcb_handle_fw_update()
275 pcmd->u.dcb.control.dcb_version_to_app_state)); in cxgb4_dcb_handle_fw_update()
278 dcb->dcb_version = dcb_running_version; in cxgb4_dcb_handle_fw_update()
281 dcb_ver_array[dcb->dcb_version]); in cxgb4_dcb_handle_fw_update()
285 dcb_ver_array[dcb->dcb_version], in cxgb4_dcb_handle_fw_update()
287 dcb->dcb_version = FW_PORT_DCB_VER_UNKNOWN; in cxgb4_dcb_handle_fw_update()
300 if (dcb->state == CXGB4_DCB_STATE_START || in cxgb4_dcb_handle_fw_update()
301 dcb->state == CXGB4_DCB_STATE_HOST) { in cxgb4_dcb_handle_fw_update()
303 dcb->state); in cxgb4_dcb_handle_fw_update()
311 dcb->pgid = be32_to_cpu(fwdcb->pgid.pgid); in cxgb4_dcb_handle_fw_update()
312 dcb->msgs |= CXGB4_DCB_FW_PGID; in cxgb4_dcb_handle_fw_update()
316 dcb->pg_num_tcs_supported = fwdcb->pgrate.num_tcs_supported; in cxgb4_dcb_handle_fw_update()
317 memcpy(dcb->pgrate, &fwdcb->pgrate.pgrate, in cxgb4_dcb_handle_fw_update()
318 sizeof(dcb->pgrate)); in cxgb4_dcb_handle_fw_update()
319 memcpy(dcb->tsa, &fwdcb->pgrate.tsa, in cxgb4_dcb_handle_fw_update()
320 sizeof(dcb->tsa)); in cxgb4_dcb_handle_fw_update()
321 dcb->msgs |= CXGB4_DCB_FW_PGRATE; in cxgb4_dcb_handle_fw_update()
322 if (dcb->msgs & CXGB4_DCB_FW_PGID) in cxgb4_dcb_handle_fw_update()
323 IEEE_FAUX_SYNC(dev, dcb); in cxgb4_dcb_handle_fw_update()
327 memcpy(dcb->priorate, &fwdcb->priorate.strict_priorate, in cxgb4_dcb_handle_fw_update()
328 sizeof(dcb->priorate)); in cxgb4_dcb_handle_fw_update()
329 dcb->msgs |= CXGB4_DCB_FW_PRIORATE; in cxgb4_dcb_handle_fw_update()
333 dcb->pfcen = fwdcb->pfc.pfcen; in cxgb4_dcb_handle_fw_update()
334 dcb->pfc_num_tcs_supported = fwdcb->pfc.max_pfc_tcs; in cxgb4_dcb_handle_fw_update()
335 dcb->msgs |= CXGB4_DCB_FW_PFC; in cxgb4_dcb_handle_fw_update()
336 IEEE_FAUX_SYNC(dev, dcb); in cxgb4_dcb_handle_fw_update()
342 struct app_priority *ap = &dcb->app_priority[idx]; in cxgb4_dcb_handle_fw_update()
352 if (dcb->dcb_version == FW_PORT_DCB_VER_IEEE) { in cxgb4_dcb_handle_fw_update()
356 IEEE_FAUX_SYNC(dev, dcb); in cxgb4_dcb_handle_fw_update()
372 dcb->msgs |= CXGB4_DCB_FW_APP_ID; in cxgb4_dcb_handle_fw_update()
393 return pi->dcb.enabled; in cxgb4_getstate()
403 if (pi->dcb.state == CXGB4_DCB_STATE_HOST) { in cxgb4_setstate()
404 pi->dcb.enabled = enabled; in cxgb4_setstate()
410 if (enabled != (pi->dcb.state == CXGB4_DCB_STATE_FW_ALLSYNCED)) in cxgb4_setstate()
432 pcmd.u.dcb.pgid.type = FW_PORT_DCB_TYPE_PGID; in cxgb4_getpgtccfg()
438 *pgid = (be32_to_cpu(pcmd.u.dcb.pgid.pgid) >> (tc * 4)) & 0xf; in cxgb4_getpgtccfg()
444 pcmd.u.dcb.pgrate.type = FW_PORT_DCB_TYPE_PGRATE; in cxgb4_getpgtccfg()
452 *bw_per = pcmd.u.dcb.pgrate.pgrate[*pgid]; in cxgb4_getpgtccfg()
496 pcmd.u.dcb.pgid.type = FW_PORT_DCB_TYPE_PGID; in cxgb4_setpgtccfg_tx()
504 _pgid = be32_to_cpu(pcmd.u.dcb.pgid.pgid); in cxgb4_setpgtccfg_tx()
507 pcmd.u.dcb.pgid.pgid = cpu_to_be32(_pgid); in cxgb4_setpgtccfg_tx()
521 pcmd.u.dcb.pgrate.type = FW_PORT_DCB_TYPE_PGRATE; in cxgb4_setpgtccfg_tx()
530 pcmd.u.dcb.pgrate.pgrate[pgid] = bw_per; in cxgb4_setpgtccfg_tx()
533 if (pi->dcb.state == CXGB4_DCB_STATE_HOST) in cxgb4_setpgtccfg_tx()
555 pcmd.u.dcb.pgrate.type = FW_PORT_DCB_TYPE_PGRATE; in cxgb4_getpgbwgcfg()
563 *bw_per = pcmd.u.dcb.pgrate.pgrate[pgid]; in cxgb4_getpgbwgcfg()
585 pcmd.u.dcb.pgrate.type = FW_PORT_DCB_TYPE_PGRATE; in cxgb4_setpgbwgcfg_tx()
594 pcmd.u.dcb.pgrate.pgrate[pgid] = bw_per; in cxgb4_setpgbwgcfg_tx()
597 if (pi->dcb.state == CXGB4_DCB_STATE_HOST) in cxgb4_setpgbwgcfg_tx()
613 struct port_dcb_info *dcb = &pi->dcb; in cxgb4_getpfccfg() local
615 if (!cxgb4_dcb_state_synced(dcb->state) || in cxgb4_getpfccfg()
619 *pfccfg = (pi->dcb.pfcen >> (7 - priority)) & 1; in cxgb4_getpfccfg()
632 if (!cxgb4_dcb_state_synced(pi->dcb.state) || in cxgb4_setpfccfg()
637 if (pi->dcb.state == CXGB4_DCB_STATE_HOST) in cxgb4_setpfccfg()
640 pcmd.u.dcb.pfc.type = FW_PORT_DCB_TYPE_PFC; in cxgb4_setpfccfg()
641 pcmd.u.dcb.pfc.pfcen = pi->dcb.pfcen; in cxgb4_setpfccfg()
644 pcmd.u.dcb.pfc.pfcen |= (1 << (7 - priority)); in cxgb4_setpfccfg()
646 pcmd.u.dcb.pfc.pfcen &= (~(1 << (7 - priority))); in cxgb4_setpfccfg()
654 pi->dcb.pfcen = pcmd.u.dcb.pfc.pfcen; in cxgb4_setpfccfg()
694 *caps = pi->dcb.supported; in cxgb4_getcap()
712 if (pi->dcb.msgs & CXGB4_DCB_FW_PGRATE) in cxgb4_getnumtcs()
713 *num = pi->dcb.pg_num_tcs_supported; in cxgb4_getnumtcs()
744 if (!cxgb4_dcb_state_synced(pi->dcb.state)) in cxgb4_getpfcstate()
747 return pi->dcb.pfcen != 0; in cxgb4_getpfcstate()
768 if (!cxgb4_dcb_state_synced(pi->dcb.state)) in __cxgb4_getapp()
780 pcmd.u.dcb.app_priority.type = FW_PORT_DCB_TYPE_APP_ID; in __cxgb4_getapp()
781 pcmd.u.dcb.app_priority.idx = i; in __cxgb4_getapp()
789 if (be16_to_cpu(pcmd.u.dcb.app_priority.protocolid) == app_id) in __cxgb4_getapp()
790 if (pcmd.u.dcb.app_priority.sel_field == app_idtype) in __cxgb4_getapp()
791 return pcmd.u.dcb.app_priority.user_prio_map; in __cxgb4_getapp()
794 if (!pcmd.u.dcb.app_priority.protocolid) in __cxgb4_getapp()
822 if (!cxgb4_dcb_state_synced(pi->dcb.state)) in __cxgb4_setapp()
831 pcmd.u.dcb.app_priority.type = FW_PORT_DCB_TYPE_APP_ID; in __cxgb4_setapp()
832 pcmd.u.dcb.app_priority.idx = i; in __cxgb4_setapp()
840 if (be16_to_cpu(pcmd.u.dcb.app_priority.protocolid) == app_id) { in __cxgb4_setapp()
842 pcmd.u.dcb.app_priority.protocolid = 0; in __cxgb4_setapp()
846 if (!pcmd.u.dcb.app_priority.protocolid) in __cxgb4_setapp()
858 if (pi->dcb.state == CXGB4_DCB_STATE_HOST) in __cxgb4_setapp()
861 pcmd.u.dcb.app_priority.type = FW_PORT_DCB_TYPE_APP_ID; in __cxgb4_setapp()
862 pcmd.u.dcb.app_priority.protocolid = cpu_to_be16(app_id); in __cxgb4_setapp()
863 pcmd.u.dcb.app_priority.sel_field = app_idtype; in __cxgb4_setapp()
864 pcmd.u.dcb.app_priority.user_prio_map = app_prio; in __cxgb4_setapp()
865 pcmd.u.dcb.app_priority.idx = i; in __cxgb4_setapp()
908 struct port_dcb_info *dcb = &pi->dcb; in cxgb4_ieee_negotiation_complete() local
910 if (dcb->state == CXGB4_DCB_STATE_FW_ALLSYNCED) in cxgb4_ieee_negotiation_complete()
911 if (dcb_subtype && !(dcb->msgs & dcb_subtype)) in cxgb4_ieee_negotiation_complete()
914 return (cxgb4_dcb_state_synced(dcb->state) && in cxgb4_ieee_negotiation_complete()
915 (dcb->supported & DCB_CAP_DCBX_VER_IEEE)); in cxgb4_ieee_negotiation_complete()
922 struct port_dcb_info *dcb = &pi->dcb; in cxgb4_ieee_read_ets() local
928 if (!(dcb->msgs & (CXGB4_DCB_FW_PGID | CXGB4_DCB_FW_PGRATE))) in cxgb4_ieee_read_ets()
931 ets->ets_cap = dcb->pg_num_tcs_supported; in cxgb4_ieee_read_ets()
940 pcmd.u.dcb.pgid.type = FW_PORT_DCB_TYPE_PGID; in cxgb4_ieee_read_ets()
947 tc_info = be32_to_cpu(pcmd.u.dcb.pgid.pgid); in cxgb4_ieee_read_ets()
954 pcmd.u.dcb.pgrate.type = FW_PORT_DCB_TYPE_PGRATE; in cxgb4_ieee_read_ets()
965 ets->tc_tx_bw[i] = pcmd.u.dcb.pgrate.pgrate[i]; in cxgb4_ieee_read_ets()
967 ets->tc_tsa[i] = pcmd.u.dcb.pgrate.tsa[i]; in cxgb4_ieee_read_ets()
982 struct port_dcb_info *dcb = &pi->dcb; in cxgb4_ieee_get_pfc() local
986 if (!(dcb->msgs & CXGB4_DCB_FW_PFC)) in cxgb4_ieee_get_pfc()
989 pfc->pfc_cap = dcb->pfc_num_tcs_supported; in cxgb4_ieee_get_pfc()
990 pfc->pfc_en = bitswap_1(dcb->pfcen); in cxgb4_ieee_get_pfc()
1055 return pi->dcb.supported; in cxgb4_getdcbx()
1072 if (!cxgb4_dcb_state_synced(pi->dcb.state)) in cxgb4_setdcbx()
1080 if (dcb_request != pi->dcb.supported) in cxgb4_setdcbx()
1083 pi->dcb.supported = dcb_request; in cxgb4_setdcbx()
1095 if (!cxgb4_dcb_state_synced(pi->dcb.state)) in cxgb4_getpeer_app()
1104 pcmd.u.dcb.app_priority.type = FW_PORT_DCB_TYPE_APP_ID; in cxgb4_getpeer_app()
1105 pcmd.u.dcb.app_priority.idx = *app_count; in cxgb4_getpeer_app()
1115 if (!pcmd.u.dcb.app_priority.protocolid) in cxgb4_getpeer_app()
1129 if (!cxgb4_dcb_state_synced(pi->dcb.state)) in cxgb4_getpeerapp_tbl()
1134 pcmd.u.dcb.app_priority.type = FW_PORT_DCB_TYPE_APP_ID; in cxgb4_getpeerapp_tbl()
1135 pcmd.u.dcb.app_priority.idx = i; in cxgb4_getpeerapp_tbl()
1145 if (!pcmd.u.dcb.app_priority.protocolid) in cxgb4_getpeerapp_tbl()
1148 table[i].selector = (pcmd.u.dcb.app_priority.sel_field + 1); in cxgb4_getpeerapp_tbl()
1150 be16_to_cpu(pcmd.u.dcb.app_priority.protocolid); in cxgb4_getpeerapp_tbl()
1152 ffs(pcmd.u.dcb.app_priority.user_prio_map) - 1; in cxgb4_getpeerapp_tbl()
1173 pcmd.u.dcb.pgid.type = FW_PORT_DCB_TYPE_PGID; in cxgb4_cee_peer_getpg()
1179 pgid = be32_to_cpu(pcmd.u.dcb.pgid.pgid); in cxgb4_cee_peer_getpg()
1185 pcmd.u.dcb.pgrate.type = FW_PORT_DCB_TYPE_PGRATE; in cxgb4_cee_peer_getpg()
1194 pg->pg_bw[i] = pcmd.u.dcb.pgrate.pgrate[i]; in cxgb4_cee_peer_getpg()
1196 pg->tcs_supported = pcmd.u.dcb.pgrate.num_tcs_supported; in cxgb4_cee_peer_getpg()
1213 pfc->pfc_en = bitswap_1(pi->dcb.pfcen); in cxgb4_cee_peer_getpfc()
1215 pfc->tcs_supported = pi->dcb.pfc_num_tcs_supported; in cxgb4_cee_peer_getpfc()