From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rcdn-iport-3.cisco.com (rcdn-iport-3.cisco.com [173.37.86.74]) by dpdk.org (Postfix) with ESMTP id 2C8B058CB for ; Thu, 18 Aug 2016 00:15:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1383; q=dns/txt; s=iport; t=1471472146; x=1472681746; h=from:to:cc:subject:date:message-id; bh=Mq0f+MrO0UzZDXs9KVOcL3alBLQxpfZUF/HLVzjHGu8=; b=L+4r1VRT4dDtgDxQNjWHv8DVorEGzX4qDUlqvG2R1ZttN/TJhZrsCXQ0 bWOQZOflBemEslsjk+Ve2Nqnji5klR3We2aYBneht93yyZ21qseI1ZV3j lAM0xFuvq1x6nhsd4BVF9UZfaHAGPlrDA4Px5199xlV9JXJNetY4PcfFm I=; X-IronPort-AV: E=Sophos;i="5.28,535,1464652800"; d="scan'208";a="141010484" Received: from alln-core-1.cisco.com ([173.36.13.131]) by rcdn-iport-3.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 17 Aug 2016 22:15:45 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-1.cisco.com (8.14.5/8.14.5) with ESMTP id u7HMFieM029670; Wed, 17 Aug 2016 22:15:44 GMT Received: by cisco.com (Postfix, from userid 392789) id BB6853FAAE44; Wed, 17 Aug 2016 15:15:44 -0700 (PDT) From: John Daley To: bruce.richardson@intel.com Cc: dev@dpdk.org, John Daley Date: Wed, 17 Aug 2016 15:15:26 -0700 Message-Id: <1471472126-8103-1-git-send-email-johndale@cisco.com> X-Mailer: git-send-email 2.7.0 Subject: [dpdk-dev] [PATCH] net/enic: bad L4 checksum ptype set on ICMP packets X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Aug 2016 22:15:46 -0000 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 Signed-off-by: John Daley --- 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