From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0046.outbound.protection.outlook.com [104.47.37.46]) by dpdk.org (Postfix) with ESMTP id 252B190FA for ; Wed, 23 Aug 2017 16:03:44 +0200 (CEST) Received: from BN6PR03CA0068.namprd03.prod.outlook.com (10.173.137.30) by CY1PR03MB2267.namprd03.prod.outlook.com (10.166.207.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18; Wed, 23 Aug 2017 14:03:42 +0000 Received: from BL2FFO11FD036.protection.gbl (2a01:111:f400:7c09::128) by BN6PR03CA0068.outlook.office365.com (2603:10b6:404:4c::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18 via Frontend Transport; Wed, 23 Aug 2017 14:03:42 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD036.mail.protection.outlook.com (10.173.161.132) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Wed, 23 Aug 2017 14:03:42 +0000 Received: from Tophie.ap.freescale.net ([10.232.14.39]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v7NE2Q3P004389; Wed, 23 Aug 2017 07:03:40 -0700 From: Shreyansh Jain To: CC: , Date: Wed, 23 Aug 2017 19:42:12 +0530 Message-ID: <20170823141213.25476-40-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170823141213.25476-1-shreyansh.jain@nxp.com> References: <1499179471-19145-1-git-send-email-shreyansh.jain@nxp.com> <20170823141213.25476-1-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131479706226855412; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39860400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(5660300001)(76176999)(81156014)(54906002)(81166006)(85426001)(53936002)(97736004)(189998001)(33646002)(50986999)(498600001)(48376002)(8656003)(106466001)(356003)(68736007)(305945005)(2351001)(105606002)(626005)(110136004)(4326008)(50466002)(8676002)(8936002)(575784001)(86362001)(2906002)(47776003)(6666003)(1076002)(36756003)(6916009)(104016004)(5003940100001)(50226002)(2950100002)(77096006); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2267; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD036; 1:Ul/TQkTpa1XNHNGMwU387w0Ayd0INsk8d2oPEIs4V0xQmJazwu13r5K2uwaBdOG9zJoc4zhPmbae1MON2nwqfytV1513edHmAOC2RLbRlGOe8r+tsUIhaT4qBOoiuCWh MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: aa5e4144-7795-46bc-ac91-08d4ea2fc347 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603185)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY1PR03MB2267; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2267; 3:du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ACH3u2DSJIU4Qe62VnS88AXrNQoTu0Fb2Yf2DtJZGy4l+S/us3IgJ1tJ7Nbq3g7UC9J1lLFL/oQQ0RCyr6AAgNYKlJPv6IN+bv4SrU3R4kffQI9MnCdsWZtE31rXwgHucNo26w/bnROKNDLcqHNwiN6SGQyU2Cf6FeExEL26nJOzshfTIpl5mmw6OkuIFNAN0KH7lynyPaULtSiVNmejBWma/gihRV+XVU92geQIQjDdMHqcvYEnU= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(8121501046)(13018025)(5005006)(13016025)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6055026)(6096035)(20161123565025)(20161123559100)(20161123563025)(20161123556025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123561025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR03MB2267; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR03MB2267; X-Forefront-PRVS: 040866B734 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2267; 23:FoNvLIxtlVKCQ/s5Us7vYg0CtsoX5QpEz7JRREsUK?= =?us-ascii?Q?/2MXidzrT+cHSpRzVaxCtuGNZoMbMlWusuSmWHMBdvdKWFukF3V+3KErcSRR?= =?us-ascii?Q?oH+n46wIUTivORseO/aPGFOrrAZTwv0NHXtrHk4WcV85eZ+nSlJu0pbeAOal?= =?us-ascii?Q?IA3tk0GcUZNj6GFd2ltXeyJLpYXGvYkpyGBJa/v6D16u2Rkwx4CGsDyROjVH?= =?us-ascii?Q?32LOGPmLAElSbit0pcKCx8CooxqypIieA8VZ1k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OY81ixnF9FJuef8Jw8ZI+Ikr7j+QTDF6wOJFYvWaJTGpv2ZfDHP+vNTicguG?= =?us-ascii?Q?QFZhY6UzHyMQbY=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2267; 6:a+rNngBH/T6t3u/K9E6kV8np2zAKAhE9v1FUWdu6uGKGdbWxEpZo950nchPtyij0HKmdoQN6TO2gpaqBrM3hglm+WXCGSymKBsteUECqOhOA4JIhn/75C5dIkMcj40Mc8lYObhwxyLdBsSp3+lxF9rNmRIpByCh+1euuW2ONuAVLzntGVrVu/iP5bTpRXQkEc86yV6NKfp0vyx5x2m+zXKU6owQoeyzXUWBuUwJay97SZwjxf/mf7k9lkjDdNoetvW9mj4JOxOW7dpSY9Mljkr47xZOK1Z/1GFXbJ3eN8lzOLyjzIHu7uoNRIglzyLzVsUyJjApLlyaIdl92ck+vug==; 5:3tzxuJe03BnJWiNm25j+EsKUaXJGRyJyl/gGnoMJs6Uq6/E+S3bL+0g6xl2/m7c1nYPJGt8Oyq6pYkjvIVVpdMjOTdebaAlU82mJGCHbFBgn0jgRLdDEPzNwEdUX6Hy/9aQ9IKoal5h5TQtY+SJMLw==; 24:GMDaxXYxV+W3U1PwG9bLWW+7omFez6NwbzOdMHwFTlHIL5AhkoBW+Hb821p3IQS6+oaKZQKJkfahLUtmJUivILWXzmKNu3RF6+P0TPXjv+Q=; 7:fNeSMvgHL9II96zrxDIgUSjFyPkMpKplpQH7baQNZMeF5ftR/7CqUWObVBHxyyQhIDSD1yb8dmlKv5pxAc3Bq9wgbc8CfNngftoOnSutYoBRoXMH7jnkVasUFFN84459BdN+CA+UfnmtnAevc5r35sC5c2YZoHorKTmfAU6uuNPUCzyVtNERgtaC/nRH6Ld0XYry/k+k977F1tUVq6bSILuXFVoUMv161/yYUdsc7Js= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2017 14:03:42.3579 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB2267 Subject: [dpdk-dev] [PATCH v3 39/40] net/dpaa: add packet dump for debugging X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Aug 2017 14:03:44 -0000 Signed-off-by: Hemant Agrawal Signed-off-by: Shreyansh Jain --- config/defconfig_arm64-dpaa-linuxapp-gcc | 2 ++ drivers/net/dpaa/dpaa_ethdev.c | 42 ++++++++++++++++++++++++++++++++ drivers/net/dpaa/dpaa_rxtx.c | 26 ++++++++++++++++++++ 3 files changed, 70 insertions(+) diff --git a/config/defconfig_arm64-dpaa-linuxapp-gcc b/config/defconfig_arm64-dpaa-linuxapp-gcc index a349cec..c0f5e4a 100644 --- a/config/defconfig_arm64-dpaa-linuxapp-gcc +++ b/config/defconfig_arm64-dpaa-linuxapp-gcc @@ -51,6 +51,8 @@ CONFIG_RTE_LIBRTE_DPAA_BUS=y CONFIG_RTE_LIBRTE_DPAA_DEBUG_BUS=n CONFIG_RTE_LIBRTE_DPAA_DEBUG_INIT=n CONFIG_RTE_LIBRTE_DPAA_DEBUG_DRIVER=n +CONFIG_RTE_LIBRTE_DPAA_DEBUG_DRIVER_DISPLAY=n +CONFIG_RTE_LIBRTE_DPAA_CHECKING=n # NXP DPAA Mempool CONFIG_RTE_LIBRTE_DPAA_MEMPOOL=y diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 96924b6..4c543ee 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -625,6 +625,39 @@ static int dpaa_tx_queue_init(struct qman_fq *fq, return ret; } +#ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER +/* Initialise a DEBUG FQ ([rt]x_error, rx_default). */ +static int dpaa_debug_queue_init(struct qman_fq *fq, uint32_t fqid) +{ + struct qm_mcc_initfq opts; + int ret; + + PMD_INIT_FUNC_TRACE(); + + ret = qman_reserve_fqid(fqid); + if (ret) { + DPAA_PMD_LOG(ERR, "reserve debug fqid %d failed with ret: %d", + fqid, ret); + return -EINVAL; + } + /* "map" this Rx FQ to one of the interfaces Tx FQID */ + DPAA_PMD_LOG(DEBUG, "creating debug fq %p, fqid %d", fq, fqid); + ret = qman_create_fq(fqid, QMAN_FQ_FLAG_NO_ENQUEUE, fq); + if (ret) { + DPAA_PMD_LOG(ERR, "create debug fqid %d failed with ret: %d", + fqid, ret); + return ret; + } + opts.we_mask = QM_INITFQ_WE_DESTWQ | QM_INITFQ_WE_FQCTRL; + opts.fqd.dest.wq = DPAA_IF_DEBUG_PRIORITY; + ret = qman_init_fq(fq, 0, &opts); + if (ret) + DPAA_PMD_LOG(ERR, "init debug fqid %d failed with ret: %d", + fqid, ret); + return ret; +} +#endif + /* Initialise a network interface */ static int dpaa_dev_init(struct rte_eth_dev *eth_dev) @@ -699,6 +732,15 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) } dpaa_intf->nb_tx_queues = num_cores; +#ifdef RTE_LIBRTE_DPAA_DEBUG_DRIVER + dpaa_debug_queue_init(&dpaa_intf->debug_queues[ + DPAA_DEBUG_FQ_RX_ERROR], fman_intf->fqid_rx_err); + dpaa_intf->debug_queues[DPAA_DEBUG_FQ_RX_ERROR].dpaa_intf = dpaa_intf; + dpaa_debug_queue_init(&dpaa_intf->debug_queues[ + DPAA_DEBUG_FQ_TX_ERROR], fman_intf->fqid_tx_err); + dpaa_intf->debug_queues[DPAA_DEBUG_FQ_TX_ERROR].dpaa_intf = dpaa_intf; +#endif + DPAA_PMD_DEBUG("All frame queues created"); /* Get the initial configuration for flow control */ diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 064f0da..8e106c0 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -85,6 +85,31 @@ (_fd)->bpid = _bpid; \ } while (0) +#if (defined RTE_LIBRTE_DPAA_DEBUG_DRIVER_DISPLAY) +void dpaa_display_frame(const struct qm_fd *fd) +{ + int ii; + char *ptr; + + printf("%s::bpid %x addr %08x%08x, format %d off %d, len %d stat %x\n", + __func__, fd->bpid, fd->addr_hi, fd->addr_lo, fd->format, + fd->offset, fd->length20, fd->status); + + ptr = (char *)rte_dpaa_mem_ptov(fd->addr); + ptr += fd->offset; + printf("%02x ", *ptr); + for (ii = 1; ii < fd->length20; ii++) { + printf("%02x ", *ptr); + if ((ii % 16) == 0) + printf("\n"); + ptr++; + } + printf("\n"); +} +#else +#define dpaa_display_frame(a) +#endif + static inline void dpaa_slow_parsing(struct rte_mbuf *m __rte_unused, uint64_t prs __rte_unused) { @@ -353,6 +378,7 @@ static inline struct rte_mbuf *dpaa_eth_fd_to_mbuf(struct qm_fd *fd, return dpaa_eth_sg_to_mbuf(fd, ifid); /* Ignoring case when format != qm_fd_contig */ + dpaa_display_frame(fd); ptr = rte_dpaa_mem_ptov(fd->addr); /* Ignoring case when ptr would be NULL. That is only possible incase * of a corrupted packet -- 2.9.3