From e62d719a9981f0d1c6f62ddacad6151d4a040634 Mon Sep 17 00:00:00 2001 From: Gaurav Asati Date: Thu, 23 Apr 2020 11:55:09 +0530 Subject: [PATCH] nvethernet: Check bit in rxcsum flag. Issue: - rxcsum is used as container of flags instead of value place holder. Fix: - Use binary operation to fetch required bit for necessity of checksum. Bug 200610815 Change-Id: Ie6f3e79868edde2393186a06f257ba4b57dae0ac Signed-off-by: Gaurav Asati Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2333164 Reviewed-by: automaticguardword Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Narayan Reddy Reviewed-by: Rakesh Goyal Reviewed-by: Srinivas Ramachandran Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions --- drivers/net/ethernet/nvidia/nvethernet/osd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/nvidia/nvethernet/osd.c b/drivers/net/ethernet/nvidia/nvethernet/osd.c index 68fa06ca..d65660be 100644 --- a/drivers/net/ethernet/nvidia/nvethernet/osd.c +++ b/drivers/net/ethernet/nvidia/nvethernet/osd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -253,7 +253,8 @@ void osd_receive_packet(void *priv, void *rxring, unsigned int chan, OSI_PKT_CX_VALID)) { skb_put(skb, rx_pkt_cx->pkt_len); - if (likely(rx_pkt_cx->rxcsum == OSI_CHECKSUM_UNNECESSARY)) { + if (likely((rx_pkt_cx->rxcsum & OSI_CHECKSUM_UNNECESSARY) == + OSI_CHECKSUM_UNNECESSARY)) { skb->ip_summed = CHECKSUM_UNNECESSARY; } else { skb->ip_summed = CHECKSUM_NONE;