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 570FC45843; Fri, 23 Aug 2024 09:34:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CF718432C2; Fri, 23 Aug 2024 09:33:24 +0200 (CEST) Received: from AM0PR83CU005.outbound.protection.outlook.com (mail-westeuropeazon11010043.outbound.protection.outlook.com [52.101.69.43]) by mails.dpdk.org (Postfix) with ESMTP id 8F8B34300B for ; Fri, 23 Aug 2024 09:33:16 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NyDc+pmYJ3wHvjtKvZyCgJV3pRQRA2HzmMRdQtvCyFGBhexBOwjX/wPjFjBbIqOh0zRhehlgErNJrKIv3+n2L+iKKC6bX/qio/IdoE3J000cp4GRslXRIHE5NiXasjtwSkx83ESM87hdQRIIMA9ABW9j5EK8QSy23M/bdAtrlMPZb+KXLzcBhf1UY7AdxDBcz0nkKMVjq0F4teg4OAol0iaD5B4oPejWx3EhEDptu0Sr0c4ybxF7UNDe3xcOtp1X/isR3y4r+NUM/8011Bnq0lANkATCFxzJhjXY+GCwXYVcBlSTEd31PFEBpRflTLuGKe/6eEZ5vKl0TSDv3u7kWw== 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=vrr0W9Y4JWVDY974GQ5sb7u8NEO1zaLgrv1+Jg+xRfg=; b=R7oluM6G7GxyN3pkF5AFOj94V8N7N6YMCDOSjqi3OkLEHr88+905BhkKL7YCrsj6dsGXvd7qbzw3kcHivxwONbwlBU0bgvw3X1xBEAi4AZHuy1m6F/2lW1vbQQ1kwBVE/VKUSV2vYvEckUMwpD+j57LUlQxl8TTVmsr0BBAQn+YY4DDKfVm6UJV3yanfeSuUpkHUHcNvlWw57WWc+oniSN/yiWdj+zf+Ng1DEkOPudlEToW+8Ec6PrJ2TMLuejLpKZ0UmJz07YXZAkrKtFBHBR1tBNJjYZOwwWuSLaUUILNOBXpa27a8UcZ7NCmhY1gRb0qJD4X8IkjD5a8Knxdp4g== 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=vrr0W9Y4JWVDY974GQ5sb7u8NEO1zaLgrv1+Jg+xRfg=; b=C28e0kioUGRBCl90w7kDX9gaZ/Exx3CJESEMmP8wiUFMPURqeTgZvxwmcgLBdQGLQOsqJRtoDSuG6GUs+NEREhxZf2phm5on3crfxNkp5h2GkD/fnFO6FP7ruylHT5ie0s9ekIxZhN+Xp+QEAw3NrZ8mYxUQ2yfbgPKaOfhbZNvzj9ng5zUl1e8R4woOuS6QE+13DW+PW+qly6QGrhcp3jw0QWH9Rcjqnwih6kvHIK/rLnRqIWCPFixBFJKjVQvnGLacBKzdU3yd3n45jkmbSoJ4k/lrEu6PDsq98MCQDqhB6mTnhpgIOnEmiP+8awTLigyhZhYWdzPHaY90OO568Q== 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 DU2PR04MB8789.eurprd04.prod.outlook.com (2603:10a6:10:2e0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.18; Fri, 23 Aug 2024 07:33:15 +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.7875.019; Fri, 23 Aug 2024 07:33:15 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@intel.com, Jun Yang Subject: [PATCH v2 12/18] net/dpaa: enhance DPAA frame display Date: Fri, 23 Aug 2024 13:02:34 +0530 Message-Id: <20240823073240.3708320-13-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240823073240.3708320-1-hemant.agrawal@nxp.com> References: <20240801105313.630280-1-hemant.agrawal@nxp.com> <20240823073240.3708320-1-hemant.agrawal@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0028.apcprd02.prod.outlook.com (2603:1096:3:18::16) To PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9328:EE_|DU2PR04MB8789:EE_ X-MS-Office365-Filtering-Correlation-Id: bbd500a2-2cc9-48de-339f-08dcc345d9c4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|376014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?8242w6wAFY+ce98xXmQLLeAVVU3h7i94H/I8hoF9j7Rly6gZVXoiE5+NrQ4M?= =?us-ascii?Q?6UmrD9CvvjnaZW3GKQ4kACrVOfKiXqfvxiHG7lGIrnRTB2qkodhHDLpyW5hV?= =?us-ascii?Q?9pG1mmAYH8XsD6lE+Gv38aJnmImlPSau3bMHDf0gq/iDXmzHQt62Wrt5qVL8?= =?us-ascii?Q?vJlS4bN38ww4X173m5Qxz1JJAw7mWeAPmezVS012GvHxxS43I0+twudjxA6o?= =?us-ascii?Q?i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xDHEbsrggdct+WciO8wZ?= =?us-ascii?Q?HguH7oRExfFyTBpTWkkSsc56ljGpAe8h8SXjGNm3hRnnE4yYE0vptNvWrCAi?= =?us-ascii?Q?qP7BuyZnWWKwhvNo6/rARz+LokzDw1KyGAfBQp5UAqt4RynsGo8HQRU/Aqkt?= =?us-ascii?Q?6KXE7DMdpPJzwkQOBOUJo2dWbT8C88uyLqX3CjN5DvY2YP9AaLKaVXADC8ad?= =?us-ascii?Q?+oHOz7wS1LY4ebOCwi9Sru9uKItysU3rXQg96fJdf3rDfUwNZsIF9CPRzuDi?= =?us-ascii?Q?h/9hfUfLp3So/hGtxmaK25CGwaJ6DIJzSp/cQR77ygy/9EN00g=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)(52116014)(376014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?0JQcX5BraVIiJDhfhGs5nqRwJPzpbFEF61oe1SjPGSR3L+xsWJP3HAxP58KC?= =?us-ascii?Q?trOJ36QcJGvzSzSuD2zikRaKPw0YokJPt3diWp4UY7bDD0GGMsRAUkARoHdq?= =?us-ascii?Q?LWBVEG4HaJ1r5KggATFGs4o+2xSaLvr9u9l9ncsLDdPHmV/0Ua2y16P+KFqy?= =?us-ascii?Q?Z5yiY0GABgpTvMYUQPSQaJzz4fnrqNUikbbcATNS/JNiJbS0wvPMR7oL/uso?= =?us-ascii?Q?ATh6ZdB8dpawF+fRtZAxHW23gCL8QZUmp4G6I2pHvLVzEquDbQ6oTye+CqJ0?= =?us-ascii?Q?TKBCrcZWqDZKRvneiaDsejshiWghaozKYH/xaS9yn5ujRKBDs+Kol63W96BV?= =?us-ascii?Q?TKAYvUrXz8xmnb4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qq?= =?us-ascii?Q?cTCA/DJ7a8E+a0cBkjJOBA15seYYM9dNnuz80BPOn0c/LZ3G9W0iffV6yIbC?= =?us-ascii?Q?JezoLNrU5gFT55ohkAW1qOzDvq5A+9uWvbKYCCzYvqLCxTAWJQjj/ogjVaPS?= =?us-ascii?Q?u8AZ4fmKWbyMLnQSq///i9Kdpv4RHwn7P41K2HNBLrmXrjSnxV5Rnq+YsXpy?= =?us-ascii?Q?Z7pyYGvU1a0wcDmq/kVzNj9EW/5jJwwpyvEchiByu4qDGZI/niEVLNopzRgM?= =?us-ascii?Q?4+JpZF30dc55NBgDUloKa8gbWNqYcZB3khluZRsjbCjiqG6ActUyZzcaYMDF?= =?us-ascii?Q?Smka75ak424BXDRn/RCfsNEgpip/Wgcthzu5oAJ/M0P+dNiZffswd6TXubj+?= =?us-ascii?Q?YA=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: bbd500a2-2cc9-48de-339f-08dcc345d9c4 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9328.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2024 07:33:15.4478 (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: VsCkAdrnLVi9t4FSdSrIBDrRDqOZZHB9f1V1kqkuY7IRtnp0tLMmPMnc7uHff7/uDZ2X6N/2cZZ9MFNcCEyOsQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8789 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 | 9 +++ drivers/net/dpaa/dpaa_rxtx.c | 138 +++++++++++++++++++++++++++------ drivers/net/dpaa/dpaa_rxtx.h | 5 ++ 4 files changed, 133 insertions(+), 24 deletions(-) diff --git a/doc/guides/nics/dpaa.rst b/doc/guides/nics/dpaa.rst index ea86e6146c..edf7a7e350 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 a302b24be6..4ead890278 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -2056,6 +2056,9 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) int8_t dev_vspids[DPAA_MAX_NUM_PCD_QUEUES]; int8_t vsp_id = -1; struct rte_device *dev = eth_dev->device; +#ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER + char *penv; +#endif PMD_INIT_FUNC_TRACE(); @@ -2135,6 +2138,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 99fc3f1b43..945c84ab10 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