From patchwork Mon Mar 18 08:02:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 138441 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BB34B43CE0; Mon, 18 Mar 2024 09:02:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 494CB4027F; Mon, 18 Mar 2024 09:02:53 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 286FF4026E for ; Mon, 18 Mar 2024 09:02:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710748971; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mXxYsZeLnoypJymJnXT+8RYVhfCrubrmojVvic1rLf4=; b=WVXmV2R/BWj6cEr54v0hntPgv/XXkLD4RQbicupw7SBQuuNQQ/0RCsffkvG9B7mqnF3DZK PXBRIG3QyM3YqgpQZir1PMdt4Y/FVauk7QLMLgr7Ybm0OotzE/1JqvAVWcZ8EYBz9Asaia 0ObTCK2a5sO/obOKbHg5VUu4ruOZXkM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-509-zLOR6E9pOj2YfcWAHSMA9g-1; Mon, 18 Mar 2024 04:02:48 -0400 X-MC-Unique: zLOR6E9pOj2YfcWAHSMA9g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A46D38F8F62; Mon, 18 Mar 2024 08:02:47 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.225.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id E1D9BC26C01; Mon, 18 Mar 2024 08:02:46 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Aman Singh , Yuying Zhang Subject: [PATCH] app/testpmd: dump TCI when asking for VLAN insertion Date: Mon, 18 Mar 2024 09:02:37 +0100 Message-ID: <20240318080237.2170473-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org I got some report for users that VLAN insertion was not working as the only thing they could see in verbose mode was a 0x0800 ethertype even though the RTE_MBUF_F_TX_VLAN flag was shown. Dump the VLAN TCI from mbuf metadata when VLAN insertion is requested. This should enhance the situation. Before: src=76:4E:EA:3F:78:1D - dst=50:7C:6F:3C:10:5B - pool=mb_pool_1 - type=0x0800 - length=64 - nb_segs=1 - sw ptype: L2_ETHER L3_IPV4 L4_UDP - l2_len=14 - l3_len=20 - l4_len=8 - Send queue=0x0 ol_flags: RTE_MBUF_F_TX_VLAN RTE_MBUF_F_TX_L4_NO_CKSUM After: src=76:4E:EA:3F:78:1D - dst=50:7C:6F:3C:10:5B - pool=mb_pool_1 - type=0x0800 - length=64 - nb_segs=1 - VLAN tci=0x2a - sw ptype: L2_ETHER L3_IPV4 L4_UDP - l2_len=14 - l3_len=20 - l4_len=8 - Send queue=0x0 ol_flags: RTE_MBUF_F_TX_VLAN RTE_MBUF_F_TX_L4_NO_CKSUM Signed-off-by: David Marchand Reviewed-by: Ferruh Yigit --- app/test-pmd/util.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c index 5aa69ed545..bf9b639d95 100644 --- a/app/test-pmd/util.c +++ b/app/test-pmd/util.c @@ -180,11 +180,13 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[], if (is_timestamp_enabled(mb)) MKDUMPSTR(print_buf, buf_size, cur_len, " - timestamp %"PRIu64" ", get_timestamp(mb)); - if (ol_flags & RTE_MBUF_F_RX_QINQ) + if ((is_rx && (ol_flags & RTE_MBUF_F_RX_QINQ) != 0) || + (!is_rx && (ol_flags & RTE_MBUF_F_TX_QINQ) != 0)) MKDUMPSTR(print_buf, buf_size, cur_len, " - QinQ VLAN tci=0x%x, VLAN tci outer=0x%x", mb->vlan_tci, mb->vlan_tci_outer); - else if (ol_flags & RTE_MBUF_F_RX_VLAN) + else if ((is_rx && (ol_flags & RTE_MBUF_F_RX_VLAN) != 0) || + (!is_rx && (ol_flags & RTE_MBUF_F_TX_VLAN) != 0)) MKDUMPSTR(print_buf, buf_size, cur_len, " - VLAN tci=0x%x", mb->vlan_tci); if (!is_rx && (ol_flags & RTE_MBUF_DYNFLAG_TX_METADATA))