From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0062.outbound.protection.outlook.com [104.47.40.62]) by dpdk.org (Postfix) with ESMTP id BE64B1B1E1 for ; Fri, 12 Jan 2018 16:08:14 +0100 (CET) Received: from MWHPR03CA0004.namprd03.prod.outlook.com (10.175.133.142) by CY1PR03MB2362.namprd03.prod.outlook.com (10.166.207.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Fri, 12 Jan 2018 15:08:13 +0000 Received: from BN1BFFO11FD029.protection.gbl (2a01:111:f400:7c10::1:177) by MWHPR03CA0004.outlook.office365.com (2603:10b6:300:117::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.407.7 via Frontend Transport; Fri, 12 Jan 2018 15:08:13 +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 BN1BFFO11FD029.mail.protection.outlook.com (10.58.144.92) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Fri, 12 Jan 2018 15:08:12 +0000 Received: from b27504-OptiPlex-790.ap.freescale.net (b27504-OptiPlex-790.ap.freescale.net [10.232.132.60]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id w0CF7oP2020468; Fri, 12 Jan 2018 08:08:10 -0700 From: Nipun Gupta To: CC: , , Nipun Gupta Date: Sat, 13 Jan 2018 02:53:01 +0530 Message-ID: <1515792181-11836-7-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1515792181-11836-1-git-send-email-nipun.gupta@nxp.com> References: <1515792181-11836-1-git-send-email-nipun.gupta@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131602432931678954; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(396003)(39380400002)(39860400002)(376002)(346002)(2980300002)(1110001)(1109001)(339900001)(189003)(199004)(47776003)(8676002)(105606002)(51416003)(50226002)(68736007)(8656006)(316002)(296002)(16586007)(498600001)(8936002)(81166006)(81156014)(6916009)(356003)(76176011)(2351001)(106466001)(5660300001)(5890100001)(54906003)(6666003)(2906002)(86362001)(575784001)(104016004)(50466002)(97736004)(2950100002)(48376002)(36756003)(4326008)(77096006)(53936002)(305945005)(85426001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR03MB2362; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD029; 1:e8fAFWBSHDA8mMRH/WClYqjLvvpEj4bJtcSIEqQZg8Zby/ER2DisB1QIkJ9gOvsO9etF1fGSBiAOqCgHhzVb8HPLCuOu153cfkCDwOdI145H2VXAkwanaKNTtp0D2izs MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7fcec2ba-60c6-45d4-4aea-08d559ce4cef X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020083)(5600026)(4604075)(2017052603307); SRVR:CY1PR03MB2362; X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2362; 3:4QAkeAFE5DcH1abWWYmrRiYJ1u6BcchAGTnK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aPpAXENDGXZ9UACooKoICyUsbKA3kq6SaoJpkBiR4CNQz42jBXMeOHfMAMk2hsBnB0AH7zZ19+f26nFmoE2NN6k7bKTuaif3IfD9SzfECC9md1nzSYECkHzwmPpl3QMCJhqMIzkxAi0cxvJOkb78t2y8wCuJbTizynhB78/7RldHgqmGNCRJ7E4Eb6LUw99jj6U/G/Zctdth9k8tZTRyK/kx5oRZITyPVNzY2AY1cKL5xd26x7IU45nBcjFEVpDfjsA= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(275809806118684); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(8121501046)(5005006)(10201501046)(3231023)(944501144)(93006095)(93001095)(3002001)(6055026)(6096035)(201703131430075)(201703131520075)(201703131433075)(201703131448075)(201703151042153)(20161123559100)(20161123563025)(20161123556025)(20161123565025)(20161123561025)(201708071742011); SRVR:CY1PR03MB2362; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:CY1PR03MB2362; X-Forefront-PRVS: 0550778858 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR03MB2362; 23:wDlTTBzNlBsS2UhOGxRwJUqDBvbJK6a6+dGNnMkFR?= =?us-ascii?Q?ywu0ccZ4LA+rPJkqMS0jqwJyl/3PfCRdWM+93riDOXKKWNfN2ZSGFSd1LVdG?= =?us-ascii?Q?xJEX/NflUJiSc5ryBMhXTwS6DByVlUAnfKWXFee4vBit3eFWOsJliCHfEtYg?= =?us-ascii?Q?JR7Yxzts/xVV+bhkmzlUrKgnkli3MU3DCC/AJMiAD9Fay5LPiudKNWA/AbaH?= =?us-ascii?Q?arWx59Tz2brU0yiNMTWv+eQ6Gi+W/g/+LOngGORR32e9QPewEMYCx4CdCwoH?= =?us-ascii?Q?I98FCZDaBwXl78MeH4UWh6drWP05XrxbRWjdpaaBGCuLfXcWtXhBtuvB2AKj?= =?us-ascii?Q?dbZ0VkSLqhrcQ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ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR03MB2362; 6:Hqwf9ydy1LFu0xuNR2taldPkVSaDDN+0+d1+V+33aCM1v+uJYiKewh2hiGWYF5iXVdW9WbfRU15Gg7eXTO3epVJnND+6qqxNJscEhQje0K/vEhbA4/FSLTZ25uwkjbi7g/JPr5SdMau1dDS2IgPEPjFuSffNspbVE71IAQQJ/lbe3wfPw1quecA1WtXb3qtJXv4zV+YkIQbDCq6cqeG38BDxJfv+vNg6OPkTMHSILKAjcqAkZSCYmjgmcTfS6INr7/uA33Uc97oWUvQV3STrUSbvoyan1xSNLzetjG3gl2FTBw+WtKTlZlhiyhKBWZG2OLqk5ad9gfj4hFfvXytHHt4MFYxkFgMG5OolAwUGJ2A=; 5:Jv6v2YPQMdrP3tbptYHGRxiUcfTsJ4jvfLcntMD/zWM8cn9to4wpndLJeZY3+TObs6QpSLUcvc164IN/fs/i3l0/kcvgihqgXMtYFUBOfwpY8XPo9tZMT4G0SgLEfW3lOpr1RB+SlTUKVJtOvIF/fMGsKbZTZAgXtrCHi93an2c=; 24:U8k207KTAm3Py9VRwoeGC9sfE0T9cGFHMNzmKdfL544QMNZVgVNJI5S3c8OfmoPrkuUROODsZ0c7eF9ULMFAN1pPN8xqrPRp0b5Xz1s9nro=; 7:U+omD488ZpE4cSJnfiUmWEkA528LUoPagwP5YwjOmcjxB01L760UnCGQQP+TEGlNPLsjuzOyervnFUWAM02qTG4ytMOGCvBlfSLtiMNdfHNJ5mQuPzgqqoEq/GtpjwcUM6KpnsJsoePGhyfl9Dbx4/9Ow/5/LNgkEk2YBZb6Ak8Bbq9sJaU8RHT84POFD3xHrjigPRoTsrwz5NmV5ebbGQP2KZfEzezC5CyZZu7LxovXlgauBF8oVUlLj7xLwiNC SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2018 15:08:12.9806 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7fcec2ba-60c6-45d4-4aea-08d559ce4cef 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: CY1PR03MB2362 Subject: [dpdk-dev] [PATCH 6/6 v2] net/dpaa2: support atomic queues 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, 12 Jan 2018 15:08:16 -0000 Signed-off-by: Nipun Gupta --- drivers/net/dpaa2/Makefile | 1 + drivers/net/dpaa2/dpaa2_ethdev.c | 7 +++++++ drivers/net/dpaa2/dpaa2_ethdev.h | 5 +++++ drivers/net/dpaa2/dpaa2_rxtx.c | 43 +++++++++++++++++++++++++++++++++++++--- 4 files changed, 53 insertions(+), 3 deletions(-) diff --git a/drivers/net/dpaa2/Makefile b/drivers/net/dpaa2/Makefile index 068e9d3..5a93a0b 100644 --- a/drivers/net/dpaa2/Makefile +++ b/drivers/net/dpaa2/Makefile @@ -25,6 +25,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/qbman/include CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/mc CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc/portal CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa2 +CFLAGS += -I$(RTE_SDK)/drivers/event/dpaa2 CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal # versioning export map diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 821c862..5f24759 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -1670,6 +1670,8 @@ int dpaa2_eth_eventq_attach(const struct rte_eth_dev *dev, if (queue_conf->ev.sched_type == RTE_SCHED_TYPE_PARALLEL) dpaa2_ethq->cb = dpaa2_dev_process_parallel_event; + else if (queue_conf->ev.sched_type == RTE_SCHED_TYPE_ATOMIC) + dpaa2_ethq->cb = dpaa2_dev_process_atomic_event; else return -EINVAL; @@ -1679,6 +1681,11 @@ int dpaa2_eth_eventq_attach(const struct rte_eth_dev *dev, cfg.destination.id = dpcon_id; cfg.destination.priority = queue_conf->ev.priority; + if (queue_conf->ev.sched_type == RTE_SCHED_TYPE_ATOMIC) { + options |= DPNI_QUEUE_OPT_HOLD_ACTIVE; + cfg.destination.hold_active = 1; + } + options |= DPNI_QUEUE_OPT_USER_CTX; cfg.user_context = (uint64_t)(dpaa2_ethq); diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h index 8fa1872..ba0856f 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.h +++ b/drivers/net/dpaa2/dpaa2_ethdev.h @@ -118,6 +118,11 @@ void dpaa2_dev_process_parallel_event(struct qbman_swp *swp, const struct qbman_result *dq, struct dpaa2_queue *rxq, struct rte_event *ev); +void dpaa2_dev_process_atomic_event(struct qbman_swp *swp, + const struct qbman_fd *fd, + const struct qbman_result *dq, + struct dpaa2_queue *rxq, + struct rte_event *ev); uint16_t dpaa2_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts); uint16_t dummy_dev_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts); #endif /* _DPAA2_ETHDEV_H */ diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index c43e3a1..e88b034 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -15,11 +15,13 @@ #include #include +#include #include #include #include #include #include +#include #include "dpaa2_ethdev.h" #include "base/dpaa2_hw_dpni_annot.h" @@ -641,6 +643,30 @@ void __attribute__((hot)) qbman_swp_dqrr_consume(swp, dq); } +void dpaa2_dev_process_atomic_event(struct qbman_swp *swp __attribute__((unused)), + const struct qbman_fd *fd, + const struct qbman_result *dq, + struct dpaa2_queue *rxq, + struct rte_event *ev) +{ + uint8_t dqrr_index = qbman_get_dqrr_idx(dq); + + ev->mbuf = eth_fd_to_mbuf(fd); + + ev->flow_id = rxq->ev.flow_id; + ev->sub_event_type = rxq->ev.sub_event_type; + ev->event_type = RTE_EVENT_TYPE_ETHDEV; + ev->op = RTE_EVENT_OP_NEW; + ev->sched_type = rxq->ev.sched_type; + ev->queue_id = rxq->ev.queue_id; + ev->priority = rxq->ev.priority; + + ev->mbuf->seqn = dqrr_index + 1; + DPAA2_PER_LCORE_DQRR_SIZE++; + DPAA2_PER_LCORE_DQRR_HELD |= 1 << dqrr_index; + DPAA2_PER_LCORE_DQRR_MBUF(dqrr_index) = ev->mbuf; +} + /* * Callback to handle sending packets through WRIOP based interface */ @@ -661,6 +687,7 @@ void __attribute__((hot)) uint16_t bpid; struct rte_eth_dev *dev = dpaa2_q->dev; struct dpaa2_dev_priv *priv = dev->data->dev_private; + uint32_t flags[MAX_TX_RING_SLOTS] = {0}; if (unlikely(!DPAA2_PER_LCORE_DPIO)) { ret = dpaa2_affine_qbman_swp(); @@ -679,7 +706,6 @@ void __attribute__((hot)) qbman_eq_desc_set_response(&eqdesc, 0, 0); qbman_eq_desc_set_qd(&eqdesc, priv->qdid, dpaa2_q->flow_id, dpaa2_q->tc_index); - /*Clear the unused FD fields before sending*/ while (nb_pkts) { /*Check if the queue is congested*/ @@ -694,6 +720,16 @@ void __attribute__((hot)) frames_to_send = (nb_pkts >> 3) ? MAX_TX_RING_SLOTS : nb_pkts; for (loop = 0; loop < frames_to_send; loop++) { + if ((*bufs)->seqn) { + uint8_t dqrr_index = (*bufs)->seqn - 1; + + flags[loop] = QBMAN_ENQUEUE_FLAG_DCA | + dqrr_index; + DPAA2_PER_LCORE_DQRR_SIZE--; + DPAA2_PER_LCORE_DQRR_HELD &= ~(1 << dqrr_index); + (*bufs)->seqn = DPAA2_INVALID_MBUF_SEQN; + } + fd_arr[loop].simple.frc = 0; DPAA2_RESET_FD_CTRL((&fd_arr[loop])); DPAA2_SET_FD_FLC((&fd_arr[loop]), NULL); @@ -761,7 +797,7 @@ void __attribute__((hot)) loop = 0; while (loop < frames_to_send) { loop += qbman_swp_enqueue_multiple(swp, &eqdesc, - &fd_arr[loop], NULL, + &fd_arr[loop], &flags[loop], frames_to_send - loop); } @@ -778,7 +814,8 @@ void __attribute__((hot)) while (i < loop) { i += qbman_swp_enqueue_multiple(swp, &eqdesc, - &fd_arr[i], NULL, + &fd_arr[i], + &flags[loop], loop - i); } num_tx += loop; -- 1.9.1