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 7A157A04FD; Wed, 28 Dec 2022 18:03:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5AE1C40A7F; Wed, 28 Dec 2022 18:03:25 +0100 (CET) Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by mails.dpdk.org (Postfix) with ESMTP id 74F5740698 for ; Wed, 28 Dec 2022 18:03:23 +0100 (CET) Received: by mail-pj1-f42.google.com with SMTP id o8-20020a17090a9f8800b00223de0364beso20546864pjp.4 for ; Wed, 28 Dec 2022 09:03:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; 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=SnU+qi/SWsdduTzglnyYbrmMeY1ULFK69b4PhYQKbMY=; b=2eOySTvBwlRwiy7WlPqCJC6DmKxwAazW5RPD7A3zHesMQ1+s9GraE+qH0TXUskI8MJ BKwcXELW7RnSf1DrnqCHDDJxAJ2mjgYMfQNgOKwle+Tx74Plphchbh32vxntwke3rWsx PWKSO6dlNECEACfpVH5pONURwTihJ/6YqIpvALfqD8Ek+pXTSXPnh3L4UNev0JukXvAy yuxpohPLuUXH/QWhHZZgWLjFu8xMTYnzVNhg8YBgEvftxplcE7tvgofYkB/TyQGHCDho nA09U9NnHWQoCW0pABXXRdwMRhsYsO9Ujk6eNyJEF7U3utUEyx0EpCh1kl0UKE97iAkH Z62g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=SnU+qi/SWsdduTzglnyYbrmMeY1ULFK69b4PhYQKbMY=; b=TYz3ZWUxWFocupu8SEufzoZWw3SxeWg8mSWnKBSux7xn9FKpXs1/yBgcNeZLhPtIeF cE705nS/AasAk+LnlUV/RiOiwTnnTypNcFrUbNsvfnOXzUT/IOFtU7WdTOW3UB/n4HZa VYyBK3AS0NipXQtgqyZNnZfNp2Mnxi8n7UpHmU4vUxQEsg+M6ssNag3uID4AjsqOYz24 UDBnqt29bgTHZrXJ1vziggQ9SXd0f54WUKvq5emRuMQBzlzAEeLD1K4c6GXt7mMRpDQw oAyAYc2cOBtDEOL3WV17oazbKqKPJdsALSe5Mm2CFdReXgbZMRu+kVhYkzL0jceD+N+S CaGQ== X-Gm-Message-State: AFqh2kouIoYjpDIibLmu7DZgqtoBmfP8qbyRdsCnIG+GX+lR9aZPC5sO L4+XbHem+4F7c9OhH/eqQy/8FA== X-Google-Smtp-Source: AMrXdXvO2C3qoF1GTevGCIwxVi4kfTZZk3OBkUJbSxrYMh4f78WRbD0P66HDh/vx74syATsHEOzFaA== X-Received: by 2002:a17:902:b205:b0:185:441e:224a with SMTP id t5-20020a170902b20500b00185441e224amr25086205plr.69.1672247002635; Wed, 28 Dec 2022 09:03:22 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id i9-20020a170902c94900b00188fc6766d6sm11226991pla.219.2022.12.28.09.03.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Dec 2022 09:03:22 -0800 (PST) Date: Wed, 28 Dec 2022 09:03:20 -0800 From: Stephen Hemminger To: Morten =?UTF-8?B?QnLDuHJ1cA==?= Cc: =?UTF-8?B?U3RhbmlzxYJhdw==?= Kardach , "Rasesh Mody" , "Shahed Shaikh" , "dev" , "Tyler Retzlaff" , , , , "Ruifeng Wang" , "Min Zhou" , "David Christensen" , "Bruce Richardson" , "Konstantin Ananyev" Subject: Re: [PATCH v5 2/4] net/bnx2x: fix warnings about rte_memcpy lengths Message-ID: <20221228090320.5fd76919@hermes.local> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D8760F@smartserver.smartshare.dk> References: <20221202153432.131023-1-mb@smartsharesystems.com> <20221228151019.101309-1-mb@smartsharesystems.com> <20221228151019.101309-2-mb@smartsharesystems.com> <98CBD80474FA8B44BF855DF32C47DC35D8760F@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 Wed, 28 Dec 2022 17:38:56 +0100 Morten Br=C3=B8rup wrote: > From: Stanis=C5=82aw Kardach [mailto:kda@semihalf.com]=20 > Sent: Wednesday, 28 December 2022 17.14 > > On Wed, Dec 28, 2022, 16:10 Morten Br=C3=B8rup wrote: =20 > > > Bugfix: The vlan in the bulletin does not contain a VLAN header, only= the > > > VLAN ID, so only copy 2 byte, not 4. The target structure has padding > > > after the field, so copying 2 byte too many is effectively harmless. = =20 > > It is a small nitpick but why use rte_memcpy for a 2 byte / half-word c= opy? Shouldn't assignment with casts be enough? =20 >=20 > Absolutely. It would also have prevented the bug to begin with. > But in order to keep the changes minimal, I kept the rte_memcpy(). For small fixed values compiler can optimize memcpy into one instruction. Not so with current rte_memcpy