DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pavan Nikhilesh Bhagavatula <pbhagavatula@caviumnetworks.com>
To: "Rao, Nikhil" <nikhil.rao@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v4 3/4] eventdev: Add eventdev ethernet Rx adapter
Date: Tue, 3 Oct 2017 14:39:31 +0530	[thread overview]
Message-ID: <20171003090930.GA24594@PBHAGAVATULA-LT> (raw)
In-Reply-To: <0327e0b4-d632-a542-1b63-d48174401e29@intel.com>

On Sat, Sep 23, 2017 at 05:05:21PM +0530, Rao, Nikhil wrote:
Hi Nikhil,
> On 9/21/2017 9:13 PM, Pavan Nikhilesh Bhagavatula wrote:
> >Hi Nikhil,
> >
> >Few comments Inline
> >
> <snip>
>
> > + *  - 0: Success, statistics reset successfully.
> >
> >Invalid description.
>
> Thanks Pavan, for catching these, will fix.
>
> >
> >>+ *  - <0: Error code on failure, if the adapter doesn't use a rte_service
> >>+ * function, this function returns -ESRCH.
> >>+ */
> >>+int rte_event_eth_rx_adapter_service_id_get(uint8_t id, uint32_t *service_id);
> >>+
> >>+#ifdef __cplusplus
> >>+}
> >>+#endif
> >>+#endif	/* _RTE_EVENT_ETH_RX_ADAPTER_ */
> >>diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c b/lib/librte_eventdev/rte_event_eth_rx_adapter.c
> >>new file mode 100644
> >>index 000000000..d5b655dae
> >>--- /dev/null
> >>+++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c
> >>@@ -0,0 +1,1238 @@
> ><snip>
> >>+
> >>+static int
> >>+rx_adapter_ctrl(uint8_t id, int start)
> >>+{
> >>+	struct rte_event_eth_rx_adapter *rx_adapter;
> >>+	struct rte_eventdev *dev;
> >>+	struct eth_device_info *dev_info;
> >>+	uint32_t i;
> >>+	int use_service = 0;
> >>+	int stop = !start;
> >>+
> >>+	RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(id, -EINVAL);
> >>+	rx_adapter = id_to_rx_adapter(id);
> >>+	if (!rx_adapter)
> >>+		return -EINVAL;
> >>+
> >>+	dev = &rte_eventdevs[rx_adapter->eventdev_id];
> >>+
> >>+	for (i = 0; i < rte_eth_dev_count(); i++) {
> >>+		dev_info = &rx_adapter->eth_devices[i];
> >>+		/* if start  check for num dev queues */
> >>+		if (start && !dev_info->nb_dev_queues)
> >>+			continue;
> >>+		/* if stop check if dev has been started */
> >>+		if (stop && !dev_info->dev_rx_started)
> >>+			continue;:1
> >>+		use_service |= !dev_info->internal_event_port;
> >>+		dev_info->dev_rx_started = start;
> >>+		if (!dev_info->internal_event_port)
> >>+			continue;
> >>+		start ? (*dev->dev_ops->eth_rx_adapter_start)(dev,
> >>+						&rte_eth_devices[i]) :
> >>+			(*dev->dev_ops->eth_rx_adapter_stop)(dev,
> >>+						&rte_eth_devices[i]);
> >>+	}
> >>+
> >>+	if (use_service)
> >
> >Here setting the service run state is not sufficient we need to enable the
> >service on a service core calling rte_service_start_with_defaults() should be
> >sufficient.
> >
>
> Yes it is necessary but insufficient.
>
> IMO,
> If the application is controlling core masks, the application flow at
> startup looks like:
>
> rte_event_eth_rx_adapter_create(id,..)
> ...
> rte_event_eth_rx_adapter_start(id)
> if (!rte_event_eth_rx_adapter_service_id_get(id, &service_id)) {
> 	rte_service_lcore_add(rx_lcore_id);
>         rte_service_map_lcore_set(service_id, rx_lcore_id, 1);
> 	rte_service_lcore_start(rx_lcore_id)
> }
>
> Since rte_service_start_with_defaults() is invoked before the adapter is
> created, how would it get assigned a core etc ?
>
I might have caused a bit of confusion, I meant to say that If we call
rte_service_start_with_defaults() when "use_service" is set while starting the
RX adapter it will assign the polling function to a service core (default 1:1
mapping).
But this might destroy the user configured service core mappings.
I think adding the above mentioned code snippet in the programmers guide is
self sufficient.

>
> Nikhil

Thanks,
Pavan
> >>+		rte_service_runstate_set(rx_adapter->service_id, start);
> >>+
> >>+	return 0;
> >>+}
> >>+
> ><snip>
> >
> >Regards,
> >Pavan
> >
>

  reply	other threads:[~2017-10-03  9:09 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-21 21:17 [dpdk-dev] [PATCH v4 0/4] eventdev: cover letter: ethernet Rx queue event adapter Nikhil Rao
2017-09-21 21:17 ` [dpdk-dev] [PATCH v4 1/4] eventdev: Add caps API and PMD callbacks for rte_event_eth_rx_adapter Nikhil Rao
2017-09-21 15:46   ` Jerin Jacob
2017-09-24 12:14     ` Rao, Nikhil
2017-10-02  8:48       ` Jerin Jacob
2017-09-21 21:17 ` [dpdk-dev] [PATCH v4 2/4] eventdev: Add ethernet Rx adapter caps function to eventdev SW PMD Nikhil Rao
2017-09-22  2:49   ` Jerin Jacob
2017-09-22  5:27   ` santosh
2017-09-21 21:17 ` [dpdk-dev] [PATCH v4 3/4] eventdev: Add eventdev ethernet Rx adapter Nikhil Rao
2017-09-21 15:43   ` Pavan Nikhilesh Bhagavatula
2017-09-23 11:35     ` Rao, Nikhil
2017-10-03  9:09       ` Pavan Nikhilesh Bhagavatula [this message]
2017-09-22  6:08   ` santosh
2017-10-02 10:20     ` Rao, Nikhil
2017-09-22  9:10   ` Jerin Jacob
2017-09-24 18:16     ` Rao, Nikhil
2017-09-25  2:59       ` Rao, Nikhil
2017-10-02 10:28         ` Rao, Nikhil
2017-10-02 10:39           ` Jerin Jacob
2017-10-05  8:54             ` Rao, Nikhil
2017-10-03 13:52       ` Jerin Jacob
2017-10-05  8:12         ` Rao, Nikhil
2017-09-21 21:17 ` [dpdk-dev] [PATCH v4 4/4] eventdev: Add tests for event eth Rx adapter APIs Nikhil Rao
2017-09-22 12:12   ` Jerin Jacob
2017-09-24 18:24     ` Rao, Nikhil
2017-10-02 10:31       ` Jerin Jacob
2017-10-04 11:28         ` Rao, Nikhil
2017-10-03 11:36   ` Pavan Nikhilesh Bhagavatula
2017-10-05  5:57     ` Rao, Nikhil
2017-10-05  8:08       ` Pavan Nikhilesh Bhagavatula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171003090930.GA24594@PBHAGAVATULA-LT \
    --to=pbhagavatula@caviumnetworks.com \
    --cc=dev@dpdk.org \
    --cc=nikhil.rao@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).