src/dpdk/drivers/net/ice/base/ice_dcb.c
void ice_dcb_cfg_to_lldp(u8 *lldpmib, u16 *miblen, struct ice_dcbx_cfg *dcbcfg)
{
	u16 len, offset = 0, tlvid = ICE_TLV_ID_START;
	struct ice_lldp_org_tlv *tlv;
	u16 typelen;

	tlv = (struct ice_lldp_org_tlv *)lldpmib;
	while (1) {
		ice_add_dcb_tlv(tlv, dcbcfg, tlvid++);
		typelen = NTOHS(tlv->typelen);
		len = (typelen & ICE_LLDP_TLV_LEN_M) >> ICE_LLDP_TLV_LEN_S;
		if (len)
			offset += len + 2;
		/* END TLV or beyond LLDPDU size */
		if (tlvid >= ICE_TLV_ID_END_OF_LLDPPDU ||
		    offset > ICE_LLDPDU_SIZE)
			break;
		/* Move to next TLV */
		if (len)
			tlv = (struct ice_lldp_org_tlv *)
				((char *)tlv + sizeof(tlv->typelen) + len);
	}
	*miblen = offset;
}
/**
 * ice_dcb_cfg_to_lldp - Convert DCB configuration to MIB format
 * @lldpmib: pointer to the HW struct
 * @miblen: length of LLDP MIB
 * @dcbcfg: Local store which holds the DCB Config
 *
 * Convert the DCB configuration to MIB format
 */
Convert DCB configuration to MIB format
@lldpmib: pointer to the HW struct
@miblen: length of LLDP MIB
@dcbcfg: Local store which holds the DCB Config

Convert the DCB configuration to MIB format
Convert DCB configuration to MIB format @lldpmib : pointer to the HW struct @miblen : length of LLDP MIB @dcbcfg : Local store which holds the DCB Config Convert the DCB configuration to MIB format
void ice_dcb_cfg_to_lldp(u8 *lldpmib, u16 *miblen, struct ice_dcbx_cfg *dcbcfg)
{
	u16 len, offset = 0, tlvid = ICE_TLV_ID_START;
	struct ice_lldp_org_tlv *tlv;
	u16 typelen;
	tlv = (struct ice_lldp_org_tlv *)lldpmib;
	while (1) {
		ice_add_dcb_tlv(tlv, dcbcfg, tlvid++);
		typelen = NTOHS(tlv->typelen);
		len = (typelen & ICE_LLDP_TLV_LEN_M) >> ICE_LLDP_TLV_LEN_S;
		if (len)
			offset += len + 2;
		if (tlvid >= ICE_TLV_ID_END_OF_LLDPPDU ||
		    offset > ICE_LLDPDU_SIZE)
			break;
		if (len)
			tlv = (struct ice_lldp_org_tlv *)
				((char *)tlv + sizeof(tlv->typelen) + len);
	}
	*miblen = offset;
}
void ice_dcb_cfg_to_lldp ( u8 * lldpmib , u16 * miblen , struct ice_dcbx_cfg * dcbcfg ) { u16 len , offset = 0 , tlvid = ICE_TLV_ID_START ; struct ice_lldp_org_tlv * tlv ; u16 typelen ; tlv = ( struct ice_lldp_org_tlv * ) lldpmib ; while ( 1 ) { ice_add_dcb_tlv ( tlv , dcbcfg , tlvid ++ ) ; typelen = NTOHS ( tlv -> typelen ) ; len = ( typelen & ICE_LLDP_TLV_LEN_M ) >> ICE_LLDP_TLV_LEN_S ; if ( len ) offset += len + 2 ; if ( tlvid >= ICE_TLV_ID_END_OF_LLDPPDU || offset > ICE_LLDPDU_SIZE ) break ; if ( len ) tlv = ( struct ice_lldp_org_tlv * ) ( ( char * ) tlv + sizeof ( tlv -> typelen ) + len ) ; } * miblen = offset ; }
ice_dcb_cfg_to_lldp - Convert DCB configuration to MIB format
 @lldpmib: pointer to the HW struct
 @miblen: length of LLDP MIB
 @dcbcfg: Local store which holds the DCB Config
ice_dcb_cfg_to_lldp - Convert DCB configuration to MIB format @lldpmib : pointer to the HW struct @miblen : length of LLDP MIB @dcbcfg : Local store which holds the DCB Config
/* END TLV or beyond LLDPDU size */ /* Move to next TLV */