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 E685E45A68; Mon, 30 Sep 2024 14:17:50 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 809C540A67; Mon, 30 Sep 2024 14:16:33 +0200 (CEST) Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011019.outbound.protection.outlook.com [52.101.70.19]) by mails.dpdk.org (Postfix) with ESMTP id 2220B4068A for ; Mon, 30 Sep 2024 14:16:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GgY+TsSnn/VqVB89ePsjNbxlVUXXlIdGPtSDm+s3Zcj6GtiChOuuin0x2BZW05m+tAOd6QOmGG4ZtrruCFHnz/B0YRmAuoIy/smmTuL9LovF4zaB9YFs11P0BhB/PX59yElkPlfuU4pG1Ab4el1Y3NrlKTe1sCr8u2yRK60FSvLIjalPQ/2b6eCnSUiZMaHC8p3s4GpYcNtUGvSawOzjwTW4CoL6ZQRNUYWxfx/yvOWSYCUNTiGg+OOTaobc4M4VQ3somMs17mq8PYjUaz2/3WIq7Wt+IJQ2Tpwik7XNWdzA8yJmBs+GmQgNSUvHzdnGqOr4sh0atGW+6HLEr6FfFw== 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=OqHNFfTgniI3eoNAvkRjb0ZlWAGZlm9UoBG75k1CoIpO7DA3ccEmKKBxw+qLRh58Uj/THmQuuJK1FTjkssUyaFZ2bqg7sBu38WFxbzmP3aDkmX0WgjNGorbDZ7jUP/mBpXKpR/La5Tt2+lY3/RavVb9Z2w++UqR0oYG9skCJPWVAtyEcSWnPVYjU32HrJ6lmgqDadZt2ZqRekF8T6ckUOw3yuGXbmLnGjvhcfd9pcjnUklKxphgE2InGxkN+AtEFOEyoDk1fniJlHt3V5vf3MHvHLPr0MvBVO9VxZEXL8QsswThNY4oQpZwuD6OWVhjmEEkhs8n3vqkfmdXT9ZDzmw== 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=DXZhkO//XY7TYIau4xYkx25yUCnZS+iS/HosUSjf44Mk/xXesZ+SbsW+RRk8hZA/B42PpUFOjDOCJ3BekmjDCTU2Zfw9fmteNXUM+P9eOWsBZ83qimMaaoVs2rdNoc97x/lVJZjZuuCklJh7nDipeHc0tLGR4+YRwr0YS7M2rR82sxwThAjkcA4jSnaKnVjH94bbbakSmDKQMhsO7jTqiDcRgPNbYHyx+Gri0Xc2NdHLSw3k1F2xE0AT8bpX6ZF54gNctj8V8dxREtyRdYS8UvvAr8OTun4/4hmkY73brOFvW5uQU4JvW4Pwl0Cuex/uShPs8PQURj0ZgczrgwwVag== 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 GV1PR04MB10583.eurprd04.prod.outlook.com (2603:10a6:150:203::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.26; Mon, 30 Sep 2024 12:16:24 +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.8005.026; Mon, 30 Sep 2024 12:16:24 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@amd.com, Jun Yang Subject: [PATCH v4 12/18] net/dpaa: enhance DPAA frame display Date: Mon, 30 Sep 2024 17:45:19 +0530 Message-Id: <20240930121525.3452847-13-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240930121525.3452847-1-hemant.agrawal@nxp.com> References: <20240823073240.3708320-1-hemant.agrawal@nxp.com> <20240930121525.3452847-1-hemant.agrawal@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR01CA0124.apcprd01.prod.exchangelabs.com (2603:1096:4:40::28) To PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9328:EE_|GV1PR04MB10583:EE_ X-MS-Office365-Filtering-Correlation-Id: 8582bfd1-9e81-4f0e-e9ac-08dce149b367 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|366016|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?YTVJfeI4lax6J+qav0t15lGVngNNtw6XvZ8ia2iauLGu3LwaJ89lbmXJ6nk0?= =?us-ascii?Q?VVzTgzVKY8qg0DI7gAsntvLDqifsgRNY3eGqxWmlfzLDL4v2QENyRr1Ri5fk?= =?us-ascii?Q?96GMl3lXiMHK4pUThay4bn5kV3+6ajKgTgHe6RFy7JTBoLuSjkYzdrcZedHD?= =?us-ascii?Q?aU5LGcNXSBAZVy2dK7zmwyzs8j0DqbzvefaSye60mA7t82ZGbKBpdwagb+0m?= =?us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1+p6cr2BDrh3dj8YjvW41hAOPzqFmN42N9?= =?us-ascii?Q?lImmc/B91na0vPjy54V0Hb0OBfjTxZBwil9t+Q9RRgt4Y66IDVMxlzRzT9if?= =?us-ascii?Q?hb2nhYDPb8BCeDhfNu/I+EzSC0Kgw5G7VhtZr0IJW4bwc5wzdMUeSKYV0/9t?= =?us-ascii?Q?+83kWtVcxRj4h8rj6v5eEjR8vHsfPGeAi872FecmupxHgFuQoZDme1t6wW/w?= =?us-ascii?Q?nx1iKa9K/dChN7/fHH8OPLolD9yAm9BwNWnFtHLu2Tws2A=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)(1800799024)(366016)(52116014)(376014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?BGZlP9nRIcw2IVpr3T24mkbDmj4AI34FQzQk5MzlPX/HzJUC1fuDXXU1aHd2?= =?us-ascii?Q?xzY+C6xkijZ86tJkscaKdGk4DrCf9Ad6ukLyme/ETtgXOXorndzQDdh5ZC4s?= =?us-ascii?Q?7umvRBJQyYbZ1EaGtwUpHBZDwbAbHyxMVxo2zBf2TiC1nFOeNmzpwauuYHkz?= =?us-ascii?Q?gkyBuVQIXYSKPASB1d5TtEScV7hQ5iAgrOp8hmNeP2z58QM3V79vW5BBd3Kw?= =?us-ascii?Q?0VlFth+pFHPRqRvo3L3rtuY37vF6Cwe7IneEGP6+QTQfIVSE7UxRhwdrhXkj?= =?us-ascii?Q?sPgcRgBvzp0X+WmPKy6osQt9KFZ1dxAGiZs02DG4thpK+gbeslRNFlmvqBKu?= =?us-ascii?Q?hlscgUgdfRldx9f9XSGiQsvVAEChRKeOH73DpliJ4OFoM1hKTE1YwBjSxSYf?= =?us-ascii?Q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FBLGySyPPb34nQ7zBRJsFdmFBcUArJC?= =?us-ascii?Q?VgbXYBVA9G4zcu4uDJLTn3at39NI5BIKpToaRhPMZsVcIF4iRZhZrKzMqCyT?= =?us-ascii?Q?oSQDFGV9z7rng7AzO31p11rchhQ1w9oZ3FlIPcBP47/M9ktGUzl13YitzKOA?= =?us-ascii?Q?LPfUB9SOkgHrfFh0QAk8WAsQC+EgBl7YKIpewvlNH58I7jO3PSXuUDRydv6C?= =?us-ascii?Q?jDiBewrOH5XTUqKPJzYYAYZvbCfnGSuxJSgd7iKyOKiCDE2VY5rM1CqJp5vy?= =?us-ascii?Q?gVShgqbHsUr3CBxQ04X0jItvWkft1pN1tuQ2B4CNRJjetfsrTgUuHyZlwkTH?= =?us-ascii?Q?Gg=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8582bfd1-9e81-4f0e-e9ac-08dce149b367 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9328.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2024 12:16:24.4890 (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: I1zJMroH6oFdT5XMei3yDbQNbbV/uAYctj8vMR5SKNGrrtzMbtbfUSjHFPqGSt9UwFpWgWygbqq70GaaFCfFnA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB10583 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