From patchwork Mon Jan 7 08:57:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 49459 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1C3E01B45A; Mon, 7 Jan 2019 09:57:21 +0100 (CET) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 7321A1B457 for ; Mon, 7 Jan 2019 09:57:20 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5A0EF87628; Mon, 7 Jan 2019 08:57:19 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-117-97.ams2.redhat.com [10.36.117.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id BED48600CC; Mon, 7 Jan 2019 08:57:17 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: olivier.matz@6wind.com, yskoh@mellanox.com, arybchenko@solarflare.com, bernard.iremonger@intel.com Date: Mon, 7 Jan 2019 09:57:09 +0100 Message-Id: <1546851432-19397-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 07 Jan 2019 08:57:19 +0000 (UTC) Subject: [dpdk-dev] [PATCH v2 0/3] segment sanity checks X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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