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 9197945A67; Mon, 30 Sep 2024 12:31:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7C98C4067C; Mon, 30 Sep 2024 12:30:31 +0200 (CEST) Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2055.outbound.protection.outlook.com [40.107.20.55]) by mails.dpdk.org (Postfix) with ESMTP id 76BB2402A3 for ; Mon, 30 Sep 2024 12:30:21 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wqE8TMHuAucAipXs/bRG0RugPWm8XNpkMxF3XJ75WnUD8DBQWHAYSUOtDQ2LW7qK1wqDvufS7M9rHidzlRBF38fHOJcm+vlsLSkoXl+N/DKV+GieUd50cttgyUjPhUT01UIdODaBQTv7CDeHdLbWOYkMyX5DSrAeycwH1eEqM95syKS0ozS4XVPZSw9xTfsRJA/o/NL9of+OhjAObuk9FriVs8HerK96uBPryEJOCmVDoESFvAnQYehPkknRnu8AGXxHV29D381PMlINc/paRp8eQq56zVyHByOTgahyriuN+cjc6h2UxK0lL02ZFd/wmPosqp2F3InImgAygXycGQ== 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=DEa9q3RhHEOs8YJ39tbo4p937IskQw8V5J24aBF3ZxuGm986R3eGs7+GiHx/pwTQxtZieQ7wY6/FBMPxBokcuzRf3mJt0RRKy/HIhLUcW+xUTSygg3b/3wAMouNMCL+6MWeWzqkhleEJXLgLXprSyweyBAvKJ5LRVy01/ElK1mv8DPirxqBx5r1P4I6FETILNXocQkc67Y+r0wIwI7W4QT0vLEKv+RLX1W836uk/P6DE5ijRsLsdnqLmblhvHPG9Wpl1YduwS806auCClA0q0i8Bx8rtcjXA9ymNEA8f+r4MUYSPgaC0TyESg/c0BAQ1i2zohxqywdYQsGk9pcQBFQ== 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=dIBuklE3FSgKEehXdiEv7nQf3rLolSnWgeexbHDLZ12OZeE6NlxUm/4dafHTOyeu1GIsrlwaFjN9HBenKy7fuP2duV2aWBuCXGxOeIrGibAm4UCKemL92NvQiEGNKaQAYSITC86MKGSkjW3SrZV2UEDjsbD01cgMtpnBEIE/I9vcDn8aLtOgkYHOtlDQlMIDPWnqiHS5N8hX4u5LBrKQxzknI3uYmAgavzvEHgADKdhyUD8GC/ojqlJfG5pPMgdo5ueubHBFIdci4XEtG5rkAIzC4u1dh6+k5Wac4ukXItubonE5kJXr18oNi1gBX0vqKM82ywZs/caEMg4079R0dw== 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 VI0PR04MB10161.eurprd04.prod.outlook.com (2603:10a6:800:242::6) 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 10:30:20 +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 10:30:20 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@amd.com, Jun Yang Subject: [PATCH v3 12/18] net/dpaa: enhance DPAA frame display Date: Mon, 30 Sep 2024 15:59:40 +0530 Message-Id: <20240930102946.3236998-13-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240930102946.3236998-1-hemant.agrawal@nxp.com> References: <20240823073240.3708320-1-hemant.agrawal@nxp.com> <20240930102946.3236998-1-hemant.agrawal@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2P153CA0027.APCP153.PROD.OUTLOOK.COM (2603:1096:4:c7::14) To PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9328:EE_|VI0PR04MB10161:EE_ X-MS-Office365-Filtering-Correlation-Id: 1cd5debd-38d8-4c80-3473-08dce13ae24a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|52116014|376014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?N3pTCkN8Am+tZVNhmzoipNcAw77rasgpBt6SD3L5/BDgmpqiL2O7TGtFvJa6?= =?us-ascii?Q?KRdoes/RFdoGLBcxZwWS5r9370djBf5MlR+Pb4/p4pvg4TOSs2fUhmZHzXER?= =?us-ascii?Q?bBl610qQNW8rYMcez0gb3/jdA4KDznyblN6lZz8WWjWDjA0Qs3ZP7+aONtyC?= =?us-ascii?Q?SImNaUp/tr+FQoAEctVMrIUa37du0HXxcYn6eoXNo7/+Y/Wbw2uqRHnpV1Gs?= =?us-ascii?Q?VDYaLJJ3VWQoHS1eNLuzGPqECu3WzH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rKNSPaQ+swC9hxqBUm+En6Lm4ck6B6aQrVWC1uITklWyXQZ0g9k7zbrH+azB?= =?us-ascii?Q?IU97D9jXDRephBGrKRWRPA/uyHICoffY4xIHoS8zBEU1oC2ZrZ4tfw3gkv4K?= =?us-ascii?Q?SCOofN+vUykfjgdvTsu5SgND4gNoaHQnp21cM7UKFzJhVnAhiDalupFcNmR7?= =?us-ascii?Q?ooZJogDCTiKibtaTmCdW/E3NpjTG6yc0KHUBu0Vmaj+hsA=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)(366016)(1800799024)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?lSvUqAVDHz045pBehDWFczkSa+U9jtMA7URvuIrM9fGTBJNw/SxZhDxBXxEP?= =?us-ascii?Q?9IVZtoJPzAWjIjoNDHnwR3cqIuFVleJTXjOJoFnbovRIAdtzxbeuaflSlRkG?= =?us-ascii?Q?bSDpva0kNyVTzofaAvpvyip5xvrULVVI7X1J1t6TLDbKGspmOzvJrXxs+ha7?= =?us-ascii?Q?5YWXYkKcJrp91qHwN5B1kddvvfiutr9QY24T4XZGnlRkMuax1Wg6TOPjg9JT?= =?us-ascii?Q?QX430P1tJF9uWSlTWRp+wUBf7p/u619T5IPngvmSrTge9P6oBi8bOUxfjqGm?= =?us-ascii?Q?ISklDzmcw5gaIj29Rl4lew4uT8cIbu/Z7FvKs93NP9FSVBtrC11JngSiQ/ri?= =?us-ascii?Q?GVzec7u07f9YyAZ2w5nEWga7ambwgI37xqUfXXdmaVPdrfQkfmlYmkdzQwqX?= =?us-ascii?Q?kMxJbjkoddr9Wkcslf4MrkqjkyiD+EEFKhSe1fhQ2IumOH69jqjyDkTI1R06?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tPGuPYOUOmN8cqAOsdgsOSbZKLOYhcJdB?= =?us-ascii?Q?eHpv0cap8nYNiWjaGqzwb4T12WEjxD02/+Ys7MBzmgcQplOtg7Rwy4ncUn4s?= =?us-ascii?Q?ahi7MYnPh25dglxqPT7CbOi1j8xNrGCQIkk2K9feyMvDJsG3JhK4I53WIrG5?= =?us-ascii?Q?HKWuyEcR8zzD5Lojlpq77GhUSe0XVjVw9ot6P7dbBQWIwUbXJhvzigvEH5XJ?= =?us-ascii?Q?s9O7OitkmyN7VOBKPVGaCzvp4iD/IZ/BqHfdLneJdj8WKCl9qxHyHuV3kMDu?= =?us-ascii?Q?0g=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1cd5debd-38d8-4c80-3473-08dce13ae24a X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9328.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2024 10:30:20.2107 (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: m48l/1jrCLcUllhItHVYVFwBlbTOjQv9XJGXbBAnAe7ZsLtskU6soiUPm9gjJCzztAeFJLxSS7a0RntWQZoLGQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI0PR04MB10161 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