From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0040.outbound.protection.outlook.com [104.47.33.40]) by dpdk.org (Postfix) with ESMTP id 22EEB1B2A2 for ; Sat, 9 Sep 2017 13:11:46 +0200 (CEST) Received: from CY4PR03CA0098.namprd03.prod.outlook.com (10.171.242.167) by CY1PR03MB2267.namprd03.prod.outlook.com (10.166.207.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Sat, 9 Sep 2017 11:11:45 +0000 Received: from BY2FFO11FD039.protection.gbl (2a01:111:f400:7c0c::182) by CY4PR03CA0098.outlook.office365.com (2603:10b6:910:4d::39) 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; Sat, 9 Sep 2017 11:11:45 +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 BY2FFO11FD039.mail.protection.outlook.com (10.1.14.224) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1385.11 via Frontend Transport; Sat, 9 Sep 2017 11:11:44 +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 v89BAUhd026326; Sat, 9 Sep 2017 04:11:42 -0700 From: Shreyansh Jain To: CC: , Date: Sat, 9 Sep 2017 16:51:30 +0530 Message-ID: <20170909112132.13936-40-shreyansh.jain@nxp.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170909112132.13936-1-shreyansh.jain@nxp.com> References: <20170823141213.25476-1-shreyansh.jain@nxp.com> <20170909112132.13936-1-shreyansh.jain@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131494291048991684; (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)(39380400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(8936002)(97736004)(50466002)(50226002)(77096006)(53936002)(76176999)(305945005)(8676002)(81156014)(81166006)(48376002)(54906002)(356003)(105606002)(85426001)(33646002)(498600001)(2950100002)(6916009)(6666003)(2351001)(104016004)(106466001)(4326008)(8656003)(189998001)(68736007)(5003940100001)(36756003)(5660300001)(47776003)(50986999)(86362001)(575784001)(1076002)(2906002)(110136004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2267; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD039; 1:JOK5+wDUN+Epfv/P3d29Fmu3eLbY40GQv62Kpi5JW1HSG5lB3QB9AvNxDssR1/h3NbT3Bw7qBVEGKcN2SgYoYJrwNf45YGoLSZVTaWxcgTzzxm1Yemik50pfx2gSj/as MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9e8176bd-2ed1-4094-8bc4-08d4f7738e6e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY1PR03MB2267; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2267; 3:3jc5CqPh4o4UqUQCuH9wwHGlAQqrHOZgbXZTW9WXwCy4w3v3XCrFfiPkuL/UwlM8gxpiKZeusJjSoHRak4vz48AUOslWooVINmaiL1q4FpGkQ2mL5o5+Vp1kCEnnFc7Vtd/eui8YnquLLUhd0FJjrYRliBttyq/PEHbzdAj3CVDKro1KGkF2hCjUzSuNcpBYzajv+6wNWsZYuWZ5R0l/El0qm958ypan0iRrebJFAplt45W+Ddt0axh+blYl2WPQfMcyKUOmhC3KNTGhO49xnrJ6RpQjB3GXVTf8CURbhLKcJCkkn74iy2wA+1POt2lN0BQHjkF+do+k5zwiT7/dagtCdScJUIcc0QvTAf1QHg4=; 25:O5kJeSx8Ysfs6F46IZfOWfnkgAbj6q3asIYElADfN3J7lBpFKa5lLZc296cKPnVYJ4JnENaBaWd2z1EUPb6O+hKfxui32OycqxqVzmuygH8wGdWm4Iksnap77plskkhUzc1MCcMepi6AdgETn2Ovq8neGSoKMsUB7lRyN2jyFx3jTo2hg+szEzx+en2LYEfoQkM7U1tyGJZ1xQ7tlqNGvv6J8xNs1HxjV61+JelvCAfsBXYpIt1HByAMOccBErbQYgn0BWiodsyrdkaUPRSIMYJBUCOJcrXbNeBLNCZitn36KgEBHNAMe75pqiIrNDcGOyoiI0Tmotax6AZeLQl1Gw== X-MS-TrafficTypeDiagnostic: CY1PR03MB2267: X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2267; 31:ypam2H/ouR7wgS5vi3AN/NvazNSSl4nufDNfAegMVmibPvvm27H7M/+vi+kIU/dhXniODBecCVfdlCzgV9weAh9YP730JoNs6Tdxg1ztT1IHJx0HcESBOkdjGIEwYp219PxmosKosexs0UGzdA/cxEGijEZos7tWUwMBU3lpoRwkryqACot26Y5wRnyXdvtNLPjpMtjCCRQauvcHpc4eM3vL373UqIPeefwSkM4gSIc=; 4:W7WAAbbeCygYhoE8NTUFTCb3OhEoHUJgwTUVJx1sW7wsDy16Wn1bUuNNsM+aaiFGA1yi5bKwN9GdKoztk8aASj6bC/LUXll3Ql/f78U4ThYzjGlXiMM0XR55F824e9c3K5QtYegjqyDFr/8q9rHxqSyW8rMNlFMTqgCf+XcqoWFK4RYVUpHjnZf0GZEj6hCfS+4g69ez2HEwdgBS8OrXLd2zSZPZMGbzEoc+GP/ME+BDm+/Q8boDYAj0uhZwfgqUB4eEOO3CUiAvm5IIf7z/rG/n1GmV+BHLv/IrZNrG3uU= 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)(3002001)(93006095)(93001095)(10201501046)(6055026)(6096035)(20161123556025)(20161123559100)(20161123561025)(20161123563025)(20161123565025)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(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: 0425A67DEF X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2267; 23:OWUtfXJ99dsnXclYYV29TVe4IX3VYUK7rv/xXfn3P?= =?us-ascii?Q?/WFtG63jkWVryZleC/Z5ycQJGqVb6ANNCi5zNfmcNB0WVQ0IYr7bBEE396My?= =?us-ascii?Q?vRn48FcMbvzGvr5d5rvFDyzg6753lWntQp+H0RXBDGc6xMNtMluTFREqscKs?= =?us-ascii?Q?9HWmBvqfJelc5MxkBNSchzE0+UptseGgbG6mo6KCfAwyCetThLOQRfozVMSF?= =?us-ascii?Q?GPqOLgHZkTenYWIT9I46aLJeKynTwG86dgzd+5DFxr9nnPekJ9WlTfYKFU1y?= =?us-ascii?Q?ZlACUKf583BxH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microsoft-Exchange-Diagnostics: 1; CY1PR03MB2267; 6:m2MJVCShvoF7ex6iGADRE7Y/t3mkOYxJNCT/GnXTXAVVMLl8pA0UXpxH8sqs9UlRZB8yG84yiqd4z3GQSlSww0eUikB11UDrLKS6XcJ+qp5E9dEegrbbsDKJVfecNgwZsefJf/sOq4aBLOtcTPK8QvaqYzUirON0WjQ5QhW8LQd7tZVq+DA4RZ4cxrBEcgpg7fQSM7p4BS47svDuNcR67PR0B/JLgZqL7oGbmzyBxJQE/XnF27KgQYiXUI41bqYQ+ZUmWYDeJYnimg/LCu96hchX5J9Ncl3KNBaReyuKoM+CHo5SbvX2l1VyUKA3VqFctbogg0jT99Rq9T8QO1FdSw==; 5:4B55jr0JUHrQg4K9hFirqA6n5J543BWZd8+d4ZKCRw4nRPA7PPXUNtgA2jc5wqAQYNKibJZYRYpo03nig0tBsJSDG2Sb+rXCe5swlsjDA/dDGXV1J1U2PRZrV1ihw/1GdEIuW62lC6V6TAuA8GcY/g==; 24:lm3q/iLPqiSdNHcqUIGzgj71KY1IiUbKOYg+pK4Yx5+hVr9kJ1g6ZoaaJ9MMvCFlrRKxvmVBPJCF54GoM1ZyHPfwMTl/Z1UFIa5AJ9BVACQ=; 7:Ugp/bAgK9x6UOCFCTgKiyVFoKwD2fgdXlHzHFj+XVqPMjOFDJKRqr5Y9D0svhkgEPncp2H3Q/HBiNVxxfMGHpk+ig3g4sWqHdJFb6MvRMP+ci4KdsH44Bq19oyVW8VMmQkWyN0Yy4qYIIjwJGHUtUL1rWpq8W9aqk1JzZV5ypVFmDaZOGlCc1nhrPFXHw542/EGBb83jwyReRi9W26wzEV3zNalCyHEcB8IUpfetOi4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Sep 2017 11:11:44.7119 (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 v4 39/41] 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: Sat, 09 Sep 2017 11:11:46 -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 1deefd3..3e3e091 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_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) @@ -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 8133a89..3c11376 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