From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
To: Harry van Haaren <harry.van.haaren@intel.com>
Cc: dev@dpdk.org, matias.elo@nokia.com
Subject: Re: [dpdk-dev] [PATCH 1/3] event: add function for reading unlink in progress
Date: Thu, 13 Sep 2018 20:15:27 +0530 [thread overview]
Message-ID: <20180913144526.GA14236@jerin> (raw)
In-Reply-To: <20180912161616.42306-1-harry.van.haaren@intel.com>
-----Original Message-----
> Date: Wed, 12 Sep 2018 17:16:14 +0100
> From: Harry van Haaren <harry.van.haaren@intel.com>
> To: dev@dpdk.org
> CC: jerin.jacob@caviumnetworks.com, matias.elo@nokia.com, Harry van Haaren
> <harry.van.haaren@intel.com>
> Subject: [PATCH 1/3] event: add function for reading unlink in progress
> X-Mailer: git-send-email 2.17.1
>
>
> This commit introduces a new function in the eventdev API,
> which allows applications to read the number of unlink requests
> in progress on a particular port of an eventdev instance.
>
> This information allows applications to verify when no more packets
> from a particular queue (or any queue) will arrive at a port.
> The application could decide to stop polling, or put the core into
> a sleep state if it wishes, as it is ensured that no new packets
> will arrive at a particular port anymore if all queues are unlinked.
>
> Suggested-by: Matias Elo <matias.elo@nokia.com>
> Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
>
> ---
>
> Cc: jerin.jacob@caviumnetworks.com
>
> Hey, I've added this API as __rte_experimental, so we should be OK to
> include in 18.11, and then possibly remove the experimental tag in
> a later release, assuming it serves its purpose correctly.
>
> For context, see thread here:
> http://mails.dpdk.org/archives/dev/2018-September/111499.html
>
> @Matias, is that workable for you?
> @Jerin, is this acceptable as maintainer?
Yes.
Overall patch looks good to me. Please find inline a minor comment.
# There is build error in this series(not in this patch), please check error log
/export/dpdk-next-eventdev/drivers/event/sw/sw_evdev.c: In function
‘sw_port_unlinks_in_progress’:
/export/dpdk-next-eventdev/drivers/event/sw/sw_evdev.c:124:50: error:
unused parameter ‘dev’ [-Werror=unused-parameter]
sw_port_unlinks_in_progress(struct rte_eventdev *dev, void *port)
With above changes:
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com
>
> Cheers, -Harry
> ---
> lib/librte_eventdev/rte_eventdev.c | 22 +++++++++++++++
> lib/librte_eventdev/rte_eventdev.h | 28 ++++++++++++++++++--
> lib/librte_eventdev/rte_eventdev_pmd.h | 19 +++++++++++++
> lib/librte_eventdev/rte_eventdev_version.map | 1 +
> 4 files changed, 68 insertions(+), 2 deletions(-)
>
> diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c
> index 801810edd..0a8572b7b 100644
> --- a/lib/librte_eventdev/rte_eventdev.c
> +++ b/lib/librte_eventdev/rte_eventdev.c
> @@ -980,6 +980,28 @@ rte_event_port_unlink(uint8_t dev_id, uint8_t port_id,
> return diag;
> }
>
> +int __rte_experimental
> +rte_event_port_unlinks_in_progress(uint8_t dev_id, uint8_t port_id)
> +{
> + struct rte_eventdev *dev;
> +
> + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
> + dev = &rte_eventdevs[dev_id];
> + if (!is_valid_port(dev, port_id)) {
> + RTE_EDEV_LOG_ERR("Invalid port_id=%" PRIu8, port_id);
> + return -EINVAL;
> + }
> +
> + /* Return 0 if the PMD does not implement unlinks in progress.
> + * This allows PMDs which handle unlink synchronously to not implement
> + * this function at all.
> + */
> + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->port_unlinks_in_progress, 0);
> +
> + return (*dev->dev_ops->port_unlinks_in_progress)(dev,
> + dev->data->ports[port_id]);
> +}
> +
> int
> rte_event_port_links_get(uint8_t dev_id, uint8_t port_id,
> uint8_t queues[], uint8_t priorities[])
> diff --git a/lib/librte_eventdev/rte_eventdev.h b/lib/librte_eventdev/rte_eventdev.h
> index b6fd6ee7f..d07e297bc 100644
> --- a/lib/librte_eventdev/rte_eventdev.h
> +++ b/lib/librte_eventdev/rte_eventdev.h
> @@ -1656,8 +1656,9 @@ rte_event_port_link(uint8_t dev_id, uint8_t port_id,
> * event port designated by its *port_id* on the event device designated
> * by its *dev_id*.
> *
> - * The unlink establishment shall disable the event port *port_id* from
> - * receiving events from the specified event queue *queue_id*
> + * The unlink call issues an async request to disable the event port *port_id*
> + * from receiving events from the specified event queue *queue_id*. See
> + * *rte_event_port_unlinks_in_progress* to poll for completed unlinks.
use @see rte_event_port_unlinks_in_progress() like reset of file.
> *
> * Event queue(s) to event port unlink establishment can be changed at runtime
> * without re-configuring the device.
> @@ -1694,6 +1695,29 @@ int
> rte_event_port_unlink(uint8_t dev_id, uint8_t port_id,
> uint8_t queues[], uint16_t nb_unlinks);
>
> +/**
> + * Returns the number of unlinks in progress.
> + *
> + * This function provides the application with a method to detect when an
> + * unlink has been completed by the implementation. See *rte_event_port_unlink*
> + * on how to issue unlink requests.
Same as above comment.
> + *
> + * @param dev_id
> + * The indentifier of the device.
> + *
> + * @param port_id
> + * Event port identifier to select port to check for unlinks in progress.
> + *
> + * @return
> + * The number of unlinks that are in progress. A return of zero indicates that
> + * there are no outstanding unlink requests. A positive return value indicates
> + * the number of unlinks that are in progress, but are not yet complete.
> + * A negative return value indicates an error, -EINVAL indicates an invalid
> + * parameter passed for *dev_id* or *port_id*.
> + */
> +int __rte_experimental
> +rte_event_port_unlinks_in_progress(uint8_t dev_id, uint8_t port_id);
> +
> /**
> * Retrieve the list of source event queues and its associated service priority
> * linked to the destination event port designated by its *port_id*
> diff --git a/lib/librte_eventdev/rte_eventdev_pmd.h b/lib/librte_eventdev/rte_eventdev_pmd.h
> index 3fbb4d2b2..65645730a 100644
> --- a/lib/librte_eventdev/rte_eventdev_pmd.h
> +++ b/lib/librte_eventdev/rte_eventdev_pmd.h
> @@ -332,6 +332,23 @@ typedef int (*eventdev_port_link_t)(struct rte_eventdev *dev, void *port,
> typedef int (*eventdev_port_unlink_t)(struct rte_eventdev *dev, void *port,
> uint8_t queues[], uint16_t nb_unlinks);
>
next prev parent reply other threads:[~2018-09-13 14:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-12 16:16 Harry van Haaren
2018-09-12 16:16 ` [dpdk-dev] [PATCH 2/3] event/sw: implement unlinks in progress function Harry van Haaren
2018-09-12 16:16 ` [dpdk-dev] [PATCH 3/3] event/sw: add unit test for unlinks in progress Harry van Haaren
2018-09-13 14:45 ` Jerin Jacob [this message]
2018-09-18 12:05 ` [dpdk-dev] [PATCH 1/3] event: add function for reading unlink " Elo, Matias (Nokia - FI/Espoo)
2018-09-20 11:22 ` [dpdk-dev] [PATCH v2 " Harry van Haaren
2018-09-20 11:22 ` [dpdk-dev] [PATCH v2 2/3] event/sw: implement unlinks in progress function Harry van Haaren
2018-09-23 11:08 ` Jerin Jacob
2018-09-20 11:22 ` [dpdk-dev] [PATCH v2 3/3] event/sw: add unit test for unlinks in progress Harry van Haaren
2018-09-24 8:23 ` [dpdk-dev] [PATCH v3 1/3] event: add function for reading unlink " Harry van Haaren
2018-09-24 8:23 ` [dpdk-dev] [PATCH v3 2/3] event/sw: implement unlinks in progress function Harry van Haaren
2018-09-24 8:23 ` [dpdk-dev] [PATCH v3 3/3] event/sw: add unit test for unlinks in progress Harry van Haaren
2018-09-24 14:56 ` [dpdk-dev] [PATCH v3 1/3] event: add function for reading unlink " Jerin Jacob
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=20180913144526.GA14236@jerin \
--to=jerin.jacob@caviumnetworks.com \
--cc=dev@dpdk.org \
--cc=harry.van.haaren@intel.com \
--cc=matias.elo@nokia.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).