From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0082.outbound.protection.outlook.com [104.47.37.82]) by dpdk.org (Postfix) with ESMTP id B358C3195 for ; Thu, 28 Sep 2017 14:20:22 +0200 (CEST) Received: from BN6PR03CA0001.namprd03.prod.outlook.com (10.168.230.139) by CY4PR03MB2696.namprd03.prod.outlook.com (10.173.43.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 28 Sep 2017 12:20:21 +0000 Received: from BL2FFO11FD054.protection.gbl (2a01:111:f400:7c09::110) by BN6PR03CA0001.outlook.office365.com (2603:10b6:404:23::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.8 via Frontend Transport; Thu, 28 Sep 2017 12:20:21 +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 BL2FFO11FD054.mail.protection.outlook.com (10.173.161.182) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.56.11 via Frontend Transport; Thu, 28 Sep 2017 12:20:20 +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 v8SCJ72V008785; Thu, 28 Sep 2017 05:20:18 -0700 From: Shreyansh Jain To: CC: , Date: Thu, 28 Sep 2017 17:59:58 +0530 Message-ID: <20170928123000.1711-39-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170928123000.1711-1-shreyansh.jain@nxp.com> References: <20170928113344.12248-1-shreyansh.jain@nxp.com> <20170928123000.1711-1-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131510748210220033; (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)(7966004)(39380400002)(346002)(39860400002)(376002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(47776003)(97736004)(305945005)(2906002)(8936002)(81156014)(85426001)(498600001)(81166006)(68736007)(53936002)(1076002)(54906003)(77096006)(86362001)(8656003)(48376002)(4326008)(6916009)(2950100002)(50466002)(5660300001)(50226002)(316002)(33646002)(50986999)(76176999)(106466001)(2351001)(36756003)(105606002)(356003)(8676002)(189998001)(16586007)(104016004)(5003940100001)(6666003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB2696; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD054; 1:+fvtdubR3bxVt5Q6hFTQPbhy5xeyTdh3zz1yWy6IADjLXsAPSLUX1/kTjG5l07SM8YOqZpZgyGM3rZy2zcHdr9ipkwSM0EGWJo/9Htu9u1QeIm83Lj16oo+QkiXHlBI6 MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 42260668-3ec0-4328-eaa2-08d5066b49ab X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:CY4PR03MB2696; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2696; 3:u9ZxO6rpNRLxEjk30krOkgR8cYcNAX1hHbK7VmOoGCbsdyntF+Chyhhrj04idR7B1Nl1EyqLukHYH0gDLdngS9c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ae8ap8mnIqevXy0OLRLsYz0wqcO6QqSLgcsea/Nni0DD2ivFvhErguqj5b4srarmX/5+MYEzLjhEM3yas3y2DRSxa8P8GAXZ1Kahn5Ny2x3yM92LBAQoEiYQzO3HCzUpEsI+ETgZ0o49+/+BWqLtg= 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)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93001095)(6055026)(6096035)(20161123561025)(20161123565025)(20161123556025)(20161123559100)(20161123563025)(201703131430075)(201703131441075)(201703131448075)(201703131433075)(201703161259150)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR03MB2696; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR03MB2696; X-Forefront-PRVS: 0444EB1997 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR03MB2696; 23:g9eBEslGPiyZ9qKO20ICuKUsFx2Mtas0PSemg9OvZ?= =?us-ascii?Q?7BWyBc6BnKPTbyouosGSMHIEtFNkqAPN1+1n3fOsLwKaasM1KFI1Jaq4Tm/9?= =?us-ascii?Q?riE3DuVU/6NAgFlUD6OAeawCEfzYquHhvDqmniyZBmao2yorVJARAMTczq2G?= =?us-ascii?Q?4HIKfuu8Pc1CLjGtCUN19+XeUmY0Z5Aq9Ihg9L7DR4N/yaIxcgtpiS/YN6AT?= =?us-ascii?Q?CJ6USrbWPtLvadznyDjfeUYRNNsQLGPDhU/Dk4Sm1XuEih3v5O85S+vN2hZ1?= =?us-ascii?Q?KR0vLE/NQFClTpU1hBiPlobRVmY3GCNnuSFf2aHBsG8iADpNlPJQu/dkAZg+?= =?us-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fqz?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB2696; 6:DuR+Olx9sA8ZnEADRWCiSsTcNF/++Mm9saraoa1AHJFtd4vJ5HbJC28Vfny2cXo9qtMryi8RUseZlNksL2SQIihSeK6z+xq9VgUWI0oVGxhjmUltDL5kNdPZGEcF++kl0kbG+/jgM3svhlcu7yZdUpfNKcfDQLHVm3sYux+ItEza+Jhfgrc98HvuIRFFgdJHd+blav+kQKmxpC6fLcJsUdL7Nq0AoSnaQ++Smo6hzOjcY/IZ5ECSIQAK+nWB+wMmxqUzErXrjL2XZzPqdbRN7Wbc4aAQnfc0GMpBYorqj6jxiuVuJxBnr6m1Xf95Uo/n1f85phvTh33kTuKDAJRbxQ==; 5:BbICCdsIPr1tvj1kJWKREdAosl2hRRSYjRQ2zr7X5USHZbdkvCPvliLeCzDVLCbi53juStq1fWEZO2ZN+xCRtoXH23eJi4oVbKaZ/4TfThz8onB/x5me48oLfleO1DssCnFkFzU4L9RS2ToC8JrSiQ==; 24:hP65XEjqlWTBn1oW9Ao8OuMbchmrhIlbVFKc+5S34TkzQM3EmzUrsnBcZXXThBkhzbuiqqua1kFEDZNm3FFjFd5Hihac9c48KaMYkfwfCN0=; 7:KGHp13Iayt7BrSXmwBqR4jrcuCk4m1FtTcDmzNJYb/x457dVWBo4J53h2ERussfIJzAfcIlGoYjVNC43cZ+V0TodteImipEJJ8k7YC1zoNIuuytyr3ZrLGp4a0tNy5fFoV0jAVVSFcht1LhAbTg03OgcGH1AzymkPIgMzjduhITOnElQi7rRtIEDbRVB5l/3AEZZQ4WH9iN5Mij0n0rb48UVDXCvXBAfXvftH17yKhY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2017 12:20:20.8504 (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: CY4PR03MB2696 Subject: [dpdk-dev] [PATCH v6 38/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: Thu, 28 Sep 2017 12:20:23 -0000 Signed-off-by: Hemant Agrawal Signed-off-by: Shreyansh Jain --- drivers/net/dpaa/dpaa_ethdev.c | 42 ++++++++++++++++++++++++++++++++++++++++++ drivers/net/dpaa/dpaa_rxtx.c | 26 ++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 12dcc68..3d6ddae 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -618,6 +618,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_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_DEBUG("Creating debug fq %p, fqid %d", fq, fqid); + ret = qman_create_fq(fqid, QMAN_FQ_FLAG_NO_ENQUEUE, fq); + if (ret) { + DPAA_PMD_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_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) @@ -692,6 +725,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 9c25d8c..d73f9cb 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) +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