DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: David Marchand <david.marchand@redhat.com>
Cc: <dev@dpdk.org>, Stephen Hemminger <stephen@networkplumber.org>,
	"Thomas Monjalon" <thomas@monjalon.net>
Subject: Re: [PATCH v2 00/17] drivers: replace strncpy with strlcpy
Date: Tue, 22 Sep 2026 17:41:37 +0100	[thread overview]
Message-ID: <arKvweESua0SewSt@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <CAJFAV8wTO-xdChto3Tzs2ci1QThtLingNDE_i0bjREhiOORjsQ@mail.gmail.com>

On Tue, Sep 22, 2026 at 06:13:08PM +0200, David Marchand wrote:
> On Wed, 24 Jun 2026 at 12:37, Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > Many uses of strncpy in DPDK drivers can be directly replaced by
> > a call to strlcpy instead, which is safer in that it always null-
> > terminates the string. This AI assisted patchset makes those
> > simple replacements, adjusting lengths as appropriate.
> >
> > After this set, there are still a number of drivers with strncpy calls
> > in them, but those are not simple strncpy->strlcpy replacements, so
> > left for later rework.
> >
> > v2:
> > * fix incorrect commit ids for fixlines.
> > * fix build errors due to missing rte_string_fns.h header include
> >
> > Bruce Richardson (17):
> >   common/cnxk: replace strncpy with strlcpy
> >   common/mlx5: replace strncpy with strlcpy
> >   crypto/mvsam: replace strncpy with strlcpy
> >   crypto/scheduler: replace strncpy with strlcpy
> >   event/cnxk: replace strncpy with strlcpy
> >   net/ark: replace strncpy with strlcpy
> >   net/bnx2x: replace strncpy with strlcpy
> >   net/cnxk: replace strncpy with strlcpy
> >   net/dpaa: replace strncpy with strlcpy
> >   net/ionic: replace strncpy with strlcpy
> >   net/mlx4: replace strncpy with strlcpy
> >   net/mlx5: replace strncpy with strlcpy
> >   net/nfp: replace strncpy with strlcpy
> >   net/qede: replace strncpy with strlcpy
> >   net/softnic: replace strncpy with strlcpy
> >   net/vhost: replace strncpy with strlcpy
> >   net/virtio: replace strncpy with strlcpy
> >
> >  drivers/common/cnxk/roc_model.c                   | 8 ++++----
> >  drivers/common/mlx5/linux/mlx5_common_os.c        | 2 +-
> >  drivers/crypto/mvsam/rte_mrvl_pmd.c               | 2 +-
> >  drivers/crypto/scheduler/scheduler_pmd.c          | 8 ++++----
> >  drivers/event/cnxk/cnxk_eventdev_stats.c          | 2 +-
> >  drivers/net/ark/ark_ethdev.c                      | 2 +-
> >  drivers/net/bnx2x/bnx2x.c                         | 2 +-
> >  drivers/net/bnx2x/bnx2x_vfpf.c                    | 2 +-
> >  drivers/net/cnxk/cnxk_eswitch.c                   | 4 ++--
> >  drivers/net/cnxk/cnxk_rep_msg.c                   | 2 +-
> >  drivers/net/dpaa/dpaa_ethdev.c                    | 2 +-
> >  drivers/net/ionic/ionic_main.c                    | 4 ++--
> >  drivers/net/mlx4/mlx4_ethdev.c                    | 2 +-
> >  drivers/net/mlx5/mlx5.c                           | 8 ++++----
> >  drivers/net/mlx5/windows/mlx5_ethdev_os.c         | 2 +-
> >  drivers/net/nfp/nfpcore/nfp_resource.c            | 2 +-
> >  drivers/net/qede/qede_ethdev.c                    | 2 +-
> >  drivers/net/softnic/conn.c                        | 6 ++++--
> >  drivers/net/vhost/rte_eth_vhost.c                 | 2 +-
> >  drivers/net/virtio/virtio_user/vhost_kernel_tap.c | 2 +-
> >  20 files changed, 34 insertions(+), 32 deletions(-)
> 
> Series applied.
> 
> Thanks for the cleanup Bruce.
> 
> Even if the transition is not finished, it is probably worth updating
> checkpatches.sh to avoid new strncpy additions now.
> 
This should be already covered by kernel checkpatch.pl script we wrap, so I
don't believe we need to add anything:

  cat /tmp/test_strncpy.patch | devtools/checkpatches.sh -q 2>&1

  ### [PATCH] test: check strncpy detection

  WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one

  WARNING:STRNCPY: Prefer strscpy, strscpy_pad, or __nonstring over strncpy - see: https://github.com/KSPP/linux/issues/90
  #20: FILE: ...


