From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
To: Nikhil Rao <nikhil.rao@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] eventdev: add callback for Rx adapter SW transfers
Date: Sun, 17 Jun 2018 19:28:00 +0530 [thread overview]
Message-ID: <20180617135758.GA22497@jerin> (raw)
In-Reply-To: <1528482256-75854-1-git-send-email-nikhil.rao@intel.com>
-----Original Message-----
> Date: Fri, 8 Jun 2018 23:54:16 +0530
> From: Nikhil Rao <nikhil.rao@intel.com>
> To: jerin.jacob@caviumnetworks.com
> CC: dev@dpdk.org, Nikhil Rao <nikhil.rao@intel.com>
> Subject: [PATCH] eventdev: add callback for Rx adapter SW transfers
> X-Mailer: git-send-email 1.8.3.1
>
> Add ability for application to register a callback function
> for SW transfers, the callback can decide which packets can
> be enqueued to the event device.
>
> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
> ---
> lib/librte_eventdev/rte_event_eth_rx_adapter.h | 78 ++++++++++++++++++++++
> lib/librte_eventdev/rte_event_eth_rx_adapter.c | 69 +++++++++++++++++--
> .../prog_guide/event_ethernet_rx_adapter.rst | 14 ++++
> lib/librte_eventdev/rte_eventdev_version.map | 1 +
> 4 files changed, 158 insertions(+), 4 deletions(-)
>
> diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.h b/lib/librte_eventdev/rte_event_eth_rx_adapter.h
> index 97f25e9..23d2ed5 100644
> --- a/lib/librte_eventdev/rte_event_eth_rx_adapter.h
> +++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.h
> @@ -63,6 +63,17 @@
> * rte_event_eth_rx_adapter_service_id_get() function can be used to retrieve
> * the service function ID of the adapter in this case.
> *
> + * For SW based packet transfers, the service function temporarily enqueues
I think, you can mention this case is valid when
!RTE_EVENT_ETH_RX_ADAPTER_CAP_INTERNAL_PORT
> + * mbufs to an event buffer before batch enqueueing these to the event device.
> + * If the buffer fills up, the service function stops dequeueing packets from
> + * the ethernet device. The application may want to monitor the buffer fill
> + * level and instruct the service function to selectively buffer packets
> + * The application may also use some other criteria to decide which packets
> + * should enter the event device even when the event buffer fill level is low.
> + * The rte_event_eth_rx_adapter_cb_register() function allows the
> + * application to register a callback that selects which packets to enqueue
> + * to the event device.
> + *
> * Note:
> * 1) Devices created after an instance of rte_event_eth_rx_adapter_create
> * should be added to a new instance of the rx adapter.
> @@ -206,6 +217,47 @@ struct rte_event_eth_rx_adapter_stats {
> * @warning
> * @b EXPERIMENTAL: this API may change without prior notice
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change without prior notice
> + *
> + * Register callback to process Rx packets, this is supported for
> + * SW based packet transfers.
> + * @see rte_event_eth_sw_rx_cb_fn
> + *
> + * @param id
> + * Adapter identifier.
> + * @param eth_dev_id
> + * Port identifier of Ethernet device.
> + * @param cb_fn
> + * Callback function.
> + * @param cb_arg
> + * Callback arg.
> + * @return
> + * - 0: Success
> + * - <0: Error code on failure.
> + */
> +int __rte_experimental
> +rte_event_eth_rx_sw_cb_register(uint8_t id,
> + uint16_t eth_dev_id,
> + rte_event_eth_rx_sw_cb_fn cb_fn,
> + void *cb_arg);
The documentation is using rte_event_eth_rx_adapter_cb_register(),
I think, it is better to keep that name. Remove *_sw_* from normative
DPDK APIs.
> +
> #ifdef __cplusplus
> }
> #endif
> diff --git a/lib/librte_eventdev/rte_eventdev_version.map b/lib/librte_eventdev/rte_eventdev_version.map
> index c3f18d6..6bc81c6 100644
> --- a/lib/librte_eventdev/rte_eventdev_version.map
> +++ b/lib/librte_eventdev/rte_eventdev_version.map
> @@ -109,4 +109,5 @@ EXPERIMENTAL {
> rte_event_crypto_adapter_stats_get;
> rte_event_crypto_adapter_stats_reset;
> rte_event_crypto_adapter_stop;
> + rte_event_eth_rx_sw_cb_register;
Use alphabetical order.
With above changes:
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> };
> --
> 1.8.3.1
>
prev parent reply other threads:[~2018-06-17 13:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-08 18:24 Nikhil Rao
2018-06-17 13:58 ` Jerin Jacob [this message]
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=20180617135758.GA22497@jerin \
--to=jerin.jacob@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).