public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Marat Khalili <marat.khalili@huawei.com>
To: "Morten Brørup" <mb@smartsharesystems.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Christophe Fontaine <cfontain@redhat.com>,
	Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>,
	Wathsala Vithanage <wathsala.vithanage@arm.com>,
	"stable@dpdk.org" <stable@dpdk.org>
Subject: RE: [PATCH v2] mbuf: fix read packet data
Date: Thu, 19 Mar 2026 14:21:33 +0000	[thread overview]
Message-ID: <da1693e3aef3481583356e9e7393a8fa@huawei.com> (raw)
In-Reply-To: <20260319124329.729034-1-mb@smartsharesystems.com>

Acked-by: Marat Khalili <marat.khalili@huawei.com>
Tested-by: Marat Khalili <marat.khalili@huawei.com>

Good idea to clarify check texts in the test.

> diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
> index a41d2d0f97..db23259745 100644
> --- a/app/test/test_mbuf.c
> +++ b/app/test/test_mbuf.c
> @@ -2037,13 +2037,13 @@ test_pktmbuf_read_from_offset(struct rte_mempool *pktmbuf_pool)
>  	/* read length greater than mbuf data_len */
>  	if (rte_pktmbuf_read(m, hdr_len, rte_pktmbuf_data_len(m) + 1,
>  				NULL) != NULL)
> -		GOTO_FAIL("%s: Requested len is larger than mbuf data len!\n",
> +		GOTO_FAIL("%s: Requested offset + len is larger than mbuf data len!\n",
>  				__func__);

Another strange check tbh, there is nothing wrong with reading beyond mbuf data
length. This only fails because we are reading beyond packet length, which is
tested immediately after. I'd vote to delete it, although it has nothing to do
with the patch. This is just a general comment, not an issue.

> 
>  	/* read length greater than mbuf pkt_len */
>  	if (rte_pktmbuf_read(m, hdr_len, rte_pktmbuf_pkt_len(m) + 1,
>  				NULL) != NULL)
> -		GOTO_FAIL("%s: Requested len is larger than mbuf pkt len!\n",
> +		GOTO_FAIL("%s: Requested offset + len is larger than mbuf pkt len!\n",
>  				__func__);
> 
>  	/* read data of zero len from valid offset */


  parent reply	other threads:[~2026-03-19 14:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-19  8:40 [PATCH] mbuf: fix read packet data Morten Brørup
2026-03-19  9:36 ` Marat Khalili
2026-03-19 12:43 ` [PATCH v2] " Morten Brørup
2026-03-19 13:15   ` Konstantin Ananyev
2026-03-19 13:55     ` Morten Brørup
2026-03-19 14:21   ` Marat Khalili [this message]
2026-03-19 14:31     ` Morten Brørup
2026-03-25 22:33   ` Thomas Monjalon

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=da1693e3aef3481583356e9e7393a8fa@huawei.com \
    --to=marat.khalili@huawei.com \
    --cc=cfontain@redhat.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.v.ananyev@yandex.ru \
    --cc=mb@smartsharesystems.com \
    --cc=stable@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=wathsala.vithanage@arm.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