From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0051.outbound.protection.outlook.com [104.47.32.51]) by dpdk.org (Postfix) with ESMTP id 2D7171B212 for ; Thu, 28 Sep 2017 13:24:21 +0200 (CEST) Received: from MWHPR03CA0056.namprd03.prod.outlook.com (10.174.173.173) by BN6PR03MB2690.namprd03.prod.outlook.com (10.173.144.9) 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 11:24:20 +0000 Received: from BL2FFO11FD007.protection.gbl (2a01:111:f400:7c09::108) by MWHPR03CA0056.outlook.office365.com (2603:10b6:301:3b::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11 via Frontend Transport; Thu, 28 Sep 2017 11:24:20 +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 BL2FFO11FD007.mail.protection.outlook.com (10.173.161.3) 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 11:24:19 +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 v8SBMpGE016035; Thu, 28 Sep 2017 04:24:17 -0700 From: Shreyansh Jain To: CC: , Date: Thu, 28 Sep 2017 17:03:42 +0530 Message-ID: <20170928113344.12248-39-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170928113344.12248-1-shreyansh.jain@nxp.com> References: <20170909112132.13936-1-shreyansh.jain@nxp.com> <20170928113344.12248-1-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131510714601095455; (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)(376002)(346002)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(50226002)(316002)(16586007)(97736004)(54906003)(498600001)(85426001)(47776003)(5660300001)(4326008)(2351001)(50986999)(104016004)(305945005)(76176999)(106466001)(105606002)(6666003)(68736007)(77096006)(2906002)(1076002)(189998001)(33646002)(8936002)(53936002)(48376002)(50466002)(5003940100001)(8676002)(86362001)(2950100002)(356003)(6916009)(8656003)(81166006)(81156014)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2690; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD007; 1:genFn57Wk+fflVHwsegmQPbkbN43Ux4paFoDrqujlry36bGIij+Wg8zDvlMyq2eZHRBfc1WHRR+SFrxVaK6U693NaJPY3vZalXDi88FncUYwG+9oSJ4bkoTZImw47WVh MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 478f41e2-f21c-4b0c-c11f-08d50663766b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:BN6PR03MB2690; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2690; 3:gFHeJnscdtXe5LM4YafU6S6PPQJTV/iscE6WPCs3dqxMvDv/Wtsx8RCMKOoEcYQQGgGjlVQ2QVmElWPHtFipv3UcF06C+MEzxb6K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AbEAPoNxTqKX4MomzARZGjhY1kDEjjTLqjlr7ls/wDU0h0nyLZtLr2kEVR09AJC9GEy3CWAKTojS04GUyDx18DBEQEMp3Hh6E/KzFm2g4p/8lASQSlMyQcncJH0V/cQNfDpNfCjFI2RQ/JtFiaWXY= 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)(5005006)(8121501046)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6096035)(20161123559100)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123561025)(20161123563025)(20161123556025)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR03MB2690; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR03MB2690; X-Forefront-PRVS: 0444EB1997 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2690; 23:agkQXgXFNxbMy4XfDw9JLe9Jfl8xVTCD4YjN9tRUd?= =?us-ascii?Q?Mpud1AXirh7T4HCJXo32IoosVyzV6pmbWx0eQ5Q8+yVa9nxOTv254BQcqggm?= =?us-ascii?Q?n1t5Ya0oUiEfGo44IjVZLnc7orCA3B2Vd3ceApRfEs5q854AcKj1AoAoWEkj?= =?us-ascii?Q?WL9T0tWpgAUuhhXVTKl8uDzC5akOioxlYAsWjvi8oQzJ+3aaIsiLjAOosW8h?= =?us-ascii?Q?2gDNzkVX74nG4eV3mKKHFQuACjgrUimvK31craFswQ4yCRFVoYY40s6Nn3aw?= =?us-ascii?Q?At2PirOM4dpR1O9NZWwaqwA+47/OIZGSW9aH9dUhnTA2sr1pHIfJmt1wkrXS?= =?us-ascii?Q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ostics: 1; BN6PR03MB2690; 6:4FchU/Rob45tO2b3F0pAY98xg0QE10irUggxZIrSKDBzBYcLW9dRMi13sriXgMNK01lmHhiMOhkUHMlUnWPVDmTQfj5lPIc7bExvlYVBLBQLOxudFiT7B5NuNpS0bUuXanF0C0+Rq0U/UDs4/bue7P7e4hhbhIt1sgydtyaRv5tuXHS1JV7AVtFHKkAELcHHHgQk3i31onFkQj0HREeMQ9z41i64/XKEtKw97uHCA7lHtq3KD9Hu3MkMc+NjSf/VezFOM9suQbMGvChH206ioyl2bgvHITF0dzwI/E03t/OHxzcrs3gg6W+I21uql8DwmPr2x3oIjn+IIs3xbR/4sQ==; 5:Vtq11ojvO0m1HCnKEGo1I2LSEk5NQRIrrjFERjGYymj/9215bNF4PXWJkEggax3t7uPbhFV6BJnr6FeYX7W7gq4A6bkOcjRXxEm1yUo+LO3bYTjeiTji2s0RYnGZFca9orMqdOhi00j4BKSyQUxzOw==; 24:GUcDnpbVZJJaOwjqEooxKLTm3+/sHyHQAiK7UK7nlQn0O9oEM3+0LKfIOiaLWh0wmwE1bZN/CbS65LIqHyQH/UOBAoq+Bx6AcvgLRCWcU+I=; 7:UFjBbQOXPOzhuDV74S7pCwrTjWAvP5qapuqOhmpHdfeNgveYXHHo7q8v6oDolr21KDkHXdv/8sDN7gC3g487aKkeCPEw2Cw2aSWrzK8PkJZ0ynBSLW/xiVFLb/vHLK1vDPwmrTyfV3M3FsJ/SD4HES6TKGayRhHe2Yu+k3+FF76YEZTbwaAP4YDXlI/O8p42iOT5S72wIvXnNIp2X9y8HOfwnoTc83TW9bSHNJmm+Ls= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2017 11:24:19.9535 (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: BN6PR03MB2690 Subject: [dpdk-dev] [PATCH v5 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 11:24:22 -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 4eb9b62..ad9fea8 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