ixgbe: offload VxLAN and NVGRE Rx checksum on X550
X550 will do VxLAN & NVGRE RX checksum off-load automatically. This patch exposes the result of the checksum off-load. Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
This commit is contained in:
parent
01c631b724
commit
d909af8f72
@ -2847,6 +2847,10 @@ ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
|
||||
!RTE_ETH_DEV_SRIOV(dev).active)
|
||||
dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_TCP_LRO;
|
||||
|
||||
if (hw->mac.type == ixgbe_mac_X550 ||
|
||||
hw->mac.type == ixgbe_mac_X550EM_x)
|
||||
dev_info->rx_offload_capa |= DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM;
|
||||
|
||||
dev_info->tx_offload_capa =
|
||||
DEV_TX_OFFLOAD_VLAN_INSERT |
|
||||
DEV_TX_OFFLOAD_IPV4_CKSUM |
|
||||
|
@ -1003,6 +1003,8 @@ rx_desc_status_to_pkt_flags(uint32_t rx_status)
|
||||
static inline uint64_t
|
||||
rx_desc_error_to_pkt_flags(uint32_t rx_status)
|
||||
{
|
||||
uint64_t pkt_flags;
|
||||
|
||||
/*
|
||||
* Bit 31: IPE, IPv4 checksum error
|
||||
* Bit 30: L4I, L4I integrity error
|
||||
@ -1011,8 +1013,15 @@ rx_desc_error_to_pkt_flags(uint32_t rx_status)
|
||||
0, PKT_RX_L4_CKSUM_BAD, PKT_RX_IP_CKSUM_BAD,
|
||||
PKT_RX_IP_CKSUM_BAD | PKT_RX_L4_CKSUM_BAD
|
||||
};
|
||||
return error_to_pkt_flags_map[(rx_status >>
|
||||
pkt_flags = error_to_pkt_flags_map[(rx_status >>
|
||||
IXGBE_RXDADV_ERR_CKSUM_BIT) & IXGBE_RXDADV_ERR_CKSUM_MSK];
|
||||
|
||||
if ((rx_status & IXGBE_RXD_STAT_OUTERIPCS) &&
|
||||
(rx_status & IXGBE_RXDADV_ERR_OUTERIPER)) {
|
||||
pkt_flags |= PKT_RX_EIP_CKSUM_BAD;
|
||||
}
|
||||
|
||||
return pkt_flags;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -825,6 +825,7 @@ struct rte_eth_conf {
|
||||
#define DEV_RX_OFFLOAD_TCP_CKSUM 0x00000008
|
||||
#define DEV_RX_OFFLOAD_TCP_LRO 0x00000010
|
||||
#define DEV_RX_OFFLOAD_QINQ_STRIP 0x00000020
|
||||
#define DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM 0x00000040
|
||||
|
||||
/**
|
||||
* TX offload capabilities of a device.
|
||||
|
@ -253,7 +253,7 @@ const char *rte_get_rx_ol_flag_name(uint64_t mask)
|
||||
case PKT_RX_FDIR: return "PKT_RX_FDIR";
|
||||
case PKT_RX_L4_CKSUM_BAD: return "PKT_RX_L4_CKSUM_BAD";
|
||||
case PKT_RX_IP_CKSUM_BAD: return "PKT_RX_IP_CKSUM_BAD";
|
||||
/* case PKT_RX_EIP_CKSUM_BAD: return "PKT_RX_EIP_CKSUM_BAD"; */
|
||||
case PKT_RX_EIP_CKSUM_BAD: return "PKT_RX_EIP_CKSUM_BAD";
|
||||
/* case PKT_RX_OVERSIZE: return "PKT_RX_OVERSIZE"; */
|
||||
/* case PKT_RX_HBUF_OVERFLOW: return "PKT_RX_HBUF_OVERFLOW"; */
|
||||
/* case PKT_RX_RECIP_ERR: return "PKT_RX_RECIP_ERR"; */
|
||||
|
@ -88,7 +88,7 @@ extern "C" {
|
||||
#define PKT_RX_FDIR (1ULL << 2) /**< RX packet with FDIR match indicate. */
|
||||
#define PKT_RX_L4_CKSUM_BAD (1ULL << 3) /**< L4 cksum of RX pkt. is not OK. */
|
||||
#define PKT_RX_IP_CKSUM_BAD (1ULL << 4) /**< IP cksum of RX pkt. is not OK. */
|
||||
#define PKT_RX_EIP_CKSUM_BAD (0ULL << 0) /**< External IP header checksum error. */
|
||||
#define PKT_RX_EIP_CKSUM_BAD (1ULL << 5) /**< External IP header checksum error. */
|
||||
#define PKT_RX_OVERSIZE (0ULL << 0) /**< Num of desc of an RX pkt oversize. */
|
||||
#define PKT_RX_HBUF_OVERFLOW (0ULL << 0) /**< Header buffer overflow. */
|
||||
#define PKT_RX_RECIP_ERR (0ULL << 0) /**< Hardware processing error. */
|
||||
|
Loading…
Reference in New Issue
Block a user