From: Anoob Joseph <anoobj@marvell.com>
To: Suanming Mou <suanmingm@nvidia.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, Ciara Power <ciara.power@intel.com>
Subject: RE: [EXT] [PATCH] app/test-crypto-perf: fix invalid mbuf next operation
Date: Wed, 3 Jan 2024 15:42:37 +0000 [thread overview]
Message-ID: <PH0PR18MB467266AB47A96E1B17BF4340DF60A@PH0PR18MB4672.namprd18.prod.outlook.com> (raw)
In-Reply-To: <CO6PR12MB53966B564444214D5AB3C78AC160A@CO6PR12MB5396.namprd12.prod.outlook.com>
Hi Suanming,
Please see inline.
Thanks,
Anoob
> -----Original Message-----
> From: Suanming Mou <suanmingm@nvidia.com>
> Sent: Wednesday, January 3, 2024 6:06 PM
> To: Anoob Joseph <anoobj@marvell.com>
> Cc: dev@dpdk.org; Ciara Power <ciara.power@intel.com>
> Subject: RE: [EXT] [PATCH] app/test-crypto-perf: fix invalid mbuf next operation
>
> Hi,
>
> > -----Original Message-----
> > From: Anoob Joseph <anoobj@marvell.com>
> > Sent: Wednesday, January 3, 2024 7:22 PM
> > To: Suanming Mou <suanmingm@nvidia.com>
> > Cc: dev@dpdk.org; Ciara Power <ciara.power@intel.com>
> > Subject: RE: [EXT] [PATCH] app/test-crypto-perf: fix invalid mbuf next
> > operation
> >
> > Hi Suanming,
> >
> > Good catch. Please see inline.
> >
> > Thanks,
> > Anoob
> >
> > > -----Original Message-----
> > > From: Suanming Mou <suanmingm@nvidia.com>
> > > Sent: Wednesday, January 3, 2024 9:24 AM
> > > To: Ciara Power <ciara.power@intel.com>
> > > Cc: dev@dpdk.org
> > > Subject: [EXT] [PATCH] app/test-crypto-perf: fix invalid mbuf next
> > > operation
> > >
> > > External Email
> > >
> > > --------------------------------------------------------------------
> > > -- In fill_multi_seg_mbuf(), when remaining_segments is 0, rte_mbuf
> > > m's next should pointer to NULL instead of a new rte_mbuf, that
> > > casues setting m->next as NULL out of the while loop to the invalid
> > > mbuf.
> > >
> > > This commit fixes the invalid mbuf next operation.
> > >
> > > Fixes: bf9d6702eca9 ("app/crypto-perf: use single mempool")
> > >
> > > Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
> > > ---
> > > app/test-crypto-perf/cperf_test_common.c | 12 +++++++-----
> > > 1 file changed, 7 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/app/test-crypto-perf/cperf_test_common.c
> > > b/app/test-crypto- perf/cperf_test_common.c index
> > > 932aab16df..ad2076dd2e 100644
> > > --- a/app/test-crypto-perf/cperf_test_common.c
> > > +++ b/app/test-crypto-perf/cperf_test_common.c
> > > @@ -72,13 +72,15 @@ fill_multi_seg_mbuf(struct rte_mbuf *m, struct
> > > rte_mempool *mp,
> > > rte_mbuf_refcnt_set(m, 1);
> > > next_mbuf = (struct rte_mbuf *) ((uint8_t *) m +
> > > mbuf_hdr_size + segment_sz);
> > > - m->next = next_mbuf;
> > > - m = next_mbuf;
> > > - remaining_segments--;
> > >
> > > + remaining_segments--;
> > > + if (remaining_segments > 0) {
> >
> > [Anoob] Would it make sense to move assignment of next_mbuf also to here?
> > That way, the checks will become self explanatory.
> > next_mbuf = (struct rte_mbuf *) ((uint8_t *) m +
> > mbuf_hdr_size + segment_sz);
> >
>
> Make sense. Maybe just like that:
> m->next = (struct rte_mbuf *) ((uint8_t *) m +
> mbuf_hdr_size + segment_sz);
> m = m->next;
>
> What do you think?
[Anoob] Yes. That's even better.
I think we can have line lengths upto 100 characters now. In case you find it easier to put in single line.
>
> > > + m->next = next_mbuf;
> > > + m = next_mbuf;
> > > + } else {
> > > + m->next = NULL;
> > > + }
> > > } while (remaining_segments > 0);
> > > -
> > > - m->next = NULL;
> > > }
> > >
> > > static void
> > > --
> > > 2.34.1
next prev parent reply other threads:[~2024-01-03 15:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-03 3:53 Suanming Mou
2024-01-03 11:21 ` [EXT] " Anoob Joseph
2024-01-03 12:35 ` Suanming Mou
2024-01-03 15:42 ` Anoob Joseph [this message]
2024-01-04 2:23 ` Suanming Mou
2024-01-04 2:24 ` [PATCH v2] " Suanming Mou
2024-01-04 4:17 ` [EXT] " Anoob Joseph
2024-01-12 16:04 ` Power, Ciara
2024-02-01 8:45 ` [EXT] " Akhil Goyal
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=PH0PR18MB467266AB47A96E1B17BF4340DF60A@PH0PR18MB4672.namprd18.prod.outlook.com \
--to=anoobj@marvell.com \
--cc=ciara.power@intel.com \
--cc=dev@dpdk.org \
--cc=suanmingm@nvidia.com \
/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;
as well as URLs for NNTP newsgroup(s).