From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0064.outbound.protection.outlook.com [104.47.36.64]) by dpdk.org (Postfix) with ESMTP id 455A01B2D4 for ; Wed, 17 Jan 2018 06:24:31 +0100 (CET) Received: from BN6PR03CA0086.namprd03.prod.outlook.com (10.164.122.152) by BN6PR03MB2689.namprd03.prod.outlook.com (10.173.144.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Wed, 17 Jan 2018 05:24:30 +0000 Received: from BN1BFFO11FD010.protection.gbl (2a01:111:f400:7c10::1:182) by BN6PR03CA0086.outlook.office365.com (2603:10b6:405:6f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.407.7 via Frontend Transport; Wed, 17 Jan 2018 05:24:30 +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 BN1BFFO11FD010.mail.protection.outlook.com (10.58.144.73) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Wed, 17 Jan 2018 05:24:30 +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 w0H5O79t027272; Tue, 16 Jan 2018 22:24:28 -0700 From: Nipun Gupta To: CC: , , Nipun Gupta Date: Wed, 17 Jan 2018 17:09:14 +0530 Message-ID: <1516189154-28331-7-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1516189154-28331-1-git-send-email-nipun.gupta@nxp.com> References: <1515792181-11836-1-git-send-email-nipun.gupta@nxp.com> <1516189154-28331-1-git-send-email-nipun.gupta@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131606402707133084; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(7966004)(39860400002)(376002)(346002)(39380400002)(396003)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(76176011)(85426001)(51416003)(8656006)(104016004)(36756003)(575784001)(508600001)(86362001)(316002)(48376002)(26005)(296002)(16586007)(54906003)(4326008)(2906002)(53936002)(305945005)(50226002)(106466001)(356003)(5660300001)(8936002)(2351001)(6916009)(2950100002)(81156014)(81166006)(97736004)(50466002)(105606002)(68736007)(77096006)(6666003)(8676002)(47776003)(5890100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2689; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD010; 1:09z17WTDEU9+GSIdDV+bpbEdbq1vGcELSumBdi2um7xYPx4Eyka5IoCdxcsjHXhOMXQAusq8Px2JTdXCkbKe5wH+PLPhz9jPcEp+yrJ4HqJ2R5H4sNfIf7ziHAUEW0rI MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 44845fa8-6870-4802-929c-08d55d6a95fd X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(5600026)(4604075)(2017052603307); SRVR:BN6PR03MB2689; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2689; 3:Kjhu9hiegS/3y7bsypYWn+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cS1rszK3Ykm8yWw1y+MUVl/gEgibvA2bNmkazEk5iwf3wGlIfKPMZvtv0LEEuQwA9XMZP48AutFhk72T4V27JiOd/Jst1mXXSQ6SVV92cZTMSbcGrq/jjgtBDQ+n475Iu6C33fajFYWzD09VDg2a9EUzuxrHal0mkPutrDcPaZ7E6tuf3paO8FjzfwWHl793NExSuqickDBX8RS+gRxQCKFXODhyKSpCoJwUfjAjuZv9foBSnGjHXmdEwPSAZPtZ1gLBwyVaBAuL3B2vL0eJjBtLc= 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)(3231023)(944501161)(10201501046)(93006095)(93001095)(3002001)(6055026)(6096035)(20161123559100)(201703131430075)(201703131520075)(201703131441075)(201703131448075)(201703131433075)(20161123563025)(20161123565025)(20161123556025)(20161123561025)(201708071742011); SRVR:BN6PR03MB2689; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN6PR03MB2689; X-Forefront-PRVS: 0555EC8317 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2689; 23:20sEIWZMexOA9CBDFUe/MxjFqfZtqvzYgvv0a1ypj?= =?us-ascii?Q?bT6d7xYpHKMEGnolVOa29IPkuYtWw6s1BOQt/RE06yJQkdKpdzVCIV5TN9GH?= =?us-ascii?Q?fy2cHCqCL/zmfzrYFqsmt6YNEEQqISzsUlQ90yGMQxPlMWfz2rBerKBZ0cKq?= =?us-ascii?Q?SweiL7xqZFSGkH/LWopwMgN7QpR9RqNz4CIWTWquecRfBvgokBLd+NYsekiu?= =?us-ascii?Q?6sAL8SRzjSunhdODGOyRBiAbTXL64SpHadyDHhclR/2TDvbhU1GqZGAiy3iD?= =?us-ascii?Q?x4ZRWDUMrJDpxQEAG4/khG/ShIinOmoiCq3FUNls9nlW02LxYGFdjNjuP7YU?= =?us-ascii?Q?eAJL4mbmLU81EZ4Xv/2W5KtNv65MPShpnhMrUl/RHvzVPq5TftV40bScJdkh?= =?us-ascii?Q?uqkN/ubTiT3DCxFSBLnBf+4VSya7WTsOWc741alkOL2UnmLMD1hnnZxrLv4/?= =?us-ascii?Q?N0BfrnYpVPG+dLbMSTYo4eVZlr4LHVIIyxsrbBcEx/rO57Nd7Ru2rDFu1TIG?= =?us-ascii?Q?41X2wNb/OJj4rohFZ261jPU46An1ZwErlhkNjcdvIZJWaWwDv/GuiBtBVODE?= =?us-ascii?Q?yWEFb5hm0ZkFV1kVTWA1u0P8FSplDgOPhLE0vzJFERBnKiVc6xyqAcb8iN3e?= =?us-ascii?Q?KWIeXeWUFc37Xp7zlHGGn50uiFDYpiQJKmgi58UAMKYa+0JoD22LNMBdIpep?= =?us-ascii?Q?tQByslGYRAFNth2qf8VhBedcvvX1DDeQaIZgZtVseS0Cb5ZD6b40POaRSKl/?= =?us-ascii?Q?UK08d1hYPRjUgxX9kVc9AWQyrQsfFq5s0BpM/3KwTroLhkcAVfqK8sZoUgPc?= =?us-ascii?Q?8INLdbScYBAgXn1SpQB64OAVW1Q0/fMuFaSE1S8ZIK6S5cN4zL/uh0H/xxQo?= =?us-ascii?Q?ELR51wOsAlyUwL+BpNuNtsKdb05YU103leoDmw5jym0jcW60uRlx1y1P/eJq?= =?us-ascii?Q?t5dCEawQ82kL5903vnwYlOrThV68WyLo/l94PJXjcGsHfuwGeJtcMURqSOwF?= =?us-ascii?Q?ITrRW2vEVN8fSpufBUCFqLl1bEXYSQoM0zZconG/tNBL71FK17L6zIFpGFCg?= =?us-ascii?Q?RSvZ9X+TFLiD7H54Se0984HqJ3awXQX+sXK5QgjFeT+bfQ1IJfuBiIo+QTYi?= =?us-ascii?Q?G736JVLbLuXscyd4ydM2ZfiXLhWv7+Reu/fdMmhPELRqYoj2qZb6Q=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2689; 6:jEYtZ2Xp/M3XwFLsj5OBi+E4E7+wrPV9n0Nx4S4p1iItvUI626PnTv3ydnwmbvq3SvGUlDsaaDNb4KavU732S7hDUfqcfrg5vMA8vd7ZdWCwmnWgE6Ma1IJ05e4O0hzDTGHaTXUA+0szPbt98VeLkCl53AsLB1EdCMcLBoTRZXtA3boOHPB4l9FbTpCfpqCZWd6yuSdq0nEH8YiAeEGaWr4xGMUUgx2MNvljlLDwKFzZFid6EtiNpl9JvNtQ/vIruIo+XuEbZJXcXYMBRotZSJlItJrSpLOJH1Tm07p4hVgD4TUNCjJMP0JpYR/im3LhDErjmcPWNrPw6oM7rgrUzocs/AxHOm3/0yIB8T7jYdA=; 5:1bmBU/k4GoboFtlLxFf0edkjSu9/MJTtrFZGynXrY3aYJgYkPVrGAkw5uD5OHI6r0OLTwpzRxDK30JbTr7ZjGuMshA37B0XuKQ5GWDjdBUjjjlLsOGhQiuBHpIBY7hjy78GCB8CrKJdSsgehHJ8Q85kGEXyZVkTPpj5mVRcYmR4=; 24:lA8Q4QRqUiPRY6H86XbYMFLNcAZDj75xtIQiSnORfwcKhBTptp3Gun1m1659w8KtTpeop3P1vCqGP7vlN7acmcnCE3heKsctMetZioMk0NY=; 7:IHw4GIvGIjGtYEGOy1cbihE/2Z+/3td46BKnjPFmsCHMa2ChURKLoO/Uk3NW4ug/MStnwahuXPhDKtBGJXeYgGIYT5/6G1YAA8x7I8b1uztqoYPx7iWBE+VLt7mgLzfaIizVYrjrbxQj/8jiAPBrXPe23m1OdYqtp8B4LRBghoe/jlAo79lKSqRnrXrIaELgzW8MVDH/a6ACZyFpHlfS45HXLfPZhBghMFMzDauY/UZre9rJ81TrA2VenZSvXm7d SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jan 2018 05:24:30.5417 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 44845fa8-6870-4802-929c-08d55d6a95fd 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: BN6PR03MB2689 Subject: [dpdk-dev] [PATCH 6/6 v3] 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: Wed, 17 Jan 2018 05:24:32 -0000 Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- 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