diff options
| author | Dmitry Torokhov <[email protected]> | 2023-05-01 15:20:08 -0700 | 
|---|---|---|
| committer | Dmitry Torokhov <[email protected]> | 2023-05-01 15:20:08 -0700 | 
| commit | 9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e (patch) | |
| tree | d57f3a63479a07b4e0cece029886e76e04feb984 /drivers/net/ethernet/intel/ice/ice_dcb.c | |
| parent | 5dc63e56a9cf8df0b59c234a505a1653f1bdf885 (diff) | |
| parent | 53bea86b5712c7491bb3dae12e271666df0a308c (diff) | |
Merge branch 'next' into for-linus
Prepare input updates for 6.4 merge window.
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_dcb.c')
| -rw-r--r-- | drivers/net/ethernet/intel/ice/ice_dcb.c | 45 | 
1 files changed, 42 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_dcb.c b/drivers/net/ethernet/intel/ice/ice_dcb.c index 6be02f9b0b8c..396e555023aa 100644 --- a/drivers/net/ethernet/intel/ice/ice_dcb.c +++ b/drivers/net/ethernet/intel/ice/ice_dcb.c @@ -73,6 +73,9 @@ ice_aq_cfg_lldp_mib_change(struct ice_hw *hw, bool ena_update,  	if (!ena_update)  		cmd->command |= ICE_AQ_LLDP_MIB_UPDATE_DIS; +	else +		cmd->command |= FIELD_PREP(ICE_AQ_LLDP_MIB_PENDING_M, +					   ICE_AQ_LLDP_MIB_PENDING_ENABLE);  	return ice_aq_send_cmd(hw, &desc, NULL, 0, cd);  } @@ -566,7 +569,7 @@ ice_parse_cee_tlv(struct ice_lldp_org_tlv *tlv, struct ice_dcbx_cfg *dcbcfg)   * @tlv: Organization specific TLV   * @dcbcfg: Local store to update ETS REC data   * - * Currently only IEEE 802.1Qaz TLV is supported, all others + * Currently IEEE 802.1Qaz and CEE DCBX TLV are supported, others   * will be returned   */  static void @@ -585,7 +588,7 @@ ice_parse_org_tlv(struct ice_lldp_org_tlv *tlv, struct ice_dcbx_cfg *dcbcfg)  		ice_parse_cee_tlv(tlv, dcbcfg);  		break;  	default: -		break; +		break; /* Other OUIs not supported */  	}  } @@ -964,6 +967,42 @@ int ice_get_dcb_cfg(struct ice_port_info *pi)  }  /** + * ice_get_dcb_cfg_from_mib_change + * @pi: port information structure + * @event: pointer to the admin queue receive event + * + * Set DCB configuration from received MIB Change event + */ +void ice_get_dcb_cfg_from_mib_change(struct ice_port_info *pi, +				     struct ice_rq_event_info *event) +{ +	struct ice_dcbx_cfg *dcbx_cfg = &pi->qos_cfg.local_dcbx_cfg; +	struct ice_aqc_lldp_get_mib *mib; +	u8 change_type, dcbx_mode; + +	mib = (struct ice_aqc_lldp_get_mib *)&event->desc.params.raw; + +	change_type = FIELD_GET(ICE_AQ_LLDP_MIB_TYPE_M,  mib->type); +	if (change_type == ICE_AQ_LLDP_MIB_REMOTE) +		dcbx_cfg = &pi->qos_cfg.remote_dcbx_cfg; + +	dcbx_mode = FIELD_GET(ICE_AQ_LLDP_DCBX_M, mib->type); + +	switch (dcbx_mode) { +	case ICE_AQ_LLDP_DCBX_IEEE: +		dcbx_cfg->dcbx_mode = ICE_DCBX_MODE_IEEE; +		ice_lldp_to_dcb_cfg(event->msg_buf, dcbx_cfg); +		break; + +	case ICE_AQ_LLDP_DCBX_CEE: +		pi->qos_cfg.desired_dcbx_cfg = pi->qos_cfg.local_dcbx_cfg; +		ice_cee_to_dcb_cfg((struct ice_aqc_get_cee_dcb_cfg_resp *) +				   event->msg_buf, pi); +		break; +	} +} + +/**   * ice_init_dcb   * @hw: pointer to the HW struct   * @enable_mib_change: enable MIB change event @@ -1372,7 +1411,7 @@ ice_add_dscp_pfc_tlv(struct ice_lldp_org_tlv *tlv, struct ice_dcbx_cfg *dcbcfg)  	tlv->ouisubtype = htonl(ouisubtype);  	buf[0] = dcbcfg->pfc.pfccap & 0xF; -	buf[1] = dcbcfg->pfc.pfcena & 0xF; +	buf[1] = dcbcfg->pfc.pfcena;  }  /**  |