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 752B15ABF for ; Mon, 12 Jan 2015 16:46:37 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 12 Jan 2015 07:46:36 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="439504069" Received: from irsmsx153.ger.corp.intel.com ([163.33.192.75]) by FMSMGA003.fm.intel.com with ESMTP; 12 Jan 2015 07:33:49 -0800 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.11]) by IRSMSX153.ger.corp.intel.com ([169.254.9.109]) with mapi id 14.03.0195.001; Mon, 12 Jan 2015 15:46:35 +0000 From: "Jastrzebski, MichalX K" To: "Jastrzebski, MichalX K" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 2/2] testpmd: fix dcb in vt mode Thread-Index: AQHQLnZzyA6hizYPZ0SZh5kxQiodFZy8oOWA Date: Mon, 12 Jan 2015 15:46:34 +0000 Message-ID: <60ABE07DBB3A454EB7FAD707B4BB1582138D2561@IRSMSX109.ger.corp.intel.com> References: <6c3329$jtfsjp@orsmga002.jf.intel.com> In-Reply-To: <6c3329$jtfsjp@orsmga002.jf.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 2/2] testpmd: fix dcb in vt mode 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: Mon, 12 Jan 2015 15:46:38 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Michal Jastrzebski > Sent: Monday, January 12, 2015 3:45 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH 2/2] testpmd: fix dcb in vt mode >=20 > Date: Mon, 12 Jan 2015 15:39:41 +0100 > Message-Id: <1421073581-6644-3-git-send-email- > michalx.k.jastrzebski@intel.com> > X-Mailer: git-send-email 2.1.1 > In-Reply-To: <1421073581-6644-1-git-send-email- > michalx.k.jastrzebski@intel.com> > References: <1421073581-6644-1-git-send-email- > michalx.k.jastrzebski@intel.com> >=20 > From: Pawel Wodkowski >=20 >=20 > This patch incorporate fixes to support DCB in SRIOV mode for testpmd. >=20 > It also clean up some old code that is not needed or wrong. >=20 >=20 >=20 > Signed-off-by: Pawel Wodkowski >=20 > --- >=20 > app/test-pmd/cmdline.c | 4 ++-- >=20 > app/test-pmd/testpmd.c | 39 +++++++++++++++++++++++++++++---------- >=20 > app/test-pmd/testpmd.h | 10 ---------- >=20 > 3 files changed, 31 insertions(+), 22 deletions(-) >=20 >=20 >=20 > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c >=20 > index 882a5a2..3c60087 100644 >=20 > --- a/app/test-pmd/cmdline.c >=20 > +++ b/app/test-pmd/cmdline.c >=20 > @@ -1947,9 +1947,9 @@ cmd_config_dcb_parsed(void *parsed_result, >=20 >=20 >=20 > /* DCB in VT mode */ >=20 > if (!strncmp(res->vt_en, "on",2)) >=20 > - dcb_conf.dcb_mode =3D DCB_VT_ENABLED; >=20 > + dcb_conf.vt_en =3D 1; >=20 > else >=20 > - dcb_conf.dcb_mode =3D DCB_ENABLED; >=20 > + dcb_conf.vt_en =3D 0; >=20 >=20 >=20 > if (!strncmp(res->pfc_en, "on",2)) { >=20 > dcb_conf.pfc_en =3D 1; >=20 > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c >=20 > index 8c69756..6677a5e 100644 >=20 > --- a/app/test-pmd/testpmd.c >=20 > +++ b/app/test-pmd/testpmd.c >=20 > @@ -1733,7 +1733,8 @@ const uint16_t vlan_tags[] =3D { >=20 > }; >=20 >=20 >=20 > static int >=20 > -get_eth_dcb_conf(struct rte_eth_conf *eth_conf, struct dcb_config > *dcb_conf) >=20 > +get_eth_dcb_conf(struct rte_eth_conf *eth_conf, struct dcb_config > *dcb_conf, >=20 > + uint16_t sriov) >=20 > { >=20 > uint8_t i; >=20 >=20 >=20 > @@ -1741,7 +1742,7 @@ get_eth_dcb_conf(struct rte_eth_conf *eth_conf, > struct dcb_config *dcb_conf) >=20 > * Builds up the correct configuration for dcb+vt based on the vlan ta= gs > array >=20 > * given above, and the number of traffic classes available for use. >=20 > */ >=20 > - if (dcb_conf->dcb_mode =3D=3D DCB_VT_ENABLED) { >=20 > + if (dcb_conf->vt_en =3D=3D 1) { >=20 > struct rte_eth_vmdq_dcb_conf vmdq_rx_conf; >=20 > struct rte_eth_vmdq_dcb_tx_conf vmdq_tx_conf; >=20 >=20 >=20 > @@ -1758,9 +1759,17 @@ get_eth_dcb_conf(struct rte_eth_conf *eth_conf, > struct dcb_config *dcb_conf) >=20 > vmdq_rx_conf.pool_map[i].vlan_id =3D vlan_tags[ i ]; >=20 > vmdq_rx_conf.pool_map[i].pools =3D 1 << (i % > vmdq_rx_conf.nb_queue_pools); >=20 > } >=20 > - for (i =3D 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) { >=20 > - vmdq_rx_conf.dcb_queue[i] =3D i; >=20 > - vmdq_tx_conf.dcb_queue[i] =3D i; >=20 > + >=20 > + if (sriov =3D=3D 0) { >=20 > + for (i =3D 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) { >=20 > + vmdq_rx_conf.dcb_queue[i] =3D i; >=20 > + vmdq_tx_conf.dcb_queue[i] =3D i; >=20 > + } >=20 > + } else { >=20 > + for (i =3D 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) { >=20 > + vmdq_rx_conf.dcb_queue[i] =3D i % dcb_conf- > >num_tcs; >=20 > + vmdq_tx_conf.dcb_queue[i] =3D i % dcb_conf- > >num_tcs; >=20 > + } >=20 > } >=20 >=20 >=20 > /*set DCB mode of RX and TX of multiple queues*/ >=20 > @@ -1818,22 +1827,32 @@ init_port_dcb_config(portid_t pid,struct > dcb_config *dcb_conf) >=20 > uint16_t nb_vlan; >=20 > uint16_t i; >=20 >=20 >=20 > - /* rxq and txq configuration in dcb mode */ >=20 > - nb_rxq =3D 128; >=20 > - nb_txq =3D 128; >=20 > rx_free_thresh =3D 64; >=20 >=20 >=20 > + rte_port =3D &ports[pid]; >=20 > memset(&port_conf,0,sizeof(struct rte_eth_conf)); >=20 > /* Enter DCB configuration status */ >=20 > dcb_config =3D 1; >=20 >=20 >=20 > nb_vlan =3D sizeof( vlan_tags )/sizeof( vlan_tags[ 0 ]); >=20 > /*set configuration of DCB in vt mode and DCB in non-vt mode*/ >=20 > - retval =3D get_eth_dcb_conf(&port_conf, dcb_conf); >=20 > + retval =3D get_eth_dcb_conf(&port_conf, dcb_conf, rte_port- > >dev_info.max_vfs); >=20 > + >=20 > + /* rxq and txq configuration in dcb mode */ >=20 > + nb_rxq =3D rte_port->dev_info.max_rx_queues; >=20 > + nb_txq =3D rte_port->dev_info.max_tx_queues; >=20 > + >=20 > + if (rte_port->dev_info.max_vfs) { >=20 > + if (port_conf.rxmode.mq_mode =3D=3D ETH_MQ_RX_VMDQ_DCB) >=20 > + nb_rxq /=3D > port_conf.rx_adv_conf.vmdq_dcb_conf.nb_queue_pools; >=20 > + >=20 > + if (port_conf.txmode.mq_mode =3D=3D ETH_MQ_TX_VMDQ_DCB) >=20 > + nb_txq /=3D > port_conf.tx_adv_conf.vmdq_dcb_tx_conf.nb_queue_pools; >=20 > + } >=20 > + >=20 > if (retval < 0) >=20 > return retval; >=20 >=20 >=20 > - rte_port =3D &ports[pid]; >=20 > memcpy(&rte_port->dev_conf, &port_conf,sizeof(struct > rte_eth_conf)); >=20 >=20 >=20 > rte_port->rx_conf.rx_thresh =3D rx_thresh; >=20 > diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h >=20 > index f8b0740..8976acc 100644 >=20 > --- a/app/test-pmd/testpmd.h >=20 > +++ b/app/test-pmd/testpmd.h >=20 > @@ -227,20 +227,10 @@ struct fwd_config { >=20 > portid_t nb_fwd_ports; /**< Nb. of ports involved. */ >=20 > }; >=20 >=20 >=20 > -/** >=20 > - * DCB mode enable >=20 > - */ >=20 > -enum dcb_mode_enable >=20 > -{ >=20 > - DCB_VT_ENABLED, >=20 > - DCB_ENABLED >=20 > -}; >=20 > - >=20 > /* >=20 > * DCB general config info >=20 > */ >=20 > struct dcb_config { >=20 > - enum dcb_mode_enable dcb_mode; >=20 > uint8_t vt_en; >=20 > enum rte_eth_nb_tcs num_tcs; >=20 > uint8_t pfc_en; >=20 > -- >=20 > 1.7.9.5 >=20 >=20 Self nacked - because of wrong message format.