From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0054.outbound.protection.outlook.com [104.47.41.54]) by dpdk.org (Postfix) with ESMTP id EE8A81B803 for ; Tue, 17 Oct 2017 14:32:46 +0200 (CEST) Received: from CY4PR03CA0078.namprd03.prod.outlook.com (10.171.242.147) by MWHPR03MB2702.namprd03.prod.outlook.com (10.168.207.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Tue, 17 Oct 2017 12:32:45 +0000 Received: from BY2FFO11FD020.protection.gbl (2a01:111:f400:7c0c::152) by CY4PR03CA0078.outlook.office365.com (2603:10b6:910:4d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.21 via Frontend Transport; Tue, 17 Oct 2017 12:32:45 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11FD020.mail.protection.outlook.com (10.1.14.137) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Tue, 17 Oct 2017 12:32:44 +0000 Received: from [10.214.249.171] ([10.214.249.171]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id v9HCWf5Y031287; Tue, 17 Oct 2017 05:32:42 -0700 To: Nipun Gupta , References: <1507657887-11366-1-git-send-email-nipun.gupta@nxp.com> <1508258314-11151-1-git-send-email-nipun.gupta@nxp.com> <1508258314-11151-2-git-send-email-nipun.gupta@nxp.com> CC: , From: Hemant Agrawal Message-ID: <1f4c51ba-649d-dd54-3262-9c389965356c@nxp.com> Date: Tue, 17 Oct 2017 18:02:41 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1508258314-11151-2-git-send-email-nipun.gupta@nxp.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131527171651869192; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.158.2; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(7966004)(39860400002)(39380400002)(346002)(376002)(2980300002)(1109001)(1110001)(339900001)(189002)(24454002)(51234002)(377454003)(199003)(65956001)(69596002)(68736007)(65806001)(54906003)(8656003)(104016004)(498600001)(50466002)(64126003)(110136005)(316002)(5660300001)(58126008)(31686004)(86362001)(23746002)(83506001)(31696002)(77096006)(5890100001)(85426001)(4326008)(8676002)(81166006)(36756003)(2950100002)(81156014)(97736004)(230700001)(47776003)(106466001)(229853002)(105606002)(189998001)(305945005)(53936002)(65826007)(6246003)(33646002)(2906002)(8936002)(76176999)(53546010)(54356999)(356003)(50986999); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2702; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD020; 1:1SnmGEwtrDHaJoFZjHs35GID/bFSRCwtTCBO3gDzX3qwudcpgREA1i/4DR3o9CGLI6dfhjwvB4umXI2D2lox2PQj1EjMg+ox9PgNmfQPSGOag1vOQVKpF79V43wqpXwt X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7846f8d1-895a-4417-ad9f-08d5155b2b00 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:MWHPR03MB2702; X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2702; 3:u/es6I5HQRtwgSJYFGNyvPiHJoAAKUYoPm3wUyrr+2Iy35J6zmr7OjaaajWuwT8jJNIJDjUHVtGToe6VFOuGYA/lIjUAmQpL/yZrT/HM3eglZY/FM4gv5BoqIKaxNdeaHhpLfp6uo6UzYjRPd+zVHeU0qZoY0+xn+/kkyEp2dMhLxhHQbyMtbLDwPqf1cYT1mGJbdlOURnXsLZ7YtU1lptYh4QxFQgRBuF/rtiIHG/IsffGz43O3qt+NDjHq60lGBEWqGoXr7u7WsoSbfq3btIQ+pO1PaogVfoQKQB9q/sqtMTd8WgnBszm5iysfUMYb2IxQlqtxzmAN6yInyXzrmnFBrLa6sC7O9GK7XJYbyY0=; 25:Gn2940Eb9NWQqdJiwuVDtRP5yyOwTc+87ZESfMg530eqo0qyR7bx9WIXa+fQ/I0fjMtmDtYr4d54++LxZA2iq6JdrdUqWWD9tFNAqpJHHWdkP04/mZxm7FNrkC4Vs80t8jp9sUdPwBTmwmT0+0Q98FuwOcDwV3iLJhwXk4pVrQlHIRNkzs6nFfOkNcTLpD+YMdtpm0weEA0dzRc/alZ+JPEHCf3JXjjaXFg9VMalkOdCaoGGEHnhNczT9CwrWv0EyHzokJbAQrLXoaoCM0O5MyfN/g4aQ6Ici1et88WrvuzC2hyKjcPgaZhVnuRFR/FmiC+BoTDTwc8jq/641++c2g== X-MS-TrafficTypeDiagnostic: MWHPR03MB2702: X-Microsoft-Exchange-Diagnostics: 1; MWHPR03MB2702; 31:RzYj/qtMuhg2FMdyFCKH+en61BjSx25rz6wczyNhLs1q5aOsE7qD9BBhxWbnWAtKZrKy3Imj6Kgv4irPA4ELQp2vx3TmYqJF+GvLYhY7RlHmghijH14ZO6BI5m0MtaVzXj6JrcHMvwUiUCorUHr9J+HjA4CxrltjOskbGtGn0WLYIwrJMX14n2UHG1jU7agbCF0cJlTaBF25DHIsNsZt65QoJGcypFvL1Uhqu1NPauU=; 4:nREPWVxwhKGztslNtr3eMhm8HhW7cqNexn5meve0GrN2IJCuvnr30Oc9Nasv5Uyty/vQsuidUJ7baXz9kUaFvb+jffuUU4w/GUyMSDEYNdUk7qffw2rGjBLbQU4HB96ihhRXcPpczmJDv8zC3AhXRIzGG2eM11odfbeb4YHzq/qL5dDsiZIN98RDysVPNr4EAWTn7Sn+acFIwTaOpg0Ds6GbBMMqjdu9+XS1WIRIMcy7cFA21G+zRTOuvj15hclX3oV8LZafx1ihw+y+mRv+lk8FPMdecqhdyYP2SbK6zHA= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6055026)(6096035)(20161123563025)(20161123561025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123559100)(20161123556025)(20161123565025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR03MB2702; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR03MB2702; X-Forefront-PRVS: 04631F8F77 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; MWHPR03MB2702; 23:5rZ9diHjnk4KhdgYk+BP6YCT+uUNgYaTz8EPy?= =?Windows-1252?Q?TDW7HY4NXmygXCfrw66P4MajY9g99cfkAdBDiWkmH/b9L73EMj6rTeQh?= =?Windows-1252?Q?uAjHLfivuNSRNeV2i06cMb2PImId+152WZ6ZIjdN6UC/xsDkERklfDw3?= =?Windows-1252?Q?1t/bePXiXKg1entxYFnB2hRbyxzoEC/00oE0enEpy1RMUHr8JM+rcTSJ?= =?Windows-1252?Q?sjFO92WpV1lcVeq3UdAxZGU0cvhGxeAABmRonwuiBWpbeKDv/FhphwwE?= =?Windows-1252?Q?OqakGd7z5uKP9CF+SC2o2oT5AjST0THQ+hxXIIBt0bA9Uv8A3y4vk/B9?= =?Windows-1252?Q?d2oIVJiMnW4hRxIGTBfmsr7M6tw/QqGa92PADVXqbm+ZXdAihW/+LgdZ?= =?Windows-1252?Q?n6w93wo9108Ab4mom8aKe3i2sqIJWl8pa4kaaqT7bftKna0P1vyYS1Ir?= =?Windows-1252?Q?sQe52GVmTRcCXkOx8+VLAscYtxm9kSfC1CuDjt+pOUqcKvpGgIcxg+gg?= =?Windows-1252?Q?inoY1MwQBvTQ40m9NaxYiQ2y6KzmJpB2kH+FaGRaP5zw3yPrZWnFzTh0?= =?Windows-1252?Q?cRIxG0KGnx+yTnoDjLnu2HgxffNKc0uhoFpjb5GbghNe09lm9vTk0RkO?= =?Windows-1252?Q?LLGOiPU57lM6fQrGWVpjSANqi+uTmg5pyyneMDviITZMCILNnMQEaBOM?= =?Windows-1252?Q?BdHSV3lahDVyUIIZwUKCo1DulUmJRSFhXoi1BezXV99CQXxiBZfHg76y?= =?Windows-1252?Q?Z0Hpy0PsQTIOQ4UVhLniCxH9lK6dFnO1yJrC1Rj2y22J1WfJKht6OR7Q?= =?Windows-1252?Q?zM4Tj5eytIIlkHujuY91roZ3htjOd0Smk/wSMVVi2+FVolG+3xyBE5Kd?= =?Windows-1252?Q?VmfQhtGb/BLrSnpz1TRCjzSlDIBXkFiZIGrgHvKUpvw1TZGFL+G0CAuo?= =?Windows-1252?Q?eCHFm6M4PrhI8+qG3/86RBdh64HL+KvIBcPDkw/oivSQZrIqoUsVAgCN?= =?Windows-1252?Q?rdjghI+Moyxwb8h0FT58qvuMeIlYBCnAMKmLWmJwZP9fWNLxesDKPDBv?= =?Windows-1252?Q?c122BGSfjP/hKw7fkLsqM2F/AdRZ5CBjXpKq9Ur3xnqe1Xnyt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CzA03D3qPVA0xV1CQjTNvO0eSA==; 24:f1Ofm8HzVmKGMYYRbnOer39EQ+aq/IrYoqXtUK9YVoYHuRryAnzpLRzeTBsEiGWw9kkThFQ6VyWNkHckS8po+BtfhSbr5BV8toa7jaANaZY=; 7:zzpZcOK3Exqj+oiOK2gpdTKEcHFId6VmzHh1oRLaim7QnYqRAOR8wITmpf/RMF1r3GOVuLGrON/g0Pf0Fqcf9q7oRUH12OkEtRZblsxW6A+1hEup/HFH/Etx+T44BNTgfWjsmmu5BSoFbC5g6wFbai+XEeBMvdGcG/Ya8FVBTAjYQlNGhVT/uCS9FzGg+8KADe5tIo53R1xjYyr1WD70ISpKrgDW/Se4VHRUJswE/dI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Oct 2017 12:32:44.9373 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB2702 Subject: Re: [dpdk-dev] [PATCH v4 2/5] net/dpaa2: add API's to support event eth adapter 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, 17 Oct 2017 12:32:47 -0000 On 10/17/2017 10:08 PM, Nipun Gupta wrote: > Signed-off-by: Nipun Gupta > --- > Changes in v3: > Check the queue schedule type before configuring MC (Hemant) > > drivers/net/dpaa2/dpaa2_ethdev.c | 62 +++++++++++++++++++++++++++++ > drivers/net/dpaa2/dpaa2_ethdev.h | 15 +++++++ > drivers/net/dpaa2/dpaa2_rxtx.c | 20 ++++++++++ > drivers/net/dpaa2/rte_pmd_dpaa2_version.map | 7 ++++ > 4 files changed, 104 insertions(+) > > diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c > index 1ac607c..14d79b9 100644 > --- a/drivers/net/dpaa2/dpaa2_ethdev.c > +++ b/drivers/net/dpaa2/dpaa2_ethdev.c > @@ -1634,6 +1634,68 @@ int dpaa2_dev_stats_get(struct rte_eth_dev *dev, > return 0; > } > > +int dpaa2_eth_eventq_attach(const struct rte_eth_dev *dev, > + int eth_rx_queue_id, > + uint16_t dpcon_id, > + const struct rte_event_eth_rx_adapter_queue_conf *queue_conf) > +{ > + struct dpaa2_dev_priv *eth_priv = dev->data->dev_private; > + struct fsl_mc_io *dpni = (struct fsl_mc_io *)eth_priv->hw; > + struct dpaa2_queue *dpaa2_ethq = eth_priv->rx_vq[eth_rx_queue_id]; > + uint8_t flow_id = dpaa2_ethq->flow_id; > + struct dpni_queue cfg; > + uint8_t options; > + int ret; > + > + if (queue_conf->ev.sched_type == RTE_SCHED_TYPE_PARALLEL) > + dpaa2_ethq->cb = dpaa2_dev_process_parallel_event; > + else > + return -EINVAL; > + > + memset(&cfg, 0, sizeof(struct dpni_queue)); > + options = DPNI_QUEUE_OPT_DEST; > + cfg.destination.type = DPNI_DEST_DPCON; > + cfg.destination.id = dpcon_id; > + cfg.destination.priority = queue_conf->ev.priority; > + > + options |= DPNI_QUEUE_OPT_USER_CTX; > + cfg.user_context = (uint64_t)(dpaa2_ethq); > + > + ret = dpni_set_queue(dpni, CMD_PRI_LOW, eth_priv->token, DPNI_QUEUE_RX, > + dpaa2_ethq->tc_index, flow_id, options, &cfg); > + if (ret) { > + RTE_LOG(ERR, PMD, "Error in dpni_set_queue: ret: %d\n", ret); > + return ret; > + } > + > + memcpy(&dpaa2_ethq->ev, &queue_conf->ev, sizeof(struct rte_event)); > + > + return 0; > +} > + > +int dpaa2_eth_eventq_detach(const struct rte_eth_dev *dev, > + int eth_rx_queue_id) > +{ > + struct dpaa2_dev_priv *eth_priv = dev->data->dev_private; > + struct fsl_mc_io *dpni = (struct fsl_mc_io *)eth_priv->hw; > + struct dpaa2_queue *dpaa2_ethq = eth_priv->rx_vq[eth_rx_queue_id]; > + uint8_t flow_id = dpaa2_ethq->flow_id; > + struct dpni_queue cfg; > + uint8_t options; > + int ret; > + > + memset(&cfg, 0, sizeof(struct dpni_queue)); > + options = DPNI_QUEUE_OPT_DEST; > + cfg.destination.type = DPNI_DEST_NONE; > + > + ret = dpni_set_queue(dpni, CMD_PRI_LOW, eth_priv->token, DPNI_QUEUE_RX, > + dpaa2_ethq->tc_index, flow_id, options, &cfg); > + if (ret) > + RTE_LOG(ERR, PMD, "Error in dpni_set_queue: ret: %d\n", ret); > + > + return ret; > +} > + > static struct eth_dev_ops dpaa2_ethdev_ops = { > .dev_configure = dpaa2_eth_dev_configure, > .dev_start = dpaa2_dev_start, > diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h > index 7b14ae0..b8e94aa 100644 > --- a/drivers/net/dpaa2/dpaa2_ethdev.h > +++ b/drivers/net/dpaa2/dpaa2_ethdev.h > @@ -34,6 +34,8 @@ > #ifndef _DPAA2_ETHDEV_H > #define _DPAA2_ETHDEV_H > > +#include > + > #include > #include > > @@ -100,8 +102,21 @@ int dpaa2_remove_flow_dist(struct rte_eth_dev *eth_dev, > > int dpaa2_attach_bp_list(struct dpaa2_dev_priv *priv, void *blist); > > +int dpaa2_eth_eventq_attach(const struct rte_eth_dev *dev, > + int eth_rx_queue_id, > + uint16_t dpcon_id, > + const struct rte_event_eth_rx_adapter_queue_conf *queue_conf); > + > +int dpaa2_eth_eventq_detach(const struct rte_eth_dev *dev, > + int eth_rx_queue_id); > + > uint16_t dpaa2_dev_prefetch_rx(void *queue, struct rte_mbuf **bufs, > uint16_t nb_pkts); > +void dpaa2_dev_process_parallel_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 7cfa73a..a317f7f 100644 > --- a/drivers/net/dpaa2/dpaa2_rxtx.c > +++ b/drivers/net/dpaa2/dpaa2_rxtx.c > @@ -514,6 +514,26 @@ static inline int __attribute__((hot)) > return num_rx; > } > > +void __attribute__((hot)) > +dpaa2_dev_process_parallel_event(struct qbman_swp *swp, > + const struct qbman_fd *fd, > + const struct qbman_result *dq, > + struct dpaa2_queue *rxq, > + struct rte_event *ev) > +{ > + 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; > + > + qbman_swp_dqrr_consume(swp, dq); > +} > + > /* > * Callback to handle sending packets through WRIOP based interface > */ > diff --git a/drivers/net/dpaa2/rte_pmd_dpaa2_version.map b/drivers/net/dpaa2/rte_pmd_dpaa2_version.map > index 8591cc0..b741bc0 100644 > --- a/drivers/net/dpaa2/rte_pmd_dpaa2_version.map > +++ b/drivers/net/dpaa2/rte_pmd_dpaa2_version.map > @@ -2,3 +2,10 @@ DPDK_17.05 { > > local: *; > }; > + > +DPDK_17.11 { > + global: > + > + dpaa2_eth_eventq_attach; > + dpaa2_eth_eventq_detach; > +}; > Acked-by: Hemant Agrawal