* [PATCH 1/1] ml/cnxk: fix name of TVM model with single layer
@ 2023-11-22 16:36 Srikanth Yalavarthi
2023-11-22 16:48 ` Bruce Richardson
2023-11-22 17:13 ` [PATCH v2 " Srikanth Yalavarthi
0 siblings, 2 replies; 6+ messages in thread
From: Srikanth Yalavarthi @ 2023-11-22 16:36 UTC (permalink / raw)
To: Srikanth Yalavarthi, Prince Takkar; +Cc: dev, sshankarnara, aprabhu, jerinj
Name field of TVM model with single MRVL layer is
currently set to empty string. Update the name with
the field from metadata.
Fixes: 5cea2c67edfc ("ml/cnxk: update internal TVM model info structure")
Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
---
drivers/ml/cnxk/mvtvm_ml_model.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/ml/cnxk/mvtvm_ml_model.c b/drivers/ml/cnxk/mvtvm_ml_model.c
index 3e06ea658bb..102d30e5f4f 100644
--- a/drivers/ml/cnxk/mvtvm_ml_model.c
+++ b/drivers/ml/cnxk/mvtvm_ml_model.c
@@ -352,6 +352,10 @@ mvtvm_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo
tvm_mrvl_model:
cn10k_ml_model_info_set(cnxk_mldev, model, &model->mvtvm.info,
&model->layer[0].glow.metadata);
+
+ metadata = &model->mvtvm.metadata;
+ rte_memcpy(info->name, metadata->model.name, TVMDP_NAME_STRLEN);
+
info->io_layout = RTE_ML_IO_LAYOUT_SPLIT;
}
--
2.42.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] ml/cnxk: fix name of TVM model with single layer
2023-11-22 16:36 [PATCH 1/1] ml/cnxk: fix name of TVM model with single layer Srikanth Yalavarthi
@ 2023-11-22 16:48 ` Bruce Richardson
2023-11-22 16:50 ` Bruce Richardson
2023-11-22 17:13 ` [PATCH v2 " Srikanth Yalavarthi
1 sibling, 1 reply; 6+ messages in thread
From: Bruce Richardson @ 2023-11-22 16:48 UTC (permalink / raw)
To: Srikanth Yalavarthi; +Cc: Prince Takkar, dev, sshankarnara, aprabhu, jerinj
On Wed, Nov 22, 2023 at 08:36:40AM -0800, Srikanth Yalavarthi wrote:
> Name field of TVM model with single MRVL layer is
> currently set to empty string. Update the name with
> the field from metadata.
>
> Fixes: 5cea2c67edfc ("ml/cnxk: update internal TVM model info structure")
>
> Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
> ---
> drivers/ml/cnxk/mvtvm_ml_model.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/ml/cnxk/mvtvm_ml_model.c b/drivers/ml/cnxk/mvtvm_ml_model.c
> index 3e06ea658bb..102d30e5f4f 100644
> --- a/drivers/ml/cnxk/mvtvm_ml_model.c
> +++ b/drivers/ml/cnxk/mvtvm_ml_model.c
> @@ -352,6 +352,10 @@ mvtvm_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo
> tvm_mrvl_model:
> cn10k_ml_model_info_set(cnxk_mldev, model, &model->mvtvm.info,
> &model->layer[0].glow.metadata);
> +
> + metadata = &model->mvtvm.metadata;
> + rte_memcpy(info->name, metadata->model.name, TVMDP_NAME_STRLEN);
> +
Minor nit, but you probably don't need a high-performance copy here, so I'd
recommend using regular memcpy rather than rte_memcpy.
/Bruce
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] ml/cnxk: fix name of TVM model with single layer
2023-11-22 16:48 ` Bruce Richardson
@ 2023-11-22 16:50 ` Bruce Richardson
2023-11-22 17:16 ` [EXT] " Srikanth Yalavarthi
0 siblings, 1 reply; 6+ messages in thread
From: Bruce Richardson @ 2023-11-22 16:50 UTC (permalink / raw)
To: Srikanth Yalavarthi; +Cc: Prince Takkar, dev, sshankarnara, aprabhu, jerinj
On Wed, Nov 22, 2023 at 04:48:50PM +0000, Bruce Richardson wrote:
> On Wed, Nov 22, 2023 at 08:36:40AM -0800, Srikanth Yalavarthi wrote:
> > Name field of TVM model with single MRVL layer is
> > currently set to empty string. Update the name with
> > the field from metadata.
> >
> > Fixes: 5cea2c67edfc ("ml/cnxk: update internal TVM model info structure")
> >
> > Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
> > ---
> > drivers/ml/cnxk/mvtvm_ml_model.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/ml/cnxk/mvtvm_ml_model.c b/drivers/ml/cnxk/mvtvm_ml_model.c
> > index 3e06ea658bb..102d30e5f4f 100644
> > --- a/drivers/ml/cnxk/mvtvm_ml_model.c
> > +++ b/drivers/ml/cnxk/mvtvm_ml_model.c
> > @@ -352,6 +352,10 @@ mvtvm_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo
> > tvm_mrvl_model:
> > cn10k_ml_model_info_set(cnxk_mldev, model, &model->mvtvm.info,
> > &model->layer[0].glow.metadata);
> > +
> > + metadata = &model->mvtvm.metadata;
> > + rte_memcpy(info->name, metadata->model.name, TVMDP_NAME_STRLEN);
> > +
>
> Minor nit, but you probably don't need a high-performance copy here, so I'd
> recommend using regular memcpy rather than rte_memcpy.
>
Actually, if this is a name value, would a strcpy function, e.g. strlcpy,
not be more appropriate?
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2 1/1] ml/cnxk: fix name of TVM model with single layer
2023-11-22 16:36 [PATCH 1/1] ml/cnxk: fix name of TVM model with single layer Srikanth Yalavarthi
2023-11-22 16:48 ` Bruce Richardson
@ 2023-11-22 17:13 ` Srikanth Yalavarthi
2023-11-23 0:28 ` Thomas Monjalon
1 sibling, 1 reply; 6+ messages in thread
From: Srikanth Yalavarthi @ 2023-11-22 17:13 UTC (permalink / raw)
To: Srikanth Yalavarthi, Prince Takkar; +Cc: dev, sshankarnara, aprabhu, jerinj
Name field of TVM model with single MRVL layer is
currently set to empty string. Update the name with
the field from metadata.
Fixes: 5cea2c67edfc ("ml/cnxk: update internal TVM model info structure")
Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
---
v2:
- Replaced rte_memcpy with strlcpy
drivers/ml/cnxk/mvtvm_ml_model.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/ml/cnxk/mvtvm_ml_model.c b/drivers/ml/cnxk/mvtvm_ml_model.c
index 3e06ea658bb..e3234ae4422 100644
--- a/drivers/ml/cnxk/mvtvm_ml_model.c
+++ b/drivers/ml/cnxk/mvtvm_ml_model.c
@@ -352,6 +352,10 @@ mvtvm_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo
tvm_mrvl_model:
cn10k_ml_model_info_set(cnxk_mldev, model, &model->mvtvm.info,
&model->layer[0].glow.metadata);
+
+ metadata = &model->mvtvm.metadata;
+ strlcpy(info->name, metadata->model.name, TVMDP_NAME_STRLEN);
+
info->io_layout = RTE_ML_IO_LAYOUT_SPLIT;
}
--
2.42.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [EXT] Re: [PATCH 1/1] ml/cnxk: fix name of TVM model with single layer
2023-11-22 16:50 ` Bruce Richardson
@ 2023-11-22 17:16 ` Srikanth Yalavarthi
0 siblings, 0 replies; 6+ messages in thread
From: Srikanth Yalavarthi @ 2023-11-22 17:16 UTC (permalink / raw)
To: Bruce Richardson
Cc: Prince Takkar, dev, Shivah Shankar Shankar Narayan Rao,
Anup Prabhu, Jerin Jacob Kollanukkaran, Srikanth Yalavarthi
> -----Original Message-----
> From: Bruce Richardson <bruce.richardson@intel.com>
> Sent: 22 November 2023 22:21
> To: Srikanth Yalavarthi <syalavarthi@marvell.com>
> Cc: Prince Takkar <ptakkar@marvell.com>; dev@dpdk.org; Shivah Shankar
> Shankar Narayan Rao <sshankarnara@marvell.com>; Anup Prabhu
> <aprabhu@marvell.com>; Jerin Jacob Kollanukkaran <jerinj@marvell.com>
> Subject: [EXT] Re: [PATCH 1/1] ml/cnxk: fix name of TVM model with single
> layer
>
> External Email
>
> ----------------------------------------------------------------------
> On Wed, Nov 22, 2023 at 04:48:50PM +0000, Bruce Richardson wrote:
> > On Wed, Nov 22, 2023 at 08:36:40AM -0800, Srikanth Yalavarthi wrote:
> > > Name field of TVM model with single MRVL layer is currently set to
> > > empty string. Update the name with the field from metadata.
> > >
> > > Fixes: 5cea2c67edfc ("ml/cnxk: update internal TVM model info
> > > structure")
> > >
> > > Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
> > > ---
> > > drivers/ml/cnxk/mvtvm_ml_model.c | 4 ++++
> > > 1 file changed, 4 insertions(+)
> > >
> > > diff --git a/drivers/ml/cnxk/mvtvm_ml_model.c
> > > b/drivers/ml/cnxk/mvtvm_ml_model.c
> > > index 3e06ea658bb..102d30e5f4f 100644
> > > --- a/drivers/ml/cnxk/mvtvm_ml_model.c
> > > +++ b/drivers/ml/cnxk/mvtvm_ml_model.c
> > > @@ -352,6 +352,10 @@ mvtvm_ml_model_info_set(struct cnxk_ml_dev
> > > *cnxk_mldev, struct cnxk_ml_model *mo
> > > tvm_mrvl_model:
> > > cn10k_ml_model_info_set(cnxk_mldev, model, &model-
> >mvtvm.info,
> > > &model->layer[0].glow.metadata);
> > > +
> > > + metadata = &model->mvtvm.metadata;
> > > + rte_memcpy(info->name, metadata->model.name,
> TVMDP_NAME_STRLEN);
> > > +
> >
> > Minor nit, but you probably don't need a high-performance copy here,
> > so I'd recommend using regular memcpy rather than rte_memcpy.
> >
> Actually, if this is a name value, would a strcpy function, e.g. strlcpy, not be
> more appropriate?
Thanks. Updated in v2.
We have few other locations unrelated to the current patch, where rte_memcpy can be replaced with strlcpy. Will submit a separate patch for this.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2 1/1] ml/cnxk: fix name of TVM model with single layer
2023-11-22 17:13 ` [PATCH v2 " Srikanth Yalavarthi
@ 2023-11-23 0:28 ` Thomas Monjalon
0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2023-11-23 0:28 UTC (permalink / raw)
To: Srikanth Yalavarthi, Prince Takkar; +Cc: dev, sshankarnara, aprabhu, jerinj
22/11/2023 18:13, Srikanth Yalavarthi:
> Name field of TVM model with single MRVL layer is
> currently set to empty string. Update the name with
> the field from metadata.
>
> Fixes: 5cea2c67edfc ("ml/cnxk: update internal TVM model info structure")
>
> Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
Applied
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-11-23 0:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-22 16:36 [PATCH 1/1] ml/cnxk: fix name of TVM model with single layer Srikanth Yalavarthi
2023-11-22 16:48 ` Bruce Richardson
2023-11-22 16:50 ` Bruce Richardson
2023-11-22 17:16 ` [EXT] " Srikanth Yalavarthi
2023-11-22 17:13 ` [PATCH v2 " Srikanth Yalavarthi
2023-11-23 0:28 ` Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).