DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Wei Zhao <wei.zhao1@intel.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v7 1/2] net/i40e: queue region set and flush
Date: Tue, 3 Oct 2017 18:54:31 +0100	[thread overview]
Message-ID: <a041900a-8d0b-1b73-01ef-9632bfb1b922@intel.com> (raw)
In-Reply-To: <1506676584-41030-2-git-send-email-wei.zhao1@intel.com>

On 9/29/2017 10:16 AM, Wei Zhao wrote:
> This feature enable queue regions configuration for RSS in PF,
> so that different traffic classes or different packet
> classification types can be separated to different queues in
> different queue regions.This patch can set queue region range,
> it include queue number in a region and the index of first queue.
> This patch enable mapping between different priorities (UP) and
> different traffic classes.It also enable mapping between a region
> index and a sepcific flowtype(PCTYPE).It also provide the solution
> of flush all configuration about queue region the above described.
> 
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> ---

<...>

> @@ -541,6 +547,34 @@ struct i40e_ethertype_rule {
>  	struct rte_hash *hash_table;
>  };
>  
> +/* queue region info */
> +struct i40e_region_info {
> +	/* the region id for this configuration */
> +	uint8_t region_id;
> +	/* the start queue index for this region */
> +	uint8_t queue_start_index;
> +	/* the total queue number of this queue region */
> +	uint8_t queue_num;
> +	/* the total number of user priority for this region */
> +	uint8_t user_priority_num;
> +	/* the packet's user priority for this region */
> +	uint8_t user_priority[I40E_MAX_USER_PRIORITY];
> +	/* the total number of flowtype for this region */
> +	uint8_t flowtype_num;
> +	/**
> +	 * the pctype or hardware flowtype of packet,
> +	 * the specific index for each type has been defined
> +	 * in file i40e_type.h as enum i40e_filter_pctype.
> +	 */
> +	uint8_t hw_flowtype[I40E_FILTER_PCTYPE_MAX];
> +};
> +
> +struct i40e_queue_region_info {

What do you think renaming:
i40e_region_info -> i40e_queue_region_info
i40e_queue_region_info -> i40e_queue_regions

> +	/* the total number of queue region for this port */
> +	uint16_t queue_region_number;
> +	struct i40e_region_info region[I40E_REGION_MAX_INDEX + 1];
> +};
> +
>  /* Tunnel filter number HW supports */
>  #define I40E_MAX_TUNNEL_FILTER_NUM 400
>  

<...>

> +static int
> +i40e_queue_region_set_flowtype(struct i40e_pf *pf,
> +			struct rte_i40e_rss_region_conf *rss_region_conf)
> +{
> +	int32_t ret = -EINVAL;
> +	struct i40e_queue_region_info *info = &pf->queue_region;
> +	uint16_t i, j;
> +	uint16_t region_index, flowtype_index;
> +
> +	/**

This is doxygen sytle comment, only nedeed for public headers.

> +	 * For the pctype or hardware flowtype of packet,
> +	 * the specific index for each type has been defined
> +	 * in file i40e_type.h as enum i40e_filter_pctype.
> +	 */
> +
<...>

> +		}
> +	}
> +}

Missing line.

