DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/enic: bad L4 checksum ptype set on ICMP packets
@ 2016-08-17 22:15 John Daley
  2016-09-21 11:19 ` Bruce Richardson
  0 siblings, 1 reply; 2+ messages in thread
From: John Daley @ 2016-08-17 22:15 UTC (permalink / raw)
  To: bruce.richardson; +Cc: dev, John Daley

The bad L4 checksum flag was set on IP packets which were not
also TCP or UDP packets. This includes ICMP, IGMP and OSPF packets.

L4 ptypes were being treated as bits instead of values within the
L4 mask causing the code to check L4 checksum in the completion
queue and incorrectly set the L4 bad checksum flag.

Fixes: 947d860c821f ("enic: improve Rx performance")

Reviewed-by: Nelson Escobar <neescoba@cisco.com>
Signed-off-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/enic_rxtx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/enic/enic_rxtx.c b/drivers/net/enic/enic_rxtx.c
index 50f0b28..ad59613 100644
--- a/drivers/net/enic/enic_rxtx.c
+++ b/drivers/net/enic/enic_rxtx.c
@@ -212,9 +212,12 @@ 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 (mbuf->packet_type & (RTE_PTYPE_L4_UDP | RTE_PTYPE_L4_TCP)) {
+		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;
 		}
-- 
2.7.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] net/enic: bad L4 checksum ptype set on ICMP packets
  2016-08-17 22:15 [dpdk-dev] [PATCH] net/enic: bad L4 checksum ptype set on ICMP packets John Daley
@ 2016-09-21 11:19 ` Bruce Richardson
  0 siblings, 0 replies; 2+ messages in thread
From: Bruce Richardson @ 2016-09-21 11:19 UTC (permalink / raw)
  To: John Daley; +Cc: dev

On Wed, Aug 17, 2016 at 03:15:26PM -0700, John Daley wrote:
> The bad L4 checksum flag was set on IP packets which were not
> also TCP or UDP packets. This includes ICMP, IGMP and OSPF packets.
> 
> L4 ptypes were being treated as bits instead of values within the
> L4 mask causing the code to check L4 checksum in the completion
> queue and incorrectly set the L4 bad checksum flag.
> 
> Fixes: 947d860c821f ("enic: improve Rx performance")
> 
> Reviewed-by: Nelson Escobar <neescoba@cisco.com>
> Signed-off-by: John Daley <johndale@cisco.com>

Applied to dpdk-next-net/rel_16_11

/Bruce

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-21 11:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-17 22:15 [dpdk-dev] [PATCH] net/enic: bad L4 checksum ptype set on ICMP packets John Daley
2016-09-21 11:19 ` Bruce Richardson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).