src/dpdk/drivers/net/iavf/iavf_rxtx.c
static inline uint64_t
iavf_rxd_to_pkt_flags(uint64_t qword)
{
	uint64_t flags;
	uint64_t error_bits = (qword >> IAVF_RXD_QW1_ERROR_SHIFT);

#define IAVF_RX_ERR_BITS 0x3f

	/* Check if RSS_HASH */
	flags = (((qword >> IAVF_RX_DESC_STATUS_FLTSTAT_SHIFT) &
					IAVF_RX_DESC_FLTSTAT_RSS_HASH) ==
			IAVF_RX_DESC_FLTSTAT_RSS_HASH) ? PKT_RX_RSS_HASH : 0;

	/* Check if FDIR Match */
	flags |= (qword & (1 << IAVF_RX_DESC_STATUS_FLM_SHIFT) ?
				PKT_RX_FDIR : 0);

	if (likely((error_bits & IAVF_RX_ERR_BITS) == 0)) {
		flags |= (PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_GOOD);
		return flags;
	}

	if (unlikely(error_bits & (1 << IAVF_RX_DESC_ERROR_IPE_SHIFT)))
		flags |= PKT_RX_IP_CKSUM_BAD;
	else
		flags |= PKT_RX_IP_CKSUM_GOOD;

	if (unlikely(error_bits & (1 << IAVF_RX_DESC_ERROR_L4E_SHIFT)))
		flags |= PKT_RX_L4_CKSUM_BAD;
	else
		flags |= PKT_RX_L4_CKSUM_GOOD;

	/* TODO: Oversize error bit is not processed here */

	return flags;
}
/* Translate the rx descriptor status and error fields to pkt flags */
Translate the rx descriptor status and error fields to pkt flags
Translate the rx descriptor status and error fields to pkt flags
static inline uint64_t
iavf_rxd_to_pkt_flags(uint64_t qword)
{
	uint64_t flags;
	uint64_t error_bits = (qword >> IAVF_RXD_QW1_ERROR_SHIFT);
#define IAVF_RX_ERR_BITS 0x3f
	flags = (((qword >> IAVF_RX_DESC_STATUS_FLTSTAT_SHIFT) &
					IAVF_RX_DESC_FLTSTAT_RSS_HASH) ==
			IAVF_RX_DESC_FLTSTAT_RSS_HASH) ? PKT_RX_RSS_HASH : 0;
	flags |= (qword & (1 << IAVF_RX_DESC_STATUS_FLM_SHIFT) ?
				PKT_RX_FDIR : 0);
	if (likely((error_bits & IAVF_RX_ERR_BITS) == 0)) {
		flags |= (PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_GOOD);
		return flags;
	}
	if (unlikely(error_bits & (1 << IAVF_RX_DESC_ERROR_IPE_SHIFT)))
		flags |= PKT_RX_IP_CKSUM_BAD;
	else
		flags |= PKT_RX_IP_CKSUM_GOOD;
	if (unlikely(error_bits & (1 << IAVF_RX_DESC_ERROR_L4E_SHIFT)))
		flags |= PKT_RX_L4_CKSUM_BAD;
	else
		flags |= PKT_RX_L4_CKSUM_GOOD;
	return flags;
}
static inline uint64_t iavf_rxd_to_pkt_flags ( uint64_t qword ) { uint64_t flags ; uint64_t error_bits = ( qword >> IAVF_RXD_QW1_ERROR_SHIFT ) ; #define IAVF_RX_ERR_BITS  0x3f flags = ( ( ( qword >> IAVF_RX_DESC_STATUS_FLTSTAT_SHIFT ) & IAVF_RX_DESC_FLTSTAT_RSS_HASH ) == IAVF_RX_DESC_FLTSTAT_RSS_HASH ) ? PKT_RX_RSS_HASH : 0 ; flags |= ( qword & ( 1 << IAVF_RX_DESC_STATUS_FLM_SHIFT ) ? PKT_RX_FDIR : 0 ) ; if ( likely ( ( error_bits & IAVF_RX_ERR_BITS ) == 0 ) ) { flags |= ( PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_GOOD ) ; return flags ; } if ( unlikely ( error_bits & ( 1 << IAVF_RX_DESC_ERROR_IPE_SHIFT ) ) ) flags |= PKT_RX_IP_CKSUM_BAD ; else flags |= PKT_RX_IP_CKSUM_GOOD ; if ( unlikely ( error_bits & ( 1 << IAVF_RX_DESC_ERROR_L4E_SHIFT ) ) ) flags |= PKT_RX_L4_CKSUM_BAD ; else flags |= PKT_RX_L4_CKSUM_GOOD ; return flags ; }
Translate the rx descriptor status and error fields to pkt flags
Translate the rx descriptor status and error fields to pkt flags
/* Check if RSS_HASH */ /* Check if FDIR Match */ /* TODO: Oversize error bit is not processed here */