src/dpdk/drivers/net/ice/base/ice_dcb.c
static void
ice_add_ieee_ets_tlv(struct ice_lldp_org_tlv *tlv, struct ice_dcbx_cfg *dcbcfg)
{
	struct ice_dcb_ets_cfg *etscfg;
	u8 *buf = tlv->tlvinfo;
	u8 maxtcwilling = 0;
	u32 ouisubtype;
	u16 typelen;

	typelen = ((ICE_TLV_TYPE_ORG << ICE_LLDP_TLV_TYPE_S) |
		   ICE_IEEE_ETS_TLV_LEN);
	tlv->typelen = HTONS(typelen);

	ouisubtype = ((ICE_IEEE_8021QAZ_OUI << ICE_LLDP_TLV_OUI_S) |
		      ICE_IEEE_SUBTYPE_ETS_CFG);
	tlv->ouisubtype = HTONL(ouisubtype);

	/* First Octet post subtype
	 * --------------------------
	 * |will-|CBS  | Re-  | Max |
	 * |ing  |     |served| TCs |
	 * --------------------------
	 * |1bit | 1bit|3 bits|3bits|
	 */
	etscfg = &dcbcfg->etscfg;
	if (etscfg->willing)
		maxtcwilling = BIT(ICE_IEEE_ETS_WILLING_S);
	maxtcwilling |= etscfg->maxtcs & ICE_IEEE_ETS_MAXTC_M;
	buf[0] = maxtcwilling;

	/* Begin adding at Priority Assignment Table (offset 1 in buf) */
	ice_add_ieee_ets_common_tlv(&buf[1], etscfg);
}
/**
 * ice_add_ieee_ets_tlv - Prepare ETS TLV in IEEE format
 * @tlv: Fill the ETS config data in IEEE format
 * @dcbcfg: Local store which holds the DCB Config
 *
 * Prepare IEEE 802.1Qaz ETS CFG TLV
 */
Prepare ETS TLV in IEEE format
@tlv: Fill the ETS config data in IEEE format
@dcbcfg: Local store which holds the DCB Config

Prepare IEEE 802.1Qaz ETS CFG TLV
Prepare ETS TLV in IEEE format @tlv : Fill the ETS config data in IEEE format @dcbcfg : Local store which holds the DCB Config Prepare IEEE 802 . 1Qaz ETS CFG TLV
static void
ice_add_ieee_ets_tlv(struct ice_lldp_org_tlv *tlv, struct ice_dcbx_cfg *dcbcfg)
{
	struct ice_dcb_ets_cfg *etscfg;
	u8 *buf = tlv->tlvinfo;
	u8 maxtcwilling = 0;
	u32 ouisubtype;
	u16 typelen;
	typelen = ((ICE_TLV_TYPE_ORG << ICE_LLDP_TLV_TYPE_S) |
		   ICE_IEEE_ETS_TLV_LEN);
	tlv->typelen = HTONS(typelen);
	ouisubtype = ((ICE_IEEE_8021QAZ_OUI << ICE_LLDP_TLV_OUI_S) |
		      ICE_IEEE_SUBTYPE_ETS_CFG);
	tlv->ouisubtype = HTONL(ouisubtype);
	etscfg = &dcbcfg->etscfg;
	if (etscfg->willing)
		maxtcwilling = BIT(ICE_IEEE_ETS_WILLING_S);
	maxtcwilling |= etscfg->maxtcs & ICE_IEEE_ETS_MAXTC_M;
	buf[0] = maxtcwilling;
	ice_add_ieee_ets_common_tlv(&buf[1], etscfg);
}
static void ice_add_ieee_ets_tlv ( struct ice_lldp_org_tlv * tlv , struct ice_dcbx_cfg * dcbcfg ) { struct ice_dcb_ets_cfg * etscfg ; u8 * buf = tlv -> tlvinfo ; u8 maxtcwilling = 0 ; u32 ouisubtype ; u16 typelen ; typelen = ( ( ICE_TLV_TYPE_ORG << ICE_LLDP_TLV_TYPE_S ) | ICE_IEEE_ETS_TLV_LEN ) ; tlv -> typelen = HTONS ( typelen ) ; ouisubtype = ( ( ICE_IEEE_8021QAZ_OUI << ICE_LLDP_TLV_OUI_S ) | ICE_IEEE_SUBTYPE_ETS_CFG ) ; tlv -> ouisubtype = HTONL ( ouisubtype ) ; etscfg = & dcbcfg -> etscfg ; if ( etscfg -> willing ) maxtcwilling = BIT ( ICE_IEEE_ETS_WILLING_S ) ; maxtcwilling |= etscfg -> maxtcs & ICE_IEEE_ETS_MAXTC_M ; buf [ 0 ] = maxtcwilling ; ice_add_ieee_ets_common_tlv ( & buf [ 1 ] , etscfg ) ; }
ice_add_ieee_ets_tlv - Prepare ETS TLV in IEEE format
 @tlv: Fill the ETS config data in IEEE format
 @dcbcfg: Local store which holds the DCB Config
ice_add_ieee_ets_tlv - Prepare ETS TLV in IEEE format @tlv : Fill the ETS config data in IEEE format @dcbcfg : Local store which holds the DCB Config
/* First Octet post subtype
	 * --------------------------
	 * |will-|CBS  | Re-  | Max |
	 * |ing  |     |served| TCs |
	 * --------------------------
	 * |1bit | 1bit|3 bits|3bits|
	 */ /* Begin adding at Priority Assignment Table (offset 1 in buf) */