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 8F92CA04B1; Tue, 6 Oct 2020 04:39:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EEF7A11A4; Tue, 6 Oct 2020 04:39:57 +0200 (CEST) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id F12141023 for ; Tue, 6 Oct 2020 04:39:55 +0200 (CEST) Received: by mail-pl1-f196.google.com with SMTP id m15so485513pls.8 for ; Mon, 05 Oct 2020 19:39:55 -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=SOlF/JpCZj+XYVWY9fYmxOpBlLnC7JVZOSABHk/FiaA=; b=hV+oquqrSoihL5EG4j43YVsgjTsMJR+H2CcETMa3sDvhLpoX6ruF7XOFvO2vHjjzsJ D/6ooHP2ARJnO1Rt5w9g1BgXNMEp+DcQewgQgEFa/SAhkCo8tl9MlFMUWjhFp8h9VsNU Zfdrv7QYLAkIWdWXN74oRfLWrrOwspVY8YBNsdo0bgXIASEw1uG7tEFmYnSH3NWZApFb fW2IwngCemoZej82XAswFNh5abaSSJ8UYeLdPBtO8JucwwIcZtie4qOpAzPoic2srtA3 e+XFadgiNNuW3tiHckc5Io1TKclSi+R5mt8YeR52va6oxhWLxqw1QNEMLkNRZSDTQs7m Or6Q== 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=SOlF/JpCZj+XYVWY9fYmxOpBlLnC7JVZOSABHk/FiaA=; b=rpcjITgn1iazf+SK9l0413/dATZ0RKwyruNzz3XNHlXR80wqlpz9XfX7wZmWEpqnE7 tLmGfWw4d+phN3vDgViGQmaBM3iB1OPnsuEx7WiNYCY5ZTyW/9NKbjL9DHnXYGgUE55x Y1aGbRkQ1iapWP9SSqi3XxsWuDJVXqw16KVE6HfphhKK1W3jK43Hn7h1Cfpr3vIneDSc GeRkgRpC/GaPCv+NOHjsWjNc9vheUzdIXQ9p+85eciZCzMjBYlLICUn7UiC7GyvpCiqt SZWCaLFgvDd2PCTMqKoiMFSyzDypZsR/Mi62mxamN6v5FTTSepHjuhPN60vAiVfSpDHf OeDg== X-Gm-Message-State: AOAM531cNdbf2oIa1lIbql+gdKPu8yStBFx4wTsBWnnvwCaS0D6UEoxL 7165gfc/FN2lG4oJj7tIkZ93tQ== X-Google-Smtp-Source: ABdhPJyTsMZEaY33kJnASdNhR6lrELqXd4hr5bu3uJIveU3VElJQ6QzMEo0Wx+wtZ3OFdUK5a0b3dQ== X-Received: by 2002:a17:90a:8b8c:: with SMTP id z12mr2142012pjn.185.1601951993962; Mon, 05 Oct 2020 19:39:53 -0700 (PDT) Received: from hermes.local (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id q6sm1449839pfn.10.2020.10.05.19.39.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Oct 2020 19:39:53 -0700 (PDT) Date: Mon, 5 Oct 2020 19:39:45 -0700 From: Stephen Hemminger To: Thomas Monjalon Cc: Michael Pfeiffer , Olivier Matz , Andrew Rybchenko , dev@dpdk.org Message-ID: <20201005193945.19aebfb5@hermes.local> In-Reply-To: <7417467.3Ncg9TYYCI@thomas> References: <20200821113210.307175-1-michael.pfeiffer@tu-ilmenau.de> <20200901094755.561661-1-michael.pfeiffer@tu-ilmenau.de> <7417467.3Ncg9TYYCI@thomas> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2] net: calculate checksums for packets with IPv4 options X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" On Tue, 06 Oct 2020 00:55:19 +0200 Thomas Monjalon wrote: > > - cksum = rte_raw_cksum(ipv4_hdr, sizeof(struct rte_ipv4_hdr)); > > + cksum = rte_raw_cksum(ipv4_hdr, (ipv4_hdr->version_ihl & 0xf) * 4); > > Truly naive questions: > - doesn't it deserve a static inline function rte_ipv4_hdr_len()? Makes sense to have that. > - how generated code for "* 4" compares with "<< 2"? The code is the same if value is unsigned.