From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20042.outbound.protection.outlook.com [40.107.2.42]) by dpdk.org (Postfix) with ESMTP id 85C0A1BDCD for ; Thu, 21 Jun 2018 11:45:49 +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=7N/KPdEWO51AJZX/Q++JYfWhSkA+gu8/eQTXbDBNIoA=; b=U+ZBq3LmtOO1pVQWGJVryiiu2qltO34wI/3j/D5ajFwGgvrnCG4tGFgcP+uov8YjNC8lbLhOznq2Bez5S2KdQI3nYN0wlnxfBdMBZXuu2jaCfr7O1t+xwE8SmxFKOc9vwc8LSOFjXQK6tX1jP3XD8FMVzGU+dQTlAZP9C/aWxcQ= 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.863.16; Thu, 21 Jun 2018 09:45:47 +0000 From: Hemant Agrawal To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Thu, 21 Jun 2018 15:14:00 +0530 Message-Id: <1529574244-18997-6-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1529574244-18997-1-git-send-email-hemant.agrawal@nxp.com> References: <1529574244-18997-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: BM1PR0101CA0035.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:1a::21) To AM2PR04MB0755.eurprd04.prod.outlook.com (2a01:111:e400:8411::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0f517316-2335-4065-84a6-08d5d75bc44a X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(48565401081)(2017052603328)(7153060)(7193020); SRVR:AM2PR04MB0755; X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0755; 3:Q50VmUrUxpbUR9BgqaoJz6XwXd4YScbZa155CL6OxPvjKRhJHxKJwbWExWCkaRN50/54Et5J3/g6VCQGqPGP9r0LI0uMjLIXYrZbf3XM4oPbsaiDz1xw3UzzSdaE7UO6N891e3zqm4nEM+pOTatFy+KnYHWxAHrDgYOW3LNcJNDaWTHc2lri1TwauoN+vUmKaR7oWj65wMiGi7+fePe07f28BSgnldstwkG+nyaDyzrx4usM04DKgCqrrB7dgnhB; 25:kgcKB5K+fB5Pd0IIiy328YYgJFe6giKM3hj/FXVkYiGIWzEm/cQoc2SUj+EvXJnqHA1SQEdeDI639+/MNu0u59AdwJIuveWwEMHKexeX8yx7x7J7o57DEDVT8X57uvXdt+mbKDkZBA0Wp14HxA82dMiAjSPjF7AaEjYtXzezctcBbyDuIdHlHhy6rfmwdLRu9GYWtiXoX1fDlfk2pkibwP2r0bTcnsgG6TjrBhr6EWI3z5/aYDelC0Hs54hOzArLtl73M24yedcjxFKfrsQFhHRXnkZThBInbkk7yBZEB6eAGLcLFRqMZZSF7TI01fvoord0cQ6wz7QSlL6urbGrTg==; 31:om35WF9cg+Oi7VXYi6JH2zom4okgA99u1DxCYSFKOqhJaS8Ma89wl4KHVRtt/AtqeD0E67eRdgLjF/hyMXcCz7U+b0ZrfwtzvAdAgHQTwSb+5PL8eA5bwiKHd7ssvq5kB/ABiBjivCP+g4S1JudHrK1gmgOn1X4vPt4m0d1Xj1NpOB1p0a6VMh3Q1k1FlJRfcIpS6HB/1eTbd4BtmGH2hEzhRk/IATjoQCPO2cVz8Eg= X-MS-TrafficTypeDiagnostic: AM2PR04MB0755: X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0755; 20:F2mi1nnV5KVNsrfkYr+DstK9DSfI4QD65g4l9PppB4TYGihDwSVQ2+GTHSKvsR4WBh2E32XmaMRJpnir+BnbdFAMmZLj6Hbp0jpRNPX01MCE3+jvAtPI2hGIP7KqhLD+0jPO5xEvayDOUPcms4dsOZD3bGqB5K1dZwcXap5inymbYmXI8NBQ5Nn+MvLL9qV9UNwGWOSigHMnABLWSfSLuPrYO2/mwrrC+nLBOC+9R42up4Qy+RYM4Dt37/y0kFrDEYp+itvzBg3+ib5sa6BieAAmILBJulBjOXy9nSn1SZbplvm1jRc0pAOO9FBEhiJiWwQVSGZAOBbDLNMNuXioVMRfe3A/MzRb0sm6eZJUEn0SKJ/FyuyiQMerSQvudy0zvaL1Z/GOMPd0cCXnLXsKUbmvmRND2uYGRXqEY43REO8A5pw/nNZQFjgBieS6XX0sfxRBiXfQMY3kygcrbqmZ8qD02j1qjvshvHVCTHDJ4zRKvs/dDm1DefEGBE40y8u2; 4:H50UGKMlLm6A6ElCny6y6gRNQH0GMe4vDFuJOCuV156AeFJn6ie+ZMaTCZ7rSF9CPCNpjm429I5mzoso+i0tckE4YVd67NiXOX+50o7kBoo15r3vxZRtmW6J3QSclDhNWfyECyMEP8IaFo6DxSw+weD3PLlhlT/2nOio9RFU9ZVwkAoe1zTes51J+apuqY/pp2ANYaEHAdZ4hg5ESzEDeeXW+XLTwQMeKtr/+cpJSg+yS/XTGQm7yeu7frZOyocPn41y112FGgAG3RQvj6uj8Cajx+tgpxP/qoYfgky2Jjqy0amiySfaiNnXjBNdtfLZObgXYDP7A/Uq8++uv9xWG8cQs6YVmfMGq3x42m/7ybI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(10201501046)(93006095)(93001095)(3002001)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:AM2PR04MB0755; BCL:0; PCL:0; RULEID:; SRVR:AM2PR04MB0755; X-Forefront-PRVS: 07106EF9B9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(376002)(366004)(39860400002)(346002)(39380400002)(199004)(189003)(50466002)(6116002)(6506007)(55236004)(76176011)(59450400001)(2906002)(6512007)(478600001)(51416003)(48376002)(52116002)(3846002)(2361001)(186003)(26005)(16526019)(956004)(11346002)(97736004)(2351001)(5009440100003)(386003)(446003)(4326008)(8936002)(8676002)(476003)(486006)(7736002)(81156014)(81166006)(305945005)(16586007)(6916009)(6486002)(105586002)(106356001)(2616005)(47776003)(53936002)(36756003)(50226002)(44832011)(86362001)(68736007)(25786009)(5660300001)(316002)(6666003)(66066001)(110426005); 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:KbAD/laiYP+svaf8O7Lxz9A26GWFeogq358qh4Jah?= =?us-ascii?Q?Tj/oyN7PPjsvIchsZwcRH46/Jwb42AihEbptzXZVpo84q0Il9+tilxCrXwLP?= =?us-ascii?Q?+oCMBWRyyq2+2LIs3p6AUnWru3cNin81pP+Im3QuVjKU3HabxfVcxE2aV+H4?= =?us-ascii?Q?3dIeR/rxhiT+39pxfvd0teMuHPupDn+zY+3Xjc7j6XCszElhIwD3/wT/elBy?= =?us-ascii?Q?ZQiZ2HPEez2c9FGjz1eWLAHDGVT/JQD5biS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HkXd4mk0Ym8aWjrSPGTxvBLcKjW6qpmPUQwKTJI1LgJSlg==; 5:aWeVmiSJS5hkFjoPMqw+sOtL6WYwZYV/d0ZrM7/w6uSsKYYkpljMvpiNbZKDjSThUXV/zQypDjpe2Y78KIuIzkWKzoEp9xvvGfx9upCMg7bZMuQRpW6/2tHX5NV5UF7bRipagur2jHPbL5lJt41NcgCfKTruNAWebQJ97L+OR68=; 24:zxDOrhkxjLvhhtEYkUl4xEmfUuHYGqgLKtJrZ6mcJ8JoLMCgINv58UwolJwToj9CFxrJw1Fe1EKcjtwDW/gDSpiji/qC2wExk/e8xKWZ+0o= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0755; 7:7emCNpInonmqHbs6zqxkyFoiMvgAOeXb1Yg4RMhlBT1be1M/ip4nsFBQplllOMRE1wVRa4s9NRUnVP57cP0Bof/f+5GMMf6ErBF/xLhHgprI/Yas5leGaPcwuZDhalQ11DSKQrWzUwaVmIruRzG3VNdWkv4/jWsdQeyjmhtKCJ96ezH7Npe1IjQS1VYKwDeXWNplzxHf9Efb3RyegJZfzWysYukTAxctZITcZE69u8ZXYt0kIf7BIF5g7M3R3H3/ X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2018 09:45:47.0781 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0f517316-2335-4065-84a6-08d5d75bc44a 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 06/10] net/dpaa: support default queue mode 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, 21 Jun 2018 09:45:49 -0000 In case DPAA FMAN configuration tool (FMC) is not available. System can still work with default queue. (1 queue per port). Signed-off-by: Hemant Agrawal --- drivers/net/dpaa/dpaa_ethdev.c | 43 +++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index d014a11..cf07d25 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -74,6 +74,7 @@ static uint64_t dev_tx_offloads_nodis = /* Keep track of whether QMAN and BMAN have been globally initialized */ static int is_global_init; +static int default_q; /* use default queue - FMC is not executed*/ /* At present we only allow up to 4 push mode queues as default - as each of * this queue need dedicated portal and we are short of portals. */ @@ -516,7 +517,8 @@ 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); + 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; @@ -715,7 +717,8 @@ 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); + 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; } @@ -1008,12 +1011,12 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, ret = qman_reserve_fqid(fqid); if (ret) { - DPAA_PMD_ERR("reserve rx fqid %d failed with ret: %d", + DPAA_PMD_ERR("reserve rx fqid 0x%x failed with ret: %d", fqid, ret); return -EINVAL; } - DPAA_PMD_DEBUG("creating rx fq %p, fqid %d", fq, fqid); + DPAA_PMD_DEBUG("creating rx fq %p, fqid 0x%x", 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", @@ -1032,7 +1035,7 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, &cgr_opts); if (ret) { DPAA_PMD_WARN( - "rx taildrop init fail on rx fqid %d (ret=%d)", + "rx taildrop init fail on rx fqid 0x%x(ret=%d)", fqid, ret); goto without_cgr; } @@ -1043,7 +1046,7 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, without_cgr: ret = qman_init_fq(fq, flags, &opts); if (ret) - DPAA_PMD_ERR("init rx fqid %d failed with ret: %d", fqid, ret); + DPAA_PMD_ERR("init rx fqid 0x%x failed with ret:%d", fqid, ret); return ret; } @@ -1071,10 +1074,10 @@ static int dpaa_tx_queue_init(struct qman_fq *fq, /* no tx-confirmation */ opts.fqd.context_a.hi = 0x80000000 | fman_dealloc_bufs_mask_hi; opts.fqd.context_a.lo = 0 | fman_dealloc_bufs_mask_lo; - DPAA_PMD_DEBUG("init tx fq %p, fqid %d", fq, fq->fqid); + DPAA_PMD_DEBUG("init tx fq %p, fqid 0x%x", fq, fq->fqid); ret = qman_init_fq(fq, QMAN_INITFQ_FLAG_SCHED, &opts); if (ret) - DPAA_PMD_ERR("init tx fqid %d failed %d", fq->fqid, ret); + DPAA_PMD_ERR("init tx fqid 0x%x failed %d", fq->fqid, ret); return ret; } @@ -1145,10 +1148,15 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) dpaa_intf->cfg = cfg; /* Initialize Rx FQ's */ - if (getenv("DPAA_NUM_RX_QUEUES")) - num_rx_fqs = atoi(getenv("DPAA_NUM_RX_QUEUES")); - else + if (default_q) { num_rx_fqs = DPAA_DEFAULT_NUM_PCD_QUEUES; + } else { + if (getenv("DPAA_NUM_RX_QUEUES")) + num_rx_fqs = atoi(getenv("DPAA_NUM_RX_QUEUES")); + else + num_rx_fqs = DPAA_DEFAULT_NUM_PCD_QUEUES; + } + /* if push mode queues to be enabled. Currenly we are allowing only * one queue per thread. @@ -1196,8 +1204,11 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) } for (loop = 0; loop < num_rx_fqs; loop++) { - fqid = DPAA_PCD_FQID_START + dpaa_intf->ifid * - DPAA_PCD_FQID_MULTIPLIER + loop; + if (default_q) + fqid = cfg->rx_def; + else + fqid = DPAA_PCD_FQID_START + dpaa_intf->ifid * + DPAA_PCD_FQID_MULTIPLIER + loop; if (dpaa_intf->cgr_rx) dpaa_intf->cgr_rx[loop].cgrid = cgrid[loop]; @@ -1391,6 +1402,12 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv, return ret; } + if (access("/tmp/fmc.bin", F_OK) == -1) { + RTE_LOG(INFO, PMD, + "* FMC not configured.Enabling default mode\n"); + default_q = 1; + } + is_global_init = 1; } -- 2.7.4