From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id AD4E7936C for ; Thu, 22 Oct 2015 09:10:46 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 22 Oct 2015 00:10:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,181,1444719600"; d="scan'208";a="669352340" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga003.jf.intel.com with ESMTP; 22 Oct 2015 00:10:31 -0700 Received: from fmsmsx155.amr.corp.intel.com (10.18.116.71) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 22 Oct 2015 00:10:24 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by FMSMSX155.amr.corp.intel.com (10.18.116.71) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 22 Oct 2015 00:10:23 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.96]) by shsmsx102.ccr.corp.intel.com ([169.254.2.253]) with mapi id 14.03.0248.002; Thu, 22 Oct 2015 15:10:21 +0800 From: "Liu, Jijiang" To: "Wu, Jingjing" , "dev@dpdk.org" Thread-Topic: [PATCH 7/8] i40e: get_dcb_info ops implement Thread-Index: AQHQ9o7LG4+2WPLtBUC0Ngw0uziXV553Q6Ig Date: Thu, 22 Oct 2015 07:10:21 +0000 Message-ID: <1ED644BD7E0A5F4091CF203DAFB8E4CC22BC1D9D@SHSMSX101.ccr.corp.intel.com> References: <1443074591-19803-1-git-send-email-jingjing.wu@intel.com> <1443074591-19803-8-git-send-email-jingjing.wu@intel.com> In-Reply-To: <1443074591-19803-8-git-send-email-jingjing.wu@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 Cc: "Pei, Yulong" Subject: Re: [dpdk-dev] [PATCH 7/8] i40e: get_dcb_info ops implement X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Oct 2015 07:10:47 -0000 > -----Original Message----- > From: Wu, Jingjing > Sent: Thursday, September 24, 2015 2:03 PM > To: dev@dpdk.org > Cc: Wu, Jingjing; Liu, Jijiang; Zhang, Helin; Tao, Zhe; Pei, Yulong > Subject: [PATCH 7/8] i40e: get_dcb_info ops implement >=20 > This patch implements the get_dcb_info ops in i40e driver. >=20 > Signed-off-by: Jingjing Wu > --- > drivers/net/i40e/i40e_ethdev.c | 42 > ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 42 insertions(+) >=20 > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethde= v.c > index 7d252fa..76e2353 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -220,6 +220,8 @@ static int i40e_dev_filter_ctrl(struct rte_eth_dev > *dev, > enum rte_filter_type filter_type, > enum rte_filter_op filter_op, > void *arg); > +static void i40e_dev_get_dcb_info(struct rte_eth_dev *dev, > + struct rte_eth_dcb_info *dcb_info); > static void i40e_configure_registers(struct i40e_hw *hw); static void > i40e_hw_init(struct i40e_hw *hw); static int i40e_config_qinq(struct > i40e_hw *hw, struct i40e_vsi *vsi); @@ -292,6 +294,7 @@ static const > struct eth_dev_ops i40e_eth_dev_ops =3D { > .timesync_disable =3D i40e_timesync_disable, > .timesync_read_rx_timestamp =3D i40e_timesync_read_rx_timestamp, > .timesync_read_tx_timestamp =3D i40e_timesync_read_tx_timestamp, > + .get_dcb_info =3D i40e_dev_get_dcb_info, > }; >=20 > static struct eth_driver rte_i40e_pmd =3D { @@ -6808,3 +6811,42 @@ > i40e_dcb_setup(struct rte_eth_dev *dev) > } > return 0; > } > + > +static void > +i40e_dev_get_dcb_info(struct rte_eth_dev *dev, > + struct rte_eth_dcb_info *dcb_info) { > + struct i40e_pf *pf =3D I40E_DEV_PRIVATE_TO_PF(dev->data- > >dev_private); > + struct i40e_hw *hw =3D I40E_DEV_PRIVATE_TO_HW(dev->data- > >dev_private); > + struct i40e_vsi *vsi =3D pf->main_vsi; > + struct i40e_dcbx_config *dcb_cfg =3D &hw->local_dcbx_config; > + uint16_t bsf, tc_mapping; > + int i; > + > + if (dev->data->dev_conf.rxmode.mq_mode & > ETH_MQ_RX_DCB_FLAG) > + dcb_info->nb_tcs =3D > + dev->data- > >dev_conf.rx_adv_conf.dcb_rx_conf.nb_tcs; > + else > + dcb_info->nb_tcs =3D 1; > + for (i =3D 0; i < I40E_MAX_USER_PRIORITY; i++) > + dcb_info->prio_tc[i] =3D dcb_cfg->etscfg.prioritytable[i]; > + for (i =3D 0; i < dcb_info->nb_tcs; i++) > + dcb_info->tc_bws[i] =3D dcb_cfg->etscfg.tcbwtable[i]; > + > + for (i =3D 0; i < I40E_MAX_TRAFFIC_CLASS; i++) { > + if (vsi->enabled_tc & (1 << i)) { > + tc_mapping =3D rte_le_to_cpu_16(vsi- > >info.tc_mapping[i]); > + /* only main vsi support multi TCs */ > + dcb_info->tc_queue.tc_rxq[0][i].base =3D > + (tc_mapping & > I40E_AQ_VSI_TC_QUE_OFFSET_MASK) >> > + I40E_AQ_VSI_TC_QUE_OFFSET_SHIFT; > + dcb_info->tc_queue.tc_txq[0][i].base =3D > + dcb_info->tc_queue.tc_rxq[0][i].base; > + bsf =3D (tc_mapping & > I40E_AQ_VSI_TC_QUE_NUMBER_MASK) >> > + I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT; > + dcb_info->tc_queue.tc_rxq[0][i].nb_queue =3D 1 << bsf; > + dcb_info->tc_queue.tc_txq[0][i].nb_queue =3D > + dcb_info->tc_queue.tc_rxq[0][i].nb_queue; > + } > + } > +} > -- > 2.4.0 If there are some command lines in testpmd to get DCB information, that is= great.