<...> > > -----Original Message----- > > From: Daly, Lee > > Sent: Tuesday, April 17, 2018 2:35 PM > > To: dev@dpdk.org > > Cc: De Lara Guarch, Pablo <pablo.de.lara.gua...@intel.com>; Tucker, > > Greg B <greg.b.tuc...@intel.com>; Jain, Deepak K > > <deepak.k.j...@intel.com>; Trahe, Fiona <fiona.tr...@intel.com>; Daly, > > Lee <lee.d...@intel.com> > > Subject: [PATCH v3 05/11] compress/isal: add queue pair related ops > > > > Signed-off-by: Lee Daly <lee.d...@intel.com> > > --- > > drivers/compress/isal/isal_compress_pmd_ops.c | 110 > > +++++++++++++++++++++- > > drivers/compress/isal/isal_compress_pmd_private.h | 2 + > > 2 files changed, 110 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/compress/isal/isal_compress_pmd_ops.c > > b/drivers/compress/isal/isal_compress_pmd_ops.c > > index 2e9381d..73e4c84 100644 > > --- a/drivers/compress/isal/isal_compress_pmd_ops.c
//snip > > > +qp_id */ static int isal_comp_pmd_qp_set_unique_name(struct > > +rte_compressdev *dev, struct isal_comp_qp *qp) { > > + unsigned int n = snprintf(qp->name, sizeof(qp->name), > > + "isal_compression_pmd_%u_qp_%u", > > + dev->data->dev_id, qp->id); > > Better to use strlcpy. [Lee] I believe snprintf to be a better fit due to the fact strlcpy doesn't handle variable arguments as inputs, i.e "snprintf(dst, length, "%s", src)" "strlcpy(dst, src, length)" To complete this action with strlcpy would cause more overhead, and snprintf() is still safe as it always null terminates. > > > + > > + if (n >= sizeof(qp->name)) > > + return -1; > > + > > + return 0; > > +}