Skip to content

segment sanity checks

David Marchand dpdk-dev 1 version Applied

Status from this message: Applied, thanks

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest3 patches 2 repliesApplied

Changes in v2 from the cover letter

- dropped unnecessary casts in patch 1,
- rewrote patch 3: reused the existing rx/tx callbacks and left the invalid mbufs in rx bulk

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3mbuf: add sanity checks on segment metadatalib/librte_mbuf/rte_mbuf.c+4 -00 replies
2/3mbuf: add a non fatal sanity check helperlib/librte_mbuf/Makefile lib/librte_mbuf/meson.build lib/librte_mbuf/rte_mbuf.c +2 more+86 -210 replies
3/3app/testpmd: check mbufs in verbose modeapp/test-pmd/util.c+3 -01 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchOlivier MatzBernard Iremonger
1/3A-b
2/3A-b
3/3A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] segment sanity checks

Resubmitting this series that I did not finish in my previous life (6WIND people are okay with this).

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.

Changelog since v1:
- dropped unnecessary casts in patch 1,
- rewrote patch 3: reused the existing rx/tx callbacks and left the invalid mbufs in rx bulk

Example (with [1] that generates invalid mbufs):
./testpmd --no-huge -l 2,3 -m 512 --log-level *:debug --vdev=eth_ring0
--vdev=eth_ring1 -- -i --total-num-mbufs 2048

[...]

testpmd> set verbose 1
testpmd> set burst 4
Number of packets per burst set to 4
testpmd> start tx_first
port 0/queue 0: received 4 packets
src=00:00:00:00:00:00 - dst=02:00:00:00:00:00 - type=0x0800 - length=64
- nb_segs=2 - sw ptype: L2_ETHER L3_IPV4 L4_UDP - l2_len=14 - l3_len=20
- l4_len=8 - Receive queue=0x0
ol_flags: PKT_RX_L4_CKSUM_UNKNOWN PKT_RX_IP_CKSUM_UNKNOWN
PKT_RX_OUTER_L4_CKSUM_UNKNOWN
INVALID mbuf: bad nb_segs
src=00:00:00:00:00:00 - dst=02:00:00:00:00:00 - type=0x0800 - length=64
- nb_segs=1 - sw ptype: L2_ETHER L3_IPV4 L4_UDP - l2_len=14 - l3_len=20
- l4_len=8 - Receive queue=0x0
ol_flags: PKT_RX_L4_CKSUM_UNKNOWN PKT_RX_IP_CKSUM_UNKNOWN
PKT_RX_OUTER_L4_CKSUM_UNKNOWN
INVALID mbuf: bad pkt_len
src=00:00:00:00:00:00 - dst=02:00:00:00:00:00 - type=0x0800 - length=64
- nb_segs=1 - sw ptype: L2_ETHER L3_IPV4 L4_UDP - l2_len=14 - l3_len=20
- l4_len=8 - Receive queue=0x0
ol_flags: PKT_RX_L4_CKSUM_UNKNOWN PKT_RX_IP_CKSUM_UNKNOWN
PKT_RX_OUTER_L4_CKSUM_UNKNOWN
INVALID mbuf: bad nb_segs
src=00:00:00:00:00:00 - dst=02:00:00:00:00:00 - type=0x0800 - length=64
- nb_segs=2 - sw ptype: L2_ETHER L3_IPV4 L4_UDP - l2_len=14 - l3_len=20
- l4_len=8 - Receive queue=0x0
ol_flags: PKT_RX_L4_CKSUM_UNKNOWN PKT_RX_IP_CKSUM_UNKNOWN
PKT_RX_OUTER_L4_CKSUM_UNKNOWN
INVALID mbuf: bad nb_segs
port 1/queue 0: received 4 packets
[...]
testpmd> stop

1: https://github.com/david-marchand/dpdk/commit/601630d8db0e

Signature · 17 lines
David Marchand

David Marchand (3):
  mbuf: add sanity checks on segment metadata
  mbuf: add a non fatal sanity check helper
  app/testpmd: check mbufs in verbose mode

 app/test-pmd/util.c                  |  3 ++
 lib/librte_mbuf/Makefile             |  2 ++
 lib/librte_mbuf/meson.build          |  2 ++
 lib/librte_mbuf/rte_mbuf.c           | 70 +++++++++++++++++++++++++++---------
 lib/librte_mbuf/rte_mbuf.h           | 23 ++++++++++++
 lib/librte_mbuf/rte_mbuf_version.map |  6 ++++
 6 files changed, 89 insertions(+), 17 deletions(-)

-- 
1.8.3.1