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 914F241E1C; Thu, 9 Mar 2023 17:23:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 71B8A40ED7; Thu, 9 Mar 2023 17:23:35 +0100 (CET) Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by mails.dpdk.org (Postfix) with ESMTP id 3282940695 for ; Thu, 9 Mar 2023 17:23:34 +0100 (CET) Received: by mail-pj1-f43.google.com with SMTP id qa18-20020a17090b4fd200b0023750b675f5so6764366pjb.3 for ; Thu, 09 Mar 2023 08:23:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1678379013; 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=Z/j8nDCfX0WoYY3pJ5VFtYvyJyUx4ieA784WbYNnSNo=; b=qtQwiplnutF1EOfU9gCF5WDsIzY1Wfv9ui+qdNrK2bH89LPyJNhsvxHUojZDWZghYv J+aBqMN/IqGMExdKDb4BotLmYRTni+sg4JmaDLLg5kEJZefGGc8J4EHC78fR67zTsp/N otZW0tpvwYXPcmbxXgmVIQ6w31A8opAes7LmaFfCz27I7LR24QBlXbqqDWQ/pTN3CqUA qlUkdyBYdcq25DymDWDZsqEYWt9RRVMWi5Nr8KnAw0nza9CdAWMxoQIVgZu7gmw6QqkR a0wet+1afMimEq19ykK4shInokz51W63gO3x0R1tGQHtTRcS3WEJ3NijEUr4PITacpE8 l8Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678379013; 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=Z/j8nDCfX0WoYY3pJ5VFtYvyJyUx4ieA784WbYNnSNo=; b=frG2rCDYdqzS3tKrBW8RU1fmvHvvhRnvX2v/OrnFBQHMW+FuuUMT6yxzHex4tmSnG/ llKnnCSNe7trgfRf5wpmboG3uN6snMYYh4t2xJlUujwiphCuyeQpnDJYAtGzdUPz47jA 94iUk6n8XbnGt0E74bSV1coBb3yUCLX/pFyIp0++GQ2+MU4zB//6ibFJ1HsQ8B+i0Ygy HCgrt7ySHWD9fnRFeba/7BDDq2cOSE6cTlpJvOWgZNoMlPbaMnchAfCXUpvgus8eKg5L asiCZpTu2jhuWhnmh4eZXFQwE3hveFhQYJwxCeudEiGUHc28ROU7EDCcKtF9oUKYDTA3 9hlw== X-Gm-Message-State: AO0yUKVPvnHuoolcDklcuXV2/wKTvhQnAI36L6l5zBBIUCAG7TjAlJB7 v7oa5df+no2ZLzjGPQ+UYOysOQ== X-Google-Smtp-Source: AK7set+HbpiBIsNk1Dd/QL0RlxiIfGYHWnIooZkuw/DtogZhAQgjkB/WdWsIZM79+1YszUSRk+hc7A== X-Received: by 2002:a17:902:e886:b0:199:4a00:9788 with SMTP id w6-20020a170902e88600b001994a009788mr28024481plg.19.1678379013273; Thu, 09 Mar 2023 08:23:33 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id p4-20020a170902780400b00192b23b8451sm11686366pll.108.2023.03.09.08.23.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Mar 2023 08:23:33 -0800 (PST) Date: Thu, 9 Mar 2023 08:23:32 -0800 From: Stephen Hemminger To: Morten =?UTF-8?B?QnLDuHJ1cA==?= Cc: , , , , , , , , , , , , Subject: Re: [PATCH v7 1/4] net/bnx2x: fix warnings about rte_memcpy lengths Message-ID: <20230309082332.1103be22@hermes.local> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D87724@smartserver.smartshare.dk> References: <20221202153432.131023-1-mb@smartsharesystems.com> <20230116130724.50277-1-mb@smartsharesystems.com> <98CBD80474FA8B44BF855DF32C47DC35D87724@smartserver.smartshare.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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, 9 Feb 2023 17:49:31 +0100 Morten Br=C3=B8rup wrote: > > rte_memcpy(old, new, sizeof(struct nig_stats)); > >=20 > > - rte_memcpy(&(estats->rx_stat_ifhcinbadoctets_hi), &(pstats- =20 > > >mac_stx[1]), =20 > > - sizeof(struct mac_stx)); > > + rte_memcpy(RTE_PTR_ADD(estats, > > + offsetof(struct bnx2x_eth_stats, > > rx_stat_ifhcinbadoctets_hi)), > > + &pstats->mac_stx[1], sizeof(struct mac_stx)); Stop using rte_memcpy() in slow path like this. memcpy() is just as fast, compiler can optimize, and the checking tools are better with it.