net/enic: use new Rx checksum flags
PATCH 1/1 net/enic: use new Rx checksum flags
Use the new L3 and L4 ..CKSUM_GOOD and ..CKSUM_UNKNOWN flags to distinguish good checksums from unknown ones.
Signed-off-by John Daley <[email protected]>
--- drivers/net/enic/enic_rxtx.c | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-)
drivers/net/enic/enic_rxtx.c +19 -10
@@ -260,16 +260,25 @@ enic_cq_rx_to_pkt_flags(struct cq_desc *cqd, struct rte_mbuf *mbuf) }/* checksum flags */ -if (!enic_cq_rx_desc_csum_not_calc (cqrd) && - (mbuf->packet_type &RTE_PTYPE_L3_IPV4 )) { -uint32_t l4_flags = mbuf->packet_type &RTE_PTYPE_L4_MASK ; - -if (unlikely (!enic_cq_rx_desc_ipv4_csum_ok (cqrd))) - pkt_flags |=PKT_RX_IP_CKSUM_BAD ; -if (l4_flags ==RTE_PTYPE_L4_UDP || - l4_flags ==RTE_PTYPE_L4_TCP ) { -if (unlikely (!enic_cq_rx_desc_tcp_udp_csum_ok (cqrd))) - pkt_flags |=PKT_RX_L4_CKSUM_BAD ; +if (mbuf->packet_type &RTE_PTYPE_L3_IPV4 ) { +if (enic_cq_rx_desc_csum_not_calc (cqrd)) + pkt_flags |= (PKT_RX_IP_CKSUM_UNKNOWN & +PKT_RX_L4_CKSUM_UNKNOWN ); +else { +uint32_t l4_flags; + l4_flags = mbuf->packet_type &RTE_PTYPE_L4_MASK ; + +if (enic_cq_rx_desc_ipv4_csum_ok (cqrd)) + pkt_flags |=PKT_RX_IP_CKSUM_GOOD ; +else + pkt_flags |=PKT_RX_IP_CKSUM_BAD ; + +if (l4_flags & (RTE_PTYPE_L4_UDP |RTE_PTYPE_L4_TCP )) { +if (enic_cq_rx_desc_tcp_udp_csum_ok (cqrd)) + pkt_flags |=PKT_RX_L4_CKSUM_GOOD ; +else + pkt_flags |=PKT_RX_L4_CKSUM_BAD ; + } } }
Signature · 1 line
2.10.0
PATCH 1/1 net/enic: remove unnecessary function parameter attributes
Remove __rte_unused attributes in function declaration when the parameters really are used.
Fixes dfbd6a9cb504 ("net/enic: extend flow director support for 1300 series")
Signed-off-by John Daley <[email protected]>
--- drivers/net/enic/enic.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/net/enic/enic.h +2 -3
@@ -301,8 +301,7 @@ int enic_link_update(struct enic *enic);void enic_fdir_info (struct enic *enic);void enic_fdir_info_get (struct enic *enic,struct rte_eth_fdir_info *stats);void copy_fltr_v1 (struct filter_v2 *fltr,struct rte_eth_fdir_input *input, -struct rte_eth_fdir_masks *masks); -void copy_fltr_v2(__rte_unused struct filter_v2 *fltr, - __rte_unused struct rte_eth_fdir_input *input, __rte_unused struct rte_eth_fdir_masks *masks); +void copy_fltr_v2 (struct filter_v2 *fltr,struct rte_eth_fdir_input *input, +struct rte_eth_fdir_masks *masks);#endif /* _ENIC_H_ */
Signature · 1 line
2.10.0
Ferruh Yigit
AppliedRe: [PATCH] net/enic: remove unnecessary function parameter attributes
Quoted 7 lines · John Daley
Remove
__rte_unusedattributes in function declaration when the parameters really are used.Fixes dfbd6a9cb504 ("net/enic: extend flow director support for 1300 series")Signed-off-by John Daley <[email protected]>
Applied to dpdk-next-net/master, thanks.
Ferruh Yigit
AppliedQuoted 4 lines · John Daley
Use the new L3 and L4 ..CKSUM_GOOD and ..CKSUM_UNKNOWN flags to distinguish good checksums from unknown ones.
Signed-off-by John Daley <[email protected]>
Applied to dpdk-next-net/master, thanks.