src/dpdk/drivers/net/qede/base/ecore_sriov.c
void ecore_dp_tlv_list(struct ecore_hwfn *p_hwfn, void *tlvs_list)
{
	u16 i = 1, total_length = 0;
	struct channel_tlv *tlv;

	do {
		/* cast current tlv list entry to channel tlv header */
		tlv = (struct channel_tlv *)((u8 *)tlvs_list + total_length);

		/* output tlv */
		if (ecore_iov_tlv_supported(tlv->type))
			DP_VERBOSE(p_hwfn, ECORE_MSG_IOV,
				   "TLV number %d: type %s, length %d\n",
				   i, qede_ecore_channel_tlvs_string[tlv->type],
				   tlv->length);
		else
			DP_VERBOSE(p_hwfn, ECORE_MSG_IOV,
				   "TLV number %d: type %d, length %d\n",
				   i, tlv->type, tlv->length);

		if (tlv->type == CHANNEL_TLV_LIST_END)
			return;

		/* Validate entry - protect against malicious VFs */
		if (!tlv->length) {
			DP_NOTICE(p_hwfn, false, "TLV of length 0 found\n");
			return;
		}
		total_length += tlv->length;
		if (total_length >= sizeof(struct tlv_buffer_size)) {
			DP_NOTICE(p_hwfn, false, "TLV ==> Buffer overflow\n");
			return;
		}

		i++;
	} while (1);
}
/* list the types and lengths of the tlvs on the buffer */
list the types and lengths of the tlvs on the buffer
list the types and lengths of the tlvs on the buffer
void ecore_dp_tlv_list(struct ecore_hwfn *p_hwfn, void *tlvs_list)
{
	u16 i = 1, total_length = 0;
	struct channel_tlv *tlv;
	do {
		tlv = (struct channel_tlv *)((u8 *)tlvs_list + total_length);
		if (ecore_iov_tlv_supported(tlv->type))
			DP_VERBOSE(p_hwfn, ECORE_MSG_IOV,
				   "TLV number %d: type %s, length %d\n",
				   i, qede_ecore_channel_tlvs_string[tlv->type],
				   tlv->length);
		else
			DP_VERBOSE(p_hwfn, ECORE_MSG_IOV,
				   "TLV number %d: type %d, length %d\n",
				   i, tlv->type, tlv->length);
		if (tlv->type == CHANNEL_TLV_LIST_END)
			return;
		if (!tlv->length) {
			DP_NOTICE(p_hwfn, false, "TLV of length 0 found\n");
			return;
		}
		total_length += tlv->length;
		if (total_length >= sizeof(struct tlv_buffer_size)) {
			DP_NOTICE(p_hwfn, false, "TLV ==> Buffer overflow\n");
			return;
		}
		i++;
	} while (1);
}
void ecore_dp_tlv_list ( struct ecore_hwfn * p_hwfn , void * tlvs_list ) { u16 i = 1 , total_length = 0 ; struct channel_tlv * tlv ; do { tlv = ( struct channel_tlv * ) ( ( u8 * ) tlvs_list + total_length ) ; if ( ecore_iov_tlv_supported ( tlv -> type ) ) DP_VERBOSE ( p_hwfn , ECORE_MSG_IOV , " \n " , i , qede_ecore_channel_tlvs_string [ tlv -> type ] , tlv -> length ) ; else DP_VERBOSE ( p_hwfn , ECORE_MSG_IOV , " \n " , i , tlv -> type , tlv -> length ) ; if ( tlv -> type == CHANNEL_TLV_LIST_END ) return ; if ( ! tlv -> length ) { DP_NOTICE ( p_hwfn , false , " \n " ) ; return ; } total_length += tlv -> length ; if ( total_length >= sizeof ( struct tlv_buffer_size ) ) { DP_NOTICE ( p_hwfn , false , " \n " ) ; return ; } i ++ ; } while ( 1 ) ; }
list the types and lengths of the tlvs on the buffer
list the types and lengths of the tlvs on the buffer
/* cast current tlv list entry to channel tlv header */ /* output tlv */ /* Validate entry - protect against malicious VFs */