DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Haiyue Wang <haiyue.wang@intel.com>
Cc: dev@dpdk.org, jerinjacobk@gmail.com, ferruh.yigit@intel.com,
	arybchenko@solarflare.com, viacheslavo@mellanox.com,
	damarion@cisco.com, xiaolong.ye@intel.com, chenmin.sun@intel.com,
	ray.kinsella@intel.com, yu.y.liu@intel.com
Subject: Re: [dpdk-dev] [PATCH v2] ethdev: enhance the API for getting burst mode information
Date: Wed, 06 Nov 2019 01:33:42 +0100	[thread overview]
Message-ID: <2399300.Xf6G4o05WB@xps> (raw)
In-Reply-To: <20191104103920.64907-1-haiyue.wang@intel.com>

04/11/2019 11:39, Haiyue Wang:
> Change the type of burst mode information from bit field to free string
> data, so that each PMD can describe the Rx/Tx busrt functions flexibly.
> 
> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
> ---
> 
> v2: - Drop the bit field for burst mode information handling.

Please use --in-reply-to, so the versions of a patch can be in the same thread.

> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
>  /**
> - * Burst mode types, values can be ORed to define the burst mode of a driver.
> + * Generic Burst mode flag definition, values can be ORed.
> + */
> +#define RTE_ETH_BURST_FLAG_PER_QUEUE     (1ULL << 0)
> +/**< If the queues have different burst mode description, this bit will be set
> + * by PMD, then the application can iterate to retrieve burst description for
> + * all other queues.
>   */

I am not sure you can have a doxygen comment before and after the same item.

> -enum rte_eth_burst_mode_option {
> -	RTE_ETH_BURST_SCALAR = (1 << 0),
> -	RTE_ETH_BURST_VECTOR = (1 << 1),
> -
> -	/**< bits[15:2] are reserved for each vector type */
> -	RTE_ETH_BURST_ALTIVEC = (1 << 2),
> -	RTE_ETH_BURST_NEON = (1 << 3),
> -	RTE_ETH_BURST_SSE = (1 << 4),
> -	RTE_ETH_BURST_AVX2 = (1 << 5),
> -	RTE_ETH_BURST_AVX512 = (1 << 6),
> -
> -	RTE_ETH_BURST_SCATTERED = (1 << 16), /**< Support scattered packets */
> -	RTE_ETH_BURST_BULK_ALLOC = (1 << 17), /**< Support mbuf bulk alloc */
> -	RTE_ETH_BURST_SIMPLE = (1 << 18),
> -
> -	RTE_ETH_BURST_PER_QUEUE = (1 << 19), /**< Support per queue burst */
> -};

Thank you

>  /**
>   * Ethernet device RX/TX queue packet burst mode information structure.
>   * Used to retrieve information about packet burst mode setting.
>   */
>  struct rte_eth_burst_mode {
> -	uint64_t options;
> +	uint64_t flags; /**< The ORed values of RTE_ETH_BURST_FLAG_xxx */
> +
> +#define RTE_ETH_BURST_MODE_INFO_SIZE 1024 /**< Maximum size for information */
> +	char info[RTE_ETH_BURST_MODE_INFO_SIZE]; /**< burst mode information */
>  };

I think the API can be simpler by passing the flags as function parameter.

In my understanding the burst mode name is fixed per Rx/Tx function,
so it can be a constant string referenced with a simple char*.

This is the current API:

int rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
    struct rte_eth_burst_mode *mode);

I wonder what do you think of such API? (just a proposal for comments):

char *rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id, uint64_t flags);

Or is there some cases where you want to build the string with snprintf?
(I cannot think about a case, given it should mapped to a C-function)




  parent reply	other threads:[~2019-11-06  0:33 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-04 10:39 Haiyue Wang
2019-11-05 15:51 ` Ray Kinsella
2019-11-06  0:33 ` Thomas Monjalon [this message]
2019-11-06  1:21   ` Wang, Haiyue
2019-11-06  1:40     ` Wang, Haiyue
2019-11-06  8:19     ` Thomas Monjalon
2019-11-06  1:30 ` [dpdk-dev] [PATCH v3] " Haiyue Wang
2019-11-06  9:19   ` Thomas Monjalon
2019-11-06 10:49     ` Wang, Haiyue
2019-11-06 15:13       ` Ferruh Yigit
2019-11-06  9:36   ` Slava Ovsiienko

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=2399300.Xf6G4o05WB@xps \
    --to=thomas@monjalon.net \
    --cc=arybchenko@solarflare.com \
    --cc=chenmin.sun@intel.com \
    --cc=damarion@cisco.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=haiyue.wang@intel.com \
    --cc=jerinjacobk@gmail.com \
    --cc=ray.kinsella@intel.com \
    --cc=viacheslavo@mellanox.com \
    --cc=xiaolong.ye@intel.com \
    --cc=yu.y.liu@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).