From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0050.outbound.protection.outlook.com [104.47.33.50]) by dpdk.org (Postfix) with ESMTP id D0C011B00C for ; Tue, 16 Jan 2018 12:43:15 +0100 (CET) Received: from BN6PR03CA0056.namprd03.prod.outlook.com (10.173.137.18) by BN6PR03MB2692.namprd03.prod.outlook.com (10.173.144.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Tue, 16 Jan 2018 11:43:14 +0000 Received: from BL2FFO11FD009.protection.gbl (2a01:111:f400:7c09::165) by BN6PR03CA0056.outlook.office365.com (2603:10b6:404:4c::18) 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, 16 Jan 2018 11:43:14 +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 BL2FFO11FD009.mail.protection.outlook.com (10.173.161.15) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.345.12 via Frontend Transport; Tue, 16 Jan 2018 11:43:14 +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 w0GBgtjO014705; Tue, 16 Jan 2018 04:43:11 -0700 From: Nipun Gupta To: CC: , , , Nipun Gupta Date: Tue, 16 Jan 2018 23:27:57 +0530 Message-ID: <1516125485-28919-5-git-send-email-nipun.gupta@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1516125485-28919-1-git-send-email-nipun.gupta@nxp.com> References: <20171215130828.14218-1-sunil.kori@nxp.com> <1516125485-28919-1-git-send-email-nipun.gupta@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131605765946738531; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(346002)(376002)(396003)(39380400002)(39860400002)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(51416003)(296002)(76176011)(4326008)(498600001)(5890100001)(48376002)(54906003)(85426001)(6916009)(2950100002)(6666003)(5660300001)(16586007)(53936002)(50226002)(68736007)(77096006)(105606002)(2351001)(106466001)(316002)(8936002)(2906002)(356003)(81156014)(81166006)(305945005)(36756003)(47776003)(86362001)(50466002)(97736004)(8656006)(575784001)(104016004)(26005)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR03MB2692; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD009; 1:XuYp62YTHyPd0GUREC/Qvc6o+ALpVZb/yzSf/ipYxexkfsrSH7fKF7+6nj5GV9jE+7RbNtwKphq8CN5V4xbdJmBWspq8x2XohsxOR2C7CDHl+eL/SgZ8u9WhIP2KoBJ+ MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5ed31f80-65bc-45b6-a600-08d55cd6541a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(5600026)(4604075)(2017052603307); SRVR:BN6PR03MB2692; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2692; 3:EDOy039lTG0f8WAOOFE+PqytbmQuZISrwL3KU7LkMXf5ikzqyAH4XFP+6tvmVatcVg5EdIwpeOxaUjK5uy7njERMmiOvR39aoi+QBxpfFU+P1I/L4x8UkdWD9y9FsuvK1Y5MJiOcO0jauvw5d+y/CgaphG1hquej+MNpiWtqu8HQ+ET4jGl1oBD7dmcUIj/5hn3XPcsgq5sPSt5fwviHdQvk3K8HiSqlXJaCU03c+XPrGi2jTPLYOexoYLnju3DlRzyH8qiDkekOxu56sq9luNvNpSDaHag930Hvmsaf2ypJFYzVfyCWdK/e0lD27a6VtJbtwd+MsmFJij+sye6oXJV9o7It1oDQqpHyQLCL944=; 25:qXZSBGlxj4JERdwJ074mVsrGpuxbbbVMUH908Y4ptl0WLUqYCht6XdsRpk2AUtuJV8BRZNER05xUpLinfKkTrkbQh+gm32lXrUlvpONwZUW8ZsBm0YJfC1YqEXf7ZAFr9muXS1elau7z3+yGeFT/9sqKlDbdJuC0xFY18mJvtyP2UVWtH+F+OpVrlRs2qYtACEPX8hNiWNsP/Jz2/jJEy4No07hulgMII0y5X2fqC0CHldcAf5GdU0XE9ms4blovAqWg2T3WhKnF3ii+hgjeYY/YC63gT9IvPi/cxq8muU4UEp8FpECt4nhfRwR8kiGJv4TRDFXlmyeon6LmiVIAcQ== X-MS-TrafficTypeDiagnostic: BN6PR03MB2692: X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2692; 31:bKo3PAPbcm8w3m9dc13/fbQvTBVFDsl6LHZjbKffkR5hzQrUKmL/y4DEcyRqAciUjKdnmC1VV+dpFGTssG/Rz5rqjsjhU/foAX/cnh4LuesyH0R+G++ksrsvQaFzB1jofWUl9+JJRBugUXh6aCYqaQjObYBfZSC6Dy1nwCcS0+aIBWlZXmlWsGpbgPqbmOGWdlLGObE0grwa31LRCT3zRabM4ShgtYogQ299/msJc58=; 4:BKrv+kGGhSc2fV7xQfvwVdp/CBoEkWjZNGVeOuDKg/j6+l4WEvIVF75vo7VSaztylk/rErMwENak33voHA13MKHP881fBrgXVdnPUxhooUVu97DbHefandFO+pWMMHUVDPMGXf6LwaXVBga9NMs/dEwohoks6BoYupX2fN3YL+eLrSnPtldpNbkW2wBDOcMfgkHcfmuEAj8ShFeIplqRXdqEZ3Zgbo6hh3XDJy0uTYPkPZM0/ZB/ipljxzVWUnKWVIDQmQqOAwE0oeImhtbUOd5rvexdhiZNV6MxzxKKtpKfz8nS9koQEUAqH71VHCEZ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095135)(2401047)(5005006)(8121501046)(3231023)(944501161)(10201501046)(93006095)(93001095)(3002001)(6055026)(6096035)(20161123563025)(20161123559100)(201703131430075)(201703131520075)(201703131448075)(201703131433075)(201703151042153)(20161123561025)(20161123565025)(20161123556025)(201708071742011); SRVR:BN6PR03MB2692; BCL:0; PCL:0; RULEID:(100000803101)(100110400095)(400006); SRVR:BN6PR03MB2692; X-Forefront-PRVS: 0554B1F54F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2692; 23:kuRkYl7QSAmTH4unPpyrVUbaktYfr9hW6Q6m1m4bo?= =?us-ascii?Q?Jipqm8XnXTBZQLdZ39ii6iCSyCI2SM03Xal4L6dx/NhmqVpxU5DuwJs6jUCA?= =?us-ascii?Q?CSTHX3qzqUof1ocUsBG62JJBdL2DKn0cj+U9a41/SpB4yFVxWpwFYfTpqvxy?= =?us-ascii?Q?IctrQHVURasVryASZv81kHcXaOvGiDvYxvBsHIfZg1anxqxNohwRgTwvfrTt?= =?us-ascii?Q?ERgqtG3V5v0bcvOT6vZGvDVWOrpmsf/R43pgP/dWWDdsFrPf9NSKmBeOI0jx?= =?us-ascii?Q?4tBblcLd+1j7DkTxsRfIqEkd4rQwDcQ3W8P4e+eTFwtVCuLaYZC7JMkAPmXh?= =?us-ascii?Q?iKoXKAtlBifquOuTEX67MN2JGbaxgXdgUAw9nH7d1u5Cv5MLRKN5o6hMwH5W?= =?us-ascii?Q?I2ylIx7Lc2wSOaxEpx4cnFxcMHJCFZJzMvbsvTU0Vam2Q4dMte1UdnIviB41?= =?us-ascii?Q?++mjNK8NMPPLr1tbhvX+G/7qK4yYsW13DcUZnPXKE3WKqzYzgxAG9ZnlYIjO?= =?us-ascii?Q?Y5Rd5yzCkVyq4ua2F7FPciS6921vxhmexjcuqmXgErk/cGbAFICKKD2MSuZK?= =?us-ascii?Q?QLwo5wPb2+rTEqYNo+uJQXnMOd/Ht3EkU6zSJezpLnRe+cIKZwRXPdrmEsKI?= =?us-ascii?Q?TEGoCzyRw+NBFq+GmgLMO3Fk/oQsmVlS5Am2xtJzUF2clfL0KyZna4B9fXQB?= =?us-ascii?Q?cZKROHOz2DKNKhDnKZ+XV0w5W7f6orXb+EwrgLRS1gJWKdxrEbkrmjVmXB8W?= =?us-ascii?Q?+V8/x8ZZzw3HDWDWNbfUhjJKE7c4GrQgA0Hlqi56xoEOdDkCzeKEfBnCMH/i?= =?us-ascii?Q?bzjHN755OHw2BfchuVVQGo5Na8X4I8DErle3+OMLsHqTGUpb2ahz7mT6niQt?= =?us-ascii?Q?Meb/aNrgLpR9EhPb4g4PCSWABcDESrYvJeV7ZeaUG4qFYheHIxxHx3c4EwRI?= =?us-ascii?Q?QRsJ6+gPiLudecbghc9dT5aLcq3o7IW2iAfRqexgN/L3pPlFbTaYK1xpxLqU?= =?us-ascii?Q?GtAUOcBGvIoNboD9F0GCCpsclKXFErPVhpTz3ilGkkD/98jR+Y6oTNPV8Ou3?= =?us-ascii?Q?8z2oxHwzM0mvSIhK+1WExQg4wpVSs2r/yocyGLZI2/4RowA5+v7pBuJ86Fvp?= =?us-ascii?Q?35FaCR8YM6ml+/KaeCi7lBb6860z0oP?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2692; 6:iKEK2t/XSi0UQXzFoQsOYfpuOjeExF7L7i70OHmccUf9RFkbmKTxh3W/FWunlz9o11rSEy76YT+h8fcCpvxFurSGMaSVSoDJAK5hhE2RG46TaFYgZATaDlrmTC9btByX0rONjLOvOEyVmhzm3KgyDVb2vjlJg/mwDbDrJuaw4halNDISd18r7bQXHm8WPhV4CCjDPSshqxobCMH9hP3Y3d42+peMM9W8L5zaK8NG/PBRiIDbqs1StVmTFs9rEzQglYaK/xMKq1yxkm1H+5DH3gg8HoP7sFwj/Ocmb28tJUV3TzvfbdaKJW68A/hsPkQOCOK1L2pFAmZwmp+AGFwNtvs7GeUE6jD+/zpQbU8gIKM=; 5:p4MrRXQjBa8M9nq6MoMwULTrfc0wq6j4bscV8sgwT92LGKS/Imuk99iF+h5feMXbSFdbeuzyiTMU7K5ACL/q6ZUYg0rfGPiscaAvuLEWwi9Ef3or+Z0xElWYhJD+M8wgLgQEUtW9vybYaRAFCVjpzDxaDeKKXR5YSeBYClGnCrE=; 24:nd391W7t3N43wYabE75/UIcOfRxp+lzP42YGpjbRQkWmflXvgRfMQekJ6eNAOpbWAv+agstNOot5nu9CjzTavtJainz7UJqGM+5zG4GLEEU=; 7:TExTJZ6Gx39E+XL1ngyiOneBQ5yaGOSrA+lvPjGXnRMpBVYJveWtGtfo9Ruo9I3HfBxsUtaMMoCBojdRP2rxlvnKKgJIix1AMMoJxRhkNVmO+Qt2f6A7iGYoXsioe2y3KHYp/B1OmwQNZALqoxWbGtv8OvQOZd2ZaqiF2MhVtAOQQDQp35PlSYN4VeCsRHhxvdxuxZW8xDK0YPbCqYGIr0AkHouvbh3u38RZrY/jjED7IWFHlpzlqqm55Yig9QSL SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Jan 2018 11:43:14.5022 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5ed31f80-65bc-45b6-a600-08d55cd6541a 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: BN6PR03MB2692 Subject: [dpdk-dev] [PATCH 04/12 v3] net/dpaa: ethdev Rx queue configurations with eventdev 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: Tue, 16 Jan 2018 11:43:16 -0000 From: Sunil Kumar Kori Given ethernet Rx queues can be attached with event queue in parallel or atomic mode. Patch imlmplements Rx queue configuration, attachment/detachment with given event queue and their corresponding callbacks to handle events from respective queues. Signed-off-by: Sunil Kumar Kori Signed-off-by: Nipun Gupta Acked-by: Hemant Agrawal --- drivers/net/dpaa/Makefile | 2 + drivers/net/dpaa/dpaa_ethdev.c | 115 ++++++++++++++++++++++++++++-- drivers/net/dpaa/dpaa_ethdev.h | 29 ++++++++ drivers/net/dpaa/dpaa_rxtx.c | 80 ++++++++++++++++++++- drivers/net/dpaa/rte_pmd_dpaa_version.map | 2 + 5 files changed, 219 insertions(+), 9 deletions(-) diff --git a/drivers/net/dpaa/Makefile b/drivers/net/dpaa/Makefile index b1fc5a0..9c2a5ea 100644 --- a/drivers/net/dpaa/Makefile +++ b/drivers/net/dpaa/Makefile @@ -17,7 +17,9 @@ CFLAGS += -I$(RTE_SDK_DPAA)/ CFLAGS += -I$(RTE_SDK_DPAA)/include CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/include/ +CFLAGS += -I$(RTE_SDK)/drivers/bus/dpaa/base/qbman CFLAGS += -I$(RTE_SDK)/drivers/mempool/dpaa +CFLAGS += -I$(RTE_SDK)/drivers/event/dpaa CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal/include diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index 444c122..09f0a73 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -95,6 +95,21 @@ struct rte_dpaa_xstats_name_off { static struct rte_dpaa_driver rte_dpaa_pmd; +static inline void +dpaa_poll_queue_default_config(struct qm_mcc_initfq *opts) +{ + memset(opts, 0, sizeof(struct qm_mcc_initfq)); + 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; + if (dpaa_svr_family != SVR_LS1046A_FAMILY) + 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; +} + static int dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu) { @@ -533,6 +548,97 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, return 0; } +int dpaa_eth_eventq_attach(const struct rte_eth_dev *dev, + int eth_rx_queue_id, + u16 ch_id, + const struct rte_event_eth_rx_adapter_queue_conf *queue_conf) +{ + int ret; + u32 flags = 0; + struct dpaa_if *dpaa_intf = dev->data->dev_private; + struct qman_fq *rxq = &dpaa_intf->rx_queues[eth_rx_queue_id]; + struct qm_mcc_initfq opts = {0}; + + if (dpaa_push_mode_max_queue) + DPAA_PMD_WARN("PUSH mode already enabled for first %d queues.\n" + "To disable set DPAA_PUSH_QUEUES_NUMBER to 0\n", + dpaa_push_mode_max_queue); + + dpaa_poll_queue_default_config(&opts); + + switch (queue_conf->ev.sched_type) { + case RTE_SCHED_TYPE_ATOMIC: + opts.fqd.fq_ctrl |= QM_FQCTRL_HOLDACTIVE; + /* Reset FQCTRL_AVOIDBLOCK bit as it is unnecessary + * configuration with HOLD_ACTIVE setting + */ + opts.fqd.fq_ctrl &= (~QM_FQCTRL_AVOIDBLOCK); + rxq->cb.dqrr_dpdk_cb = dpaa_rx_cb_atomic; + break; + case RTE_SCHED_TYPE_ORDERED: + DPAA_PMD_ERR("Ordered queue schedule type is not supported\n"); + return -1; + default: + opts.fqd.fq_ctrl |= QM_FQCTRL_AVOIDBLOCK; + rxq->cb.dqrr_dpdk_cb = dpaa_rx_cb_parallel; + break; + } + + opts.we_mask = opts.we_mask | QM_INITFQ_WE_DESTWQ; + opts.fqd.dest.channel = ch_id; + opts.fqd.dest.wq = queue_conf->ev.priority; + + if (dpaa_intf->cgr_rx) { + opts.we_mask |= QM_INITFQ_WE_CGID; + opts.fqd.cgid = dpaa_intf->cgr_rx[eth_rx_queue_id].cgrid; + opts.fqd.fq_ctrl |= QM_FQCTRL_CGE; + } + + flags = QMAN_INITFQ_FLAG_SCHED; + + ret = qman_init_fq(rxq, flags, &opts); + if (ret) { + DPAA_PMD_ERR("Channel/Queue association failed. fqid %d ret:%d", + rxq->fqid, ret); + return ret; + } + + /* copy configuration which needs to be filled during dequeue */ + memcpy(&rxq->ev, &queue_conf->ev, sizeof(struct rte_event)); + dev->data->rx_queues[eth_rx_queue_id] = rxq; + + return ret; +} + +int dpaa_eth_eventq_detach(const struct rte_eth_dev *dev, + int eth_rx_queue_id) +{ + struct qm_mcc_initfq opts; + int ret; + u32 flags = 0; + struct dpaa_if *dpaa_intf = dev->data->dev_private; + struct qman_fq *rxq = &dpaa_intf->rx_queues[eth_rx_queue_id]; + + dpaa_poll_queue_default_config(&opts); + + if (dpaa_intf->cgr_rx) { + opts.we_mask |= QM_INITFQ_WE_CGID; + opts.fqd.cgid = dpaa_intf->cgr_rx[eth_rx_queue_id].cgrid; + opts.fqd.fq_ctrl |= QM_FQCTRL_CGE; + } + + ret = qman_init_fq(rxq, flags, &opts); + if (ret) { + DPAA_PMD_ERR("init rx fqid %d failed with ret: %d", + rxq->fqid, ret); + } + + rxq->cb.dqrr_dpdk_cb = NULL; + dev->data->rx_queues[eth_rx_queue_id] = NULL; + + return 0; +} + static void dpaa_eth_rx_queue_release(void *rxq __rte_unused) { @@ -853,13 +959,8 @@ static int dpaa_rx_queue_init(struct qman_fq *fq, struct qman_cgr *cgr_rx, return ret; } 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; - 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; + + dpaa_poll_queue_default_config(&opts); if (cgr_rx) { /* Enable tail drop with cgr on this queue */ diff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h index 1fa6caf..3c9162b 100644 --- a/drivers/net/dpaa/dpaa_ethdev.h +++ b/drivers/net/dpaa/dpaa_ethdev.h @@ -10,6 +10,7 @@ /* System headers */ #include #include +#include #include #include @@ -24,6 +25,13 @@ #error "Annotation requirement is more than RTE_PKTMBUF_HEADROOM" #endif +/* mbuf->seqn will be used to store event entry index for + * driver specific usage. For parallel mode queues, invalid + * index will be set and for atomic mode queues, valid value + * ranging from 1 to 16. + */ +#define DPAA_INVALID_MBUF_SEQN 0 + /* we will re-use the HEADROOM for annotation in RX */ #define DPAA_HW_BUF_RESERVE 0 #define DPAA_PACKET_LAYOUT_ALIGN 64 @@ -152,4 +160,25 @@ struct dpaa_if_stats { uint64_t tund; /** #include #include +#include #include "dpaa_ethdev.h" #include "dpaa_rxtx.h" #include #include +#include #include #include #include @@ -425,6 +427,67 @@ enum qman_cb_dqrr_result dpaa_rx_cb(void *event __always_unused, return qman_portal_poll_rx(nb_bufs, (void **)bufs, fq->qp); } +enum qman_cb_dqrr_result +dpaa_rx_cb_parallel(void *event, + struct qman_portal *qm __always_unused, + struct qman_fq *fq, + const struct qm_dqrr_entry *dqrr, + void **bufs) +{ + u32 ifid = ((struct dpaa_if *)fq->dpaa_intf)->ifid; + struct rte_mbuf *mbuf; + struct rte_event *ev = (struct rte_event *)event; + + mbuf = dpaa_eth_fd_to_mbuf(&dqrr->fd, ifid); + ev->event_ptr = (void *)mbuf; + ev->flow_id = fq->ev.flow_id; + ev->sub_event_type = fq->ev.sub_event_type; + ev->event_type = RTE_EVENT_TYPE_ETHDEV; + ev->op = RTE_EVENT_OP_NEW; + ev->sched_type = fq->ev.sched_type; + ev->queue_id = fq->ev.queue_id; + ev->priority = fq->ev.priority; + ev->impl_opaque = (uint8_t)DPAA_INVALID_MBUF_SEQN; + mbuf->seqn = DPAA_INVALID_MBUF_SEQN; + *bufs = mbuf; + + return qman_cb_dqrr_consume; +} + +enum qman_cb_dqrr_result +dpaa_rx_cb_atomic(void *event, + struct qman_portal *qm __always_unused, + struct qman_fq *fq, + const struct qm_dqrr_entry *dqrr, + void **bufs) +{ + u8 index; + u32 ifid = ((struct dpaa_if *)fq->dpaa_intf)->ifid; + struct rte_mbuf *mbuf; + struct rte_event *ev = (struct rte_event *)event; + + mbuf = dpaa_eth_fd_to_mbuf(&dqrr->fd, ifid); + ev->event_ptr = (void *)mbuf; + ev->flow_id = fq->ev.flow_id; + ev->sub_event_type = fq->ev.sub_event_type; + ev->event_type = RTE_EVENT_TYPE_ETHDEV; + ev->op = RTE_EVENT_OP_NEW; + ev->sched_type = fq->ev.sched_type; + ev->queue_id = fq->ev.queue_id; + ev->priority = fq->ev.priority; + + /* Save active dqrr entries */ + index = DQRR_PTR2IDX(dqrr); + DPAA_PER_LCORE_DQRR_SIZE++; + DPAA_PER_LCORE_DQRR_HELD |= 1 << index; + DPAA_PER_LCORE_DQRR_MBUF(index) = mbuf; + ev->impl_opaque = index + 1; + mbuf->seqn = (uint32_t)index + 1; + *bufs = mbuf; + + return qman_cb_dqrr_defer; +} + uint16_t dpaa_eth_queue_rx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) @@ -708,6 +771,7 @@ static struct rte_mbuf *dpaa_get_dmable_mbuf(struct rte_mbuf *mbuf, uint32_t frames_to_send, loop, sent = 0; uint16_t state; int ret; + uint32_t seqn, index, flags[DPAA_TX_BURST_SIZE] = {0}; ret = rte_dpaa_portal_init((void *)0); if (ret) { @@ -768,14 +832,26 @@ static struct rte_mbuf *dpaa_get_dmable_mbuf(struct rte_mbuf *mbuf, goto send_pkts; } } + seqn = mbuf->seqn; + if (seqn != DPAA_INVALID_MBUF_SEQN) { + index = seqn - 1; + if (DPAA_PER_LCORE_DQRR_HELD & (1 << index)) { + flags[loop] = + ((index & QM_EQCR_DCA_IDXMASK) << 8); + flags[loop] |= QMAN_ENQUEUE_FLAG_DCA; + DPAA_PER_LCORE_DQRR_SIZE--; + DPAA_PER_LCORE_DQRR_HELD &= + ~(1 << index); + } + } } send_pkts: loop = 0; while (loop < frames_to_send) { loop += qman_enqueue_multi(q, &fd_arr[loop], - NULL, - frames_to_send - loop); + &flags[loop], + frames_to_send - loop); } nb_bufs -= frames_to_send; sent += frames_to_send; diff --git a/drivers/net/dpaa/rte_pmd_dpaa_version.map b/drivers/net/dpaa/rte_pmd_dpaa_version.map index d1f3ea4..3b937b1 100644 --- a/drivers/net/dpaa/rte_pmd_dpaa_version.map +++ b/drivers/net/dpaa/rte_pmd_dpaa_version.map @@ -6,6 +6,8 @@ DPDK_17.11 { EXPERIMENTAL { global: + dpaa_eth_eventq_attach; + dpaa_eth_eventq_detach; rte_pmd_dpaa_set_tx_loopback; local: *; -- 1.9.1