DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jerin Jacob <jerin.jacob@caviumnetworks.com>
To: Nikhil Rao <nikhil.rao@intel.com>
Cc: olivier.matz@6wind.com, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v2 1/4] eventdev: add eth Tx adapter APIs
Date: Sun, 19 Aug 2018 15:49:24 +0530	[thread overview]
Message-ID: <20180819101923.GA11085@jerin> (raw)
In-Reply-To: <1534479652-80182-1-git-send-email-nikhil.rao@intel.com>

-----Original Message-----
> Date: Fri, 17 Aug 2018 09:50:49 +0530
> From: Nikhil Rao <nikhil.rao@intel.com>
> To: jerin.jacob@caviumnetworks.com, olivier.matz@6wind.com
> CC: dev@dpdk.org, Nikhil Rao <nikhil.rao@intel.com>
> Subject: [PATCH v2 1/4] eventdev: add eth Tx adapter APIs
> X-Mailer: git-send-email 1.8.3.1
> 
> 
> The ethernet Tx adapter abstracts the transmit stage of an
> event driven packet processing application. The transmit
> stage may be implemented with eventdev PMD support or use a
> rte_service function implemented in the adapter. These APIs
> provide a common configuration and control interface and
> an transmit API for the eventdev PMD implementation.
> 
> The transmit port is specified using mbuf::port. The transmit
> queue is specified using the rte_event_eth_tx_adapter_txq_set()
> function.
> 
> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>

Overall it looks good to me.

Could you please add programmers guide in the next revision?

Some minor comments below.

> ---
> 
> +/**
> + * @file
> + *
> + * RTE Event Ethernet Tx Adapter
> + *
> + * The event ethernet Tx adapter provides configuration and data path APIs
> + * for the ethernet transmit stage of an event driven packet processing
> + * application. These APIs abstract the implementation of the transmit stage
> + * and allow the application to use eventdev PMD support or a common
> + * implementation.
> + *
> + * In the common implementation, the application enqueues mbufs to the adapter
> + * which runs as a rte_service function. The service function dequeues events
> + * from its event port and transmits the mbufs referenced by these events.
> + *
> + * The ethernet Tx event adapter APIs are:
> + *
> + *  - rte_event_eth_tx_adapter_create()
> + *  - rte_event_eth_tx_adapter_create_ext()
> + *  - rte_event_eth_tx_adapter_free()
> + *  - rte_event_eth_tx_adapter_start()
> + *  - rte_event_eth_tx_adapter_stop()
> + *  - rte_event_eth_tx_adapter_queue_add()
> + *  - rte_event_eth_tx_adapter_queue_del()
> + *  - rte_event_eth_tx_adapter_stats_get()
> + *  - rte_event_eth_tx_adapter_stats_reset()
> + *  - rte_event_eth_tx_adapter_enqueue()
> + *  - rte_event_eth_tx_adapter_event_port_get()
> + *  - rte_event_eth_tx_adapter_service_id_get()
> + *
> + * The application creates the adapter using
> + * rte_event_eth_tx_adapter_create() or rte_event_eth_tx_adapter_create_ext().
> + *
> + * The adapter will use the common implementation when the eventdev PMD
> + * does not have the RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT capability.

Due to some reason, the generated doxygen file, does not show
RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT as hyperlink.


> + * The common implementation uses an event port that is created using the port
> + * configuration parameter passed to rte_event_eth_tx_adapter_create(). The
> + * application can get the port identifier using
> + * rte_event_eth_tx_adapter_event_port_get() and must link an event queue to
> + * this port.
> + *
> + * If the eventdev PMD has the RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT
> + * flags set, Tx adapter events should be enqueued using the
> + * rte_event_eth_tx_adapter_enqueue() function, else the application should
> + * use rte_event_enqueue_burst().
> + *
> + * Transmit queues can be added and deleted from the adapter using
> + * rte_event_eth_tx_adapter_queue_add()/del() APIs respectively.
> + *
> + * The application can start and stop the adapter using the
> + * rte_event_eth_tx_adapter_start/stop() calls.
> + *
> + * The common adapter implementation uses an EAL service function as described
> + * before and its execution is controlled using the rte_service APIs. The
> + * rte_event_eth_tx_adapter_service_id_get()
> + * function can be used to retrieve the adapter's service function ID.
> + *
> + * The ethernet port and transmit queue index to transmit the mbuf on are
> + * specified using the mbuf port and the struct rte_event_tx_adapter_mbuf_queue
> + * (overlaid on mbuf::hash). The application should use the
> + * rte_event_eth_tx_adapter_txq_set() and rte_event_eth_tx_adapter_txq_get()
> + * functions to access the transmit queue index since it is expected that the
> + * transmit queue will be eventually defined within struct rte_mbuf and using
> + * these macros will help with minimizing application impact due to
> + * a change in how the transmit queue index is specified.
> + */
> +
> +#ifdef __cplusplus
> +extern "C" {
> +#endif
> +
> +#include <stdint.h>
> +
> +#include <rte_mbuf.h>
> +
> +#include "rte_eventdev.h"
> +
> +
> +/**
> + * @warning
> + * @b EXPERIMENTAL: this API may change without prior notice
> + *
> + * Set Tx queue in the mbuf. This queue is used by the  adapter
> + * to transmit the mbuf.
> + *
> + * @param pkt
> + *  Pointer to the mbuf.
> + * @param queue
> + *  Tx queue index.
> + */
> +static __rte_always_inline void __rte_experimental
> +rte_event_eth_tx_adapter_txq_set(struct rte_mbuf *pkt, uint16_t queue)
> +{
> +       struct rte_event_tx_adapter_mbuf_queue *mbuf_queue =
> +               (struct rte_event_tx_adapter_mbuf_queue *)(&pkt->hash);

It make sense to have inline function to set and get txq so that mbuf
change wont have any visible impact.

But, Can we get ride of struct rte_event_tx_adapter_mbuf_queue
typecasting/indirection?

I prefer to use just pkt->hi and add comment in rte_mbuf.h, see rte_event_eth_tx_adapter_txq_set()
or add following without breaking anything on exiting scheme.

+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -529,6 +529,11 @@ struct rte_mbuf {
                        /**< First 4 flexible bytes or FD ID, dependent
 * on
                             PKT_RX_FDIR_* flag in ol_flags. */
                } fdir;           /**< Filter identifier if FDIR enabled
*/
+               struct {
+                       uint32_t resvd1;
+                       uint16_t resvd2;
+                       uint16_t txq_id;
+               } txadapter;

Reasons:
1) Additional indirection may result in additional instruction(s) in fastpath.
2) It is kind of hiding the mbuf usage on specific variable. So consumers
may get confused on the usage and it may hide problem when mbuf gets
changed as changes are not in one place.

