From patchwork Wed Jan 10 10:46:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 124056 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp5162635qgn; Wed, 10 Jan 2018 03:37:45 -0800 (PST) X-Google-Smtp-Source: ACJfBoup7SeNRaMOqlQkPBZe5uHFWYaObnuMKEEXEWkmv3iMynm+go3DO0LuY6sdo5v/OsWqmAfp X-Received: by 10.28.124.1 with SMTP id x1mr14468473wmc.20.1515584265589; Wed, 10 Jan 2018 03:37:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515584265; cv=none; d=google.com; s=arc-20160816; b=ZXiqqYkupT8iztnJECj4Ptgc2GXR1qbhhA0P84vabSasiJIFGtzLUUeoioBXAs8y4q GpOJVraU01Nu2NhaoCfY9elqRt9s2E+fZVTpFvVgGXzq/iE15bisgJD/f3Zu3bfswGC6 o/9Lo7F+mr8+wTv3s2iZzeP75FzzAfmePq0Ov7TfKNVRfSv9Yyl5XEK0i4lOQzXAWfYR KvucJxXVmDgE91UZadpTEYB0+W8hJQYJ3SScDNeI2dz/4DS9j5KrLNC1lD2GlBcA4KNF RKFIC6F/LEAuknQucmGlJG44zlwnNfYOyvlsybTWHz9LAJsyaT1scmqMLqy+nQgZqdWt c45g== 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=rTdtSgsPRnhCp5m36iuR2/LMSaNP0RIjw/zMAgp2Lkt57tpaVfRWbX5lmexUKpKHM/ hlAcwARQGNkfNDpNK3CegKrODcbOtlpgZ3faflJl52RnovRzlQ2VaGkMYKlqWBjStpYS PlD5hkLznJU4DMky16kFc4oPyIFal3lbzl6StBAmeUPQWh9mKeqBRWGND84i1ZtUOy2W xUaVik6Gw9V1JsUTsqxUcF9rA9zlyxB3GU66tWaSD3lGakC9OL4UWqPqVWvVavO+2tfe 8STPeIbpTTWhQiaeYzp5YdY907wmIG4Wu7KUKgp61PKclIaU4c/+ipOl7wgOtQwcYe9c SwWw== 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 i186si10848850wmf.240.2018.01.10.03.37.45; Wed, 10 Jan 2018 03:37:45 -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 8FA1C1B222; Wed, 10 Jan 2018 12:36:18 +0100 (CET) Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0041.outbound.protection.outlook.com [104.47.41.41]) by dpdk.org (Postfix) with ESMTP id 233EC1B1A3 for ; Wed, 10 Jan 2018 11:48:33 +0100 (CET) Received: from MWHPR03CA0053.namprd03.prod.outlook.com (10.174.173.170) by MWHPR03MB2704.namprd03.prod.outlook.com (10.168.207.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Wed, 10 Jan 2018 10:48:31 +0000 Received: from BL2FFO11FD029.protection.gbl (2a01:111:f400:7c09::134) by MWHPR03CA0053.outlook.office365.com (2603:10b6:301:3b::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.386.5 via Frontend Transport; Wed, 10 Jan 2018 10:48:31 +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 BL2FFO11FD029.mail.protection.outlook.com (10.173.160.69) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Wed, 10 Jan 2018 10:47:59 +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 w0AAljSa007124; Wed, 10 Jan 2018 03:48:28 -0700 From: Hemant Agrawal To: CC: , , Sunil Kumar Kori , Nipun Gupta Date: Wed, 10 Jan 2018 16:16:40 +0530 Message-ID: <1515581201-29784-19-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515581201-29784-1-git-send-email-hemant.agrawal@nxp.com> References: <1515504186-13587-1-git-send-email-hemant.agrawal@nxp.com> <1515581201-29784-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131600548797080019; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(376002)(39860400002)(346002)(39380400002)(396003)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(2950100002)(76176011)(54906003)(16586007)(97736004)(36756003)(48376002)(77096006)(50466002)(51416003)(8656006)(105606002)(6916009)(106466001)(296002)(2351001)(86362001)(2906002)(5660300001)(59450400001)(6666003)(316002)(104016004)(47776003)(53936002)(81156014)(8676002)(4326008)(81166006)(50226002)(498600001)(68736007)(85426001)(356003)(8936002)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2704; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD029; 1:drspsjlX4GvmWV5U4XnUVoTzqMaZQZw2suMGfZlHTMkiVpoe/zBODRAeJoao0/RlCvFtEr3ffBN8MAKA2sDux34Vdu8fZBryEWFrwd4tiqVqXxdEGH+QjDmGw2i3BT+4 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: eaae41b0-b967-45e9-e1d3-08d558179dc2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4628075)(201703131517081)(5600026)(4604075)(2017052603307); SRVR:MWHPR03MB2704; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2704; 3:UHuOjR3XDhhWSPMpcrVnVvp6Q4IRTlkhcdnX2XR85X0DpINcQAP4KHC/ht320F9Ax31yAXSo5R3/Ld0vzSsChnJGm2zUsm2oV89jtrtchH1QYwWirZUJuQcL57cKvMFRU96vtZ1N3GQojgJCQEp4JsQWJZZvrJDvjvWpr93z0x1ehfr1it1luzOigkb4bhtOp4OutnGKCRnczJ2QF+PGwGdYGo7R7DcunU4a2mH3o60VyBJPtUM6Kb917V1LEuC2uhzQuUXFmIgbM7f4tWVBwlF3OntrQMbACKJtL5NP9igsQ5NJ7Piqs4WjzVAanP2c01zpEYHZ22g/7G0MyxkYyVkkRBVVwAbZKhsPp1mqBgg=; 25:bGmDJGh0ogGlxPHGswYFqySbSA5ZWJzqRWqN/b4uIE0tyk50nrKvPyyuxua8i1UBy7SBMk9P32MCWqekafSuJDM9AarDBiO51zUPqjmSPVs43LxmoZZWY0Mepee5CPwfQ253IPTDAScKfobDEVqw615nhklHo7eundo1NSV59NmAxB+/F//aflfRq4MARpYQyawSnNjFx9fEfC51YJobG62aQlWo+DcQ3JGVhEqkaQww0DOrMszIKejdJ0j1qN5vogPM5TyDf8WRaIz++Rb70mii45qLhUxrXpIsaQo3kwceasqHWuS1nusroMCgDZp+YK6H79dehvb642822vz3UQ== X-MS-TrafficTypeDiagnostic: MWHPR03MB2704: X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2704; 31:2TQqi9c7sEb0//i35HxC9uyy72lBvcdU3poUpDo9eZaxOxbpbPe2cGwirIC8DIHdHi43VGsGv/821b3TR11gtVUSjMuCOxkns8W88yGcudMsirSSoW0iq1le0OwwM9VstrE90hNvu5Rw7bqfGLn5TW7abmo5za0V4YwkGbSMqgQ75/Rlloi2WTxgxSQqVMyPx69W8PC0nx5kVXmXBk9DTXx+CezhD6tcb0IN0liAe+0=; 4:m+gGO1hhDWXIqxZFm0WBc29c2EBbyOO+2hBhwp+ecPRRHAaL2GHL/fv7X+ucnTlREOxW53a6QOZGht4wAIcMq77qV7Oa8BsAdry8vEoIvfhJzN7z45ZTBJUuKxIATl59Qfr2Z6jyyoZA/0kt5I9hvwG4iSSUZUjkt70LVAwyj4HQ0XvVi3PTl+PkgRn3nr7521RUIFt7Tk2NpCBiNSAPSi8GkSaGIu8aPWkIuJk/m1AaVjjgh58i4MtY7rf6rW4C4kaEhQvgWnHDaOcKihI2WcJn73xXYJfiZb2v5edyLYPDd3Fj6xluXXc8aBDBVuv7/Wj/+KU15Mx80WCPUL1WnHMn64xvvt5C2IwZLd3h9pCoXjES225fXKQdewixa2fM 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)(10201501046)(3231023)(944510075)(944921075)(946801075)(946901075)(3002001)(93006095)(93001095)(6055026)(6096035)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123559100)(20161123565025)(20161123563025)(20161123556025)(20161123561025)(201708071742011); SRVR:MWHPR03MB2704; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:MWHPR03MB2704; X-Forefront-PRVS: 0548586081 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2704; 23:UXFsFxiicsAScOHW5LzNqjtGWv7Xe25zyAZCorAs3?= hArNA0fkOrs4wF+RgbMtNNFKKoTfKTOhFksabDDd90QTkQLYoE29Rkis7AqdIdQsvM9sF+mZ98mxun8lPfzmKkRbyKmTNiZ+cghOw8ApWh/NV7ngs+xzkUUoYWmvbPLNgBAxqFv/dw97ZEbcJYWnowIfbCkDM5/KjdY3w6OipqzKhcI04Jw9ddsW07yme68h/6Pu8TPCmS/lxVikx+ThUkl33My7/WexApO2LY0oay/RFopchbaLFnlj6txjx+Pg0w8atuuQEB7g26wij4ifJOLuqPZocC8kyjqQeluLGc+C0qUqm2jzVXF29O1A1sc5YyEg4PZ0xJUOsXLAPO8FZj+4gY1lFWB8gCqL+e+wzzGVRDMMh1fXodG+io07XsTUj3dpTmJ8Dws/C9i2KRRi8hQ6tEx+im7axyof/8h3Y2Q3PPu7xg+BwJU2s0GujGlt8mLH+MR8Hb9nu80WU9muPBiXf6pPqOJkOzsgartQPstupZRS2ssYJx8XztTjyA7gku8KNuYYi3eE1AwHKyXwLmxYkVqvWC0xUsds0pxbxmciED44tdpfaAQXeEgcorfyb9otYV9Q52bC2IlrUTmy4/stPb028tGRDM/m9iL5xGsorOP/NNASnKArmfHSCpl74UMwT0dCGk4E9djzNDFZ8/CTYj3ZPk5O6Vee2tPZYxOX5atTdSAPkcUQpN0c3OwBRK7cxGum0rxsywEnNROrdWFw0lUq0GqwbtWVkOB41ZCoK6qDKbPA5xz90aZLiHyPpispxah49puwDtVj1YOC2QaVd48Yp5KoGEhtUfFb/78ycuuNtPd52pk/spibCUkN+RxWlKxyi62hN45uHfkHvmE3kdBIgdDVjdioMEvzjPrMnVR0k4GDqiS3iiqDLVhZmacwcjapbmrvs1Fv4WFEO9KmXO8jHvjxbnoFkCL/3UZ1NvfREkixvML8R1GJrTR9ZhhW5pCxijrbsThnwCUzmxxdQNUSxPKppQQQ8wv0/JeejeppHJUdFqBsSb+CD8a8jXarKd+kLXRb65k+DnITyu0qPhqDWaliyLOmjqp1ODupWfDD6d0/x1BqPO/BdLAhRY= X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2704; 6:s5WSH0e64xTXPpC6DiVhchRUVaQ7slpHyt90tL44Cvy5Qt0f5i5mZZmEHXX5ZkdUtWNnr3CD/KJs+C3iUQHPMx4HfBd32HtBkum/HM4uU0AcBXUWGr4igQLmZBVEBRfO8fgFwuw1T2xBsAHdFI7LkUEV6y9zl8BWOkjXpMG35Wg0H4k8goP7K+mFG1Nk0hIrp+ogbOq1FscirlfpGFy0ebw+FpdhlgstA2oKra4I9pUWiJt4Ei/5bNhq8vJxEyOMVmvmsoCE7+Q5wei4WjJqvF5zjDUWHh5GO6XVTc0C3IO6yoNXrVW94fi6ivdMpWpT9A01Mg2YCa1w6kHZNEGs0iYa+YLqvet5bgKowsLQAi8=; 5:pCaTMwFa76Z7p7ifBm70iEl8rUc67tCWaELFRY5pa1phQ8z+egicairJvcFpDrLM6+wgwkQCtQR1huAG+5r1c/zETjCvi5Qd9CQjDzKGGLAYTzE4emly5eedcW1n4YpGnBhFHMoWKP6tVGVmH1p7teXJzL8oVfbqb0yoqKEX9Nw=; 24:dvNZcr5JPyxgTC+W2n9lh7TNDXp1i0BCzEglbqrjSotHzyw7jyI0taVIYid8Kvxx/Xb0peDflWXDWHQBPDppHQAmEYWcSuJZa3Y3hXDG5Qw=; 7:aVK7iyu3wRcLlnIhSU2kKWOEaBTNGIjJGnwf8hgVK4I01xihKzJjzKUEErGZekSiNzSt0VI/kuLLPe7bu2Q9rZ1JDX8dc4Mhid5talyc+99U/expmyGoIVANnURLStTGK+M1vdLrBeHdMPjy1uRKgzQHzpjFVFoY/dLOu9ym7D00mg5ns2o6ukYDGOhyJ1PuSmwnXOaRL1+uiit8M8Z8OHOVnsvkYMUPa1bwxVWwM5Zo9y8YtYNlhrSqVuOVpPne SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 10:47:59.5364 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eaae41b0-b967-45e9-e1d3-08d558179dc2 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: MWHPR03MB2704 Subject: [dpdk-dev] [PATCH v3 18/19] 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