src/dpdk/drivers/net/nfp/nfp_net.c
static inline void
nfp_net_rx_cksum(struct nfp_net_rxq *rxq, struct nfp_net_rx_desc *rxd,
		 struct rte_mbuf *mb)
{
	struct nfp_net_hw *hw = rxq->hw;

	if (!(hw->ctrl & NFP_NET_CFG_CTRL_RXCSUM))
		return;

	/* If IPv4 and IP checksum error, fail */
	if (unlikely((rxd->rxd.flags & PCIE_DESC_RX_IP4_CSUM) &&
	    !(rxd->rxd.flags & PCIE_DESC_RX_IP4_CSUM_OK)))
		mb->ol_flags |= PKT_RX_IP_CKSUM_BAD;
	else
		mb->ol_flags |= PKT_RX_IP_CKSUM_GOOD;

	/* If neither UDP nor TCP return */
	if (!(rxd->rxd.flags & PCIE_DESC_RX_TCP_CSUM) &&
	    !(rxd->rxd.flags & PCIE_DESC_RX_UDP_CSUM))
		return;

	if (likely(rxd->rxd.flags & PCIE_DESC_RX_L4_CSUM_OK))
		mb->ol_flags |= PKT_RX_L4_CKSUM_GOOD;
	else
		mb->ol_flags |= PKT_RX_L4_CKSUM_BAD;
}
/* nfp_net_rx_cksum - set mbuf checksum flags based on RX descriptor flags */
set mbuf checksum flags based on RX descriptor flags
set mbuf checksum flags based on RX descriptor flags
static inline void
nfp_net_rx_cksum(struct nfp_net_rxq *rxq, struct nfp_net_rx_desc *rxd,
		 struct rte_mbuf *mb)
{
	struct nfp_net_hw *hw = rxq->hw;
	if (!(hw->ctrl & NFP_NET_CFG_CTRL_RXCSUM))
		return;
	if (unlikely((rxd->rxd.flags & PCIE_DESC_RX_IP4_CSUM) &&
	    !(rxd->rxd.flags & PCIE_DESC_RX_IP4_CSUM_OK)))
		mb->ol_flags |= PKT_RX_IP_CKSUM_BAD;
	else
		mb->ol_flags |= PKT_RX_IP_CKSUM_GOOD;
	if (!(rxd->rxd.flags & PCIE_DESC_RX_TCP_CSUM) &&
	    !(rxd->rxd.flags & PCIE_DESC_RX_UDP_CSUM))
		return;
	if (likely(rxd->rxd.flags & PCIE_DESC_RX_L4_CSUM_OK))
		mb->ol_flags |= PKT_RX_L4_CKSUM_GOOD;
	else
		mb->ol_flags |= PKT_RX_L4_CKSUM_BAD;
}
static inline void nfp_net_rx_cksum ( struct nfp_net_rxq * rxq , struct nfp_net_rx_desc * rxd , struct rte_mbuf * mb ) { struct nfp_net_hw * hw = rxq -> hw ; if ( ! ( hw -> ctrl & NFP_NET_CFG_CTRL_RXCSUM ) ) return ; if ( unlikely ( ( rxd -> rxd . flags & PCIE_DESC_RX_IP4_CSUM ) && ! ( rxd -> rxd . flags & PCIE_DESC_RX_IP4_CSUM_OK ) ) ) mb -> ol_flags |= PKT_RX_IP_CKSUM_BAD ; else mb -> ol_flags |= PKT_RX_IP_CKSUM_GOOD ; if ( ! ( rxd -> rxd . flags & PCIE_DESC_RX_TCP_CSUM ) && ! ( rxd -> rxd . flags & PCIE_DESC_RX_UDP_CSUM ) ) return ; if ( likely ( rxd -> rxd . flags & PCIE_DESC_RX_L4_CSUM_OK ) ) mb -> ol_flags |= PKT_RX_L4_CKSUM_GOOD ; else mb -> ol_flags |= PKT_RX_L4_CKSUM_BAD ; }
nfp_net_rx_cksum - set mbuf checksum flags based on RX descriptor flags
nfp_net_rx_cksum - set mbuf checksum flags based on RX descriptor flags
/* If IPv4 and IP checksum error, fail */ /* If neither UDP nor TCP return */