DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/3] segment sanity checks
@ 2018-09-10  5:45 David Marchand
  2018-09-10  5:45 ` [dpdk-dev] [PATCH 1/3] mbuf: add sanity checks on segment metadata David Marchand
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: David Marchand @ 2018-09-10  5:45 UTC (permalink / raw)
  To: dev; +Cc: olivier.matz, wenzhuo.lu, jingjing.wu, bernard.iremonger

Here is a little series which helped me identify a multi segment issue.
Hope it can help others.

The difference since the RFC patches I sent some time ago is that, rather
than force the user to build the dpdk with CONFIG_RTE_LIBRTE_MBUF_DEBUG
enabled, it uses rx/tx callbacks to apply checks on the mbufs.

This is not perfect, since when an invalid mbuf is detected, we try to free
it and a crash is possible at this time (depends on what went wrong).

On the rx side, this is better than let this packet go through the
application and we end up with harder to identify issues.
On the tx side, this is more about validating that the application did not
break the mbuf before passing it to the driver.

Example:
./testpmd -l 2,14 --socket-mem 2048,0 -w 0000:03:00.0 -w 0000:03:00.1 -- -i
[...]
testpmd> port stop all
testpmd> port config all sanity_check rx+tx
testpmd> port config all scatter on
testpmd> port start all
Configuring Port 0 (socket 0)
Port 0: F4:E9:D4:ED:B4:06
Configuring Port 1 (socket 0)
Port 1: F4:E9:D4:ED:B4:07
Checking link statuses...
Done
testpmd> port config mtu 0 9000
testpmd> port config mtu 1 9000
testpmd> start
testpmd: invalid rx mbuf on port 1 queue 0: data length too big in mbuf segment

testpmd> set verbose 1
Change verbose level from 0 to 1
dump mbuf at 0x7f48db9fa740, iova=2291fa7c0, buf_len=2176
  pkt_len=8014, ol_flags=180, nb_segs=4, in_port=1
  segment at 0x7f48db9fa740, data=0x7f48db9fa840, data_len=2112
  segment at 0x7f48db9fb080, data=0x7f48db9fb180, data_len=2112
  segment at 0x7f48db9fb9c0, data=0x7f48db9fbac0, data_len=2112
  segment at 0x7f48db9fc300, data=0x7f48db9fc400, data_len=1678
testpmd: invalid rx mbuf on port 1 queue 0: data length too big in mbuf segment


-- 
David Marchand

David Marchand (3):
  mbuf: add sanity checks on segment metadata
  mbuf: add a non fatal sanity check helper
  app/testpmd: add sanity checks on received/sent packets

 app/test-pmd/cmdline.c               |  63 ++++++++++++++
 app/test-pmd/config.c                |  23 +++++
 app/test-pmd/parameters.c            |   7 ++
 app/test-pmd/testpmd.c               | 123 +++++++++++++++++++++++++++
 app/test-pmd/testpmd.h               |   9 ++
 lib/librte_mbuf/Makefile             |   2 +
 lib/librte_mbuf/meson.build          |   2 +
 lib/librte_mbuf/rte_mbuf.c           |  71 ++++++++++++----
 lib/librte_mbuf/rte_mbuf.h           |  23 +++++
 lib/librte_mbuf/rte_mbuf_version.map |   6 ++
 10 files changed, 312 insertions(+), 17 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2018-10-09  9:11 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).