mbox series

[v2,0/3] segment sanity checks

Message ID 1546851432-19397-1-git-send-email-david.marchand@redhat.com (mailing list archive)
Headers
Series segment sanity checks |

Message

David Marchand Jan. 7, 2019, 8:57 a.m. UTC
  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
  

Comments

Thomas Monjalon Jan. 15, 2019, 1:33 a.m. UTC | #1
07/01/2019 09:57, David Marchand:
> 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

Applied, thanks