src/dpdk/drivers/net/ice/base/ice_dcb.c
static void
ice_parse_cee_app_tlv(struct ice_cee_feat_tlv *tlv, struct ice_dcbx_cfg *dcbcfg)
{
	u16 len, typelen, offset = 0;
	struct ice_cee_app_prio *app;
	u8 i;

	typelen = NTOHS(tlv->hdr.typelen);
	len = ((typelen & ICE_LLDP_TLV_LEN_M) >> ICE_LLDP_TLV_LEN_S);

	dcbcfg->numapps = len / sizeof(*app);
	if (!dcbcfg->numapps)
		return;
	if (dcbcfg->numapps > ICE_DCBX_MAX_APPS)
		dcbcfg->numapps = ICE_DCBX_MAX_APPS;

	for (i = 0; i < dcbcfg->numapps; i++) {
		u8 up, selector;

		app = (struct ice_cee_app_prio *)(tlv->tlvinfo + offset);
		for (up = 0; up < ICE_MAX_USER_PRIORITY; up++)
			if (app->prio_map & BIT(up))
				break;

		dcbcfg->app[i].priority = up;

		/* Get Selector from lower 2 bits, and convert to IEEE */
		selector = (app->upper_oui_sel & ICE_CEE_APP_SELECTOR_M);
		switch (selector) {
		case ICE_CEE_APP_SEL_ETHTYPE:
			dcbcfg->app[i].selector = ICE_APP_SEL_ETHTYPE;
			break;
		case ICE_CEE_APP_SEL_TCPIP:
			dcbcfg->app[i].selector = ICE_APP_SEL_TCPIP;
			break;
		default:
			/* Keep selector as it is for unknown types */
			dcbcfg->app[i].selector = selector;
		}

		dcbcfg->app[i].prot_id = NTOHS(app->protocol);
		/* Move to next app */
		offset += sizeof(*app);
	}
}
/**
 * ice_parse_cee_app_tlv
 * @tlv: CEE DCBX APP TLV
 * @dcbcfg: Local store to update APP PRIO data
 *
 * Parses CEE DCBX APP PRIO TLV
 */


Parses CEE DCBX APP PRIO TLV
Parses CEE DCBX APP PRIO TLV
static void
ice_parse_cee_app_tlv(struct ice_cee_feat_tlv *tlv, struct ice_dcbx_cfg *dcbcfg)
{
	u16 len, typelen, offset = 0;
	struct ice_cee_app_prio *app;
	u8 i;
	typelen = NTOHS(tlv->hdr.typelen);
	len = ((typelen & ICE_LLDP_TLV_LEN_M) >> ICE_LLDP_TLV_LEN_S);
	dcbcfg->numapps = len / sizeof(*app);
	if (!dcbcfg->numapps)
		return;
	if (dcbcfg->numapps > ICE_DCBX_MAX_APPS)
		dcbcfg->numapps = ICE_DCBX_MAX_APPS;
	for (i = 0; i < dcbcfg->numapps; i++) {
		u8 up, selector;
		app = (struct ice_cee_app_prio *)(tlv->tlvinfo + offset);
		for (up = 0; up < ICE_MAX_USER_PRIORITY; up++)
			if (app->prio_map & BIT(up))
				break;
		dcbcfg->app[i].priority = up;
		selector = (app->upper_oui_sel & ICE_CEE_APP_SELECTOR_M);
		switch (selector) {
		case ICE_CEE_APP_SEL_ETHTYPE:
			dcbcfg->app[i].selector = ICE_APP_SEL_ETHTYPE;
			break;
		case ICE_CEE_APP_SEL_TCPIP:
			dcbcfg->app[i].selector = ICE_APP_SEL_TCPIP;
			break;
		default:
			dcbcfg->app[i].selector = selector;
		}
		dcbcfg->app[i].prot_id = NTOHS(app->protocol);
		offset += sizeof(*app);
	}
}
static void ice_parse_cee_app_tlv ( struct ice_cee_feat_tlv * tlv , struct ice_dcbx_cfg * dcbcfg ) { u16 len , typelen , offset = 0 ; struct ice_cee_app_prio * app ; u8 i ; typelen = NTOHS ( tlv -> hdr . typelen ) ; len = ( ( typelen & ICE_LLDP_TLV_LEN_M ) >> ICE_LLDP_TLV_LEN_S ) ; dcbcfg -> numapps = len / sizeof ( * app ) ; if ( ! dcbcfg -> numapps ) return ; if ( dcbcfg -> numapps > ICE_DCBX_MAX_APPS ) dcbcfg -> numapps = ICE_DCBX_MAX_APPS ; for ( i = 0 ; i < dcbcfg -> numapps ; i ++ ) { u8 up , selector ; app = ( struct ice_cee_app_prio * ) ( tlv -> tlvinfo + offset ) ; for ( up = 0 ; up < ICE_MAX_USER_PRIORITY ; up ++ ) if ( app -> prio_map & BIT ( up ) ) break ; dcbcfg -> app [ i ] . priority = up ; selector = ( app -> upper_oui_sel & ICE_CEE_APP_SELECTOR_M ) ; switch ( selector ) { case ICE_CEE_APP_SEL_ETHTYPE : dcbcfg -> app [ i ] . selector = ICE_APP_SEL_ETHTYPE ; break ; case ICE_CEE_APP_SEL_TCPIP : dcbcfg -> app [ i ] . selector = ICE_APP_SEL_TCPIP ; break ; default : dcbcfg -> app [ i ] . selector = selector ; } dcbcfg -> app [ i ] . prot_id = NTOHS ( app -> protocol ) ; offset += sizeof ( * app ) ; } }
ice_parse_cee_app_tlv
 @tlv: CEE DCBX APP TLV
 @dcbcfg: Local store to update APP PRIO data
ice_parse_cee_app_tlv @tlv : CEE DCBX APP TLV @dcbcfg : Local store to update APP PRIO data
/* Get Selector from lower 2 bits, and convert to IEEE */ /* Keep selector as it is for unknown types */ /* Move to next app */