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 4A92A43BCF; Fri, 1 Mar 2024 14:54:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ACB81434B0; Fri, 1 Mar 2024 14:54:08 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id D656F433F2 for ; Fri, 1 Mar 2024 14:54:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709301246; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3aVL7aQVNDoTfCk++aKGr54IDYJvm3Vm95Ubo75ejFU=; b=U4DVCSE0kd3BRAIRxkHOZdIlUPDPhs6YjnGPUivl/BRaZcmCC3cr842XZIxsBhzVRRF1cK 3UxGuKI0yzr6EQNWJTv9vJg6XrUJFpzKL+GRkF/srpSvsRjpNY75yJa5NSF08oCaIDLvSZ 8MGKxh7qsi3piXrUe4itNP5lqUcvjrg= Received: from mail-lj1-f200.google.com (mail-lj1-f200.google.com [209.85.208.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-303-dt40CU0KOhmSD6vH29ydKQ-1; Fri, 01 Mar 2024 08:54:04 -0500 X-MC-Unique: dt40CU0KOhmSD6vH29ydKQ-1 Received: by mail-lj1-f200.google.com with SMTP id 38308e7fff4ca-2d29b5e9f7cso19779901fa.1 for ; Fri, 01 Mar 2024 05:54:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709301240; x=1709906040; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3aVL7aQVNDoTfCk++aKGr54IDYJvm3Vm95Ubo75ejFU=; b=u6Wn7NvJzipKZb4EGO5YtxHsmPwqjeJmWhVpqJeRxqGIqUwylH/XAZ418NH1ORZpto U86DyExjG5UnkJby2xqpH505BXuSNI4beRVrIQb6DpD/OcBxEy0/6M3zbYYEgFLYv5CR HJjbcT+J2DkiEyZ6SIS+RMDkio0VxV7OVFSGtmB165+Vl57+iud7TjwbpfCCFhussGef Mh6y2U50oI+vdUQBrtj0YtdCdI1McHoKC1uDZe4nkzOybqdgkDLSrqxHe/uhce2YYhd1 8XUDHvF4DRF3k1TEJNHZG50wJhTNc7EFsGAfDJjRspVUN4yh3BAxsMut/1iFrDrPeDHA +tZQ== X-Gm-Message-State: AOJu0YxGWzNIyKy8t0OVkEQJ93KgzLNO/ag34+QLBqKkKuO7z+utIX/b R0jyVH8FXnLkYe4vym/i9yNV0/q3Fl9r3Gt80vttzgFcX3WQfBd7uzyPLUbdDca7UCKEWdMvhbS CPSkK+TB0G4A0SpdsgyXCG5yD9H8AEM8b1WSb3oMra/SXYCtnLOlD6/Vvmz8Zp2tSBBNRWFEkJO UCiqxQ2aKsW5nSTUOR/f6VJZw= X-Received: by 2002:a05:651c:198e:b0:2d3:202b:2b9c with SMTP id bx14-20020a05651c198e00b002d3202b2b9cmr1743263ljb.5.1709301240462; Fri, 01 Mar 2024 05:54:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IEvOHNJvYQlkFjMfKN++DNBmJL70hDfBeslgMSUSzegMo3JsyhTLFSCUPicwR00yohqSMuC2h6HHG0WASujoL4= X-Received: by 2002:a05:651c:198e:b0:2d3:202b:2b9c with SMTP id bx14-20020a05651c198e00b002d3202b2b9cmr1743256ljb.5.1709301240107; Fri, 01 Mar 2024 05:54:00 -0800 (PST) MIME-Version: 1.0 References: <20240229225936.483472-1-stephen@networkplumber.org> In-Reply-To: <20240229225936.483472-1-stephen@networkplumber.org> From: David Marchand Date: Fri, 1 Mar 2024 14:53:48 +0100 Message-ID: Subject: Re: [PATCH 00/71] replace use of fixed size rte_memcpy To: Stephen Hemminger Cc: dev@dpdk.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 Hello Stephen, On Fri, Mar 1, 2024 at 12:00=E2=80=AFAM Stephen Hemminger wrote: > > The DPDK has a lot of "cargo cult" usage of rte_memcpy. > This patch set replaces cases where rte_memcpy is used with a fixed > size constant size. > > Typical example is: > rte_memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN); > which can be replaced with: > memcpy(mac_addrs, mac.addr_bytes, RTE_ETHER_ADDR_LEN); > > This has two benefits. Gcc (and clang) are smart enough that for > all small fixed size values, they just generate the necessary instruction= s > to do it inline. It also means that fortify, Coverity, and ASAN > analyzers can check these memcpy's. > > So faster, better, safer. > > The first patch is a simple coccinelle script to do the replacement > and the rest are the results broken out by module. > > The coccinelle script can be used again to make sure more bad > usage doesn't creep in with new drivers. There is a build issue reported by the CI, please fix and submit a new revi= sion. --=20 David Marchand