From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id ABDC11B1BE for ; Wed, 11 Oct 2017 06:10:25 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP; 10 Oct 2017 21:10:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,359,1503385200"; d="scan'208";a="1229441410" Received: from nikhilr-mobl.amr.corp.intel.com (HELO [10.106.152.30]) ([10.106.152.30]) by fmsmga002.fm.intel.com with ESMTP; 10 Oct 2017 21:10:22 -0700 To: Nipun Gupta , dev@dpdk.org Cc: hemant.agrawal@nxp.com, jerin.jacob@caviumnetworks.com References: <1507657887-11366-1-git-send-email-nipun.gupta@nxp.com> <1507657887-11366-3-git-send-email-nipun.gupta@nxp.com> From: "Rao, Nikhil" Message-ID: <06dd15c2-ed06-2dfc-fa2b-05759c0885f1@intel.com> Date: Wed, 11 Oct 2017 09:40:21 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1507657887-11366-3-git-send-email-nipun.gupta@nxp.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 3/4] event/dpaa2: 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: Wed, 11 Oct 2017 04:10:26 -0000 On 10/10/2017 11:21 PM, Nipun Gupta wrote: > Signed-off-by: Nipun Gupta > --- > drivers/event/Makefile | 4 +- > drivers/event/dpaa2/Makefile | 2 + > drivers/event/dpaa2/dpaa2_eventdev.c | 96 +++++++++++++++++++++++++++++++++++- > drivers/event/dpaa2/dpaa2_eventdev.h | 8 +++ > 4 files changed, 107 insertions(+), 3 deletions(-) > > diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c > index 6967741..ca782c3 100644 > --- a/drivers/event/dpaa2/dpaa2_eventdev.c > +++ b/drivers/event/dpaa2/dpaa2_eventdev.c > @@ -53,11 +53,14 @@ > #include > #include > #include > +#include > +#include > > #include > #include > #include > #include > +#include > #include "dpaa2_eventdev.h" > #include > #include > @@ -557,6 +560,92 @@ static void dpaa2_eventdev_process_atomic(struct qbman_swp *swp, > RTE_SET_USED(f); > } > > +static int > +dpaa2_eventdev_eth_caps_get(const struct rte_eventdev *dev, > + const struct rte_eth_dev *eth_dev, > + uint32_t *caps) > +{ > + const char *ethdev_driver = eth_dev->device->driver->name; > + > + PMD_DRV_FUNC_TRACE(); > + > + RTE_SET_USED(dev); > + > + if (!strcmp(ethdev_driver, "net_dpaa2")) > + *caps = RTE_EVENT_ETH_RX_ADAPTER_DPAA2_CAP; > + else > + *caps = RTE_EVENT_ETH_RX_ADAPTER_SW_CAP; > + > + return 0; > +} > + > +static int > +dpaa2_eventdev_eth_queue_add(const struct rte_eventdev *dev, > + const struct rte_eth_dev *eth_dev, > + int32_t rx_queue_id, > + const struct rte_event_eth_rx_adapter_queue_conf *queue_conf) > +{ > + struct dpaa2_eventdev *priv = dev->data->dev_private; > + uint8_t ev_qid = queue_conf->ev.queue_id; > + uint16_t dpcon_id = priv->evq_info[ev_qid].dpcon->dpcon_id; > + int ret; > + > + PMD_DRV_FUNC_TRACE(); > + > + ret = dpaa2_eth_eventq_attach(eth_dev, rx_queue_id, > + dpcon_id, queue_conf); Shouldn't the _add & _del functions be handling the case where rx_queue_id == -1 ? > + if (ret) { > + PMD_DRV_ERR("dpaa2_eth_eventq_attach failed: ret: %d\n", ret); > + return ret; > + } > + return 0; > +} > + > +static int > +dpaa2_eventdev_eth_queue_del(const struct rte_eventdev *dev, > + const struct rte_eth_dev *eth_dev, > + int32_t rx_queue_id) > +{ > + int ret; > + > + PMD_DRV_FUNC_TRACE(); > + > + RTE_SET_USED(dev); > + > + ret = dpaa2_eth_eventq_detach(eth_dev, rx_queue_id); > + if (ret) { > + PMD_DRV_ERR("dpaa2_eth_eventq_detach failed: ret: %d\n", ret); > + return ret; > + } > + return 0; > + > + return 0; > +} > + Nikhil