From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH] eventdev: add callback for Rx adapter SW transfers Date: Sun, 17 Jun 2018 19:28:00 +0530 Message-ID: <20180617135758.GA22497@jerin> References: <1528482256-75854-1-git-send-email-nikhil.rao@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org To: Nikhil Rao Return-path: Received: from NAM04-CO1-obe.outbound.protection.outlook.com (mail-eopbgr690069.outbound.protection.outlook.com [40.107.69.69]) by dpdk.org (Postfix) with ESMTP id C68C81B3A3 for ; Sun, 17 Jun 2018 15:58:15 +0200 (CEST) Content-Disposition: inline In-Reply-To: <1528482256-75854-1-git-send-email-nikhil.rao@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" -----Original Message----- > Date: Fri, 8 Jun 2018 23:54:16 +0530 > From: Nikhil Rao > To: jerin.jacob@caviumnetworks.com > CC: dev@dpdk.org, Nikhil Rao > 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 > --- > 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 > }; > -- > 1.8.3.1 >