If we replace the checkpatches.sh script with Stephen's python version, we
can probably get a better error message more relevant for userspace.

/Bruce

      reply	other threads:[~2026-09-22 16:41 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-23 16:51 [PATCH 00/17] drivers: replace strncpy with strlcpy Bruce Richardson
2026-06-23 16:51 ` [PATCH 01/17] common/cnxk: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 02/17] common/mlx5: " Bruce Richardson
2026-08-25 12:17   ` Dariusz Sosnowski
2026-06-23 16:51 ` [PATCH 03/17] crypto/mvsam: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 04/17] crypto/scheduler: " Bruce Richardson
2026-06-23 16:59   ` Bruce Richardson
2026-06-23 16:51 ` [PATCH 05/17] event/cnxk: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 06/17] net/ark: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 07/17] net/bnx2x: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 08/17] net/cnxk: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 09/17] net/dpaa: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 10/17] net/ionic: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 11/17] net/mlx4: " Bruce Richardson
2026-08-25 12:17   ` Dariusz Sosnowski
2026-06-23 16:51 ` [PATCH 12/17] net/mlx5: " Bruce Richardson
2026-08-25 12:18   ` Dariusz Sosnowski
2026-06-23 16:51 ` [PATCH 13/17] net/nfp: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 14/17] net/qede: " Bruce Richardson
2026-06-23 17:02   ` Bruce Richardson
2026-06-23 16:51 ` [PATCH 15/17] net/softnic: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 16/17] net/vhost: " Bruce Richardson
2026-06-23 16:51 ` [PATCH 17/17] net/virtio: " Bruce Richardson
2026-06-23 17:33 ` [PATCH 00/17] drivers: " Stephen Hemminger
2026-06-24  7:49   ` Bruce Richardson
2026-06-24 10:36 ` [PATCH v2 " Bruce Richardson
2026-06-24 10:36   ` [PATCH v2 01/17] common/cnxk: " Bruce Richardson
2026-06-24 10:36   ` [PATCH v2 02/17] common/mlx5: " Bruce Richardson
2026-08-25 12:20     ` Dariusz Sosnowski
2026-06-24 10:36   ` [PATCH v2 03/17] crypto/mvsam: " Bruce Richardson
2026-06-24 10:36   ` [PATCH v2 04/17] crypto/scheduler: " Bruce Richardson
2026-06-30  8:56     ` Ji, Kai
2026-07-01 11:18     ` Ji, Kai
2026-06-24 10:36   ` [PATCH v2 05/17] event/cnxk: " Bruce Richardson
2026-06-24 10:36   ` [PATCH v2 06/17] net/ark: " Bruce Richardson
2026-06-24 10:36   ` [PATCH v2 07/17] net/bnx2x: " Bruce Richardson
2026-06-24 10:36   ` [PATCH v2 08/17] net/cnxk: " Bruce Richardson
2026-06-24 10:36   ` [PATCH v2 09/17] net/dpaa: " Bruce Richardson
2026-06-24 10:36   ` [PATCH v2 10/17] net/ionic: " Bruce Richardson
2026-06-24 10:36   ` [PATCH v2 11/17] net/mlx4: " Bruce Richardson
2026-08-25 12:20     ` Dariusz Sosnowski
2026-06-24 10:36   ` [PATCH v2 12/17] net/mlx5: " Bruce Richardson
2026-08-25 12:20     ` Dariusz Sosnowski
2026-06-24 10:36   ` [PATCH v2 13/17] net/nfp: " Bruce Richardson
2026-06-24 10:36   ` [PATCH v2 14/17] net/qede: " Bruce Richardson
2026-06-24 10:36   ` [PATCH v2 15/17] net/softnic: " Bruce Richardson
2026-06-24 10:36   ` [PATCH v2 16/17] net/vhost: " Bruce Richardson
2026-06-24 10:36   ` [PATCH v2 17/17] net/virtio: " Bruce Richardson
2026-08-17 14:47   ` [PATCH v2 00/17] drivers: " Bruce Richardson
2026-09-22 16:13   ` David Marchand
2026-09-22 16:41     ` Bruce Richardson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=arKvweESua0SewSt@bricha3-mobl1.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox