From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0049.outbound.protection.outlook.com [104.47.42.49]) by dpdk.org (Postfix) with ESMTP id 417E51B728 for ; Fri, 13 Oct 2017 16:55:49 +0200 (CEST) Received: from BN3PR03CA0065.namprd03.prod.outlook.com (10.167.1.153) by CO2PR03MB2359.namprd03.prod.outlook.com (10.166.93.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Fri, 13 Oct 2017 14:55:47 +0000 Received: from BY2FFO11OLC012.protection.gbl (2a01:111:f400:7c0c::182) by BN3PR03CA0065.outlook.office365.com (2a01:111:e400:7a4d::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10 via Frontend Transport; Fri, 13 Oct 2017 14:55:46 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) 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.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 BY2FFO11OLC012.mail.protection.outlook.com (10.1.15.23) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Fri, 13 Oct 2017 14:55:46 +0000 Received: from [10.214.249.170] ([10.214.249.170]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v9DEtgwF022308; Fri, 13 Oct 2017 07:55:43 -0700 To: Nipun Gupta , References: <1507657887-11366-1-git-send-email-nipun.gupta@nxp.com> <1507828729-18194-1-git-send-email-nipun.gupta@nxp.com> <1507828729-18194-2-git-send-email-nipun.gupta@nxp.com> CC: , From: Hemant Agrawal Message-ID: <4c751bec-20a1-cb47-4961-abfc35e7cb76@nxp.com> Date: Fri, 13 Oct 2017 20:25: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: <1507828729-18194-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: 131523801467765278; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(346002)(39860400002)(39380400002)(376002)(2980300002)(1109001)(1110001)(339900001)(189002)(24454002)(377454003)(51234002)(199003)(64126003)(50466002)(189998001)(33646002)(50986999)(76176999)(54356999)(5660300001)(229853002)(68736007)(356003)(2950100002)(316002)(23746002)(85426001)(105606002)(47776003)(6246003)(65806001)(106466001)(65956001)(65826007)(36756003)(104016004)(83506001)(53546010)(97736004)(8656003)(5890100001)(230700001)(81156014)(81166006)(2906002)(110136005)(58126008)(305945005)(53936002)(8936002)(54906003)(77096006)(31686004)(86362001)(8676002)(31696002)(4326008)(498600001); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2359; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC012; 1:JhTv4/KiLorBLPA8Qv7al/I5r7XymiNtkr1sppAhH4uCY9sI36FCl5K4JlVtvBBPbc6cufQCHQa4JHUaxgRZIAa0zNdnPwWQy9evUhUulUsZEebKNyDh3JyfBOTm/v4R X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3aaf2245-138d-43d9-c21e-08d5124a7c75 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017052603199)(201703131430075)(201703131517081); SRVR:CO2PR03MB2359; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2359; 3:4kcmk9296ZdkODzn6DnzW6y+LmP8bTtZG6VFv6RoXavc38jP9caXUAeim4zBR/Ou0G8a/w2WlhQDOCbu5icszpMGg3Mg9Rh9quN230Q17P2W9tYzqwNoWDLNg/7NpVvgMZGzsUE47ESD5+sKbUC3lvWN0ibbrsfEZ6nZoaMfL234FBtR6shVHYOZUM9JqRsaH1v8SqKcuvdEshm7O1ZZP2aImVCOdAU82k7SgJjpF7XSan6h1C9mBE+3gyhXC2ukMlO/MlZd1sUPJDm1o6Kj8k4F11Gl+QrTYOaDw9J8/1RlMKcpFw90mmIaelFdA2nu6zW+KkFRtrMlA+Y7Cxz0kcAsd8YHXEbhxMDo5nrCV+o=; 25:y0zGVCQgGZILD27a83Jodd9rfzocP8xqDSlVpY0qxlbGPZYBNNJwqRXfJGcDCtTrmkuVQYTc5KXO77j984n0cah2tGE5H9C7Ow3AJlle9QWlNnEffppzr727/J/C0eJ8KHXaLBKPgt38zs5XODyuqfBZjKi8DsmB0x+5mNSa/Bqdr1pjo8eaJflKvUgNwokaCk8iXK1rLjLvj1gE2u9ykxqoSknGHpTph6ZfivRECuOlm66/FCj14N4hH5IzuBinM3R8L/aIuO2z0Mf4WN5rc6p/kppJ1l/kxT+7gqAlOahm7q2Bvm52CUf5Ho4rl5wH3AkhLuKCj8wxQu94hjNGfg== X-MS-TrafficTypeDiagnostic: CO2PR03MB2359: X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2359; 31:5DmGxamncZn4DknR0np0nk8BFfgSXmW3FXSdcbTDuCI0wTFQ2Y1I52yQb1QNfrH5qzk896pDFBkvyhOtWGrTgLY1HO/eDfi+whQhcqBwKveB2kOSB0VSUVVQDK8tDIJnkd6UgAmG65nR3cTq+MOUt4Ns+pAadklSK0ZDNrEcPeUxgO3GkaSudYSeKwzMjODRv/W0htXO0r3RQcp2gLHHtadAd/9pzRaeClnxmnqb/Wo=; 4:ug1gtG9jEi2mVkpXZuOM9Uffj8jxlYqDTaGccmGE11wX8fRbgXLR3y9VYrDM1KyJ9rC+FEDatGtjOkzaxXZySWk0iOd2BiJYNjDJzb3XS9+xfj1h7UDVvrhZXLkusMgEpOQ5lZkMXzjtVMeoI4X7xSM2Bq2pLFMtFfAMLKEB2Whv/HCicm/VfLPv3WWArXJfKbdeH9ZFgXvcjuJah5esfH1TKiYfsVQfNK/q96iw4kmjYcB4bAdFyImQtyOd3BGsWnu+cAxO/Cl0RHPenEwHXnxLogyRwZWxcauTaY8k3m4= 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)(5005006)(8121501046)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6096035)(20161123565025)(20161123556025)(20161123561025)(20161123559100)(201703131430075)(201703131448075)(201703131433075)(201703161259150)(201703151042153)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CO2PR03MB2359; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CO2PR03MB2359; X-Forefront-PRVS: 04599F3534 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; CO2PR03MB2359; 23:7GcVfhh/x+tKcxkw974v+FpEWcqWWnBnS7G/f?= =?Windows-1252?Q?ag/dqfgcsDfjS3enQX0GivkOQEU5UyLaWm0n1LNJ8vMetD3UQ2n9Pd8c?= =?Windows-1252?Q?kJoXUDCf91q2jUwY7Td9nGXNlx8ITd0a2sXUCMaaUzx6Iw643x8Hlai3?= =?Windows-1252?Q?uHKfS0Jhqu6ss/a9GZOk7q2h4LYZuAuXJZOC1BIx9o7zjSgr4FlTUdUY?= =?Windows-1252?Q?Ic7nft0MhSpKwXM4GVKWQvpNAzmdS6iGN3VdNuXsoWlraP0tLlaiOaBe?= =?Windows-1252?Q?91InA/gnOxXxFPpliN9mE1ixETntFLBSGJxOcZNcTOEeb9B18KMK8MAL?= =?Windows-1252?Q?BvOJFSRr6icPEMbuki+d5+C3rM4l9jFFdjbKikJ74RFkQ3qhWlYPuxXw?= =?Windows-1252?Q?3RWinRwIOblJCsGg/XgAS54F3PEEvOBW4cH+/IcAxtjL3aYtGAMixG7B?= =?Windows-1252?Q?5rXwYshnjGkFmB59PacZuYZmIwnRTaDh603f3nuvWsm34WqgATxOROPO?= =?Windows-1252?Q?hzSrJfTmYrbVs0N6RnVTrV1EY1u4FJtGGsHas5hZpmVUKYnM8pbTUu9N?= =?Windows-1252?Q?B1m/Efvarkp6c0qHHNO/7t9MbBL48xkp16/UXzqRBtiyDoGW0JhWBUDb?= =?Windows-1252?Q?1GN1kBN8DVgTYv66N8olpEN1hpOncrBQge+8PYzJ7UE8iWMt2v6RVTL2?= =?Windows-1252?Q?NgrUTPhxuPBO6nZdZ809roTYmYg1X+n/t7tdGOVRVm1XOxLhei8Ka9KQ?= =?Windows-1252?Q?2P3VJt4LlfG4STyUSugWJibc4g8/jLQtEfUcXh8NaYBokH62io7NClGD?= =?Windows-1252?Q?9jKP2IM95IpoQCXAcT0qlejjgk5H4VFTJIerPaF3FnOkkaYahN/83GtJ?= =?Windows-1252?Q?xSy1PHQg2FzP+Xax3yYGVhFIhlXUHsZuA4IbHR/Op1390htJ+NKW8mpw?= =?Windows-1252?Q?MiVdvtmn0QH3Hu2hdNvmsCwxfEAOXS/FEKTcAN8ysuO+EK/agCkXTxQu?= =?Windows-1252?Q?OTkjAHlNtbcBl/mlhP0/MHjteKsXICjbRhb4gNMgQgsFDZ2Rlbnto9XJ?= =?Windows-1252?Q?OJJzd5ppvV3nD0IzwOKAMA5UsHfM91vNIKf5Xfmf7tsIFee0318FzFQE?= =?Windows-1252?Q?WGalUbRX8yMt5atrn5PS2/f7HHr7M7BuH8kVj2Z1PHhvlqlDzDCS7L0g?= =?Windows-1252?Q?h2QH5yjFCc4NeIHqiw3u6DsYsdOcoVgctbpdHp7snlQmKINFfRBmVBzo?= =?Windows-1252?Q?w8r531gWm1OTGm6l5mHUZVzclVOEN/1Fqh28jifc0LHayV7f4bixE2ix?= =?Windows-1252?Q?9T1a7VfYb6GEk1SiUwQSQHGTqBSRoGm19mEhmeXnMGzOVHqPYxUCUP7i?= =?Windows-1252?Q?U+NOZzQfHOJT4hY1m6bJeWftaNRCTOfwm5wMpT2YLIiMpZILf7I8IN3N?= =?Windows-1252?Q?C6jpaI3dZJZZzgCKjbt49phO8KHSIirK42dOmAP5sCtnLF9tTkslXWRL?= =?Windows-1252?Q?iymmpxNQZqm6bLhIEKgqOJS+h1MLtmF0b6SMmxAdB09EoqUPw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2359; 6:z95hRTMJmrfta2Ee8Tk1m0x2K7JMbZ1jrYCHAOh666TJpda2vE2nmJd1WUntTBmvPJsfrP+zt4fXfeSYO3axDSJIew6aeKx1UBABqFfEHwtIabCmTYuDvczQhA+ISXGg5a8dOZX4vTsVkLeNFcq/V62iirZJppesg7kLg6gUhx9NFgQhJP0aRqnSrtoJ3UCIN8IxUy6TdQ4WBtN42/EdolgEA+IcggQbGDqipmnN3mC5pflWsh5IfgWKiJMPlXT0DtUVvAqrNsz3H7HSMhFyOJk/ZYGqJkN0tin5BLxpKOFUIFQF6vPfsZFxnDXAY1IUyDQucFslZZPBUEUJAiAtSw==; 5:XFrZKRaJH6ECelHYCyHq9qtxKnLKAkZFIj7MVZVYtPEMq16NLfeRLdCoj5OeXxVtCDrK/i0r/4QK2OtjZTOUz2qAUtrnXMFGOfaGP9fhqghXssMLEllwSWJxgegSI13iXn7W43J+RDXl/3dVWRpslw==; 24:hA1Rly2hBfzzuO/l+A6ZbGOjf/kq9NHeg8ltczrQMbg6rTVVB+TGB+PqZ13I7hD0ZI3f9u9XZZDSoStAje9KLTMLXoHeVm4Oj0JSGoyA8Zw=; 7:K1zt9r0jiluHGEMOB2WWSUqTMxAxMY2NeY0DATXw3x4PECz1EMyfOH7ylRU1kVuY9C2vhKNMAID8T7PhmP+UL6lm5y2vWa6blg28boVZnlitUGNP3smyMxIZV7pLLBDjU2cjUNcfIj9vExUE02l39JdiE6GzPZMM4tOcGILhFbvDjLYAyeMlguF0iNLVDi4HniuwDUYfe2TaWuIrBIb7E9I7ywiD45DqsoRh12lnBRU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2017 14:55:46.5893 (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.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR03MB2359 Subject: Re: [dpdk-dev] [PATCH v2 2/4] 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: Fri, 13 Oct 2017 14:55:49 -0000 On 10/12/2017 10:48 PM, Nipun Gupta wrote: > Signed-off-by: Nipun Gupta > --- > drivers/net/dpaa2/dpaa2_ethdev.c | 67 +++++++++++++++++++++++++++++ > 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, 109 insertions(+) > > diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c > index 39c32b3..724719a 100644 > --- a/drivers/net/dpaa2/dpaa2_ethdev.c > +++ b/drivers/net/dpaa2/dpaa2_ethdev.c > @@ -1634,6 +1634,73 @@ void 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; > + > + 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; > + } > + > + if (queue_conf->ev.sched_type == RTE_SCHED_TYPE_PARALLEL) > + dpaa2_ethq->cb = dpaa2_dev_process_parallel_event; > + else > + return -1; > + Should not you check the type supported in the start of function? This way you will not be doing hw "dpni_set_queue" for not supported case? > + 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; > + } > + > + return 0; trivial one. you can simply "return ret" in both cases. > +} > + > 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; > +}; >