From patchwork Tue Jan 9 13:23:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 123957 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4022443qgn; Tue, 9 Jan 2018 05:28:14 -0800 (PST) X-Google-Smtp-Source: ACJfBotDJiyiPFioL9HUI4LVArAnXnz9I/fTau8w6OInR5s79Eg8zgBpp6WSs+aVjuGN0C856wjc X-Received: by 10.223.162.199 with SMTP id t7mr14011936wra.130.1515504494762; Tue, 09 Jan 2018 05:28:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515504494; cv=none; d=google.com; s=arc-20160816; b=IqOU7jZCS+iUggbZ0SCyFqK0lCwT99NClduU1DGB6/lWjzr6nJ1zJhO8mC1iCParWL DXRPGnA0hq20Wklt3p+Kd2z3JDon0/tyeYZZH1IDuhBesklWQHfTYL6+p8PvWq/XQT9c 3PIAW157O3/6ZpzDpqyyrhRHkOF4bzhtLQnzVeiPxi14Gnx2/1BtoLL8QDJq1Gtr9OU2 TKU3P1aCsKkkZ2kmLsARZrKF3Hs3uUDSM6PryMj+lrYOLBpN5O1YCkLhVH/2uIbjq/xv cQ6VNCtqHVpXuCwX0rTZJksYTYjjl2NVwCZzgDMwqvYeVlqsIb9xlqoyBxvz0ShrWKO7 mP0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=9HYWrsBjo43a4mwHLxLvV+VoarPweJeo6kYvwI0vOmE=; b=zJ9d9yTOukU2ehR3sp2PSiz+2NMz/p++9Nev3S4Ys4reo3GXQqpEf1x6eLdFpRs5VF 3lez7yhkhffGqP01jubWU0ODSLZYr+P6bP7X0D+oNUyxtkxctJ4qYCDE94murPsCtPl8 vuUi/fWxcCqvzrCTVS2BEpaCJx7YjXvxRngqJ4sL4sqSw3COCAdGOJ1z3mxso5h4I6kr iy9v7Q6tqHdFelY4irEpKkGvsG9YCf4P8CicOOsYOaQrnKPdaKVYMR7CXVQq8w9vJDlL 3sVbDKup/y1Qc6vZyrwwbSTICIkqY9xHKVzPljrUnE+SRSLrfNYgtLrwKk6hPrmJeeGZ d86g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id k184si9457248wmd.221.2018.01.09.05.28.14; Tue, 09 Jan 2018 05:28:14 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6CE941B252; Tue, 9 Jan 2018 14:24:57 +0100 (CET) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0062.outbound.protection.outlook.com [104.47.42.62]) by dpdk.org (Postfix) with ESMTP id EC4D41B243 for ; Tue, 9 Jan 2018 14:24:54 +0100 (CET) Received: from MWHPR03CA0015.namprd03.prod.outlook.com (10.175.133.153) by BN3PR03MB2354.namprd03.prod.outlook.com (10.166.74.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Tue, 9 Jan 2018 13:24:52 +0000 Received: from BY2FFO11FD011.protection.gbl (2a01:111:f400:7c0c::141) by MWHPR03CA0015.outlook.office365.com (2603:10b6:300:117::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.407.7 via Frontend Transport; Tue, 9 Jan 2018 13:24:52 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; NXP1.onmicrosoft.com; dkim=none (message not signed) header.d=none;NXP1.onmicrosoft.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 BY2FFO11FD011.mail.protection.outlook.com (10.1.14.129) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 9 Jan 2018 13:24:21 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w09DOAW1017638; Tue, 9 Jan 2018 06:24:49 -0700 From: Hemant Agrawal To: CC: , , Sunil Kumar Kori , Nipun Gupta Date: Tue, 9 Jan 2018 18:53:05 +0530 Message-ID: <1515504186-13587-18-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> References: <1513166759-13466-1-git-send-email-hemant.agrawal@nxp.com> <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131599778619438283; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(39380400002)(346002)(396003)(39860400002)(376002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(296002)(305945005)(68736007)(498600001)(4326008)(16586007)(8936002)(77096006)(316002)(356003)(50226002)(81166006)(59450400001)(86362001)(106466001)(81156014)(36756003)(105606002)(8676002)(47776003)(2351001)(104016004)(6666003)(2906002)(5660300001)(54906003)(53936002)(8656006)(76176011)(2950100002)(50466002)(48376002)(6916009)(85426001)(97736004)(51416003); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR03MB2354; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD011; 1:xKphphRYtlEd6W3beTxUAkEvWdd/7+wahfxZh785iWQVm2wESA75HFEK5scep8FMjrKdTMxh1XPNhAkbNb9wz70sdqEHiCGIy52GgiG9M/i1ZpPyT4fUnBJZ2B//fz+G MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a6f3d63e-0519-4b1d-b4cb-08d557644b98 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:BN3PR03MB2354; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2354; 3:pmXZkDmDcdlunfF15TkdWwwlJCtrirFsdoSwHyXc9n+9n0w4PECyS7EbGDmHFmA/4XlEba1HqeUjlFAanpdItPUA2PohuU+JYRllQSL32HsGA55YBXtu/RDKvHseM4Zbz7IJS3iL7NKUUw6iQOHDUWdFL/iDXOdVDDqWyrFKWPypv4d6fe1ejzqHuHilUwQsXfVvHRbgkaowhTk46fsDIer8liNog5ieAV+dxwvRcUekNyq1jC8fF34CvtG8NEwNZCrzBxg6llgsyGw8aGNzoKrwsU1YO3rSjuUZPmMcbjs93IuKR6/mW7cL95rNooTQpgCSugkQgt4xNAuPIHQ2GxmNRWolYxxo9eZeKlo7z74=; 25:8bjGETeKSPO6krREVwJjyPVXZf/lX676bfV+VXaJNVKbcIz7IqUxXBdIuMQSyW00RtkV78J6ikdYq/ANkXZiAoVOv9WsR4sVpx4BopIx9Oda/EEv6NtKQ+iNt5FsY702uqKrODE6nU3rWXdni8/q71glT9MNNr/uPNs4QG5FyrNc/5kma6e+Dcwk4FzAvHWSEQfzxSE5xauX2sf63KvsLl7mxvFF9L39asN2wx6aT8xrZ3ijqWCMYIRdaDhmlt7O9EiQClECDIrS7v0GLupUtxYIPA7wqlwCsBo+e7nNyJaqpn9yrpJ2j0cV1pYT0dZeAsft+QNcBcEL4oXRZZBEYA== X-MS-TrafficTypeDiagnostic: BN3PR03MB2354: X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2354; 31:bb1LoExxW/SWrnH/ppipoEIJeBFriD1WO9WLn64QCR2EntG9klaqJf52nnx1SnbzLa/YV145S+hDkpMtCOSpo8VrhUKeAXV0wstLk3qWzyDkswBO8bp2ilfBu4WEgaTSQfBYkLE3YWKl25FD5gxzVTfVOHiucqY9IRrUpbj1cLP/n9gnB04DuPqpLxEQvTTda7svqCL2XdqM8moSQUBapWwHQl+XoCIUimI8/47+GHg=; 4:n91uTfNyg/+8cSdg6EHyMDshczEA+SNDNgHMeeEoQHW92kC0yyO9g3mSNgjG2+o5WhN5p5iJnsXFdLq56bqjJqe4j1Tnk4hcVDD6S+Tijf9Udg7V6T1eHqqi6jjakv0AXeZebvscdHnrRo49m/oK7dNF5dwjHgj8xjZYN2CIEQxdVZ0S24w5U6XxqohvW6CgA9Pxis1s5q0rUC0YDwwgSSN+71Ubo1Eg0tkq8Ad0RRXUm3d/3lBhmIqbhQL11UBk3/mlvgLUOC5iKRMzbiHLHdl8WeVKx9Efk3WmoP3mqjxP6sEQf0r6EB/yYFaJ2cOrekW2K7SThOnxtaibs8HmW2NZnjQiYSRWqyn458GxV34xmAR2MhTS0/leYKZlSzxP X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(227817650892897)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231023)(944510075)(944921075)(946801075)(946901075)(6055026)(6096035)(20161123561025)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123565025)(20161123563025)(20161123559100)(20161123556025)(201708071742011); SRVR:BN3PR03MB2354; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN3PR03MB2354; X-Forefront-PRVS: 0547116B72 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB2354; 23:5UASTwPXeClTiGx9HqBp8KxwF7u5QieelGH7RMsb/?= dxRgTYBkwnv5XdU4vXtcBw+MQbzYfWlou85MXMKq1KqRvMCTZMbl/wGJ2IvREZQaoj3azdb95BOlylYy+EZictFtnMhfo4+RW15qNZnJrzIN19uv3wD456MXcWd+GV8GHpFWSvXo7dUPdUvowFv3mRxAB4+2EQdoI73vdojI7eATp8Ltou6sVG+F818XzoJy6zkWA4syjIYa/tfWLgscVlvgKhJqrA1kTeS7SvZhUMeUyGRL8VOhBVQJxL/KwSp3q7lbKMk4/rrRVEk0vonp5AMiMFFNob+qPyHCg+ZQk4z7bSuBdqZfHIxOecfgy69prhUtYT5CkJZI8TaShZ3PZWWCoF9WVoAnxfq/SuON6GuT4bz0t8vNue0X0a4HAGctqMZ6JkCVulJzcSwfvhbjj2/RJ8h5Bdig04RAtRRxA7Rqx9LojvmtJDnzSQ0N8dW4f3NCRbID7TYLBtMkQCuVYOynVErw99Q8dQM+/1AXmHCO/FTJ7psH+AcXlczWJ+PhtHegHSRkOSGC2qDiXCfABetyU0YFgQmAW2EFoZlyGN5dRZVRJBP1E77gcXnmBNvRKt+g8cbKVOztN7e3MkhGl40o3nUYXcbX3j2DsP0iwNvpA50ZfLd6guXykJsIP2Rs32yZhVpKMVAABjmBfOzuY/MCdmMCPXh5xnuAR6tDxCeodp/gqM8uUx5mosEuA9Wj85/qjt7oR2quHhsLyIcofC8t3EZcjgiP4UGGvvezueKWjaSZQ9szYTbEh6ivPfu4AiufVh3mNoZ1T3J7KQM1zTxoHsaNfmY9mDlIFaZMUNfLntui90QFMuo5tnA+p4bNj5vyVD9piZsDrklUs9R5rH5DivfviBiKwjHwHbWeqp6TJXOIAKIM1O14/A+JSeLBPWgyhA8X534JE5KPZwWym9KBp7ZCJmaFrmrlxvXuc2+cpkCSKvaSa1tGYzUWBIrZb2CDSfnGpDyz9NBlnsYY89Jn5jBRCiY7X0ezYwEEendaMP6n8PUS+Dnlvz2WTfhnWFnaX50JBXagK6UMSaqNONmW3AsYRF0zVYc85BUwzBmQ1Z+exHyT80+hsWEm1u5W1c= X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB2354; 6:6+m0Kzm+qg2N01GWPm8d5NB4g1BugYdS8AYIKB/bL2B23HTZhuvzsmAdsBglV7UJiu5EIIH08rcqbYE1yYOQ/NJVBKxfwRR4/t5/EyF7cOYqlUYuAQsVmszj15hbPN7mm2a1gD9qw+CLEGfhWu9QSyfcxwcIryr2wvZTC4jlCka/zJVr6Ixn9qH8G4M19ZYMmAqwNm2rbxqc3Kbh/EhVBuZ+zE/qMUEWi8s5thhrkTbiFXWhFb3U++9xnxa0ntLQhfB3CHsOaN+d7MmOZklaUGCv5MmCN5n1C6LH8bQiVYYf453L9K75BFoSMrXZtV1I6zentWuhZYN4TOLAq4/RxmrmZi1cfYBXpvqTYWIO13U=; 5:h+xf5GQ7K+Q/vJxOwmQye3TaMA1yB1jkv5IDWVcaWlvF8V4e9aX7gTjGqR181H7LHh90O4vH6AJsVoifDnQ5O59nHvfRH9eCH8HM1t6N8nhBlhN712hV3sZu3977iCg7U4xXgIQh0QR8J2ZuoQxWyWdtCSMCq27s/zWhqve3B2I=; 24:pj1cyIOJAStZUCs0mI0DWDIG8cc5C69O+kBI+AdHIM6RdAiuQIgaS3iMU06KxbLf7ZQ1Y3ydVFoHqlVr0vxlM7tAIHy+14U8yqWsBe7g7Q0=; 7:om9ufEa0C6E0llyf0r7NL9qRvnjrEZ038ffvamN0tq50wCrWhKyhTAY7fz2zYNOOsK8Sr4O0UZBFvyDFziAhfRyXvTKJN9fBz+/4y6yQezkIsbZSUkPgCgucEGicBE3EnIkXS9Nk2xAlkA7lEJISVlYQ4J/y1He14fozEYM967V55njh3WGa48lU0wtov9KR+TB2pgGdCEmWoS8sTRi9M8LcgXqZz8QzNLBFAiyH/Rh26+roegqTUijezD3+m/SV SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2018 13:24:21.7566 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a6f3d63e-0519-4b1d-b4cb-08d557644b98 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: BN3PR03MB2354 Subject: [dpdk-dev] [PATCH v2 17/18] net/dpaa: integrate the support of push mode in PMD 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Sunil Kumar Kori Signed-off-by: Hemant Agrawal Signed-off-by: Nipun Gupta --- doc/guides/nics/dpaa.rst | 11 ++++++++ drivers/net/dpaa/dpaa_ethdev.c | 64 +++++++++++++++++++++++++++++++++++++----- drivers/net/dpaa/dpaa_ethdev.h | 2 +- drivers/net/dpaa/dpaa_rxtx.c | 34 ++++++++++++++++++++++ drivers/net/dpaa/dpaa_rxtx.h | 5 ++++ 5 files changed, 108 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/doc/guides/nics/dpaa.rst b/doc/guides/nics/dpaa.rst index a62f128..0a13996 100644 --- a/doc/guides/nics/dpaa.rst +++ b/doc/guides/nics/dpaa.rst @@ -290,6 +290,17 @@ state during application initialization: In case the application is configured to use lesser number of queues than configured above, it might result in packet loss (because of distribution). +- ``DPAA_PUSH_QUEUES_NUMBER`` (default 4) + + This defines the number of High performance queues to be used for ethdev Rx. + These queues use one private HW portal per queue configured, so they are + limited in the system. The first configured ethdev queues will be + automatically be assigned from the these high perf PUSH queues. Any queue + configuration beyond that will be standard Rx queues. The application can + choose to change their number if HW portals are limited. + The valid values are from '0' to '4'. The valuse shall be set to '0' if the + application want to use eventdev with DPAA device. + Driver compilation and testing ------------------------------ diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 85ccea4..444c122 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -47,6 +47,14 @@ /* Keep track of whether QMAN and BMAN have been globally initialized */ static int is_global_init; +/* At present we only allow up to 4 push mode queues - as each of this queue + * need dedicated portal and we are short of portals. + */ +#define DPAA_MAX_PUSH_MODE_QUEUE 4 + +static int dpaa_push_mode_max_queue = DPAA_MAX_PUSH_MODE_QUEUE; +static int dpaa_push_queue_idx; /* Queue index which are in push mode*/ + /* Per FQ Taildrop in frame count */ static unsigned int td_threshold = CGR_RX_PERFQ_THRESH; @@ -434,6 +442,9 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, { struct dpaa_if *dpaa_intf = dev->data->dev_private; struct qman_fq *rxq = &dpaa_intf->rx_queues[queue_idx]; + struct qm_mcc_initfq opts = {0}; + u32 flags = 0; + int ret; PMD_INIT_FUNC_TRACE(); @@ -469,13 +480,45 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, dpaa_intf->name, fd_offset, fman_if_get_fdoff(dpaa_intf->fif)); } - + /* checking if push mode only, no error check for now */ + if (dpaa_push_mode_max_queue > dpaa_push_queue_idx) { + dpaa_push_queue_idx++; + opts.we_mask = QM_INITFQ_WE_FQCTRL | QM_INITFQ_WE_CONTEXTA; + opts.fqd.fq_ctrl = QM_FQCTRL_AVOIDBLOCK | + QM_FQCTRL_CTXASTASHING | + QM_FQCTRL_PREFERINCACHE; + opts.fqd.context_a.stashing.exclusive = 0; + opts.fqd.context_a.stashing.annotation_cl = + DPAA_IF_RX_ANNOTATION_STASH; + opts.fqd.context_a.stashing.data_cl = DPAA_IF_RX_DATA_STASH; + opts.fqd.context_a.stashing.context_cl = + DPAA_IF_RX_CONTEXT_STASH; + + /*Create a channel and associate given queue with the channel*/ + qman_alloc_pool_range((u32 *)&rxq->ch_id, 1, 1, 0); + opts.we_mask = opts.we_mask | QM_INITFQ_WE_DESTWQ; + opts.fqd.dest.channel = rxq->ch_id; + opts.fqd.dest.wq = DPAA_IF_RX_PRIORITY; + flags = QMAN_INITFQ_FLAG_SCHED; + + /* Configure tail drop */ + if (dpaa_intf->cgr_rx) { + opts.we_mask |= QM_INITFQ_WE_CGID; + opts.fqd.cgid = dpaa_intf->cgr_rx[queue_idx].cgrid; + 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); + rxq->cb.dqrr_dpdk_cb = dpaa_rx_cb; + rxq->is_static = true; + } dev->data->rx_queues[queue_idx] = rxq; /* configure the CGR size as per the desc size */ if (dpaa_intf->cgr_rx) { struct qm_mcc_initcgr cgr_opts = {0}; - int ret; /* Enable tail drop with cgr on this queue */ qm_cgr_cs_thres_set64(&cgr_opts.cgr.cs_thres, nb_desc, 0); @@ -809,11 +852,8 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, fqid, ret); return ret; } - - opts.we_mask = QM_INITFQ_WE_DESTWQ | QM_INITFQ_WE_FQCTRL | - QM_INITFQ_WE_CONTEXTA; - - opts.fqd.dest.wq = DPAA_IF_RX_PRIORITY; + fq->is_static = false; + opts.we_mask = QM_INITFQ_WE_FQCTRL | QM_INITFQ_WE_CONTEXTA; opts.fqd.fq_ctrl = QM_FQCTRL_AVOIDBLOCK | QM_FQCTRL_CTXASTASHING | QM_FQCTRL_PREFERINCACHE; opts.fqd.context_a.stashing.exclusive = 0; @@ -947,6 +987,16 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev) 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. + */ + if (getenv("DPAA_PUSH_QUEUES_NUMBER")) { + dpaa_push_mode_max_queue = + atoi(getenv("DPAA_PUSH_QUEUES_NUMBER")); + if (dpaa_push_mode_max_queue > DPAA_MAX_PUSH_MODE_QUEUE) + dpaa_push_mode_max_queue = DPAA_MAX_PUSH_MODE_QUEUE; + } + /* Each device can not have more than DPAA_PCD_FQID_MULTIPLIER RX * queues. */ diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index 1b36567..1fa6caf 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -54,7 +54,7 @@ #define DPAA_MAX_NUM_PCD_QUEUES 32 #define DPAA_IF_TX_PRIORITY 3 -#define DPAA_IF_RX_PRIORITY 4 +#define DPAA_IF_RX_PRIORITY 0 #define DPAA_IF_DEBUG_PRIORITY 7 #define DPAA_IF_RX_ANNOTATION_STASH 1 diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 98671fa..0413932 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -394,6 +394,37 @@ dpaa_eth_fd_to_mbuf(const struct qm_fd *fd, uint32_t ifid) return mbuf; } +enum qman_cb_dqrr_result dpaa_rx_cb(void *event __always_unused, + struct qman_portal *qm __always_unused, + struct qman_fq *fq, + const struct qm_dqrr_entry *dqrr, + void **bufs) +{ + const struct qm_fd *fd = &dqrr->fd; + + *bufs = dpaa_eth_fd_to_mbuf(fd, + ((struct dpaa_if *)fq->dpaa_intf)->ifid); + return qman_cb_dqrr_consume; +} + +static uint16_t +dpaa_eth_queue_portal_rx(struct qman_fq *fq, + struct rte_mbuf **bufs, + uint16_t nb_bufs) +{ + int ret; + + if (unlikely(fq->qp == NULL)) { + ret = rte_dpaa_portal_fq_init((void *)0, fq); + if (ret) { + DPAA_PMD_ERR("Failure in affining portal %d", ret); + return 0; + } + } + + return qman_portal_poll_rx(nb_bufs, (void **)bufs, fq->qp); +} + uint16_t dpaa_eth_queue_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) @@ -403,6 +434,9 @@ uint16_t dpaa_eth_queue_rx(void *q, uint32_t num_rx = 0, ifid = ((struct dpaa_if *)fq->dpaa_intf)->ifid; int ret; + if (likely(fq->is_static)) + return dpaa_eth_queue_portal_rx(fq, bufs, nb_bufs); + ret = rte_dpaa_portal_init((void *)0); if (ret) { DPAA_PMD_ERR("Failure in affining portal"); diff --git a/drivers/net/dpaa/dpaa_rxtx.h b/drivers/net/dpaa/dpaa_rxtx.h index 78e804f..29d8f95 100644 --- a/drivers/net/dpaa/dpaa_rxtx.h +++ b/drivers/net/dpaa/dpaa_rxtx.h @@ -268,4 +268,9 @@ int dpaa_eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf, struct qm_fd *fd, uint32_t bpid); +enum qman_cb_dqrr_result dpaa_rx_cb(void *event, + struct qman_portal *qm, + struct qman_fq *fq, + const struct qm_dqrr_entry *dqrr, + void **bd); #endif