From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2157445710; Thu, 1 Aug 2024 12:55:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0BA59433DA; Thu, 1 Aug 2024 12:53:50 +0200 (CEST) Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010018.outbound.protection.outlook.com [52.101.69.18]) by mails.dpdk.org (Postfix) with ESMTP id 8C564433D8 for ; Thu, 1 Aug 2024 12:53:48 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PSEQd8fQkkB9e9kWIVh0g7i1jDPCZ+qhs/VRSZq+3nMjuZw1BrGjsOqnlDAVqrC5H9SPJp21uSJemVEECPvTbpkPJgV5MT0NZN/2HCyxw7Tqzooe81+tDt5SK8XZ6UkKbfs3+694cwx3id5ZrNnk4enJj14IMqxcqaayhdDBLjcakE1YHWql6Z8x11AwnCRkJGIC1VtWv83YkqDbEmz96MfstU9u0nYE5FzAVRXpgAXw+aR/ICEIPiKHXcU765EhcA3kNlBRJJlSIQ2gmo5wgaxwgWPc+zDJ5VTzB8YsLJD9xlZ3OdVhm6t1z/XgojJw0+6rTP9P4TO4c+cO8TPzSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ghJB9z6pLN1bMW6AgQPAFlHzLxoZhuhAxC93Fb6Og+8=; b=PkMjmeVKGfbirEUK6aG2erPpBIfPMhrOFjdzIGPRa624zZgzDb5hgIUCndhdln8dFgpjz5GmebBKM3ckPGtC9uMltRwCaFf/OtnHbk5lOd5L3oXlvBmnA2rGcww2k+BYpnRCM9lr1aoDvgn6nnml5QLLRFXzhbikBQ0JwbkMPpw1Nl/LyvT1N3dnR9jEIFRWOhvFOIZxhpNFfka9Rx8vITcahPZnX7RqLxU155aGKmvQ/hUKr2YtxwMSJDJN6oSpeM7zNme3WwgUBMWlIxKCcA3lR77xarim9zI1itBHU00hu2q6KDK/bYLwr5WSOGlxTqGtC+b0ISAXNdG2tKR5tA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ghJB9z6pLN1bMW6AgQPAFlHzLxoZhuhAxC93Fb6Og+8=; b=PiHYClj+NSvASFyTn3Pf4SidFPAWI+Vs+l6DuHaoU+oE2dNUQPsL2VqaJAIzvrSidOKzgLZXu2e5RV91CRJHXP1XJuObUoOer1TqIJhBhKApyfJ4HZ4ezTXj3OfxwV14/r/PrwTTiAqHzLoznEPiHb2+dUIyn61NqBZx24JBzOd43VbzAdVcVPKXh1ijDh8J8pC3DB3hiwMwER1Lqr6YNsgtUW5suWK4vDl1eMY997ciSH8B+/QYSnx5tTQy//GZ15EiIXFMq/AHu96aBN4qJRlBdaLRLYHErckWmbQImAV6IYKAqEp4Xbch/vaRoqIlfLlB4s9RfgmYyfGX/Eieeg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) by AS8PR04MB8433.eurprd04.prod.outlook.com (2603:10a6:20b:407::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.23; Thu, 1 Aug 2024 10:53:43 +0000 Received: from PAXPR04MB9328.eurprd04.prod.outlook.com ([fe80::367:d59:375:fb87]) by PAXPR04MB9328.eurprd04.prod.outlook.com ([fe80::367:d59:375:fb87%3]) with mapi id 15.20.7828.021; Thu, 1 Aug 2024 10:53:43 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@amd.com, Jun Yang Subject: [PATCH 11/17] net/dpaa: enhance DPAA frame display Date: Thu, 1 Aug 2024 16:23:07 +0530 Message-Id: <20240801105313.630280-12-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240801105313.630280-1-hemant.agrawal@nxp.com> References: <20240801105313.630280-1-hemant.agrawal@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2P153CA0026.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::13) To PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9328:EE_|AS8PR04MB8433:EE_ X-MS-Office365-Filtering-Correlation-Id: bd348746-cdb4-4e18-075e-08dcb21835d2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|366016|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?bDCjcuceNFlP0KlbOzPRA5hfVWUIvxTRx8e/oXIclk4xg28eKGcMwohCnrvq?= =?us-ascii?Q?LLh+1PF0Cvjcw4GFG+lrgUym6KeXyRbyJHYIcMzv+j6CC8gwT0WqNrne13f5?= =?us-ascii?Q?5J/rdKK1tmK2e3yQmsxeZ/B2mtfVJ7BhFzAkBxmsL5SIiG/7+oWRUPQigJBg?= =?us-ascii?Q?9ik9lhtaavmzwnlpM0T3eD43q4jVXSaPwy8KJoEkDK++eG1Zg6WXnXMgHbyP?= =?us-ascii?Q?rlBXLPVGo6k6vfdrff9LhG0iPZk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ii?Q?a5NDIkKPIJ/TorxQAGniGIgXB3RNNY6eVTEaGpFALKj6YYxnt9RflrJavSpc?= =?us-ascii?Q?mppUOSWiM0RNWVO28rgxxZOcT9aO+emv4BwobiGvVDvmQL4hSDjqpKwXOEPb?= =?us-ascii?Q?OQvgtB2WVTE7wsKLLb0TIoh5NmNXEUiIjqTs8oRSWXNbJgVB20Ok6I3DlwXv?= =?us-ascii?Q?KM5A1CJ+tfRmUVvPbOEDKh31adMhnyFtvkV0IGcBgC3SshhnFx5CbNahXOrC?= =?us-ascii?Q?16Gjlf7Rcx0qatn67hjDK+51OtVmgYoHQLkCEFDyz0HMFaHXCQ=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB9328.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(366016)(52116014)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Jth4wBf5RXVIMbAMIsE0ugU0EPZrcOOVlR3HkEz5rStoxpxe6cRHKHM6bSHh?= =?us-ascii?Q?cnDz1+/XfqaVb3DYTJ4OpPbClQ3QOsW1gZdp4CoJ7S3AVWL6CULPAUIh66V4?= =?us-ascii?Q?PAYMBgc29beiR9hua081/+LVoyNl95XHhDwdIwuFsY123jZOigdk9D9zKcCr?= =?us-ascii?Q?3g49b+aR4m4uoGSpI2DZMTQOMdrXN15FUySuUEUlOgSOxiXnc3jjCTTwj5xN?= =?us-ascii?Q?O8QoAWbZYC++6lsoau9no8eWmc2uFWw3nRBTE9BSZCOytx33muSGb3INDLPg?= =?us-ascii?Q?WuDZs5bTv20mp0jxCq4hrKB3N1upoaJ7XzhOHLoJLwTIbYp58m6KqG/sLcoe?= =?us-ascii?Q?ZnzOexpBtpYpXdf0slzSAek61bmSNS07p0scRrjY7I1aTUL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/JKtDhJP2/cU951q9FAH0M8+46mUudBvQ2P5u5eG9dKbvE5Awq?= =?us-ascii?Q?rQewIfIqYywqKqDbB7RECzwbkrmbray0514CHmZ+h4bLU1C1RmH/6sI6us2R?= =?us-ascii?Q?4brnkCt4O8DS+fJNtKGp0k5HICxi3BaTgMMLOEw+BqyqjhFk8Vw53+wwY2ZH?= =?us-ascii?Q?akxcmvUJcyI4xYKWXd3JO+yXArKp4O2Np33tA61ywO5ELh5rbX742r8yEGQP?= =?us-ascii?Q?nMajBuW8WvWWxMlI/aagtrBBhybYgWEYCmG0T1QFztmEv/2s2+Mdo0NI4y+n?= =?us-ascii?Q?MmsIiBvwcwNroTGAB9ZtOnkZqWcIqLAFNz6fY6KQYIZ6BcQABfsqAHYA+fh8?= =?us-ascii?Q?qQ=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bd348746-cdb4-4e18-075e-08dcb21835d2 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9328.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2024 10:53:43.3001 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HHwc3J3Rx4U6Uu0P6o5hDqCqBnQxL4Ho60mpuzaZt9FXl+Uq9+Dm4WWvlhUpzL/dWKJo9nDaiXlU7KKpMnZWMA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8433 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 This patch enhances the received packet debugging capability. This help displaying the full packet parsing output. Signed-off-by: Jun Yang Signed-off-by: Hemant Agrawal --- doc/guides/nics/dpaa.rst | 5 ++ drivers/net/dpaa/dpaa_ethdev.c | 6 ++ drivers/net/dpaa/dpaa_rxtx.c | 138 +++++++++++++++++++++++++++------ drivers/net/dpaa/dpaa_rxtx.h | 5 ++ 4 files changed, 130 insertions(+), 24 deletions(-) diff --git a/doc/guides/nics/dpaa.rst b/doc/guides/nics/dpaa.rst index 580edd9327..448607e9ac 100644 --- a/doc/guides/nics/dpaa.rst +++ b/doc/guides/nics/dpaa.rst @@ -227,6 +227,11 @@ state during application initialization: application want to use eventdev with DPAA device. Currently these queues are not used for LS1023/LS1043 platform by default. +- ``DPAA_DISPLAY_FRAME_AND_PARSER_RESULT`` (default 0) + + This defines the debug flag, whether to dump the detailed frame and packet + parsing result for the incoming packets. + Driver compilation and testing ------------------------------ diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index e92f1c25b2..979220a700 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -2094,6 +2094,12 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) td_tx_threshold = CGR_RX_PERFQ_THRESH; } +#ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER + penv = getenv("DPAA_DISPLAY_FRAME_AND_PARSER_RESULT"); + if (penv) + dpaa_force_display_frame_set(atoi(penv)); +#endif + /* If congestion control is enabled globally*/ if (num_rx_fqs > 0 && td_threshold) { dpaa_intf->cgr_rx = rte_zmalloc(NULL, diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 588a78a50c..56b4ce1056 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -47,6 +47,10 @@ #include #include +#ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER +static int s_force_display_frm; +#endif + #define DPAA_MBUF_TO_CONTIG_FD(_mbuf, _fd, _bpid) \ do { \ (_fd)->opaque_addr = 0; \ @@ -58,37 +62,122 @@ } while (0) #ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER +void +dpaa_force_display_frame_set(int set) +{ + s_force_display_frm = set; +} + #define DISPLAY_PRINT printf -static void dpaa_display_frame_info(const struct qm_fd *fd, - uint32_t fqid, bool rx) +static void +dpaa_display_frame_info(const struct qm_fd *fd, + uint32_t fqid, bool rx) { - int ii; - char *ptr; + int pos, offset = 0; + char *ptr, info[1024]; struct annotations_t *annot = rte_dpaa_mem_ptov(fd->addr); uint8_t format; + const struct dpaa_eth_parse_results_t *psr; - if (!fd->status) { - /* Do not display correct packets.*/ + if (!fd->status && !s_force_display_frm) { + /* Do not display correct packets unless force display.*/ return; } + psr = &annot->parse; - format = (fd->opaque & DPAA_FD_FORMAT_MASK) >> - DPAA_FD_FORMAT_SHIFT; - - DISPLAY_PRINT("fqid %d bpid %d addr 0x%lx, format %d\r\n", - fqid, fd->bpid, (unsigned long)fd->addr, fd->format); - DISPLAY_PRINT("off %d, len %d stat 0x%x\r\n", - fd->offset, fd->length20, fd->status); + format = (fd->opaque & DPAA_FD_FORMAT_MASK) >> DPAA_FD_FORMAT_SHIFT; + if (format == qm_fd_contig) + sprintf(info, "simple"); + else if (format == qm_fd_sg) + sprintf(info, "sg"); + else + sprintf(info, "unknown format(%d)", format); + + DISPLAY_PRINT("%s: fqid=%08x, bpid=%d, phy addr=0x%lx ", + rx ? "RX" : "TX", fqid, fd->bpid, (unsigned long)fd->addr); + DISPLAY_PRINT("format=%s offset=%d, len=%d, stat=0x%x\r\n", + info, fd->offset, fd->length20, fd->status); if (rx) { - ptr = (char *)&annot->parse; - DISPLAY_PRINT("RX parser result:\r\n"); - for (ii = 0; ii < (int)sizeof(struct dpaa_eth_parse_results_t); - ii++) { - DISPLAY_PRINT("%02x ", ptr[ii]); - if (((ii + 1) % 16) == 0) - DISPLAY_PRINT("\n"); + DISPLAY_PRINT("Display usual RX parser result:\r\n"); + if (psr->eth_frame_type == 0) + offset += sprintf(&info[offset], "unicast"); + else if (psr->eth_frame_type == 1) + offset += sprintf(&info[offset], "multicast"); + else if (psr->eth_frame_type == 3) + offset += sprintf(&info[offset], "broadcast"); + else + offset += sprintf(&info[offset], "unknown eth type(%d)", + psr->eth_frame_type); + if (psr->l2r_err) { + offset += sprintf(&info[offset], " L2 error(%d)", + psr->l2r_err); + } else { + offset += sprintf(&info[offset], " L2 non error"); } - DISPLAY_PRINT("\n"); + DISPLAY_PRINT("L2: %s, %s, ethernet type:%s\r\n", + psr->ethernet ? "is ethernet" : "non ethernet", + psr->vlan ? "is vlan" : "non vlan", info); + + offset = 0; + DISPLAY_PRINT("L3: %s/%s, %s/%s, %s, %s\r\n", + psr->first_ipv4 ? "first IPv4" : "non first IPv4", + psr->last_ipv4 ? "last IPv4" : "non last IPv4", + psr->first_ipv6 ? "first IPv6" : "non first IPv6", + psr->last_ipv6 ? "last IPv6" : "non last IPv6", + psr->gre ? "GRE" : "non GRE", + psr->l3_err ? "L3 has error" : "L3 non error"); + + if (psr->l4_type == DPAA_PR_L4_TCP_TYPE) { + offset += sprintf(&info[offset], "tcp"); + } else if (psr->l4_type == DPAA_PR_L4_UDP_TYPE) { + offset += sprintf(&info[offset], "udp"); + } else if (psr->l4_type == DPAA_PR_L4_IPSEC_TYPE) { + offset += sprintf(&info[offset], "IPSec "); + if (psr->esp_sum) + offset += sprintf(&info[offset], "ESP"); + if (psr->ah) + offset += sprintf(&info[offset], "AH"); + } else if (psr->l4_type == DPAA_PR_L4_SCTP_TYPE) { + offset += sprintf(&info[offset], "sctp"); + } else if (psr->l4_type == DPAA_PR_L4_DCCP_TYPE) { + offset += sprintf(&info[offset], "dccp"); + } else { + offset += sprintf(&info[offset], "unknown l4 type(%d)", + psr->l4_type); + } + DISPLAY_PRINT("L4: type:%s, L4 validation %s\r\n", + info, psr->l4cv ? "Performed" : "NOT performed"); + + offset = 0; + if (psr->ethernet) { + offset += sprintf(&info[offset], + "Eth offset=%d, ethtype offset=%d, ", + psr->eth_off, psr->etype_off); + } + if (psr->vlan) { + offset += sprintf(&info[offset], "vLAN offset=%d, ", + psr->vlan_off[0]); + } + if (psr->first_ipv4 || psr->first_ipv6) { + offset += sprintf(&info[offset], "first IP offset=%d, ", + psr->ip_off[0]); + } + if (psr->last_ipv4 || psr->last_ipv6) { + offset += sprintf(&info[offset], "last IP offset=%d, ", + psr->ip_off[1]); + } + if (psr->gre) { + offset += sprintf(&info[offset], "GRE offset=%d, ", + psr->gre_off); + } + if (psr->l4_type >= DPAA_PR_L4_TCP_TYPE) { + offset += sprintf(&info[offset], "L4 offset=%d, ", + psr->l4_off); + } + offset += sprintf(&info[offset], "Next HDR(0x%04x) offset=%d.", + rte_be_to_cpu_16(psr->nxthdr), psr->nxthdr_off); + + DISPLAY_PRINT("%s\r\n", info); } if (unlikely(format == qm_fd_sg)) { @@ -99,13 +188,14 @@ static void dpaa_display_frame_info(const struct qm_fd *fd, DISPLAY_PRINT("Frame payload:\r\n"); ptr = (char *)annot; ptr += fd->offset; - for (ii = 0; ii < fd->length20; ii++) { - DISPLAY_PRINT("%02x ", ptr[ii]); - if (((ii + 1) % 16) == 0) + for (pos = 0; pos < fd->length20; pos++) { + DISPLAY_PRINT("%02x ", ptr[pos]); + if (((pos + 1) % 16) == 0) DISPLAY_PRINT("\n"); } DISPLAY_PRINT("\n"); } + #else #define dpaa_display_frame_info(a, b, c) #endif diff --git a/drivers/net/dpaa/dpaa_rxtx.h b/drivers/net/dpaa/dpaa_rxtx.h index 215bdeaf7f..392926e286 100644 --- a/drivers/net/dpaa/dpaa_rxtx.h +++ b/drivers/net/dpaa/dpaa_rxtx.h @@ -274,4 +274,9 @@ void dpaa_rx_cb_prepare(struct qm_dqrr_entry *dq, void **bufs); void dpaa_rx_cb_no_prefetch(struct qman_fq **fq, struct qm_dqrr_entry **dqrr, void **bufs, int num_bufs); +#ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER +void +dpaa_force_display_frame_set(int set); +#endif + #endif -- 2.25.1