src/dpdk/drivers/net/ice/base/ice_dcb.c
static void
ice_parse_cee_pgcfg_tlv(struct ice_cee_feat_tlv *tlv,
			struct ice_dcbx_cfg *dcbcfg)
{
	struct ice_dcb_ets_cfg *etscfg;
	u8 *buf = tlv->tlvinfo;
	u16 offset = 0;
	int i;

	etscfg = &dcbcfg->etscfg;

	if (tlv->en_will_err & ICE_CEE_FEAT_TLV_WILLING_M)
		etscfg->willing = 1;

	etscfg->cbs = 0;
	/* Priority Group Table (4 octets)
	 * Octets:|    1    |    2    |    3    |    4    |
	 *        -----------------------------------------
	 *        |pri0|pri1|pri2|pri3|pri4|pri5|pri6|pri7|
	 *        -----------------------------------------
	 *   Bits:|7  4|3  0|7  4|3  0|7  4|3  0|7  4|3  0|
	 *        -----------------------------------------
	 */
	for (i = 0; i < 4; i++) {
		etscfg->prio_table[i * 2] =
			((buf[offset] & ICE_CEE_PGID_PRIO_1_M) >>
			 ICE_CEE_PGID_PRIO_1_S);
		etscfg->prio_table[i * 2 + 1] =
			((buf[offset] & ICE_CEE_PGID_PRIO_0_M) >>
			 ICE_CEE_PGID_PRIO_0_S);
		offset++;
	}

	/* PG Percentage Table (8 octets)
	 * Octets:| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
	 *        ---------------------------------
	 *        |pg0|pg1|pg2|pg3|pg4|pg5|pg6|pg7|
	 *        ---------------------------------
	 */
	ice_for_each_traffic_class(i) {
		etscfg->tcbwtable[i] = buf[offset++];

		if (etscfg->prio_table[i] == ICE_CEE_PGID_STRICT)
			dcbcfg->etscfg.tsatable[i] = ICE_IEEE_TSA_STRICT;
		else
			dcbcfg->etscfg.tsatable[i] = ICE_IEEE_TSA_ETS;
	}

	/* Number of TCs supported (1 octet) */
	etscfg->maxtcs = buf[offset];
}
/**
 * ice_parse_cee_pgcfg_tlv
 * @tlv: CEE DCBX PG CFG TLV
 * @dcbcfg: Local store to update ETS CFG data
 *
 * Parses CEE DCBX PG CFG TLV
 */


Parses CEE DCBX PG CFG TLV
Parses CEE DCBX PG CFG TLV
static void
ice_parse_cee_pgcfg_tlv(struct ice_cee_feat_tlv *tlv,
			struct ice_dcbx_cfg *dcbcfg)
{
	struct ice_dcb_ets_cfg *etscfg;
	u8 *buf = tlv->tlvinfo;
	u16 offset = 0;
	int i;
	etscfg = &dcbcfg->etscfg;
	if (tlv->en_will_err & ICE_CEE_FEAT_TLV_WILLING_M)
		etscfg->willing = 1;
	etscfg->cbs = 0;
	for (i = 0; i < 4; i++) {
		etscfg->prio_table[i * 2] =
			((buf[offset] & ICE_CEE_PGID_PRIO_1_M) >>
			 ICE_CEE_PGID_PRIO_1_S);
		etscfg->prio_table[i * 2 + 1] =
			((buf[offset] & ICE_CEE_PGID_PRIO_0_M) >>
			 ICE_CEE_PGID_PRIO_0_S);
		offset++;
	}
	ice_for_each_traffic_class(i) {
		etscfg->tcbwtable[i] = buf[offset++];
		if (etscfg->prio_table[i] == ICE_CEE_PGID_STRICT)
			dcbcfg->etscfg.tsatable[i] = ICE_IEEE_TSA_STRICT;
		else
			dcbcfg->etscfg.tsatable[i] = ICE_IEEE_TSA_ETS;
	}
	etscfg->maxtcs = buf[offset];
}
static void ice_parse_cee_pgcfg_tlv ( struct ice_cee_feat_tlv * tlv , struct ice_dcbx_cfg * dcbcfg ) { struct ice_dcb_ets_cfg * etscfg ; u8 * buf = tlv -> tlvinfo ; u16 offset = 0 ; int i ; etscfg = & dcbcfg -> etscfg ; if ( tlv -> en_will_err & ICE_CEE_FEAT_TLV_WILLING_M ) etscfg -> willing = 1 ; etscfg -> cbs = 0 ; for ( i = 0 ; i < 4 ; i ++ ) { etscfg -> prio_table [ i * 2 ] = ( ( buf [ offset ] & ICE_CEE_PGID_PRIO_1_M ) >> ICE_CEE_PGID_PRIO_1_S ) ; etscfg -> prio_table [ i * 2 + 1 ] = ( ( buf [ offset ] & ICE_CEE_PGID_PRIO_0_M ) >> ICE_CEE_PGID_PRIO_0_S ) ; offset ++ ; } ice_for_each_traffic_class ( i ) { etscfg -> tcbwtable [ i ] = buf [ offset ++ ] ; if ( etscfg -> prio_table [ i ] == ICE_CEE_PGID_STRICT ) dcbcfg -> etscfg . tsatable [ i ] = ICE_IEEE_TSA_STRICT ; else dcbcfg -> etscfg . tsatable [ i ] = ICE_IEEE_TSA_ETS ; } etscfg -> maxtcs = buf [ offset ] ; }
ice_parse_cee_pgcfg_tlv
 @tlv: CEE DCBX PG CFG TLV
 @dcbcfg: Local store to update ETS CFG data
ice_parse_cee_pgcfg_tlv @tlv : CEE DCBX PG CFG TLV @dcbcfg : Local store to update ETS CFG data
/* Priority Group Table (4 octets)
	 * Octets:|    1    |    2    |    3    |    4    |
	 *        -----------------------------------------
	 *        |pri0|pri1|pri2|pri3|pri4|pri5|pri6|pri7|
	 *        -----------------------------------------
	 *   Bits:|7  4|3  0|7  4|3  0|7  4|3  0|7  4|3  0|
	 *        -----------------------------------------
	 */ /* PG Percentage Table (8 octets)
	 * Octets:| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
	 *        ---------------------------------
	 *        |pg0|pg1|pg2|pg3|pg4|pg5|pg6|pg7|
	 *        ---------------------------------
	 */ /* Number of TCs supported (1 octet) */