DPDK patches and discussions
 help / color / mirror / Atom feed
From: Olivier Matz <olivier.matz@6wind.com>
To: David Marchand <david.marchand@6wind.com>
Cc: Yongseok Koh <yskoh@mellanox.com>, "dev@dpdk.org" <dev@dpdk.org>,
	"wenzhuo.lu@intel.com" <wenzhuo.lu@intel.com>,
	"jingjing.wu@intel.com" <jingjing.wu@intel.com>,
	"bernard.iremonger@intel.com" <bernard.iremonger@intel.com>
Subject: Re: [dpdk-dev] [PATCH 1/3] mbuf: add sanity checks on segment metadata
Date: Tue, 9 Oct 2018 11:11:35 +0200	[thread overview]
Message-ID: <20181009091135.omavbr56dchdaauz@platinum> (raw)
In-Reply-To: <CALwxeUsxu7m-MaNG=VHmT_1BRjjL++4TrKkp0QZNWqKidAmR-A@mail.gmail.com>

Hi David,

On Thu, Sep 13, 2018 at 08:55:40AM +0200, David Marchand wrote:
> Hello Yongseok,
> 
> On Tue, Sep 11, 2018 at 8:16 PM, Yongseok Koh <yskoh@mellanox.com> wrote:
> >
> >> On Sep 9, 2018, at 10:45 PM, David Marchand <david.marchand@6wind.com> wrote:
> >>
> >> Add some basic checks on the segments offset and length metadata:
> >> always funny to have a < 0 tailroom cast to uint16_t ;-).
> >>
> >> Signed-off-by: David Marchand <david.marchand@6wind.com>
> >> ---
> >> lib/librte_mbuf/rte_mbuf.c | 5 +++++
> >> 1 file changed, 5 insertions(+)
> >>
> >> diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
> >> index e714c5a59..137a320ed 100644
> >> --- a/lib/librte_mbuf/rte_mbuf.c
> >> +++ b/lib/librte_mbuf/rte_mbuf.c
> >> @@ -200,6 +200,11 @@ rte_mbuf_sanity_check(const struct rte_mbuf *m, int is_header)
> >>       pkt_len = m->pkt_len;
> >>
> >>       do {
> >> +             if (m->data_off > m->buf_len)
> >> +                     rte_panic("data offset too big in mbuf segment\n");
> >> +             if ((uint32_t)m->data_off + (uint32_t)m->data_len >
> >> +                             (uint32_t)m->buf_len)
> >
> > Casting to uint32_t is needed? All of the three fields are uint16_t and it would
> > anyway happen because of the integer promotion rule. Right?
> 
> Indeed, this is unnecessary.
> Will send a v2 without this.

You can add my ack in your v2 with this change.

Thanks,
Olivier

  reply	other threads:[~2018-10-09  9:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-10  5:45 [dpdk-dev] [PATCH 0/3] segment sanity checks David Marchand
2018-09-10  5:45 ` [dpdk-dev] [PATCH 1/3] mbuf: add sanity checks on segment metadata David Marchand
2018-09-11 18:16   ` Yongseok Koh
2018-09-13  6:55     ` David Marchand
2018-10-09  9:11       ` Olivier Matz [this message]
2018-09-10  5:45 ` [dpdk-dev] [PATCH 2/3] mbuf: add a non fatal sanity check helper David Marchand
2018-09-10  5:56   ` David Marchand
2018-09-10  8:12   ` Andrew Rybchenko
2018-09-10  8:24     ` David Marchand
2018-09-10  8:33       ` Andrew Rybchenko
2018-10-09  9:10         ` Olivier Matz
2018-09-10  5:45 ` [dpdk-dev] [PATCH 3/3] app/testpmd: add sanity checks on received/sent packets David Marchand
2018-09-25 13:17   ` Iremonger, Bernard
2018-09-25 15:11     ` David Marchand

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=20181009091135.omavbr56dchdaauz@platinum \
    --to=olivier.matz@6wind.com \
    --cc=bernard.iremonger@intel.com \
    --cc=david.marchand@6wind.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=wenzhuo.lu@intel.com \
    --cc=yskoh@mellanox.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).