From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id AE317A0518 for ; Fri, 24 Jul 2020 14:09:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A634A1C1C7; Fri, 24 Jul 2020 14:09:07 +0200 (CEST) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by dpdk.org (Postfix) with ESMTP id B51FF1C1C7 for ; Fri, 24 Jul 2020 14:09:05 +0200 (CEST) Received: by mail-wm1-f49.google.com with SMTP id o2so8071438wmh.2 for ; Fri, 24 Jul 2020 05:09:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=n70d7nXKtMyLUDQmGxGMtE51XVMJJZ8kqrWvfRI9NPs=; b=FsGM1wh6XY7Ms9rfF9vBPkuCH1kQoT+42pD/eQGrhaDxeDlvO/ucW11GwOYEAM9JIi YzOYn4/ELNfqnS8mA4DX2S685P/qeGxFOXwbMW+VnfkU4TEtZPNulAg5FM3q027lueuG ObOGylXxVwD8ZF3VW7eRhHv9Qvix5X6M2bdxjfzOaYsguTcAZWf9k2jkO++Rp9hlX+4i L0lRodhFfc+0p5FA2jDOFDNInwvgmOvq8tqw97Qk8MbUnxBuqdmDYh3reHfvtYGzg2BD gey3ZRePenHfI11s48FF4Cp8tO3DzohFBVDBzvY+KMmrmPCI2P3oNgFCghJp32Ge6mYH betA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=n70d7nXKtMyLUDQmGxGMtE51XVMJJZ8kqrWvfRI9NPs=; b=KJjgEppGy5/XeLAFr5qQDRdbAsYTOqV2lXALKCQEbyvXFPaS+RjfVvA1zh4K5NFRPH krs6v7HuQlTqJCakefeH05veub2IlpTjPJadx7HI3vKhlLV/4M3LHj8ftYB8X6mupIg3 A2uB8lyaeB9dAbv/+uRFljNHFcCcP3oNE+MrSBTAYcSYd+tilxu0Nhvx0x45g30dj+zh TZ9yIbMUd0li7WxvIdKTllRigXgcywZyZAJBdSCBeF/SjqnNbH94LxMuZu7gyuD07rPd R4TK1X+7nHflz2UcRVy4PnubvO120zOd7nVZHzLcUdsFsGI3ncnqjPBc9K29rISfpare /iuw== X-Gm-Message-State: AOAM533CcEndiwE8Rj0wgwuG4r24EKGBpmBzPDhhKkehB4bXMTXx5q02 Y9pxiq7ClH2PJZB/BxsFrbz3cHGSP58jmA== X-Google-Smtp-Source: ABdhPJxiKYP2zN9JHLgBESbwj/CVrI4nAzOLoFm/cx9q+2ClzkowCuxiPy5J5LX5Xib0OsJBmleakA== X-Received: by 2002:a7b:c002:: with SMTP id c2mr8946776wmb.51.1595592545400; Fri, 24 Jul 2020 05:09:05 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id g145sm10793730wmg.23.2020.07.24.05.09.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2020 05:09:04 -0700 (PDT) From: luca.boccassi@gmail.com To: Hongzhi Guo Cc: =?UTF-8?q?Morten=20Br=C3=B8rup?= , Olivier Matz , dpdk stable Date: Fri, 24 Jul 2020 12:59:24 +0100 Message-Id: <20200724120030.1863487-126-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200724120030.1863487-1-luca.boccassi@gmail.com> References: <20200724120030.1863487-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net: fix checksum on big endian CPUs' has been queued to stable release 19.11.4 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.4 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 07/26/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From 862bc496af14cd62856037a9a5c882ef47461e50 Mon Sep 17 00:00:00 2001 From: Hongzhi Guo Date: Fri, 10 Jul 2020 19:43:13 +0800 Subject: [PATCH] net: fix checksum on big endian CPUs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ upstream commit 982bb68cab2b93724f9625d53c309e73fa194e6e ] With current code, the checksum of odd-length buffers is wrong on big endian CPUs: the last byte is not properly summed to the accumulator. Fix this by left-shifting the remaining byte by 8. For instance, if the last byte is 0x42, we should add 0x4200 to the accumulator on big endian CPUs. This change is similar to what is suggested in Errata 3133 of RFC 1071. Fixes: 6006818cfb26("net: new checksum functions") Signed-off-by: Hongzhi Guo Reviewed-by: Morten Brørup Acked-by: Olivier Matz --- lib/librte_net/rte_ip.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h index 6254c5cc6..0897da744 100644 --- a/lib/librte_net/rte_ip.h +++ b/lib/librte_net/rte_ip.h @@ -139,8 +139,11 @@ __rte_raw_cksum(const void *buf, size_t len, uint32_t sum) } /* if length is in odd bytes */ - if (len == 1) - sum += *((const uint8_t *)u16_buf); + if (len == 1) { + uint16_t left = 0; + *(uint8_t *)&left = *(const uint8_t *)u16_buf; + sum += left; + } return sum; } -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-07-24 12:53:53.396197351 +0100 +++ 0126-net-fix-checksum-on-big-endian-CPUs.patch 2020-07-24 12:53:48.423008994 +0100 @@ -1,4 +1,4 @@ -From 982bb68cab2b93724f9625d53c309e73fa194e6e Mon Sep 17 00:00:00 2001 +From 862bc496af14cd62856037a9a5c882ef47461e50 Mon Sep 17 00:00:00 2001 From: Hongzhi Guo Date: Fri, 10 Jul 2020 19:43:13 +0800 Subject: [PATCH] net: fix checksum on big endian CPUs @@ -6,6 +6,8 @@ Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit +[ upstream commit 982bb68cab2b93724f9625d53c309e73fa194e6e ] + With current code, the checksum of odd-length buffers is wrong on big endian CPUs: the last byte is not properly summed to the accumulator. @@ -18,7 +20,6 @@ RFC 1071. Fixes: 6006818cfb26("net: new checksum functions") -Cc: stable@dpdk.org Signed-off-by: Hongzhi Guo Reviewed-by: Morten Brørup @@ -28,7 +29,7 @@ 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h -index a9ffc3357..fcd1eb342 100644 +index 6254c5cc6..0897da744 100644 --- a/lib/librte_net/rte_ip.h +++ b/lib/librte_net/rte_ip.h @@ -139,8 +139,11 @@ __rte_raw_cksum(const void *buf, size_t len, uint32_t sum)