* [PATCH 2/2] testpmd: fix dcb in vt mode @ 2015-01-12 14:44 Michal Jastrzebski [not found] ` <6c3329$jtfsjp-zyQnk7H6ZEMSgA9wuWY2vVDQ4js95KgL@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Michal Jastrzebski @ 2015-01-12 14:44 UTC (permalink / raw) To: dev-VfR2kkLFssw Date: Mon, 12 Jan 2015 15:39:41 +0100 Message-Id: <1421073581-6644-3-git-send-email-michalx.k.jastrzebski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1421073581-6644-1-git-send-email-michalx.k.jastrzebski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> References: <1421073581-6644-1-git-send-email-michalx.k.jastrzebski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> From: Pawel Wodkowski <pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> This patch incorporate fixes to support DCB in SRIOV mode for testpmd. It also clean up some old code that is not needed or wrong. Signed-off-by: Pawel Wodkowski <pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> --- app/test-pmd/cmdline.c | 4 ++-- app/test-pmd/testpmd.c | 39 +++++++++++++++++++++++++++++---------- app/test-pmd/testpmd.h | 10 ---------- 3 files changed, 31 insertions(+), 22 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 882a5a2..3c60087 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -1947,9 +1947,9 @@ cmd_config_dcb_parsed(void *parsed_result, /* DCB in VT mode */ if (!strncmp(res->vt_en, "on",2)) - dcb_conf.dcb_mode = DCB_VT_ENABLED; + dcb_conf.vt_en = 1; else - dcb_conf.dcb_mode = DCB_ENABLED; + dcb_conf.vt_en = 0; if (!strncmp(res->pfc_en, "on",2)) { dcb_conf.pfc_en = 1; diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 8c69756..6677a5e 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1733,7 +1733,8 @@ const uint16_t vlan_tags[] = { }; static int -get_eth_dcb_conf(struct rte_eth_conf *eth_conf, struct dcb_config *dcb_conf) +get_eth_dcb_conf(struct rte_eth_conf *eth_conf, struct dcb_config *dcb_conf, + uint16_t sriov) { uint8_t i; @@ -1741,7 +1742,7 @@ get_eth_dcb_conf(struct rte_eth_conf *eth_conf, struct dcb_config *dcb_conf) * Builds up the correct configuration for dcb+vt based on the vlan tags array * given above, and the number of traffic classes available for use. */ - if (dcb_conf->dcb_mode == DCB_VT_ENABLED) { + if (dcb_conf->vt_en == 1) { struct rte_eth_vmdq_dcb_conf vmdq_rx_conf; struct rte_eth_vmdq_dcb_tx_conf vmdq_tx_conf; @@ -1758,9 +1759,17 @@ get_eth_dcb_conf(struct rte_eth_conf *eth_conf, struct dcb_config *dcb_conf) vmdq_rx_conf.pool_map[i].vlan_id = vlan_tags[ i ]; vmdq_rx_conf.pool_map[i].pools = 1 << (i % vmdq_rx_conf.nb_queue_pools); } - for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) { - vmdq_rx_conf.dcb_queue[i] = i; - vmdq_tx_conf.dcb_queue[i] = i; + + if (sriov == 0) { + for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) { + vmdq_rx_conf.dcb_queue[i] = i; + vmdq_tx_conf.dcb_queue[i] = i; + } + } else { + for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) { + vmdq_rx_conf.dcb_queue[i] = i % dcb_conf->num_tcs; + vmdq_tx_conf.dcb_queue[i] = i % dcb_conf->num_tcs; + } } /*set DCB mode of RX and TX of multiple queues*/ @@ -1818,22 +1827,32 @@ init_port_dcb_config(portid_t pid,struct dcb_config *dcb_conf) uint16_t nb_vlan; uint16_t i; - /* rxq and txq configuration in dcb mode */ - nb_rxq = 128; - nb_txq = 128; rx_free_thresh = 64; + rte_port = &ports[pid]; memset(&port_conf,0,sizeof(struct rte_eth_conf)); /* Enter DCB configuration status */ dcb_config = 1; nb_vlan = sizeof( vlan_tags )/sizeof( vlan_tags[ 0 ]); /*set configuration of DCB in vt mode and DCB in non-vt mode*/ - retval = get_eth_dcb_conf(&port_conf, dcb_conf); + retval = get_eth_dcb_conf(&port_conf, dcb_conf, rte_port->dev_info.max_vfs); + + /* rxq and txq configuration in dcb mode */ + nb_rxq = rte_port->dev_info.max_rx_queues; + nb_txq = rte_port->dev_info.max_tx_queues; + + if (rte_port->dev_info.max_vfs) { + if (port_conf.rxmode.mq_mode == ETH_MQ_RX_VMDQ_DCB) + nb_rxq /= port_conf.rx_adv_conf.vmdq_dcb_conf.nb_queue_pools; + + if (port_conf.txmode.mq_mode == ETH_MQ_TX_VMDQ_DCB) + nb_txq /= port_conf.tx_adv_conf.vmdq_dcb_tx_conf.nb_queue_pools; + } + if (retval < 0) return retval; - rte_port = &ports[pid]; memcpy(&rte_port->dev_conf, &port_conf,sizeof(struct rte_eth_conf)); rte_port->rx_conf.rx_thresh = rx_thresh; diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index f8b0740..8976acc 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -227,20 +227,10 @@ struct fwd_config { portid_t nb_fwd_ports; /**< Nb. of ports involved. */ }; -/** - * DCB mode enable - */ -enum dcb_mode_enable -{ - DCB_VT_ENABLED, - DCB_ENABLED -}; - /* * DCB general config info */ struct dcb_config { - enum dcb_mode_enable dcb_mode; uint8_t vt_en; enum rte_eth_nb_tcs num_tcs; uint8_t pfc_en; -- 1.7.9.5 ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <6c3329$jtfsjp-zyQnk7H6ZEMSgA9wuWY2vVDQ4js95KgL@public.gmane.org>]
* Re: [PATCH 2/2] testpmd: fix dcb in vt mode [not found] ` <6c3329$jtfsjp-zyQnk7H6ZEMSgA9wuWY2vVDQ4js95KgL@public.gmane.org> @ 2015-01-12 15:46 ` Jastrzebski, MichalX K 0 siblings, 0 replies; 5+ messages in thread From: Jastrzebski, MichalX K @ 2015-01-12 15:46 UTC (permalink / raw) To: Jastrzebski, MichalX K, dev-VfR2kkLFssw@public.gmane.org > -----Original Message----- > From: dev [mailto:dev-bounces-VfR2kkLFssw@public.gmane.org] On Behalf Of Michal Jastrzebski > Sent: Monday, January 12, 2015 3:45 PM > To: dev-VfR2kkLFssw@public.gmane.org > Subject: [dpdk-dev] [PATCH 2/2] testpmd: fix dcb in vt mode > > Date: Mon, 12 Jan 2015 15:39:41 +0100 > Message-Id: <1421073581-6644-3-git-send-email- > michalx.k.jastrzebski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > X-Mailer: git-send-email 2.1.1 > In-Reply-To: <1421073581-6644-1-git-send-email- > michalx.k.jastrzebski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > References: <1421073581-6644-1-git-send-email- > michalx.k.jastrzebski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > > From: Pawel Wodkowski <pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > > > This patch incorporate fixes to support DCB in SRIOV mode for testpmd. > > It also clean up some old code that is not needed or wrong. > > > > Signed-off-by: Pawel Wodkowski <pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > > --- > > app/test-pmd/cmdline.c | 4 ++-- > > app/test-pmd/testpmd.c | 39 +++++++++++++++++++++++++++++---------- > > app/test-pmd/testpmd.h | 10 ---------- > > 3 files changed, 31 insertions(+), 22 deletions(-) > > > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c > > index 882a5a2..3c60087 100644 > > --- a/app/test-pmd/cmdline.c > > +++ b/app/test-pmd/cmdline.c > > @@ -1947,9 +1947,9 @@ cmd_config_dcb_parsed(void *parsed_result, > > > > /* DCB in VT mode */ > > if (!strncmp(res->vt_en, "on",2)) > > - dcb_conf.dcb_mode = DCB_VT_ENABLED; > > + dcb_conf.vt_en = 1; > > else > > - dcb_conf.dcb_mode = DCB_ENABLED; > > + dcb_conf.vt_en = 0; > > > > if (!strncmp(res->pfc_en, "on",2)) { > > dcb_conf.pfc_en = 1; > > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > > index 8c69756..6677a5e 100644 > > --- a/app/test-pmd/testpmd.c > > +++ b/app/test-pmd/testpmd.c > > @@ -1733,7 +1733,8 @@ const uint16_t vlan_tags[] = { > > }; > > > > static int > > -get_eth_dcb_conf(struct rte_eth_conf *eth_conf, struct dcb_config > *dcb_conf) > > +get_eth_dcb_conf(struct rte_eth_conf *eth_conf, struct dcb_config > *dcb_conf, > > + uint16_t sriov) > > { > > uint8_t i; > > > > @@ -1741,7 +1742,7 @@ get_eth_dcb_conf(struct rte_eth_conf *eth_conf, > struct dcb_config *dcb_conf) > > * Builds up the correct configuration for dcb+vt based on the vlan tags > array > > * given above, and the number of traffic classes available for use. > > */ > > - if (dcb_conf->dcb_mode == DCB_VT_ENABLED) { > > + if (dcb_conf->vt_en == 1) { > > struct rte_eth_vmdq_dcb_conf vmdq_rx_conf; > > struct rte_eth_vmdq_dcb_tx_conf vmdq_tx_conf; > > > > @@ -1758,9 +1759,17 @@ get_eth_dcb_conf(struct rte_eth_conf *eth_conf, > struct dcb_config *dcb_conf) > > vmdq_rx_conf.pool_map[i].vlan_id = vlan_tags[ i ]; > > vmdq_rx_conf.pool_map[i].pools = 1 << (i % > vmdq_rx_conf.nb_queue_pools); > > } > > - for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) { > > - vmdq_rx_conf.dcb_queue[i] = i; > > - vmdq_tx_conf.dcb_queue[i] = i; > > + > > + if (sriov == 0) { > > + for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) { > > + vmdq_rx_conf.dcb_queue[i] = i; > > + vmdq_tx_conf.dcb_queue[i] = i; > > + } > > + } else { > > + for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) { > > + vmdq_rx_conf.dcb_queue[i] = i % dcb_conf- > >num_tcs; > > + vmdq_tx_conf.dcb_queue[i] = i % dcb_conf- > >num_tcs; > > + } > > } > > > > /*set DCB mode of RX and TX of multiple queues*/ > > @@ -1818,22 +1827,32 @@ init_port_dcb_config(portid_t pid,struct > dcb_config *dcb_conf) > > uint16_t nb_vlan; > > uint16_t i; > > > > - /* rxq and txq configuration in dcb mode */ > > - nb_rxq = 128; > > - nb_txq = 128; > > rx_free_thresh = 64; > > > > + rte_port = &ports[pid]; > > memset(&port_conf,0,sizeof(struct rte_eth_conf)); > > /* Enter DCB configuration status */ > > dcb_config = 1; > > > > nb_vlan = sizeof( vlan_tags )/sizeof( vlan_tags[ 0 ]); > > /*set configuration of DCB in vt mode and DCB in non-vt mode*/ > > - retval = get_eth_dcb_conf(&port_conf, dcb_conf); > > + retval = get_eth_dcb_conf(&port_conf, dcb_conf, rte_port- > >dev_info.max_vfs); > > + > > + /* rxq and txq configuration in dcb mode */ > > + nb_rxq = rte_port->dev_info.max_rx_queues; > > + nb_txq = rte_port->dev_info.max_tx_queues; > > + > > + if (rte_port->dev_info.max_vfs) { > > + if (port_conf.rxmode.mq_mode == ETH_MQ_RX_VMDQ_DCB) > > + nb_rxq /= > port_conf.rx_adv_conf.vmdq_dcb_conf.nb_queue_pools; > > + > > + if (port_conf.txmode.mq_mode == ETH_MQ_TX_VMDQ_DCB) > > + nb_txq /= > port_conf.tx_adv_conf.vmdq_dcb_tx_conf.nb_queue_pools; > > + } > > + > > if (retval < 0) > > return retval; > > > > - rte_port = &ports[pid]; > > memcpy(&rte_port->dev_conf, &port_conf,sizeof(struct > rte_eth_conf)); > > > > rte_port->rx_conf.rx_thresh = rx_thresh; > > diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h > > index f8b0740..8976acc 100644 > > --- a/app/test-pmd/testpmd.h > > +++ b/app/test-pmd/testpmd.h > > @@ -227,20 +227,10 @@ struct fwd_config { > > portid_t nb_fwd_ports; /**< Nb. of ports involved. */ > > }; > > > > -/** > > - * DCB mode enable > > - */ > > -enum dcb_mode_enable > > -{ > > - DCB_VT_ENABLED, > > - DCB_ENABLED > > -}; > > - > > /* > > * DCB general config info > > */ > > struct dcb_config { > > - enum dcb_mode_enable dcb_mode; > > uint8_t vt_en; > > enum rte_eth_nb_tcs num_tcs; > > uint8_t pfc_en; > > -- > > 1.7.9.5 > > Self nacked - because of wrong message format. ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 0/2] Enable DCB in SRIOV mode for ixgbe driver @ 2015-01-12 15:50 Michal Jastrzebski [not found] ` <1421077843-8492-1-git-send-email-michalx.k.jastrzebski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Michal Jastrzebski @ 2015-01-12 15:50 UTC (permalink / raw) To: dev-VfR2kkLFssw From: Pawel Wodkowski <pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> Hi, this patchset enables DCB in SRIOV (ETH_MQ_RX_VMDQ_DCB and ETH_MQ_TX_VMDQ_DCB) for each VF and PF for ixgbe driver. As a side effect this allow to use multiple queues for TX in VF (8 if there is 16 or less VFs or 4 if there is 32 or less VFs) when PFC is not enabled. Pawel Wodkowski (2): pmd: add DCB for VF for ixgbe testpmd: fix dcb in vt mode app/test-pmd/cmdline.c | 4 +- app/test-pmd/testpmd.c | 39 ++++++++++---- app/test-pmd/testpmd.h | 10 ---- lib/librte_ether/rte_ethdev.c | 84 +++++++++++++++++++++--------- lib/librte_ether/rte_ethdev.h | 5 +- lib/librte_pmd_e1000/igb_pf.c | 3 +- lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 10 ++-- lib/librte_pmd_ixgbe/ixgbe_ethdev.h | 1 + lib/librte_pmd_ixgbe/ixgbe_pf.c | 98 ++++++++++++++++++++++++++++++----- lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 7 ++- 10 files changed, 190 insertions(+), 71 deletions(-) -- 1.7.9.5 ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <1421077843-8492-1-git-send-email-michalx.k.jastrzebski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>]
* [PATCH 2/2] testpmd: fix dcb in vt mode [not found] ` <1421077843-8492-1-git-send-email-michalx.k.jastrzebski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> @ 2015-01-12 15:50 ` Michal Jastrzebski [not found] ` <1421077843-8492-3-git-send-email-michalx.k.jastrzebski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Michal Jastrzebski @ 2015-01-12 15:50 UTC (permalink / raw) To: dev-VfR2kkLFssw From: Pawel Wodkowski <pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> This patch incorporate fixes to support DCB in SRIOV mode for testpmd. It also clean up some old code that is not needed or wrong. Signed-off-by: Pawel Wodkowski <pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> --- app/test-pmd/cmdline.c | 4 ++-- app/test-pmd/testpmd.c | 39 +++++++++++++++++++++++++++++---------- app/test-pmd/testpmd.h | 10 ---------- 3 files changed, 31 insertions(+), 22 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 882a5a2..3c60087 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -1947,9 +1947,9 @@ cmd_config_dcb_parsed(void *parsed_result, /* DCB in VT mode */ if (!strncmp(res->vt_en, "on",2)) - dcb_conf.dcb_mode = DCB_VT_ENABLED; + dcb_conf.vt_en = 1; else - dcb_conf.dcb_mode = DCB_ENABLED; + dcb_conf.vt_en = 0; if (!strncmp(res->pfc_en, "on",2)) { dcb_conf.pfc_en = 1; diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 8c69756..6677a5e 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1733,7 +1733,8 @@ const uint16_t vlan_tags[] = { }; static int -get_eth_dcb_conf(struct rte_eth_conf *eth_conf, struct dcb_config *dcb_conf) +get_eth_dcb_conf(struct rte_eth_conf *eth_conf, struct dcb_config *dcb_conf, + uint16_t sriov) { uint8_t i; @@ -1741,7 +1742,7 @@ get_eth_dcb_conf(struct rte_eth_conf *eth_conf, struct dcb_config *dcb_conf) * Builds up the correct configuration for dcb+vt based on the vlan tags array * given above, and the number of traffic classes available for use. */ - if (dcb_conf->dcb_mode == DCB_VT_ENABLED) { + if (dcb_conf->vt_en == 1) { struct rte_eth_vmdq_dcb_conf vmdq_rx_conf; struct rte_eth_vmdq_dcb_tx_conf vmdq_tx_conf; @@ -1758,9 +1759,17 @@ get_eth_dcb_conf(struct rte_eth_conf *eth_conf, struct dcb_config *dcb_conf) vmdq_rx_conf.pool_map[i].vlan_id = vlan_tags[ i ]; vmdq_rx_conf.pool_map[i].pools = 1 << (i % vmdq_rx_conf.nb_queue_pools); } - for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) { - vmdq_rx_conf.dcb_queue[i] = i; - vmdq_tx_conf.dcb_queue[i] = i; + + if (sriov == 0) { + for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) { + vmdq_rx_conf.dcb_queue[i] = i; + vmdq_tx_conf.dcb_queue[i] = i; + } + } else { + for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) { + vmdq_rx_conf.dcb_queue[i] = i % dcb_conf->num_tcs; + vmdq_tx_conf.dcb_queue[i] = i % dcb_conf->num_tcs; + } } /*set DCB mode of RX and TX of multiple queues*/ @@ -1818,22 +1827,32 @@ init_port_dcb_config(portid_t pid,struct dcb_config *dcb_conf) uint16_t nb_vlan; uint16_t i; - /* rxq and txq configuration in dcb mode */ - nb_rxq = 128; - nb_txq = 128; rx_free_thresh = 64; + rte_port = &ports[pid]; memset(&port_conf,0,sizeof(struct rte_eth_conf)); /* Enter DCB configuration status */ dcb_config = 1; nb_vlan = sizeof( vlan_tags )/sizeof( vlan_tags[ 0 ]); /*set configuration of DCB in vt mode and DCB in non-vt mode*/ - retval = get_eth_dcb_conf(&port_conf, dcb_conf); + retval = get_eth_dcb_conf(&port_conf, dcb_conf, rte_port->dev_info.max_vfs); + + /* rxq and txq configuration in dcb mode */ + nb_rxq = rte_port->dev_info.max_rx_queues; + nb_txq = rte_port->dev_info.max_tx_queues; + + if (rte_port->dev_info.max_vfs) { + if (port_conf.rxmode.mq_mode == ETH_MQ_RX_VMDQ_DCB) + nb_rxq /= port_conf.rx_adv_conf.vmdq_dcb_conf.nb_queue_pools; + + if (port_conf.txmode.mq_mode == ETH_MQ_TX_VMDQ_DCB) + nb_txq /= port_conf.tx_adv_conf.vmdq_dcb_tx_conf.nb_queue_pools; + } + if (retval < 0) return retval; - rte_port = &ports[pid]; memcpy(&rte_port->dev_conf, &port_conf,sizeof(struct rte_eth_conf)); rte_port->rx_conf.rx_thresh = rx_thresh; diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index f8b0740..8976acc 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -227,20 +227,10 @@ struct fwd_config { portid_t nb_fwd_ports; /**< Nb. of ports involved. */ }; -/** - * DCB mode enable - */ -enum dcb_mode_enable -{ - DCB_VT_ENABLED, - DCB_ENABLED -}; - /* * DCB general config info */ struct dcb_config { - enum dcb_mode_enable dcb_mode; uint8_t vt_en; enum rte_eth_nb_tcs num_tcs; uint8_t pfc_en; -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 5+ messages in thread
[parent not found: <1421077843-8492-3-git-send-email-michalx.k.jastrzebski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH 2/2] testpmd: fix dcb in vt mode [not found] ` <1421077843-8492-3-git-send-email-michalx.k.jastrzebski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> @ 2015-01-13 10:15 ` Vlad Zolotarov [not found] ` <54B4F05A.90006-RmZWMc9puTNJc61us3aD9laTQe2KTcn/@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Vlad Zolotarov @ 2015-01-13 10:15 UTC (permalink / raw) To: Michal Jastrzebski, dev-VfR2kkLFssw On 01/12/15 17:50, Michal Jastrzebski wrote: > From: Pawel Wodkowski <pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > > This patch incorporate fixes to support DCB in SRIOV mode for testpmd. > It also clean up some old code that is not needed or wrong. The same here: could u, pls., separate the "cleanup" part of the patch from the "fixes" part into separate patches? thanks, vlad > > Signed-off-by: Pawel Wodkowski <pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > --- > app/test-pmd/cmdline.c | 4 ++-- > app/test-pmd/testpmd.c | 39 +++++++++++++++++++++++++++++---------- > app/test-pmd/testpmd.h | 10 ---------- > 3 files changed, 31 insertions(+), 22 deletions(-) > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c > index 882a5a2..3c60087 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -1947,9 +1947,9 @@ cmd_config_dcb_parsed(void *parsed_result, > > /* DCB in VT mode */ > if (!strncmp(res->vt_en, "on",2)) > - dcb_conf.dcb_mode = DCB_VT_ENABLED; > + dcb_conf.vt_en = 1; > else > - dcb_conf.dcb_mode = DCB_ENABLED; > + dcb_conf.vt_en = 0; > > if (!strncmp(res->pfc_en, "on",2)) { > dcb_conf.pfc_en = 1; > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > index 8c69756..6677a5e 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -1733,7 +1733,8 @@ const uint16_t vlan_tags[] = { > }; > > static int > -get_eth_dcb_conf(struct rte_eth_conf *eth_conf, struct dcb_config *dcb_conf) > +get_eth_dcb_conf(struct rte_eth_conf *eth_conf, struct dcb_config *dcb_conf, > + uint16_t sriov) > { > uint8_t i; > > @@ -1741,7 +1742,7 @@ get_eth_dcb_conf(struct rte_eth_conf *eth_conf, struct dcb_config *dcb_conf) > * Builds up the correct configuration for dcb+vt based on the vlan tags array > * given above, and the number of traffic classes available for use. > */ > - if (dcb_conf->dcb_mode == DCB_VT_ENABLED) { > + if (dcb_conf->vt_en == 1) { > struct rte_eth_vmdq_dcb_conf vmdq_rx_conf; > struct rte_eth_vmdq_dcb_tx_conf vmdq_tx_conf; > > @@ -1758,9 +1759,17 @@ get_eth_dcb_conf(struct rte_eth_conf *eth_conf, struct dcb_config *dcb_conf) > vmdq_rx_conf.pool_map[i].vlan_id = vlan_tags[ i ]; > vmdq_rx_conf.pool_map[i].pools = 1 << (i % vmdq_rx_conf.nb_queue_pools); > } > - for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) { > - vmdq_rx_conf.dcb_queue[i] = i; > - vmdq_tx_conf.dcb_queue[i] = i; > + > + if (sriov == 0) { > + for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) { > + vmdq_rx_conf.dcb_queue[i] = i; > + vmdq_tx_conf.dcb_queue[i] = i; > + } > + } else { > + for (i = 0; i < ETH_DCB_NUM_USER_PRIORITIES; i++) { > + vmdq_rx_conf.dcb_queue[i] = i % dcb_conf->num_tcs; > + vmdq_tx_conf.dcb_queue[i] = i % dcb_conf->num_tcs; > + } > } > > /*set DCB mode of RX and TX of multiple queues*/ > @@ -1818,22 +1827,32 @@ init_port_dcb_config(portid_t pid,struct dcb_config *dcb_conf) > uint16_t nb_vlan; > uint16_t i; > > - /* rxq and txq configuration in dcb mode */ > - nb_rxq = 128; > - nb_txq = 128; > rx_free_thresh = 64; > > + rte_port = &ports[pid]; > memset(&port_conf,0,sizeof(struct rte_eth_conf)); > /* Enter DCB configuration status */ > dcb_config = 1; > > nb_vlan = sizeof( vlan_tags )/sizeof( vlan_tags[ 0 ]); > /*set configuration of DCB in vt mode and DCB in non-vt mode*/ > - retval = get_eth_dcb_conf(&port_conf, dcb_conf); > + retval = get_eth_dcb_conf(&port_conf, dcb_conf, rte_port->dev_info.max_vfs); > + > + /* rxq and txq configuration in dcb mode */ > + nb_rxq = rte_port->dev_info.max_rx_queues; > + nb_txq = rte_port->dev_info.max_tx_queues; > + > + if (rte_port->dev_info.max_vfs) { > + if (port_conf.rxmode.mq_mode == ETH_MQ_RX_VMDQ_DCB) > + nb_rxq /= port_conf.rx_adv_conf.vmdq_dcb_conf.nb_queue_pools; > + > + if (port_conf.txmode.mq_mode == ETH_MQ_TX_VMDQ_DCB) > + nb_txq /= port_conf.tx_adv_conf.vmdq_dcb_tx_conf.nb_queue_pools; > + } > + > if (retval < 0) > return retval; > > - rte_port = &ports[pid]; > memcpy(&rte_port->dev_conf, &port_conf,sizeof(struct rte_eth_conf)); > > rte_port->rx_conf.rx_thresh = rx_thresh; > diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h > index f8b0740..8976acc 100644 > --- a/app/test-pmd/testpmd.h > +++ b/app/test-pmd/testpmd.h > @@ -227,20 +227,10 @@ struct fwd_config { > portid_t nb_fwd_ports; /**< Nb. of ports involved. */ > }; > > -/** > - * DCB mode enable > - */ > -enum dcb_mode_enable > -{ > - DCB_VT_ENABLED, > - DCB_ENABLED > -}; > - > /* > * DCB general config info > */ > struct dcb_config { > - enum dcb_mode_enable dcb_mode; > uint8_t vt_en; > enum rte_eth_nb_tcs num_tcs; > uint8_t pfc_en; ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <54B4F05A.90006-RmZWMc9puTNJc61us3aD9laTQe2KTcn/@public.gmane.org>]
* Re: [PATCH 2/2] testpmd: fix dcb in vt mode [not found] ` <54B4F05A.90006-RmZWMc9puTNJc61us3aD9laTQe2KTcn/@public.gmane.org> @ 2015-01-13 11:08 ` Wodkowski, PawelX 0 siblings, 0 replies; 5+ messages in thread From: Wodkowski, PawelX @ 2015-01-13 11:08 UTC (permalink / raw) To: Vlad Zolotarov, Jastrzebski, MichalX K, dev-VfR2kkLFssw@public.gmane.org > -----Original Message----- > From: dev [mailto:dev-bounces-VfR2kkLFssw@public.gmane.org] On Behalf Of Vlad Zolotarov > Sent: Tuesday, January 13, 2015 11:16 AM > To: Jastrzebski, MichalX K; dev-VfR2kkLFssw@public.gmane.org > Subject: Re: [dpdk-dev] [PATCH 2/2] testpmd: fix dcb in vt mode > > > On 01/12/15 17:50, Michal Jastrzebski wrote: > > From: Pawel Wodkowski <pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> > > > > This patch incorporate fixes to support DCB in SRIOV mode for testpmd. > > It also clean up some old code that is not needed or wrong. > > The same here: could u, pls., separate the "cleanup" part of the patch > from the "fixes" part into separate patches? > Maybe little confusion I introduced by saying cleanups. Some code became obsolete (like enum dcb_mode_enable) when I fixed DCV in VT mode, so removing those parts I called "cleanups". Please consider them to be a fixes. Pawel ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-01-13 11:08 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-01-12 14:44 [PATCH 2/2] testpmd: fix dcb in vt mode Michal Jastrzebski [not found] ` <6c3329$jtfsjp-zyQnk7H6ZEMSgA9wuWY2vVDQ4js95KgL@public.gmane.org> 2015-01-12 15:46 ` Jastrzebski, MichalX K -- strict thread matches above, loose matches on Subject: below -- 2015-01-12 15:50 [PATCH 0/2] Enable DCB in SRIOV mode for ixgbe driver Michal Jastrzebski [not found] ` <1421077843-8492-1-git-send-email-michalx.k.jastrzebski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> 2015-01-12 15:50 ` [PATCH 2/2] testpmd: fix dcb in vt mode Michal Jastrzebski [not found] ` <1421077843-8492-3-git-send-email-michalx.k.jastrzebski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> 2015-01-13 10:15 ` Vlad Zolotarov [not found] ` <54B4F05A.90006-RmZWMc9puTNJc61us3aD9laTQe2KTcn/@public.gmane.org> 2015-01-13 11:08 ` Wodkowski, PawelX
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).