From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00047.outbound.protection.outlook.com [40.107.0.47]) by dpdk.org (Postfix) with ESMTP id 265D41C43F; Fri, 6 Jul 2018 10:12:03 +0200 (CEST) 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=VM/Y6zCa7x/eeaO9INYVT8R3qtHuT+ev3wbrH2sTeGo=; b=vAkURQoc/9GHUkoLbRt4PbXKnQo+SykJHPQpof1PGF+CjvRZpTGcJDdJ0qs4snUZBZ1pOkBZkbQXor1nJPeBP8HIQlTwuFxnlAn3d9gQR5xMQ/SLlLLKm3NmEy3X6kwdYMZrEnlM8qsvG2osNlmni/0B9ALL9gV+NwPE9TSP6Pc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; Received: from bf-netperf1.ap.freescale.net (14.142.187.166) by AM2PR04MB0755.eurprd04.prod.outlook.com (2a01:111:e400:8411::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.23; Fri, 6 Jul 2018 08:12:00 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: shreyansh.jain@nxp.com, stable@dpdk.org Date: Fri, 6 Jul 2018 13:40:01 +0530 Message-Id: <1530864613-11754-4-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530864613-11754-1-git-send-email-hemant.agrawal@nxp.com> References: <1530697431-1244-1-git-send-email-hemant.agrawal@nxp.com> <1530864613-11754-1-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR01CA0076.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:1::16) To AM2PR04MB0755.eurprd04.prod.outlook.com (2a01:111:e400:8411::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 66d75303-c442-4e46-f30b-08d5e31826b8 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(48565401081)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:AM2PR04MB0755; X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0755; 3:kBlXYSM2POK+2d/+LpC8ughmdyYPUNdq/kLu8MD6Z+ZxJvMiHgoySvSheY517f1LehEZBdaWR3+PuD4KJfKW4aaK1LCAiJ6jf2YUFUMeUXaUQx/Mhu1c8WsW6lRTcn7BqrEkA2Lt8uUtOQSX9HY5zDU0u+tTk0XoBOn4AGf7S+LMczpWuUCDMenMCW8HHu1+8oW7KEaRGZy5UmbfIrnziF0Trpyl679CndM5mLJw2k+acIwQKUFSRQWnG2GwrnBp; 25:W3j9+8gTlUdIwFsyKoBEITMdvDtSouLHmi6b8A/JUwhUY67maAE4K3yRgKcM9s+EqQq/d6GluXCCXP6Ds/9HyZz54BYKwrpTcAPDM9NyGbTBZz9OP+9MRF9r040evwZ235Kf+7JCKr8A7CkFiufCXMNFJYD8nygu2GH8LSX3E8jjKc4Sq9A+sPzcSQ1mjVm2u7KyxzMlqZHQil/+hFCiRu6jDVOpvrtQPU9HbNBpL/JMFZkxHKEk9777ZhORlkt5GqAO+xq3l+8F4fLya5Dt7U5WpK8JyyfsJU32bopy/ePdVWYTmcAJIJ7QeDar9FafntKj0Gv4Q9f7yQB3Fxdctw==; 31:lz0c8CNDxDwezda7uIG3AqCE8YT0CD7TUa+0lctTjSAg2H+/NmBCZgoaaSe4xUg8VkTim+w7mihF9lIOFgl7VeinQ1rqwHGqG8CrcK45C6k8HKGVEdAoyYGNwD5MXeM1+nx1PVATahLTZSE8P4AU4Cv6McvuhWuoDpA4cC9mnAjZRRLgSIuN1GOMFBWvknsq7CFaajiKJeVWwQWs3GSQGT3QD7jK8OlUP+WXodRp4gI= X-MS-TrafficTypeDiagnostic: AM2PR04MB0755: X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0755; 20:epGR34BBEq1XutCD7/GMuvxTWRRf/wTeoQPc9Md9fgJc1uQuaW1ukOUlOFRtZ4WNRKma7l5aXht7BL61uNgoAiMs1RjSjKYvIwdA8OVBLvF8XxvR8z8cWBQatS8zKA5RB9ADvcAJQKqBOCEs+vyf5UdAlB5KWDylcIjyFvPXeCjHW5idyy7pxFRs7hSLuLfUk6EwL6ZyDl7Tn+4K0Lr02X5C1EvsDy3IEfH78G5hkuSWyMf3bpaLH+BBxGxAzYkDe7V0JmpsHky3A5Vo/4urQxIzO1JYDfYIICrxIgD1eV+jZM/A/wHvyML8oWWDNrhfAkzzKtk8taSoIgyYcOH7KyToxvxithuelU3o6ZA7SudPd0bdB52lCNAbQr3eP4hvSLZIbE0xlLICcLyItQpoS1zNJl/1m3D3jFPTLbSDUaGVuUIieHAPvJyyoJ6fxPSrXv2CvalW+6WhsRliGSd6VICrt7WfOp5+8XXtOPgng+BpSj94kbxRd1dkcCeJG0hh; 4:8n4inje5Okau4weWIzjzgXvC0QMnTEW2xsVJz7qG4sG/lwnHNZDaVsFCDD+t20/e/oXtgCT1T8A6KOwQ46aEbAY10eQM0L3cx9TdqlZI6cdb4hfsaIN5462FQgi+YtZOVR786fG8ACJdJxAtX58N/se+guDoz6AraWutv3o+3KDSA9V0LNMy9qDzXpXIBSUMF9mZmg/Tu02E8ApUeJylDbPmdqBsQh0Rwr16eEL8vBNaT5MVqBFJ/i0rlGJEchngg47sC7QxXIYOb4xVua/UlePC3xVon8Rv45Zwld4OtgAJ/9UEuQCJU6b1RV73ceAF X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:AM2PR04MB0755; BCL:0; PCL:0; RULEID:; SRVR:AM2PR04MB0755; X-Forefront-PRVS: 0725D9E8D0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(39860400002)(396003)(136003)(366004)(346002)(376002)(199004)(189003)(956004)(66066001)(446003)(6116002)(2616005)(476003)(5009440100003)(6916009)(76176011)(186003)(16586007)(16526019)(105586002)(478600001)(86362001)(450100002)(44832011)(106356001)(3846002)(4326008)(5024004)(486006)(11346002)(6486002)(2906002)(25786009)(305945005)(47776003)(50466002)(2361001)(7736002)(5660300001)(6512007)(48376002)(8936002)(68736007)(36756003)(97736004)(55236004)(6506007)(53936002)(26005)(51416003)(50226002)(8676002)(2351001)(81156014)(81166006)(386003)(52116002)(316002)(110426005)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR04MB0755; H:bf-netperf1.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM2PR04MB0755; 23:791lE79OkA+l5cpTU7Ob6qkZPz0yupRioQ43H+T05?= =?us-ascii?Q?gARNg8PjnZJ7WRpy+Ch6m36fsaFnns++WyTDLZtkhDxM1bf30zWZCOdAjoBi?= =?us-ascii?Q?LDGut9JmG347GpCRZX5HYSKKiwEAenViQc821FyQ5nOumwMBPpafuzEWicnW?= =?us-ascii?Q?0O3uypEV8dTGAxfBAI/ba9EiHIabF6sbq2u5uX3nBpgebPiTtFmmuVGZemUM?= =?us-ascii?Q?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NG0/Pzrpnbab?= =?us-ascii?Q?tuk8mCZ7s4aDZHJrKidoLMDpp0tcgzOXOea9U9CArXZ9oaqiTTxnOfFhdgXo?= =?us-ascii?Q?TXx9QOfmyTk7SjBhOg5m02ULUBxhMlsYSA44nbokDsE6H6qd2WdsrDvr2+fF?= =?us-ascii?Q?DUUSJGgAWk7iClk35vgLGvxhUCAo5SPD3RptQ518+VzoLEDBCdMZCt1pS3V7?= =?us-ascii?Q?1nD8PdM42ZYwM/J9FJtuUKP1lMnUyWg0w8ziD74aeyUU7JgN/oF4Tp7WjsQI?= =?us-ascii?Q?W58VuCs/COJBgOdcbv+2XgmugJ6eA7LfGGBM728DnZWhHjX0hx7hVT4b66tG?= =?us-ascii?Q?MBb7OcIGA=3D=3D?= X-Microsoft-Antispam-Message-Info: +p238KtePdaUqS26pj1Z0o50Kukyx60AgIrUyfLIAI+zcqec9UYL/BONsHke/XRQW2T42Ox/47aekH50fI61ZDZp/Bl9v4NM/9CbwCoqUWkN6XyUtJQO32AvJBWIGo4XMnNZuWDefh0eQ/MQzNGDecGGUIlej5PTFooL8VxigOoSPR5SME2yz0qLjXOuiaRSP2e+G6JSaDOyYECsam1uedskXuw+ei14/0+/8xWJv+Bw7Jr9Wv+Q67PVZYTYASyvCUGDN6251rUHONQM7qbK1d6s72hwZzp4DEnTL99ceVxS3r3BBXLTP/JryaMef1AXpRfTadTHu58KROgP4P4dll2keluSO1uwi7BBX7obxEo= X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0755; 6:UHWrcPBEecJXxzpvIUJNUqRMeA54qRgh3xLKAkrEwkVyY6Pfg7D7esPDPWaX2BdxjPRmK/SO+aIpunSoHr1SAT/isjXmeWhe26aUMMxerVtdNT9bmL136freSBvjMdEepEVi0Va3N9e7+h7McZIHUCJ6vltmNbs7KWaxCzyMJaeYtDIaW5m70uwNxPOKYGNW6np+QtVhptylarhAAzNLKKR5lMxxpQjawYR9OOONw1BxnAbWrg/juqM4C/3XIv3jsC+FxsEt0PRHNKexNIGLjDzqcXiKEKvSJT8Cd8TsnnAznOAMYHhlj0qxc0iZjiwprdobazG/goypFJl0ZZXSK03ZL1apfNQZbs/3E4Zxe6Zki7pIWp4q44Zi5KGpfpGhtXNkaPNG0xMzj3c5zQEBkm3mhooXPbsJJ+YQRGwuI7Q6+r2kYAW++vGBiN8Muy1VsXYsr3qs5fTh3e3Qu9BG8g==; 5:xavOM2Buh4UqniMArmW0tGEVNUJYxbgoIoI+pF0aUmzd2rdQ/Q5cwsXigOrOCcGjDQ1IpoGUVRd+nye0X0HFz/129lEz769i15pAfW4N55vk897FivWsAhlWQsUsUh3iv7vHQDm9VV69qAjEH2UBoI5UVRIdS6L7GY7qfusVk3M=; 24:LsB+yrn7uqabArej5+eXfylxbGx5L/5MXy8DTaye8D4Jf2pYPPO8yhMBVBd7vZOFtBVDM0VyPlpRH1NgyZQew9M4nUE3AP2RCRReqMst2ug= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0755; 7:2QldV1n3U2r+1t999Ff7H4aHgSg6eDUnSFFaqyL0V6uKjSPewoW69i0i1QgRgKnZbTNp8U1o5tB9VRjwuB1uGNEKGVQTOATOdCuOYweVzjjlp/SL0DaipCQTKt/W/DyKu2VfjqOGCTgtnYVuNtP/Ja4NT6A1Ez+BDewAALCYQhNA+//aDAyRU/O10/yBfCZkE3c+7V3sJOpzylnwFvc7FmB43BL9sRldpJEu+fTCRisLCc38ylHYjaMOI2A9nIrg X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2018 08:12:00.2421 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 66d75303-c442-4e46-f30b-08d5e31826b8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR04MB0755 Subject: [dpdk-dev] [PATCH v3 04/16] net/dpaa: fix the queue err handling and logs 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: Fri, 06 Jul 2018 08:12:03 -0000 Fixes: 5e7455931442 ("net/dpaa: support Rx queue configurations with eventdev") Cc: stable@dpdk.org Signed-off-by: Hemant Agrawal Acked-by: Shreyansh Jain --- drivers/net/dpaa/dpaa_ethdev.c | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index d014a11..79ba6bd 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -516,7 +516,15 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, PMD_INIT_FUNC_TRACE(); - DPAA_PMD_INFO("Rx queue setup for queue index: %d", queue_idx); + if (queue_idx >= dev->data->nb_rx_queues) { + rte_errno = EOVERFLOW; + DPAA_PMD_ERR("%p: queue index out of range (%u >= %u)", + (void *)dev, queue_idx, dev->data->nb_rx_queues); + return -rte_errno; + } + + DPAA_PMD_INFO("Rx queue setup for queue index: %d fq_id (0x%x)", + queue_idx, rxq->fqid); if (!dpaa_intf->bp_info || dpaa_intf->bp_info->mp != mp) { struct fman_if_ic_params icp; @@ -580,9 +588,11 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, opts.fqd.fq_ctrl |= QM_FQCTRL_CGE; } ret = qman_init_fq(rxq, flags, &opts); - if (ret) - DPAA_PMD_ERR("Channel/Queue association failed. fqid %d" - " ret: %d", rxq->fqid, ret); + if (ret) { + DPAA_PMD_ERR("Channel/Q association failed. fqid 0x%x " + "ret:%d(%s)", rxq->fqid, ret, strerror(ret)); + return ret; + } rxq->cb.dqrr_dpdk_pull_cb = dpaa_rx_cb; rxq->cb.dqrr_prepare = dpaa_rx_cb_prepare; rxq->is_static = true; @@ -657,8 +667,8 @@ dpaa_eth_eventq_attach(const struct rte_eth_dev *dev, ret = qman_init_fq(rxq, flags, &opts); if (ret) { - DPAA_PMD_ERR("Channel/Queue association failed. fqid %d ret:%d", - rxq->fqid, ret); + DPAA_PMD_ERR("Ev-Channel/Q association failed. fqid 0x%x " + "ret:%d(%s)", rxq->fqid, ret, strerror(ret)); return ret; } @@ -715,7 +725,15 @@ int dpaa_eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, PMD_INIT_FUNC_TRACE(); - DPAA_PMD_INFO("Tx queue setup for queue index: %d", queue_idx); + if (queue_idx >= dev->data->nb_tx_queues) { + rte_errno = EOVERFLOW; + DPAA_PMD_ERR("%p: queue index out of range (%u >= %u)", + (void *)dev, queue_idx, dev->data->nb_tx_queues); + return -rte_errno; + } + + DPAA_PMD_INFO("Tx queue setup for queue index: %d fq_id (0x%x)", + queue_idx, dpaa_intf->tx_queues[queue_idx].fqid); dev->data->tx_queues[queue_idx] = &dpaa_intf->tx_queues[queue_idx]; return 0; } @@ -1016,7 +1034,7 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, DPAA_PMD_DEBUG("creating rx fq %p, fqid %d", fq, fqid); ret = qman_create_fq(fqid, QMAN_FQ_FLAG_NO_ENQUEUE, fq); if (ret) { - DPAA_PMD_ERR("create rx fqid %d failed with ret: %d", + DPAA_PMD_ERR("create rx fqid 0x%x failed with ret: %d", fqid, ret); return ret; } -- 2.7.4