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 5CF43A034E for ; Wed, 27 May 2020 17:02:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 33C0B1DABE; Wed, 27 May 2020 17:02:55 +0200 (CEST) Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by dpdk.org (Postfix) with ESMTP id 11E121DAA0 for ; Wed, 27 May 2020 17:02:52 +0200 (CEST) Received: by mail-pj1-f66.google.com with SMTP id k2so605961pjs.2 for ; Wed, 27 May 2020 08:02:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=L/AnMjuCc1VVJIs5IQwXH9NUZF87gTNLtkkAa75gPqI=; b=NJVn6KFHTP1s62/332Hqt0hrNarDYfoIkX2xbMCq2cFeG++jVYHpOA8qkCy4iTeoMD WD45+KH9s3ZcdjJFGvKThabNJTka0JJe3FtAVirrhwXPJQ2jMwD9fWq6EDYP3XbH8xyd GyPxyGNJKrCQIUhGp91w4Plg05dgKRVSz42RreU+ivhKuaufuGyVBnkpa5/XC93xCBUa fGJu5cVtCewS30X510RYiw+BE3Y3G9y9l8kC7Q/PCJHYruUbf5qgSCTtVw1MChZPa2BP iZDgfj/rBjtDJuqe3PI6p77Pgwy0BTH5CdNyWSujiQ2bojPFI3xWW1GoVGM0ECQhthf8 gQpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=L/AnMjuCc1VVJIs5IQwXH9NUZF87gTNLtkkAa75gPqI=; b=OCNvbJENeFIPA2xf7/dTbIk7zJEciXf/yjIDgQEWfvcGqrXI3uILnMl+UgiFiPffpj extBFYQXqonpaJvh1CCL8dQslsgdocnXKuuQu1h9PDez4RdlmT0LiAtp97T2wn3wlaE/ 42MokwfxCMtOnFP2IgzFad/d36HZzNJCHjcsReG4E4ZXePZpptJ/iWF7HXqtTV1kd6Dn wBWbXyWpS04IH5By3DbzbaudqLKGZ8fcX3nd82uC0xQBO13MiMZIABT1k4s57dfbpXJo e+7dlzqG49FmfiHbouWx8sIs2+gajm2UK0o5fbubiG9GuNs6b9RG5jKrBd2Dq/RJgPx0 y9DA== X-Gm-Message-State: AOAM531KvAxgN8iQyJcf3yx0jL11fq9zIEa3K4LD9SSD9jr60ksz0TPX pxAlr5ilqU8YfojQAgrfbmAjAQ== X-Google-Smtp-Source: ABdhPJzGKvtekXopAdwjRVV3zaqyw/ww9mbJDsupLsNLz/SQEN/jIWy13efLcxBS5B9dvzR/Ji6qSQ== X-Received: by 2002:a17:90b:19d5:: with SMTP id nm21mr5591627pjb.212.1590591771853; Wed, 27 May 2020 08:02:51 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id m2sm2808918pjl.45.2020.05.27.08.02.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 May 2020 08:02:50 -0700 (PDT) Date: Wed, 27 May 2020 08:02:42 -0700 From: Stephen Hemminger To: guohongzhi Cc: , , , , , , , , , , , , Message-ID: <20200527080242.16dceeae@hermes.lan> In-Reply-To: <20200527144127.5792-1-guohongzhi1@huawei.com> References: <20200527144127.5792-1-guohongzhi1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] bugfix: udptcp_checksum should tread tcp and udp differently 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" On Wed, 27 May 2020 22:41:27 +0800 guohongzhi wrote: > + /* For Udp, if the computed checksum is zero, > + * it is transmitted as all ones.RFC768 > + */ > + if (cksum == 0 && ipv4_hdr->next_proto_id == IPPROTO_UDP) > cksum = 0xffff; > The comment should be reformatted to be clearer. Maybe: /* * Per RFC768: * If the computed checksum is zero,it is transmitted as all ones * (the equivalent in one's complement arithmetic). */ There is no special case required here, it is true for TCP as well. In TCP it appears 0 is allowed but not generally used. Most implementations use common checksum for both TCP and UDP