[dpdk-dev] net/i40e: fix Rx checksum flag

Message ID 1484804363-99047-1-git-send-email-xiao.w.wang@intel.com
State Accepted, archived
Delegated to: Ferruh Yigit
Headers show

Checks

Context Check Description
ci/Intel compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Wang, Xiao W Jan. 19, 2017, 5:39 a.m.
When no error reported in Rx descriptor, we should set CKSUM_GOOD flag
before return.

Fixes: b704f9071b09 ("net/i40e: implement new Rx checksum flag")

Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>
CC: stable@dpdk.org
---
 drivers/net/i40e/i40e_rxtx.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Ferruh Yigit Jan. 20, 2017, 6:41 p.m. | #1
On 1/19/2017 5:39 AM, Xiao Wang wrote:
> When no error reported in Rx descriptor, we should set CKSUM_GOOD flag
> before return.
> 
> Fixes: b704f9071b09 ("net/i40e: implement new Rx checksum flag")
CC: stable@dpdk.org

> 
> Signed-off-by: Xiao Wang <xiao.w.wang@intel.com>

Applied to dpdk-next-net/master, thanks.

Patch

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 1c9a6c8..22809fa 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -151,8 +151,11 @@  static uint16_t i40e_xmit_pkts_simple(void *tx_queue,
 	uint64_t error_bits = (qword >> I40E_RXD_QW1_ERROR_SHIFT);
 
 #define I40E_RX_ERR_BITS 0x3f
-	if (likely((error_bits & I40E_RX_ERR_BITS) == 0))
+	if (likely((error_bits & I40E_RX_ERR_BITS) == 0)) {
+		flags |= (PKT_RX_IP_CKSUM_GOOD | PKT_RX_L4_CKSUM_GOOD);
 		return flags;
+	}
+
 	if (unlikely(error_bits & (1 << I40E_RX_DESC_ERROR_IPE_SHIFT)))
 		flags |= PKT_RX_IP_CKSUM_BAD;
 	else