src/dpdk/drivers/net/ice/base/ice_dcb.c
enum ice_status ice_set_dcb_cfg(struct ice_port_info *pi)
{
	u8 mib_type, *lldpmib = NULL;
	struct ice_dcbx_cfg *dcbcfg;
	enum ice_status ret;
	struct ice_hw *hw;
	u16 miblen;

	if (!pi)
		return ICE_ERR_PARAM;

	hw = pi->hw;

	/* update the HW local config */
	dcbcfg = &pi->qos_cfg.local_dcbx_cfg;
	/* Allocate the LLDPDU */
	lldpmib = (u8 *)ice_malloc(hw, ICE_LLDPDU_SIZE);
	if (!lldpmib)
		return ICE_ERR_NO_MEMORY;

	mib_type = SET_LOCAL_MIB_TYPE_LOCAL_MIB;
	if (dcbcfg->app_mode == ICE_DCBX_APPS_NON_WILLING)
		mib_type |= SET_LOCAL_MIB_TYPE_CEE_NON_WILLING;

	ice_dcb_cfg_to_lldp(lldpmib, &miblen, dcbcfg);
	ret = ice_aq_set_lldp_mib(hw, mib_type, (void *)lldpmib, miblen,
				  NULL);

	ice_free(hw, lldpmib);

	return ret;
}
/**
 * ice_set_dcb_cfg - Set the local LLDP MIB to FW
 * @pi: port information structure
 *
 * Set DCB configuration to the Firmware
 */
Set the local LLDP MIB to FW
@pi: port information structure

Set DCB configuration to the Firmware
Set the local LLDP MIB to FW @pi : port information structure Set DCB configuration to the Firmware
enum ice_status ice_set_dcb_cfg(struct ice_port_info *pi)
{
	u8 mib_type, *lldpmib = NULL;
	struct ice_dcbx_cfg *dcbcfg;
	enum ice_status ret;
	struct ice_hw *hw;
	u16 miblen;
	if (!pi)
		return ICE_ERR_PARAM;
	hw = pi->hw;
	dcbcfg = &pi->qos_cfg.local_dcbx_cfg;
	lldpmib = (u8 *)ice_malloc(hw, ICE_LLDPDU_SIZE);
	if (!lldpmib)
		return ICE_ERR_NO_MEMORY;
	mib_type = SET_LOCAL_MIB_TYPE_LOCAL_MIB;
	if (dcbcfg->app_mode == ICE_DCBX_APPS_NON_WILLING)
		mib_type |= SET_LOCAL_MIB_TYPE_CEE_NON_WILLING;
	ice_dcb_cfg_to_lldp(lldpmib, &miblen, dcbcfg);
	ret = ice_aq_set_lldp_mib(hw, mib_type, (void *)lldpmib, miblen,
				  NULL);
	ice_free(hw, lldpmib);
	return ret;
}
enum ice_status ice_set_dcb_cfg ( struct ice_port_info * pi ) { u8 mib_type , * lldpmib = NULL ; struct ice_dcbx_cfg * dcbcfg ; enum ice_status ret ; struct ice_hw * hw ; u16 miblen ; if ( ! pi ) return ICE_ERR_PARAM ; hw = pi -> hw ; dcbcfg = & pi -> qos_cfg . local_dcbx_cfg ; lldpmib = ( u8 * ) ice_malloc ( hw , ICE_LLDPDU_SIZE ) ; if ( ! lldpmib ) return ICE_ERR_NO_MEMORY ; mib_type = SET_LOCAL_MIB_TYPE_LOCAL_MIB ; if ( dcbcfg -> app_mode == ICE_DCBX_APPS_NON_WILLING ) mib_type |= SET_LOCAL_MIB_TYPE_CEE_NON_WILLING ; ice_dcb_cfg_to_lldp ( lldpmib , & miblen , dcbcfg ) ; ret = ice_aq_set_lldp_mib ( hw , mib_type , ( void * ) lldpmib , miblen , NULL ) ; ice_free ( hw , lldpmib ) ; return ret ; }
ice_set_dcb_cfg - Set the local LLDP MIB to FW
 @pi: port information structure
ice_set_dcb_cfg - Set the local LLDP MIB to FW @pi : port information structure
/* update the HW local config */ /* Allocate the LLDPDU */