mbox series

[0/2] cleanup use of rte_strlcpy

Message ID 20230531220533.29910-1-stephen@networkplumber.org (mailing list archive)
Headers
Series cleanup use of rte_strlcpy |

Message

Stephen Hemminger May 31, 2023, 10:05 p.m. UTC
  In DPDK API's rte_strlcpy() is not intended to be used directly.
It was introduced as a replacement for when operating system
libraries were missing strlcpy(). Over time it appears several
drivers and subsystems started using it directly, which is
inefficient since the wrapper uses snprintf().

This series makes sure that the only usage of rte_strlcpy()
is in rte_string_fns.h where it is needed.

Perhaps checkpatch should warn about other uses?

Stephen Hemminger (2):
  lib: replace rte_strlcpy() with strlcpy()
  drivers: don't use rte_strlcpy

 drivers/common/cnxk/roc_platform.h            |  2 +-
 drivers/mempool/cnxk/cnxk_mempool_telemetry.c |  2 +-
 drivers/net/cnxk/cnxk_ethdev_ops.c            |  4 +-
 drivers/net/mlx5/mlx5_testpmd.c               |  2 +-
 lib/eal/common/eal_common_memzone.c           |  2 +-
 lib/fib/rte_fib.c                             |  2 +-
 lib/fib/rte_fib6.c                            |  2 +-
 lib/hash/rte_thash.c                          |  4 +-
 lib/mempool/rte_mempool.c                     |  2 +-
 lib/mldev/mldev_utils.c                       | 40 +++++++++----------
 lib/rib/rte_rib.c                             |  2 +-
 lib/rib/rte_rib6.c                            |  2 +-
 12 files changed, 33 insertions(+), 33 deletions(-)
  

Comments

Bruce Richardson June 1, 2023, 10:18 a.m. UTC | #1
On Wed, May 31, 2023 at 03:05:31PM -0700, Stephen Hemminger wrote:
> In DPDK API's rte_strlcpy() is not intended to be used directly.
> It was introduced as a replacement for when operating system
> libraries were missing strlcpy(). Over time it appears several
> drivers and subsystems started using it directly, which is
> inefficient since the wrapper uses snprintf().
> 
> This series makes sure that the only usage of rte_strlcpy()
> is in rte_string_fns.h where it is needed.
> 
> Perhaps checkpatch should warn about other uses?
> 
> Stephen Hemminger (2):
>   lib: replace rte_strlcpy() with strlcpy()
>   drivers: don't use rte_strlcpy
> 
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
Tyler Retzlaff June 2, 2023, 9:46 p.m. UTC | #2
On Thu, Jun 01, 2023 at 11:18:52AM +0100, Bruce Richardson wrote:
> On Wed, May 31, 2023 at 03:05:31PM -0700, Stephen Hemminger wrote:
> > In DPDK API's rte_strlcpy() is not intended to be used directly.
> > It was introduced as a replacement for when operating system
> > libraries were missing strlcpy(). Over time it appears several
> > drivers and subsystems started using it directly, which is
> > inefficient since the wrapper uses snprintf().
> > 
> > This series makes sure that the only usage of rte_strlcpy()
> > is in rte_string_fns.h where it is needed.
> > 
> > Perhaps checkpatch should warn about other uses?
> > 
> > Stephen Hemminger (2):
> >   lib: replace rte_strlcpy() with strlcpy()
> >   drivers: don't use rte_strlcpy
> > 
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>