> +static int
> +i40e_queue_region_set_user_priority(struct i40e_pf *pf,
> +		struct rte_i40e_rss_region_conf *rss_region_conf)
> +{
> +	struct i40e_queue_region_info *info = &pf->queue_region;
> +	int32_t ret = -EINVAL;
> +	uint16_t i, j, region_index;
> +
<...>

> +static int
> +i40e_queue_region_display_all_info(struct i40e_pf *pf, uint16_t port_id)
> +{
> +	uint16_t i, j;
> +	struct i40e_queue_region_info *info = &pf->queue_region;
> +	static const char *queue_region_info_stats_border = "-------";
> +
> +	if (!info->queue_region_number)
> +		PMD_DRV_LOG(ERR, "there is no has been region set before");
> +
> +	printf("\n  %s All queue region info for port=%2d %s",
> +			queue_region_info_stats_border, port_id,
> +			queue_region_info_stats_border);

printf ? Please use driver logging functions.

> +	printf("\n  queue_region_number: %-14u \n", info->queue_region_number);
> +
> +	for (i = 0; i < info->queue_region_number; i++) {
> +		printf("\n  region_id: %-14u queue_number: %-14u "
> +			"queue_start_index: %-14u \n",
> +			info->region[i].region_id,
> +			info->region[i].queue_num,
> +			info->region[i].queue_start_index);
> +
> +		printf("  user_priority_num is  %-14u :",
> +				info->region[i].user_priority_num);
> +		for (j = 0; j < info->region[i].user_priority_num; j++)
> +			printf(" %-14u ", info->region[i].user_priority[j]);
> +
> +		printf("\n  flowtype_num is  %-14u :",
> +				info->region[i].flowtype_num);
> +		for (j = 0; j < info->region[i].flowtype_num; j++)
> +			printf(" %-14u ", info->region[i].hw_flowtype[j]);
> +	}
> +
> +	printf("\n\n");
> +	return 0;
> +}
> +
> +int rte_pmd_i40e_rss_queue_region_conf(uint16_t port_id,
> +			struct rte_i40e_rss_region_conf *rss_region_conf)
> +{
> +	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
> +	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);
> +	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> +	enum rte_pmd_i40e_queue_region_op op_type = rss_region_conf->op;
> +	int32_t ret;
> +
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> +
> +	if (!is_i40e_supported(dev))
> +		return -ENOTSUP;
> +
> +	if (!(!i40e_queue_region_pf_check_rss(pf)))
> +		return -ENOTSUP;
> +
> +	/**
> +	 * This queue region feature only support pf by now. It should
> +	 * be called after dev_start, and will be clear after dev_stop.
> +	 * "RTE_PMD_I40E_RSS_QUEUE_REGION_ALL_FLUSH_ON"
> +	 * is just an enable function which server for other configuration,
> +	 * it is for all configuration about queue region from up layer,
> +	 * at first will only keep in DPDK softwarestored in driver,
> +	 * only after "FLUSH_ON", it commit all configuration to HW.
> +	 * Because PMD had to set hardware configuration at a time, so
> +	 * it will record all up layer command at first.
> +	 * "RTE_PMD_I40E_RSS_QUEUE_REGION_ALL_FLUSH_OFF" is
> +	 * just clean all configuration about queue region just now,
> +	 * and restore all to DPDK i40e driver default
> +	 * config when start up.
> +	 */
> +
> +	switch (op_type) {
> +	case RTE_PMD_I40E_QUEUE_REGION_SET:
> +		ret = i40e_queue_region_set_region(pf, rss_region_conf);
> +		break;
> +	case RTE_PMD_I40E_REGION_FLOWTYPE_SET:
> +		ret = i40e_queue_region_set_flowtype(pf, rss_region_conf);
> +		break;
> +	case RTE_PMD_I40E_USER_PRIORITY_REGION_SET:
> +		ret = i40e_queue_region_set_user_priority(pf, rss_region_conf);
> +		break;
> +	case RTE_PMD_I40E_RSS_QUEUE_REGION_ALL_FLUSH_ON:
> +		ret = i40e_flush_queue_region_all_conf(dev, hw, pf, 1);
> +		break;
> +	case RTE_PMD_I40E_RSS_QUEUE_REGION_ALL_FLUSH_OFF:
> +		ret = i40e_flush_queue_region_all_conf(dev, hw, pf, 0);
> +		break;
> +	case RTE_PMD_I40E_RSS_QUEUE_REGION_INFO_GET:
> +		ret = i40e_queue_region_display_all_info(pf, port_id);

Displaying is not always very useful in API level.
What do you think get fills the rss_region_conf with current device
settings and return back to the caller?

> +		break;
> +	default:
> +		PMD_DRV_LOG(WARNING, "op type (%d) not supported",
> +			    op_type);
> +		ret = -EINVAL;
> +	}
> +
> +	I40E_WRITE_FLUSH(hw);
> +
> +	return ret;
> +}
> diff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h
> index 155b7e8..2219318 100644
> --- a/drivers/net/i40e/rte_pmd_i40e.h
> +++ b/drivers/net/i40e/rte_pmd_i40e.h
> @@ -91,6 +91,33 @@ enum rte_pmd_i40e_package_info {
>  	RTE_PMD_I40E_PKG_INFO_MAX = 0xFFFFFFFF
>  };
>  
> +/**
> + *  Option types of queue region.
> + */
> +enum rte_pmd_i40e_queue_region_op {
> +	RTE_PMD_I40E_REGION_UNDEFINED,
> +	RTE_PMD_I40E_QUEUE_REGION_SET,      /**< add queue region set */
> +	RTE_PMD_I40E_REGION_FLOWTYPE_SET,   /**< add pf region pctype set */
> +	/*** add queue region user priority set */
> +	RTE_PMD_I40E_USER_PRIORITY_REGION_SET,
> +	/**
> +	 * ALL configuration about queue region from up layer
> +	 * at first will only keep in DPDK softwarestored in driver,
> +	 * only after " FLUSH_ON ", it commit all configuration to HW.
> +	 * Because PMD had to set hardware configuration at a time, so
> +	 * it will record all up layer command at first.
> +	 */
> +	RTE_PMD_I40E_RSS_QUEUE_REGION_ALL_FLUSH_ON,
> +	/**
> +	 * "FLUSH_OFF " is just clean all configuration about queue
> +	 * region just now, and restore all to DPDK i40e driver default
> +	 * config when start up.
> +	 */
> +	RTE_PMD_I40E_RSS_QUEUE_REGION_ALL_FLUSH_OFF,
> +	RTE_PMD_I40E_RSS_QUEUE_REGION_INFO_GET,
> +	RTE_PMD_I40E_QUEUE_REGION_OP_MAX

These are in public header now.
Can you please use same namespace for all ops.
It can be "RTE_PMD_I40E_RSS_QUEUE_REGION_"

> +};
> +
>  #define RTE_PMD_I40E_DDP_NAME_SIZE 32
>  
>  /**
> @@ -146,6 +173,27 @@ struct rte_pmd_i40e_ptype_mapping {
>  };
>  
>  /**
> + * Queue region related information.
> + */
> +struct rte_i40e_rss_region_conf {

Can you please be consistant in using public names.
There are:
rss_region
queue_region
rss_queue_region

Also there is confusion between using:
rte_i40e_
rte_pmd_i40e_

> +	/*** the region id for this configuration */
> +	uint8_t region_id;
> +	/** the pctype or hardware flowtype of packet,
> +	 * the specific index for each type has been defined
> +	 * in file i40e_type.h as enum i40e_filter_pctype.
> +	 */
> +	uint8_t hw_flowtype;
> +	/*** the start queue index for this region */
> +	uint8_t queue_start_index;
> +	/*** the total queue number of this queue region */
> +	uint8_t queue_num;
> +	/*** the packet's user priority for this region */
> +	uint8_t user_priority;
> +	 /*** Option types of queue region */
> +	enum rte_pmd_i40e_queue_region_op op;
> +};
> +
> +/**
>   * Notify VF when PF link status changes.
>   *
>   * @param port
> @@ -657,4 +705,16 @@ int rte_pmd_i40e_ptype_mapping_replace(uint8_t port,
>  int rte_pmd_i40e_add_vf_mac_addr(uint8_t port, uint16_t vf_id,
>  				 struct ether_addr *mac_addr);
>  
> +/**
> + * Do RSS queue region configuration for that port as
> + * the command option type
> + *
> + * @param port
> + *    pointer id for that port device

port id ?

> + * @param conf_ptr
> + *    pointer to the struct that contain all the
> + *    region configuration parameters
> + */
> +int rte_pmd_i40e_rss_queue_region_conf(uint16_t port_id,

By defining port_id uint16_t, this patches becomes dependent to the
port_id update patchset, please clarify this in cover letter.

> +		struct rte_i40e_rss_region_conf *rss_region_conf);
>  #endif /* _PMD_I40E_H_ */
> diff --git a/drivers/net/i40e/rte_pmd_i40e_version.map b/drivers/net/i40e/rte_pmd_i40e_version.map
> index ef8882b..29d6b74 100644
> --- a/drivers/net/i40e/rte_pmd_i40e_version.map
> +++ b/drivers/net/i40e/rte_pmd_i40e_version.map
> @@ -50,5 +50,6 @@ DPDK_17.11 {
>  	global:
>  
>  	rte_pmd_i40e_add_vf_mac_addr;
> +	rte_pmd_i40e_rss_queue_region_conf;
>  
>  } DPDK_17.08;
> 

  parent reply	other threads:[~2017-10-03 17:54 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-24  3:26 [dpdk-dev] [PATCH 0/2] net/i40e: API to configure queue regions for RSS Wei Zhao
2017-08-24  3:26 ` [dpdk-dev] [PATCH 1/2] net/i40e: queue region set and flush Wei Zhao
2017-08-31 16:18   ` Ferruh Yigit
2017-09-01  2:38     ` Zhao1, Wei
2017-09-06  9:11       ` Ferruh Yigit
2017-09-15 11:00         ` Ferruh Yigit
2017-09-20  3:20           ` Zhao1, Wei
2017-09-20 10:32             ` Ferruh Yigit
2017-09-18  3:38         ` Zhao1, Wei
2017-09-05 23:52   ` Chilikin, Andrey
2017-09-06  7:21     ` Zhao1, Wei
2017-08-24  3:26 ` [dpdk-dev] [PATCH 2/2] app/testpmd: add API for configuration of queue region Wei Zhao
2017-09-13  6:04 ` [dpdk-dev] [PATCH v2 0/2] net/i40e: API to configure queue regions for RSS Wei Zhao
2017-09-13  6:04   ` [dpdk-dev] [PATCH v2 1/2] net/i40e: queue region set and flush Wei Zhao
2017-09-13  6:04   ` [dpdk-dev] [PATCH v2 2/2] app/testpmd: add API for configuration of queue region Wei Zhao
2017-09-15  3:13   ` [dpdk-dev] [PATCH v3 0/2] net/i40e: API to configure queue regions for RSS Wei Zhao
2017-09-15  3:13     ` [dpdk-dev] [PATCH v3 1/2] net/i40e: queue region set and flush Wei Zhao
2017-09-20 10:36       ` Ferruh Yigit
2017-09-21  6:48         ` Zhao1, Wei
2017-09-21  7:10           ` Ferruh Yigit
2017-09-21  7:26             ` Zhao1, Wei
2017-09-21 15:45               ` Ferruh Yigit
2017-09-25  7:40         ` Zhao1, Wei
2017-09-25  9:31           ` Ferruh Yigit
2017-09-26  7:46             ` Zhao1, Wei
2017-09-26  8:54         ` Zhao1, Wei
2017-09-27 19:13           ` Ferruh Yigit
2017-09-28  2:40             ` Zhao1, Wei
2017-09-21 19:53       ` Chilikin, Andrey
2017-09-22  8:49         ` Zhao1, Wei
2017-09-22 20:13           ` Chilikin, Andrey
2017-09-25  2:55             ` Zhao1, Wei
2017-09-24 16:01       ` Wu, Jingjing
2017-09-25  3:26         ` Zhao1, Wei
2017-09-25  5:55         ` Zhao1, Wei
2017-09-15  3:13     ` [dpdk-dev] [PATCH v3 2/2] app/testpmd: add API for configuration of queue region Wei Zhao
2017-09-20 10:45       ` Ferruh Yigit
2017-09-25  9:25         ` Zhao1, Wei
2017-09-25  9:43           ` Ferruh Yigit
2017-09-26  5:30             ` Zhao1, Wei
2017-09-28  9:04     ` [dpdk-dev] [PATCH v4 0/3] net/i40e: API to configure queue regions for RSS Wei Zhao
2017-09-28  9:04       ` [dpdk-dev] [PATCH v4 1/3] net/i40e: queue region set and flush Wei Zhao
2017-09-28  9:04       ` [dpdk-dev] [PATCH v4 2/3] app/testpmd: add API for configuration of queue region Wei Zhao
2017-09-28  9:04       ` [dpdk-dev] [PATCH v4 3/3] doc/testpmd_app_ug: add doc info for " Wei Zhao
2017-09-28  9:10     ` [dpdk-dev] [PATCH v4 0/3] net/i40e: API to configure queue regions for RSS Wei Zhao
2017-09-28  9:10       ` [dpdk-dev] [PATCH v4 1/3] net/i40e: queue region set and flush Wei Zhao
2017-09-28  9:10       ` [dpdk-dev] [PATCH v4 2/3] app/testpmd: add API for configuration of queue region Wei Zhao
2017-09-28  9:10       ` [dpdk-dev] [PATCH v4 3/3] doc/testpmd_app_ug: add doc info for " Wei Zhao
2017-09-29  2:56       ` [dpdk-dev] [PATCH v5 0/3] net/i40e: API to configure queue regions for RSS Wei Zhao
2017-09-29  2:56         ` [dpdk-dev] [PATCH v5 1/3] net/i40e: queue region set and flush Wei Zhao
2017-09-29  4:54           ` Wu, Jingjing
2017-09-29  8:27             ` Zhao1, Wei
2017-09-29  2:56         ` [dpdk-dev] [PATCH v5 2/3] app/testpmd: add API for configuration of queue region Wei Zhao
2017-09-29  5:04           ` Wu, Jingjing
2017-09-29  5:21             ` Zhao1, Wei
2017-09-29  2:56         ` [dpdk-dev] [PATCH v5 3/3] doc/testpmd_app_ug: add doc info for " Wei Zhao
2017-09-29  8:11         ` [dpdk-dev] [PATCH v6] net/i40e: API to configure queue regions for RSS Wei Zhao
2017-09-29  8:11           ` [dpdk-dev] [PATCH v6] app/testpmd: add API for configuration of queue region Wei Zhao
2017-09-29  8:11           ` [dpdk-dev] [PATCH v6] net/i40e: queue region set and flush Wei Zhao
2017-09-29  9:00             ` Wu, Jingjing
2017-09-29  9:16           ` [dpdk-dev] [PATCH v7 0/2] net/i40e: API to configure queue regions for RSS Wei Zhao
2017-09-29  9:16             ` [dpdk-dev] [PATCH v7 1/2] net/i40e: queue region set and flush Wei Zhao
2017-09-29 12:22               ` Wu, Jingjing
2017-10-10  1:45                 ` Zhao1, Wei
2017-10-03 17:54               ` Ferruh Yigit [this message]
2017-10-10  6:11                 ` Zhao1, Wei
2017-09-29  9:16             ` [dpdk-dev] [PATCH v7 2/2] app/testpmd: add API for configuration of queue region Wei Zhao
2017-09-29 14:29               ` Wu, Jingjing
2017-10-03 18:04               ` Ferruh Yigit
2017-10-10  1:46                 ` Zhao1, Wei
2017-10-10  2:55                 ` Zhao1, Wei
2017-10-10  3:01                 ` Zhao1, Wei
2017-10-11  2:15                   ` Ferruh Yigit
2017-09-29 10:15             ` [dpdk-dev] [PATCH v7 0/2] net/i40e: API to configure queue regions for RSS Peng, Yuan
2017-10-11  8:49             ` [dpdk-dev] [PATCH v8 " Wei Zhao
2017-10-11  8:49               ` [dpdk-dev] [PATCH v8 1/2] net/i40e: queue region set and flush Wei Zhao
2017-10-11  8:49               ` [dpdk-dev] [PATCH v8 2/2] app/testpmd: add API for configuration of queue region Wei Zhao
2017-10-11  8:55             ` [dpdk-dev] [PATCH v8 0/2] net/i40e: API to configure queue regions for RSS Wei Zhao
2017-10-11  8:55               ` [dpdk-dev] [PATCH v8 1/2] net/i40e: queue region set and flush Wei Zhao
2017-10-13 10:06                 ` Chilikin, Andrey
2017-10-18  3:00                   ` Zhao1, Wei
2017-10-18 13:00                     ` Chilikin, Andrey
2017-10-19  2:18                       ` Zhao1, Wei
2017-10-11  8:55               ` [dpdk-dev] [PATCH v8 2/2] app/testpmd: add API for configuration of queue region Wei Zhao
2017-10-11 11:29               ` [dpdk-dev] [PATCH v8 0/2] net/i40e: API to configure queue regions for RSS Peng, Yuan
2017-10-11 21:06               ` Ferruh Yigit
2017-10-13  1:52                 ` Zhao1, Wei

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=a041900a-8d0b-1b73-01ef-9632bfb1b922@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=wei.zhao1@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).