src/dpdk/drivers/net/mlx4/mlx4_rxtx.c
static uint32_t
mlx4_txq_stamp_freed_wqe(struct mlx4_sq *sq, volatile uint32_t *start,
			 volatile uint32_t *end)
{
	uint32_t stamp = sq->stamp;
	int32_t size = (intptr_t)end - (intptr_t)start;

	MLX4_ASSERT(start != end);
	/* Hold SQ ring wrap around. */
	if (size < 0) {
		size = (int32_t)sq->size + size;
		do {
			*start = stamp;
			start += MLX4_SQ_STAMP_DWORDS;
		} while (start != (volatile uint32_t *)sq->eob);
		start = (volatile uint32_t *)sq->buf;
		/* Flip invalid stamping ownership. */
		stamp ^= RTE_BE32(1u << MLX4_SQ_OWNER_BIT);
		sq->stamp = stamp;
		if (start == end)
			return size;
	}
	do {
		*start = stamp;
		start += MLX4_SQ_STAMP_DWORDS;
	} while (start != end);
	return (uint32_t)size;
}
/**
 * Stamp TXBB burst so it won't be reused by the HW.
 *
 * Routine is used when freeing WQE used by the chip or when failing
 * building an WQ entry has failed leaving partial information on the queue.
 *
 * @param sq
 *   Pointer to the SQ structure.
 * @param start
 *   Pointer to the first TXBB to stamp.
 * @param end
 *   Pointer to the followed end TXBB to stamp.
 *
 * @return
 *   Stamping burst size in byte units.
 */
Stamp TXBB burst so it won't be reused by the HW.
Routine is used when freeing WQE used by the chip or when failing
building an WQ entry has failed leaving partial information on the queue.

@param sq
Pointer to the SQ structure.
@param start
Pointer to the first TXBB to stamp.
@param end
Pointer to the followed end TXBB to stamp.

@return
Stamping burst size in byte units.
Stamp TXBB burst so it won ' t be reused by the HW . Routine is used when freeing WQE used by the chip or when failing building an WQ entry has failed leaving partial information on the queue . @param sq Pointer to the SQ structure . @param start Pointer to the first TXBB to stamp . @param end Pointer to the followed end TXBB to stamp . @return Stamping burst size in byte units .
static uint32_t
mlx4_txq_stamp_freed_wqe(struct mlx4_sq *sq, volatile uint32_t *start,
			 volatile uint32_t *end)
{
	uint32_t stamp = sq->stamp;
	int32_t size = (intptr_t)end - (intptr_t)start;
	MLX4_ASSERT(start != end);
	if (size < 0) {
		size = (int32_t)sq->size + size;
		do {
			*start = stamp;
			start += MLX4_SQ_STAMP_DWORDS;
		} while (start != (volatile uint32_t *)sq->eob);
		start = (volatile uint32_t *)sq->buf;
		stamp ^= RTE_BE32(1u << MLX4_SQ_OWNER_BIT);
		sq->stamp = stamp;
		if (start == end)
			return size;
	}
	do {
		*start = stamp;
		start += MLX4_SQ_STAMP_DWORDS;
	} while (start != end);
	return (uint32_t)size;
}
static uint32_t mlx4_txq_stamp_freed_wqe ( struct mlx4_sq * sq , volatile uint32_t * start , volatile uint32_t * end ) { uint32_t stamp = sq -> stamp ; int32_t size = ( intptr_t ) end - ( intptr_t ) start ; MLX4_ASSERT ( start != end ) ; if ( size < 0 ) { size = ( int32_t ) sq -> size + size ; do { * start = stamp ; start += MLX4_SQ_STAMP_DWORDS ; } while ( start != ( volatile uint32_t * ) sq -> eob ) ; start = ( volatile uint32_t * ) sq -> buf ; stamp ^= RTE_BE32 ( 1u << MLX4_SQ_OWNER_BIT ) ; sq -> stamp = stamp ; if ( start == end ) return size ; } do { * start = stamp ; start += MLX4_SQ_STAMP_DWORDS ; } while ( start != end ) ; return ( uint32_t ) size ; }
Stamp TXBB burst so it won't be reused by the HW.
Stamp TXBB burst so it won ' t be reused by the HW .
/* Hold SQ ring wrap around. */ /* Flip invalid stamping ownership. */