DPDK patches and discussions
 help / color / mirror / Atom feed
From: Vlad Zolotarov <vladz@cloudius-systems.com>
To: Michal Jastrzebski <michalx.k.jastrzebski@intel.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 2/2] testpmd: fix dcb in vt mode
Date: Tue, 13 Jan 2015 12:15:54 +0200	[thread overview]
Message-ID: <54B4F05A.90006@cloudius-systems.com> (raw)
In-Reply-To: <1421077843-8492-3-git-send-email-michalx.k.jastrzebski@intel.com>


On 01/12/15 17:50, Michal Jastrzebski wrote:
> From: Pawel Wodkowski <pawelx.wodkowski@intel.com>
>
> 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@intel.com>
> ---
>   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;

  reply	other threads:[~2015-01-13 10:15 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-12 15:50 [dpdk-dev] [PATCH 0/2] Enable DCB in SRIOV mode for ixgbe driver Michal Jastrzebski
2015-01-12 15:50 ` [dpdk-dev] [PATCH 1/2] pmd: add DCB for VF for ixgbe Michal Jastrzebski
2015-01-13 10:14   ` Vlad Zolotarov
2015-01-13 11:00     ` Wodkowski, PawelX
2015-01-14  1:00     ` Ouyang, Changchun
2015-01-12 15:50 ` [dpdk-dev] [PATCH 2/2] testpmd: fix dcb in vt mode Michal Jastrzebski
2015-01-13 10:15   ` Vlad Zolotarov [this message]
2015-01-13 11:08     ` Wodkowski, PawelX
2015-01-13  9:50 ` [dpdk-dev] [PATCH 0/2] Enable DCB in SRIOV mode for ixgbe driver Wodkowski, PawelX
2015-01-13 10:11 ` Vlad Zolotarov
2015-01-19 13:02 ` [dpdk-dev] [PATCH v2 0/4] " Pawel Wodkowski
2015-01-19 13:02   ` [dpdk-dev] [PATCH v2 1/4] ethdev: Allow zero rx/tx queues in SRIOV mode Pawel Wodkowski
2015-01-19 13:02   ` [dpdk-dev] [PATCH v2 2/4] ethdev: prevent changing of nb_q_per_pool in rte_eth_dev_check_mq_mode() Pawel Wodkowski
2015-01-20  1:32     ` Ouyang, Changchun
2015-01-20  9:09       ` Wodkowski, PawelX
2015-01-19 13:02   ` [dpdk-dev] [PATCH v2 3/4] pmd: add support for DCB in SRIOV mode for ixgbe driver Pawel Wodkowski
2015-01-20  1:56     ` Ouyang, Changchun
2015-01-20  6:52     ` Thomas Monjalon
2015-01-19 13:02   ` [dpdk-dev] [PATCH v2 4/4] testpmd: fix dcb in vt mode Pawel Wodkowski
2015-02-19 15:54   ` [dpdk-dev] [PATCH v4 0/7] Enable DCB in SRIOV mode for ixgbe driver Pawel Wodkowski
2015-02-19 15:54     ` [dpdk-dev] [PATCH v4 1/7] ethdev: Allow zero rx/tx queues in SRIOV mode Pawel Wodkowski
2015-02-19 15:54     ` [dpdk-dev] [PATCH v4 2/7] pmd igb: fix VMDQ mode checking Pawel Wodkowski
2015-02-19 15:54     ` [dpdk-dev] [PATCH v4 3/7] pmd: igb/ixgbe split nb_q_per_pool to rx and tx nb_q_per_pool Pawel Wodkowski
2015-02-25  3:24       ` Ouyang, Changchun
2015-02-25  7:47         ` Pawel Wodkowski
2015-02-19 15:54     ` [dpdk-dev] [PATCH v4 4/7] move rte_eth_dev_check_mq_mode() logic to driver Pawel Wodkowski
2015-02-25  6:14       ` Ouyang, Changchun
2015-02-25  9:57         ` Pawel Wodkowski
2015-06-09  4:06       ` Wu, Jingjing
2015-02-19 15:54     ` [dpdk-dev] [PATCH v4 5/7] pmd ixgbe: enable DCB in SRIOV Pawel Wodkowski
2015-02-25  3:36       ` Ouyang, Changchun
2015-02-25 11:29         ` Pawel Wodkowski
2015-02-19 15:54     ` [dpdk-dev] [PATCH v4 6/7] tespmd: fix DCB in SRIOV mode support Pawel Wodkowski
2015-02-19 15:54     ` [dpdk-dev] [PATCH v4 7/7] pmd ixgbe: fix vlan setting in in PF Pawel Wodkowski
2015-06-08  3:00     ` [dpdk-dev] [PATCH v4 0/7] Enable DCB in SRIOV mode for ixgbe driver Zhang, Helin
  -- strict thread matches above, loose matches on Subject: below --
2015-01-12 14:44 [dpdk-dev] [PATCH 2/2] testpmd: fix dcb in vt mode Michal Jastrzebski
2015-01-12 15:46 ` Jastrzebski, MichalX K

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54B4F05A.90006@cloudius-systems.com \
    --to=vladz@cloudius-systems.com \
    --cc=dev@dpdk.org \
    --cc=michalx.k.jastrzebski@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).