2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

dp-packet : Update DPDK rx checksum validation functions.

DPDK ports use masks while reporting rx checksum flags. OVS should use these
mask along with reported checksum flag while validating the good checksum.

Added two new functions to validate bad checksum reported by DPDK NIC port.
These two functions will be used in the following patch for enabling rx checksum
offload in conntrack module.

Signed-off-by: Sugesh Chandran <sugesh.chandran@intel.com>
Co-authored-by: Darrell Ball <dball@vmware.com>
Signed-off-by: Darrell Ball <dball@vmware.com>
Acked-by: Antonio Fishetti <antonio.fischetti@intel.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
Sugesh Chandran
2017-08-01 17:36:33 -07:00
committed by Ben Pfaff
parent af697f26b5
commit 7451af618e

View File

@@ -612,7 +612,19 @@ static inline bool
dp_packet_ip_checksum_valid(struct dp_packet *p)
{
#ifdef DPDK_NETDEV
return p->mbuf.ol_flags & PKT_RX_IP_CKSUM_GOOD;
return (p->mbuf.ol_flags & PKT_RX_IP_CKSUM_MASK) ==
PKT_RX_IP_CKSUM_GOOD;
#else
return 0 && p;
#endif
}
static inline bool
dp_packet_ip_checksum_bad(struct dp_packet *p)
{
#ifdef DPDK_NETDEV
return (p->mbuf.ol_flags & PKT_RX_IP_CKSUM_MASK) ==
PKT_RX_IP_CKSUM_BAD;
#else
return 0 && p;
#endif
@@ -622,7 +634,19 @@ static inline bool
dp_packet_l4_checksum_valid(struct dp_packet *p)
{
#ifdef DPDK_NETDEV
return p->mbuf.ol_flags & PKT_RX_L4_CKSUM_GOOD;
return (p->mbuf.ol_flags & PKT_RX_L4_CKSUM_MASK) ==
PKT_RX_L4_CKSUM_GOOD;
#else
return 0 && p;
#endif
}
static inline bool
dp_packet_l4_checksum_bad(struct dp_packet *p)
{
#ifdef DPDK_NETDEV
return (p->mbuf.ol_flags & PKT_RX_L4_CKSUM_MASK) ==
PKT_RX_L4_CKSUM_BAD;
#else
return 0 && p;
#endif