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 A521745B60; Thu, 17 Oct 2024 18:26:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 839D240664; Thu, 17 Oct 2024 18:26:43 +0200 (CEST) Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) by mails.dpdk.org (Postfix) with ESMTP id BE2504065A for ; Thu, 17 Oct 2024 18:26:42 +0200 (CEST) Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-2e2e23f2931so983416a91.0 for ; Thu, 17 Oct 2024 09:26:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1729182402; x=1729787202; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=07t5hN8D0owYI1m3M32t2P0W+kxY+MtE9sg0Q5vwDb4=; b=gTOkUmOnYjmWVxI4SRYEkrL6TqQA/UuP9AIoh+2PgWJRzgPzDuwMWkCqxP3hfmYvgA b4OPzVwjeLPdGbbwsveIgt4WdDyjHHEraz4MufM91LG3WONlDq79aNp6ihl0Ea8Y9FNP 7tNEclVfHZGQq0NkYdpn1NAuzmZNql4sDS4+zrFIEmxUteXAPi4Zul5VWelWq1Dmu434 JTbDbkt5oiz9EY5VHfv+4GMgKolGnPs1LX7/1w7DW2ymPOjEpaOPhT0h4r5DczjhF8KI yGLuw50NWOjuQkK+iHkNVzodmt0MR8YiD98r+QIpEVnjzMILBZfdbGXR6/03urQF13mY h+lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729182402; x=1729787202; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=07t5hN8D0owYI1m3M32t2P0W+kxY+MtE9sg0Q5vwDb4=; b=M47/Gk9Mgz0qOWXTFpxvBa3odkCjFpWOdaFZcsyHbnVupgjPnyLhWXlIbmyTYwGLas Yfux+8PuU0LlFwmPm3TLyDvhWrb7GnYpPqo6Eu2isYX5dxGvpd5HDEfg0kycmAEZqNs1 J1KV9qFrDHuaMvaYDgMKJIIVkC/zzLCd6Z3/kCHMkyKEzaomdBqDkKo3Imp+/e+ka6Av OEhaIMACQyOIEELsTICj6ckz9Ob9EHKTmEjA2supSV8bWiE1EhLPie4QhHNjHmubJimD 2wBkq+Em/qJLOCrXl+2BT1u9IWuom6S6GzIgMYlvfq+lxi5ArvBpJ8X5tvQ+8BCsBhgW ehfg== X-Gm-Message-State: AOJu0Yy1529vYMnMeHENRde5OE+HctfSW0Mn+QI2lSjvTBmACMi8zSot AZGO8R0TCtAAQuj5aJ0e5HiKp1Jcf09ByeBRdxn9oFIvGMyPBBb8zbUZgfqpcHQ= X-Google-Smtp-Source: AGHT+IEhg3///Dzq1e+AC2xP/eQUYIwKgFzG4Fj3ug1RBEGiue+fVzAmYbpUqvOlKMJx+PSkC9hh+g== X-Received: by 2002:a17:90b:180a:b0:2e2:b204:90c8 with SMTP id 98e67ed59e1d1-2e3153717dfmr21721680a91.34.1729182401947; Thu, 17 Oct 2024 09:26:41 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e55d796a2csm23257a91.7.2024.10.17.09.26.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2024 09:26:41 -0700 (PDT) Date: Thu, 17 Oct 2024 09:24:37 -0700 From: Stephen Hemminger To: Bruce Richardson Cc: dev@dpdk.org, Jerin Jacob , Aman Singh , Konstantin Ananyev Subject: Re: [PATCH 5/6] net: add smaller IPv4 cksum function for simple cases Message-ID: <20241017092431.75cf1b45@hermes.local> In-Reply-To: <20241017142214.1669370-6-bruce.richardson@intel.com> References: <20241017142214.1669370-1-bruce.richardson@intel.com> <20241017142214.1669370-6-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 On Thu, 17 Oct 2024 15:22:12 +0100 Bruce Richardson wrote: > There are multiple instances in the DPDK app folder where we set up an > IP header and then compute the checksum field by direct addition of > nine uint16_t values in the header (20 bytes less the cksum field). > The existing rte_ip.h checksum function is more general than necessary > here and requires that the checksum field is already set to zero - > rather than having it skipped. > > Fix the code duplication present in the apps by creating a new > rte_ipv4_cksum_simple function - taking the code from the existing > testpmd icmpecho.c file - and using that in app/test, testpmd and > testeventdev. > > Within that new function, we can adjust slightly how the typecasting to > uint16_t is done, and thereby ensure that the app can all be compiled > without -Wno-address-of-packed-member compiler flag. > > Signed-off-by: Bruce Richardson DPDK should use the same optimization as FreeBSD and Linux and use 32 bit add's here. Acked-by: Stephen Hemminger