From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0042.outbound.protection.outlook.com [104.47.2.42]) by dpdk.org (Postfix) with ESMTP id 89B231BB22 for ; Sat, 7 Apr 2018 16:34:51 +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; bh=WtKz5KMnOPcDxnkomM6BiIZm6GXZxSDv91MUzqu2Kc8=; b=lmuR6FZkdouPp1xPQOBMTs4YLnK7WO6l1k0TsreMR5aopK11YoiMpkjG3o/bQPgrkTDyJhSo0ZCkQexCZPFlWQuK+EfbDAmewd0rrKSH3rtbSaX35BbajSNyNRdxo32uGwBpNDvmdlnc8wn0y/DZS9ttcL7x5+pnpkDJ2UERMhQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=nipun.gupta@nxp.com; Received: from b27504-OptiPlex-790.ap.freescale.net (14.142.187.166) by DB6PR0401MB2424.eurprd04.prod.outlook.com (2603:10a6:4:4a::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.653.12; Sat, 7 Apr 2018 14:34:49 +0000 From: Nipun Gupta To: thomas@monjalon.net, hemant.agrawal@nxp.com, shreyansh.jain@nxp.com Cc: dev@dpdk.org, Nipun Gupta Date: Sat, 7 Apr 2018 20:03:59 +0530 Message-Id: <1523111645-8076-4-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1523111645-8076-1-git-send-email-nipun.gupta@nxp.com> References: <1519292089-13851-1-git-send-email-nipun.gupta@nxp.com> <1523111645-8076-1-git-send-email-nipun.gupta@nxp.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR0101CA0017.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:e::27) To DB6PR0401MB2424.eurprd04.prod.outlook.com (2603:10a6:4:4a::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 09f47bfb-b3cb-4922-dd7c-08d59c94b829 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(48565401081)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB6PR0401MB2424; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0401MB2424; 3:K2aG+eCC64mQgFlDaDYpmcTe0DYwgPzh6QKxtdmP4upnxM8WWa+zEAKtbjsJ95l7B212g0e8tfy9TkM4bXHwGm1q6FgQOla+BKfR1X4frqnsR7h8PbmKlCV7AuRZnP/4vfi0gzq6wIlGRd6YN9WmT0TbfzMtPkzyFmgyLST5kOzwBhb5rLC5waSu0fCzMqdzzQqJomJnp2orVrLJX3yUBdrgpfZEdDX/8x27j2zeu2+zeG2Tyg5zoRnYPX7jjrvc; 25:Pk4Vt8MzxugZtC6hIMuKf3y9aA/PkLoW7PFEFSK2XcDE8IMyZT75gAzfVa6CeZBLn0gcHpJuRtAH56MiT0CsBHe7dZ4qsV3TgcehovqIVdVpJIVglICKwDngxnI5JnPdLYNtyjbhWeyRELB01VOxR4g7x6OPZ8Lo1sTFcPhIVeVQBGedVf88AnFYQKsWWHdk6pBUOitkb99mzBMin3aPe8QNQpMLCcbDZqZlfp2hFeOxpQWC7d4IPZy6oXjLId5R5lKtzElMiL5VmHbQKZmXDoYpwfYHUQtnPtAA1apPI85iwMOSHLNEWApa/Xjnr6SpiMkOrahFstcKxpBMCvZDfw==; 31:tdFMv2VWsJCBfiYSonxbFbSB+MqOZCOThv5P2zI5gKrlYX/xY9bh1p0Mfa2gcYuRKWdGuEZR2uoWO/r9KejIz09HPkd1/bgxWrurltvCdzNFxNi7BkEYGGJ9WsnsJIIeD9mkPv94l7VkSxwg43FRggt9cd4vBizBJfMoZb7Rc4hxfdEUjuYlTmvqwUmR2nMQgFHurSoBRpIzm82eRYHTKvM8C7XSVKlnocUJNzVPrWM= X-MS-TrafficTypeDiagnostic: DB6PR0401MB2424: X-Microsoft-Exchange-Diagnostics: 1; DB6PR0401MB2424; 20:9fBWCA/wPcgXRcoodDXByUwHDuX4yuSW2KMTMGCqomh4O+14YSItHKK7/wQtqd4CCT/XUuWkvgohqVj5g/3DOkEVSLDPSpRMwo1/4u9StxQiwdXXlm9RXHJtVnHKbkFiJE6chJIKgOQ0MZ2zx+EifzCLcnxsixuxgknDZvvjv3IEKJ1zr9Fx4veNdr0XfzafDvwMKgX0E6gShsZy45/2T3QphkwSIjrc9wkMAFqYymwnpGGrkJZNkd8P20MYg71vGMEP9Oe5MOUSbyYRW589oI3tP/7bwzbgSRNF4vD2ZbhhXoaymsnwkh2kahMn4nXXXa25CNBjeWFLi5Epk82wFMBXw47M9Yb/2m4xUY4yqzfxOtdJthQ+nfPfUDMksZWN6ygjUKFaZ8XCRZ+9lXxqtf4crLwUflNzP3HTm5Ib4lNVr4IHz4q8RMKt5fvV9hEZSxTtFYwhLUCXR3s/LevB4pmpvzT6GD/QH+Mw13x5mH6+u1JR9qQ3A0eCQg1VlNfb; 4:SEja59bGGck668S2hrLndCbzyBhlk6SFxnip0IB4Lr5qRAHpQhUnkzpB2O15UGm+MOR+Uvtq6vd/5j9IGB0YIZ827S34OGFu19P1dzn1gpizEV4Ynm6Ay0BvSLWqFZbdS07hPADd05cjZnkr8MLyO6AFOd1KLxOgiD4pa8jKQzp4RF7yZjDxGVsHVshp3sfMj7XsJHHDDM/mYpPxTv1dP7D/P+NEQYSow/zKK9eOZ7zdM0b27o5D78IuIpH+b2SqTYRliZORbok3zLFXGWnTZpSTzsJaNtBaFy8cYU5sRm/CQy6VFuwxDOwaxdxyeMQKTDYu2kouu6leNeRm/37gDlSau8jkr46+glTDVyQhdUk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231221)(944501327)(52105095)(10201501046)(93006095)(93001095)(6055026)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DB6PR0401MB2424; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0401MB2424; X-Forefront-PRVS: 0635D5275E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39380400002)(366004)(376002)(346002)(39860400002)(189003)(199004)(105586002)(26005)(446003)(5009440100003)(48376002)(50226002)(186003)(16526019)(53936002)(47776003)(50466002)(52116002)(476003)(6486002)(36756003)(76176011)(305945005)(86362001)(66066001)(6512007)(6116002)(2616005)(51416003)(956004)(2906002)(16586007)(3846002)(4326008)(7736002)(8936002)(478600001)(81156014)(81166006)(486006)(11346002)(5660300001)(97736004)(316002)(6636002)(55236004)(6666003)(59450400001)(8676002)(25786009)(386003)(106356001)(6506007)(68736007)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0401MB2424; H:b27504-OptiPlex-790.ap.freescale.net; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0401MB2424; 23:AIPtk5+CMMI4iBptybzawPnkWNipk4jtV5rKAGI?= =?us-ascii?Q?joxBc99HpcKk4LlucZt44qDjCze/rh45lIdcso1X20aKxZkbp6C/KBx6u4JQ?= =?us-ascii?Q?ZG1Lngyoa3gBQSQMW4csjDuepWi9diXeV4UnmhUv5eTQXBTxOmjPa9tg86Pc?= =?us-ascii?Q?qx6ID8q+A2kQy9VMMWn5Tl/p9tZslU1LBPO3Ru/bBbsODDS153t4LbufPEP/?= =?us-ascii?Q?1dn/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Br2pxTjTQU0AN7e31epZidrp7hXnK3DpotbCqHe6YXkt3Opxp9GukcaOmx2cAh8jUd5gk71v4F1OhKDeOPeOFeqyNSQGkx1Fc=; 24:cFRGTcuYfG0pIWfWFinXcDn3gQLBDxgs8IvHVj6su74gFExZwLqBbq89+Q4C1wxEYCdh+xjDei5c4fLpAj4Eo/cRDOEh5wHngz2IqvSsbAk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR0401MB2424; 7:0W3S05kcqfJ/E4xKivF/JbavCHmSmTstreWXYwVo1LsUhGxk+FxEnJcLCw6fQsIOJgYJN9vkZ1Dji/WHSY7ShXAGEv1Tx+Bu/1wjjfCHLbmfTraE7Suj4mpQh6cYVOotpXG8V4NHVw+dlC4YtjUwqMjJIANuoABLMbGfnBBes2nUmpMwJwEk1cPYE33ihpnCOlFnTSkvKi8+jT2JD7PJxej+G2UMOitHg4UNVZyU1ZbgsiwO5i71vNpKDsGplfcv X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2018 14:34:49.0543 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 09f47bfb-b3cb-4922-dd7c-08d59c94b829 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0401MB2424 Subject: [dpdk-dev] [PATCH v2 3/9] bus/fslmc: keep Tx queues information for DPCI devices too 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, 07 Apr 2018 14:34:51 -0000 The DPCI devices have oth Tx and Rx queues. Event devices use DPCI Rx queues only, but CMDIF (AIOP) uses both Tx and Rx queues. This patch enables Tx queues configuration too. Signed-off-by: Nipun Gupta --- drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 57 +++++++++++++++++++++++++------- drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 3 +- drivers/event/dpaa2/dpaa2_eventdev.c | 10 +++--- 3 files changed, 52 insertions(+), 18 deletions(-) diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c index aee870a..3bf7e7f 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c @@ -39,6 +39,7 @@ struct dpci_attr attr; struct dpci_rx_queue_cfg rx_queue_cfg; struct dpci_rx_queue_attr rx_attr; + struct dpci_tx_queue_attr tx_attr; int ret, i; /* Allocate DPAA2 dpci handle */ @@ -67,17 +68,38 @@ return -1; } - /* Set up the Rx Queue */ - memset(&rx_queue_cfg, 0, sizeof(struct dpci_rx_queue_cfg)); - ret = dpci_set_rx_queue(&dpci_node->dpci, - CMD_PRI_LOW, - dpci_node->token, - 0, &rx_queue_cfg); - if (ret) { - DPAA2_BUS_ERR("Setting Rx queue failed with err code: %d", - ret); - rte_free(dpci_node); - return -1; + for (i = 0; i < DPAA2_DPCI_MAX_QUEUES; i++) { + struct dpaa2_queue *rxq; + + memset(&rx_queue_cfg, 0, sizeof(struct dpci_rx_queue_cfg)); + ret = dpci_set_rx_queue(&dpci_node->dpci, + CMD_PRI_LOW, + dpci_node->token, + i, &rx_queue_cfg); + if (ret) { + DPAA2_BUS_ERR("Setting Rx queue failed with err code: %d", + ret); + rte_free(dpci_node); + return -1; + } + + /* Allocate DQ storage for the DPCI Rx queues */ + rxq = &(dpci_node->rx_queue[i]); + rxq->q_storage = rte_malloc("dq_storage", + sizeof(struct queue_storage_info_t), + RTE_CACHE_LINE_SIZE); + if (!rxq->q_storage) { + DPAA2_BUS_ERR("q_storage allocation failed\n"); + rte_free(dpci_node); + return -ENOMEM; + } + + memset(rxq->q_storage, 0, sizeof(struct queue_storage_info_t)); + if (dpaa2_alloc_dq_storage(rxq->q_storage)) { + DPAA2_BUS_ERR("dpaa2_alloc_dq_storage failed\n"); + rte_free(dpci_node); + return -ENOMEM; + } } /* Enable the device */ @@ -101,8 +123,19 @@ rte_free(dpci_node); return -1; } + dpci_node->rx_queue[i].fqid = rx_attr.fqid; - dpci_node->queue[i].fqid = rx_attr.fqid; + ret = dpci_get_tx_queue(&dpci_node->dpci, + CMD_PRI_LOW, + dpci_node->token, i, + &tx_attr); + if (ret != 0) { + DPAA2_BUS_ERR("Reading device failed with err code:" + " %d",ret); + rte_free(dpci_node); + return -1; + } + dpci_node->tx_queue[i].fqid = tx_attr.fqid; } dpci_node->dpci_id = dpci_id; diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h index 4a19d42..bdc33ea 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h +++ b/drivers/bus/fslmc/portal/dpaa2_hw_pvt.h @@ -142,7 +142,8 @@ struct dpaa2_dpci_dev { uint16_t token; rte_atomic16_t in_use; uint32_t dpci_id; /*HW ID for DPCI object */ - struct dpaa2_queue queue[DPAA2_DPCI_MAX_QUEUES]; + struct dpaa2_queue rx_queue[DPAA2_DPCI_MAX_QUEUES]; + struct dpaa2_queue tx_queue[DPAA2_DPCI_MAX_QUEUES]; }; /*! Global MCP list */ diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index 9d9c8d3..d91254c 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -87,10 +87,10 @@ const struct rte_event *event = &ev[num_tx + loop]; if (event->sched_type != RTE_SCHED_TYPE_ATOMIC) - fqid = evq_info->dpci->queue[ + fqid = evq_info->dpci->rx_queue[ DPAA2_EVENT_DPCI_PARALLEL_QUEUE].fqid; else - fqid = evq_info->dpci->queue[ + fqid = evq_info->dpci->rx_queue[ DPAA2_EVENT_DPCI_ATOMIC_QUEUE].fqid; /* Prepare enqueue descriptor */ @@ -733,13 +733,13 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, rx_queue_cfg.dest_cfg.dest_id = dpcon_dev->dpcon_id; rx_queue_cfg.dest_cfg.priority = DPAA2_EVENT_DEFAULT_DPCI_PRIO; - dpci_dev->queue[DPAA2_EVENT_DPCI_PARALLEL_QUEUE].cb = + dpci_dev->rx_queue[DPAA2_EVENT_DPCI_PARALLEL_QUEUE].cb = dpaa2_eventdev_process_parallel; - dpci_dev->queue[DPAA2_EVENT_DPCI_ATOMIC_QUEUE].cb = + dpci_dev->rx_queue[DPAA2_EVENT_DPCI_ATOMIC_QUEUE].cb = dpaa2_eventdev_process_atomic; for (i = 0 ; i < DPAA2_EVENT_DPCI_MAX_QUEUES; i++) { - rx_queue_cfg.user_ctx = (size_t)(&dpci_dev->queue[i]); + rx_queue_cfg.user_ctx = (size_t)(&dpci_dev->rx_queue[i]); ret = dpci_set_rx_queue(&dpci_dev->dpci, CMD_PRI_LOW, dpci_dev->token, i, -- 1.9.1