src/dpdk/drivers/net/bnxt/tf_ulp/ulp_utils.c
void
ulp_encap_buffer_copy(uint8_t *dst,
		      const uint8_t *src,
		      uint16_t size,
		      uint16_t align)
{
	uint16_t	idx, tmp_size = 0;

	do {
		dst += tmp_size;
		src += tmp_size;
		idx = 0;
		if (size > align) {
			tmp_size = align;
			size -= align;
		} else {
			tmp_size = size;
			size = 0;
		}
		/* copy 2 bytes at a time. Write MSB to LSB */
		while ((idx + sizeof(uint16_t)) <= tmp_size) {
			memcpy(&dst[idx],
			       &src[tmp_size - idx - sizeof(uint16_t)],
			       sizeof(uint16_t));
			idx += sizeof(uint16_t);
		}
	} while (size);
}
/*
 * copy the buffer in the encap format which is 2 bytes.
 * The MSB of the src is placed at the LSB of dst.
 *
 * dst [out] The destination buffer
 * src [in] The source buffer dst
 * size[in] size of the buffer.
 * align[in] The alignment is either 8 or 16.
 */
copy the buffer in the encap format which is 2 bytes.
The MSB of the src is placed at the LSB of dst.

dst [out] The destination buffer
src [in] The source buffer dst
size[in] size of the buffer.
align[in] The alignment is either 8 or 16.
copy the buffer in the encap format which is 2 bytes . The MSB of the src is placed at the LSB of dst . dst [ out ] The destination buffer src [ in ] The source buffer dst size [ in ] size of the buffer . align [ in ] The alignment is either 8 or 16 .
void
ulp_encap_buffer_copy(uint8_t *dst,
		      const uint8_t *src,
		      uint16_t size,
		      uint16_t align)
{
	uint16_t	idx, tmp_size = 0;
	do {
		dst += tmp_size;
		src += tmp_size;
		idx = 0;
		if (size > align) {
			tmp_size = align;
			size -= align;
		} else {
			tmp_size = size;
			size = 0;
		}
		while ((idx + sizeof(uint16_t)) <= tmp_size) {
			memcpy(&dst[idx],
			       &src[tmp_size - idx - sizeof(uint16_t)],
			       sizeof(uint16_t));
			idx += sizeof(uint16_t);
		}
	} while (size);
}
void ulp_encap_buffer_copy ( uint8_t * dst , const uint8_t * src , uint16_t size , uint16_t align ) { uint16_t idx , tmp_size = 0 ; do { dst += tmp_size ; src += tmp_size ; idx = 0 ; if ( size > align ) { tmp_size = align ; size -= align ; } else { tmp_size = size ; size = 0 ; } while ( ( idx + sizeof ( uint16_t ) ) <= tmp_size ) { memcpy ( & dst [ idx ] , & src [ tmp_size - idx - sizeof ( uint16_t ) ] , sizeof ( uint16_t ) ) ; idx += sizeof ( uint16_t ) ; } } while ( size ) ; }
copy the buffer in the encap format which is 2 bytes.
copy the buffer in the encap format which is 2 bytes .
/* copy 2 bytes at a time. Write MSB to LSB */