[dpdk-dev] [PATCH v6] net/i40e: queue region set and flush

Wu, Jingjing jingjing.wu at intel.com
Fri Sep 29 11:00:52 CEST 2017



> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Wei Zhao
> Sent: Friday, September 29, 2017 4:12 PM
> To: dev at dpdk.org
> Cc: Zhao1, Wei <wei.zhao1 at intel.com>
> Subject: [dpdk-dev] [PATCH v6] net/i40e: queue region set and flush
> 
> 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 at intel.com>
> ---
>  drivers/net/i40e/i40e_ethdev.c            |  27 +-
>  drivers/net/i40e/i40e_ethdev.h            |  39 +++
>  drivers/net/i40e/rte_pmd_i40e.c           | 520
> ++++++++++++++++++++++++++++++
>  drivers/net/i40e/rte_pmd_i40e.h           |  60 ++++
>  drivers/net/i40e/rte_pmd_i40e_version.map |   1 +
>  5 files changed, 641 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index 720f067..9a67b6d 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -137,10 +137,6 @@
>  #define I40E_PRTTSYN_TSYNTYPE    0x0e000000
>  #define I40E_CYCLECOUNTER_MASK   0xffffffffffffffffULL
> 
> -#define I40E_MAX_PERCENT            100
> -#define I40E_DEFAULT_DCB_APP_NUM    1
> -#define I40E_DEFAULT_DCB_APP_PRIO   3
> -
>  /**
>   * Below are values for writing un-exposed registers suggested
>   * by silicon experts
> @@ -309,7 +305,6 @@ static int i40e_pf_parameter_init(struct rte_eth_dev
> *dev);  static int i40e_pf_setup(struct i40e_pf *pf);  static int
> i40e_dev_rxtx_init(struct i40e_pf *pf);  static int i40e_vmdq_setup(struct
> rte_eth_dev *dev); -static int i40e_dcb_init_configure(struct rte_eth_dev *dev,
> bool sw_dcb);  static int i40e_dcb_setup(struct rte_eth_dev *dev);  static void
> i40e_stat_update_32(struct i40e_hw *hw, uint32_t reg,
>  		bool offset_loaded, uint64_t *offset, uint64_t *stat); @@ -
> 1036,6 +1031,20 @@ i40e_init_fdir_filter_list(struct rte_eth_dev *dev)
>  	return ret;
>  }
> 
> +void
> +i40e_init_queue_region_conf(struct rte_eth_dev *dev) {
> +	struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data-
> >dev_private);
> +	struct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data-
> >dev_private);
> +	struct i40e_queue_region_info *info = &pf->queue_region;
> +	uint16_t i;
> +
> +	for (i = 0; i < I40E_PFQF_HREGION_MAX_INDEX; i++)
> +		i40e_write_rx_ctl(hw, I40E_PFQF_HREGION(i), 0);
> +
> +	memset(info, 0, sizeof(struct i40e_queue_region_info)); }
> +
>  static int
>  eth_i40e_dev_init(struct rte_eth_dev *dev)  { @@ -1311,6 +1320,9 @@
> eth_i40e_dev_init(struct rte_eth_dev *dev)
>  	if (ret < 0)
>  		goto err_init_fdir_filter_list;
> 
> +		/* initialize queue region configuration */
Indent too much.

[......]
> +i40e_queue_region_dcb_configure(struct i40e_hw *hw,
> +				struct i40e_pf *pf)
> +{
> +	struct i40e_dcbx_config dcb_cfg_local;
> +	struct i40e_dcbx_config *dcb_cfg;
> +	struct i40e_queue_region_info *info = &pf->queue_region;
> +	struct i40e_dcbx_config *old_cfg = &hw->local_dcbx_config;
> +	int32_t ret = -EINVAL;
> +	uint16_t i, j, prio_index, region_index;
> +	uint8_t tc_map, tc_bw, bw_lf;
> +
> +	if (!info->queue_region_number) {
> +		PMD_DRV_LOG(ERR, "there is no that region id been set
> before");

How about "No queue region has been set"?
[......]
> +/**
> + *  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
> +};
> +
>  #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 {
> +	/**< 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.
> +	 */

Please change "/**<" to "/**", and please check all comments!!!

> +	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;
> +};
> +
Thanks
Jingjing



More information about the dev mailing list