From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0084FA0C45; Fri, 15 Oct 2021 16:39:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 90E5D410F1; Fri, 15 Oct 2021 16:39:05 +0200 (CEST) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) by mails.dpdk.org (Postfix) with ESMTP id 305C740040 for ; Fri, 15 Oct 2021 16:39:04 +0200 (CEST) Received: by mail-wr1-f47.google.com with SMTP id m22so27097947wrb.0 for ; Fri, 15 Oct 2021 07:39:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Bx82tHk4/p1aHJu5eioC4U1zML/qSftK7JlUhlOCfiI=; b=NKZ5RnVYattM1gUd82GK48jKuD+p5rbba+7zeOz4WrPeHOOkOaLWURMmZfhCNEVYiY ehlBnzqbw5ePWblvbJS+mVYF0JWQXZ29kCH8SYYy3WSC3BkVAoAtsqGt9Qk1aELQpCrB KwWFwh34SVfGADYen+69WITYImV22IJrUWA2+s1WFpDjKFe34HfDmsp83dZtt6xSAkuh nB9+OqPytH+e1EFSqJUFOtw6E+fB5VcJtUd0MbhjAOr+NPLrPdDiNxYzDCxPyJWNqyOV APddVUCuErXzWGcHD3lvIMy5nf5IfRCCL59sLVgycgpLcw0dNme62O9cjYdXZBEeDLaf fzng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Bx82tHk4/p1aHJu5eioC4U1zML/qSftK7JlUhlOCfiI=; b=5to14VDPutjzFHUeekxllGXVo7bY+DdBgfiAxtEdKfyAEx+Vp9ZhrFPwIW+OPWiW2W dHEGvjfYXbe2iOU8EaSe3as024gGTglzOWwHMRsw7HHcCKG4ZWMosXBkKDZJLdqvQY68 JMOHczIzIU8sFGBF9WrLpC6wGxgPV2Bkw7SmAvXgTeGcVSWngeFDy+KyEEA5JQU7vH5x IW3SxZFQZSDjRVk5pXW7cCEatx70gzpPAIsgtgZ3/JP3HXgQtNNItoX+1q29R3yT5f/j Gm9ntVLEUj0/09KUoaBRAxv0Usx/kH83T14zuI0IaAMDEx/9o2W9zzFyooBfijF6odhe XaGQ== X-Gm-Message-State: AOAM530w70eMfPMdlzeNJQcelopuS/AmIgVLrLb/sHsVnNkvEGktusUI vAmUlyTwBtJJwlv/BHu6X+KusQ== X-Google-Smtp-Source: ABdhPJx7E8+zRn5v2n2FsY4GslpPU/8DUZntOgwIeZ5aiZfLfkq3hseUbOrzkLJ+BXMkb52FMH5YmA== X-Received: by 2002:adf:9147:: with SMTP id j65mr14909275wrj.163.1634308743809; Fri, 15 Oct 2021 07:39:03 -0700 (PDT) Received: from 6wind.com ([2a01:e0a:5ac:6460:c065:401d:87eb:9b25]) by smtp.gmail.com with ESMTPSA id l20sm15453765wmq.42.2021.10.15.07.39.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 07:39:03 -0700 (PDT) Date: Fri, 15 Oct 2021 16:39:02 +0200 From: Olivier Matz To: Georg Sauthoff Cc: Thomas Monjalon , David Marchand , dev@dpdk.org Message-ID: References: <20210918114930.245387-1-mail@gms.tf> <20210918114930.245387-2-mail@gms.tf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210918114930.245387-2-mail@gms.tf> Subject: Re: [dpdk-dev] [PATCH 1/1] net: fix aliasing issue in checksum computation X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Georg, On Sat, Sep 18, 2021 at 01:49:30PM +0200, Georg Sauthoff wrote: > That means a superfluous cast is removed and aliasing through a uint8_t > pointer is eliminated. Note that uint8_t doesn't have the same > strict-aliasing properties as unsigned char. Interesting. Out of curiosity, do you have links that explains this? I found these, but these are just discussions: https://stackoverflow.com/questions/16138237/when-is-uint8-t-%E2%89%A0-unsigned-char https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66110 What about rewording the sentence "uint8_t doesn't have the same strict-aliasing properties as unsigned char" to clarify that unsigned char may alias, but uint8_t may not? > Also simplified the loop since a modern C compiler can speed up (i.e. > auto-vectorize) it in a similar way. For example, GCC auto-vectorizes it > for Haswell using AVX registers while halving the number of instructions > in the generated code. > > Signed-off-by: Georg Sauthoff The patch looks good to me, thanks! Acked-by: Olivier Matz