Skip to content

drivers: replace strncpy with strlcpy

Bruce Richardson dpdk-dev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest17 patches 8 repliesIn review
  2. v117 patches 7 repliesSuperseded

Changes in v2 from the cover letter

* fix incorrect commit ids for fixlines.
* fix build errors due to missing rte_string_fns.h header include

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17common/cnxk: replace strncpy with strlcpydrivers/common/cnxk/roc_model.c+4 -40 replies
2/17common/mlx5: replace strncpy with strlcpydrivers/common/mlx5/linux/mlx5_common_os.c+1 -11 reply
3/17crypto/mvsam: replace strncpy with strlcpydrivers/crypto/mvsam/rte_mrvl_pmd.c+1 -10 replies
4/17crypto/scheduler: replace strncpy with strlcpydrivers/crypto/scheduler/scheduler_pmd.c+4 -42 replies
5/17event/cnxk: replace strncpy with strlcpydrivers/event/cnxk/cnxk_eventdev_stats.c+1 -10 replies
6/17net/ark: replace strncpy with strlcpydrivers/net/ark/ark_ethdev.c+1 -10 replies
7/17net/bnx2x: replace strncpy with strlcpydrivers/net/bnx2x/bnx2x.c drivers/net/bnx2x/bnx2x_vfpf.c+2 -20 replies
8/17net/cnxk: replace strncpy with strlcpydrivers/net/cnxk/cnxk_eswitch.c drivers/net/cnxk/cnxk_rep_msg.c+3 -30 replies
9/17net/dpaa: replace strncpy with strlcpydrivers/net/dpaa/dpaa_ethdev.c+1 -10 replies
10/17net/ionic: replace strncpy with strlcpydrivers/net/ionic/ionic_main.c+2 -20 replies
11/17net/mlx4: replace strncpy with strlcpydrivers/net/mlx4/mlx4_ethdev.c+1 -11 reply
12/17net/mlx5: replace strncpy with strlcpydrivers/net/mlx5/mlx5.c drivers/net/mlx5/windows/mlx5_ethdev_os.c+5 -51 reply
13/17net/nfp: replace strncpy with strlcpydrivers/net/nfp/nfpcore/nfp_resource.c+1 -10 replies
14/17net/qede: replace strncpy with strlcpydrivers/net/qede/qede_ethdev.c+1 -10 replies
15/17net/softnic: replace strncpy with strlcpydrivers/net/softnic/conn.c+4 -20 replies
16/17net/vhost: replace strncpy with strlcpydrivers/net/vhost/rte_eth_vhost.c+1 -10 replies
17/17net/virtio: replace strncpy with strlcpydrivers/net/virtio/virtio_user/vhost_kernel_tap.c+1 -10 replies

Reviews trailers per patch

4 of 17 patches have a Reviewed-by or Acked-by.

PatchKai JiDariusz Sosnowski
1/17
2/17A-b
3/17
4/17A-b A-b
5/17
6/17
7/17
8/17
9/17
10/17
11/17A-b
12/17A-b
13/17
14/17
15/17
16/17
17/17

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/17] drivers: replace strncpy with strlcpy

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(-)

--
2.53.0