From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 14F331B1F9 for ; Fri, 29 Sep 2017 11:00:56 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Sep 2017 02:00:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,451,1500966000"; d="scan'208";a="1225124814" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga002.fm.intel.com with ESMTP; 29 Sep 2017 02:00:55 -0700 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 29 Sep 2017 02:00:55 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 29 Sep 2017 02:00:55 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.152]) with mapi id 14.03.0319.002; Fri, 29 Sep 2017 17:00:53 +0800 From: "Wu, Jingjing" To: "Zhao1, Wei" , "dev@dpdk.org" CC: "Zhao1, Wei" Thread-Topic: [dpdk-dev] [PATCH v6] net/i40e: queue region set and flush Thread-Index: AQHTOPxDghSLpkkO8kedpoz4x2cJyqLLjyng Date: Fri, 29 Sep 2017 09:00:52 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F810E839BB@SHSMSX103.ccr.corp.intel.com> References: <1506653786-28970-1-git-send-email-wei.zhao1@intel.com> <1506672718-39160-1-git-send-email-wei.zhao1@intel.com> <1506672718-39160-3-git-send-email-wei.zhao1@intel.com> In-Reply-To: <1506672718-39160-3-git-send-email-wei.zhao1@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v6] net/i40e: queue region set and flush X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Sep 2017 09:00:57 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wei Zhao > Sent: Friday, September 29, 2017 4:12 PM > To: dev@dpdk.org > Cc: Zhao1, Wei > Subject: [dpdk-dev] [PATCH v6] net/i40e: queue region set and flush >=20 > This feature enable queue regions configuration for RSS in PF, so that di= fferent > traffic classes or different packet classification types can be separated= to > different queues in different queue regions.This patch can set queue regi= on > 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 sepci= fic > flowtype(PCTYPE).It also provide the solution of flush all configuration = about > queue region the above described. >=20 > Signed-off-by: Wei Zhao > --- > 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(-) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.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 >=20 > -#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(struc= t > 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); stati= c 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; > } >=20 > +void > +i40e_init_queue_region_conf(struct rte_eth_dev *dev) { > + struct i40e_hw *hw =3D I40E_DEV_PRIVATE_TO_HW(dev->data- > >dev_private); > + struct i40e_pf *pf =3D I40E_DEV_PRIVATE_TO_PF(dev->data- > >dev_private); > + struct i40e_queue_region_info *info =3D &pf->queue_region; > + uint16_t i; > + > + for (i =3D 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; >=20 > + /* 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 =3D &pf->queue_region; > + struct i40e_dcbx_config *old_cfg =3D &hw->local_dcbx_config; > + int32_t ret =3D -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 >=20 > /** > @@ -146,6 +173,27 @@ struct rte_pmd_i40e_ptype_mapping { }; >=20 > /** > + * 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