With above changes:

Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

  parent reply	other threads:[~2018-08-19 10:19 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-17  4:20 Nikhil Rao
2018-08-17  4:20 ` [dpdk-dev] [PATCH v2 2/4] eventdev: add caps API and PMD callbacks for eth Tx adapter Nikhil Rao
2018-08-19 10:45   ` Jerin Jacob
2018-08-21  8:52     ` Rao, Nikhil
2018-08-21  9:11       ` Jerin Jacob
2018-08-22 13:34         ` Rao, Nikhil
2018-08-17  4:20 ` [dpdk-dev] [PATCH v2 3/4] eventdev: add eth Tx adapter implementation Nikhil Rao
2018-08-17  4:20 ` [dpdk-dev] [PATCH v2 4/4] eventdev: add auto test for eth Tx adapter Nikhil Rao
2018-08-17 11:55   ` Pavan Nikhilesh
2018-08-22 16:13     ` Rao, Nikhil
2018-08-22 16:23       ` Pavan Nikhilesh
2018-08-23  1:48         ` Rao, Nikhil
2018-08-19 10:19 ` Jerin Jacob [this message]
2018-08-31  5:41 ` [dpdk-dev] [PATCH v3 1/5] eventdev: add eth Tx adapter APIs Nikhil Rao
2018-08-31  5:41   ` [dpdk-dev] [PATCH v3 2/5] eventdev: add caps API and PMD callbacks for eth Tx adapter Nikhil Rao
2018-08-31  5:41   ` [dpdk-dev] [PATCH v3 3/5] eventdev: add eth Tx adapter implementation Nikhil Rao
2018-08-31  5:41   ` [dpdk-dev] [PATCH v3 4/5] eventdev: add auto test for eth Tx adapter Nikhil Rao
2018-09-17 14:00     ` Jerin Jacob
2018-08-31  5:41   ` [dpdk-dev] [PATCH v3 5/5] doc: add event eth Tx adapter guide Nikhil Rao
2018-09-17 13:56     ` Jerin Jacob
2018-09-20 17:41   ` [dpdk-dev] [PATCH v4 1/5] eventdev: add eth Tx adapter APIs Nikhil Rao
2018-09-20 17:41     ` [dpdk-dev] [PATCH v4 2/5] eventdev: add caps API and PMD callbacks for eth Tx adapter Nikhil Rao
2018-09-20 17:41     ` [dpdk-dev] [PATCH v4 3/5] eventdev: add eth Tx adapter implementation Nikhil Rao
2018-09-20 17:41     ` [dpdk-dev] [PATCH v4 4/5] eventdev: add auto test for eth Tx adapter Nikhil Rao
2018-09-20 17:41     ` [dpdk-dev] [PATCH v4 5/5] doc: add event eth Tx adapter guide Nikhil Rao
2018-09-21  5:04     ` [dpdk-dev] [PATCH v4 1/5] eventdev: add eth Tx adapter APIs Jerin Jacob
2018-09-28 10:05     ` 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=20180819101923.GA11085@jerin \
    --to=jerin.jacob@caviumnetworks.com \
    --cc=dev@dpdk.org \
    --cc=nikhil.rao@intel.com \
    --cc=olivier.matz@6wind.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).