dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
From: Pawel Wodkowski <pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: dev-VfR2kkLFssw@public.gmane.org
Subject: [PATCH v3 1/2] pmd: enable DCB in SRIOV
Date: Tue, 17 Feb 2015 17:19:45 +0100	[thread overview]
Message-ID: <1424189986-26219-2-git-send-email-pawelx.wodkowski@intel.com> (raw)
In-Reply-To: <1424189986-26219-1-git-send-email-pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

This patch enables DCB in SRIOV mode for ixgbe (Niantic) driver.

Signed-off-by: Pawel Wodkowski <pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
 lib/librte_pmd_ixgbe/ixgbe_ethdev.c |  2 +-
 lib/librte_pmd_ixgbe/ixgbe_pf.c     | 19 ++++++++++---------
 lib/librte_pmd_ixgbe/ixgbe_rxtx.c   |  7 +++----
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
index 412bab2..7e7434d 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
+++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
@@ -1514,7 +1514,7 @@ ixgbe_dev_configure(struct rte_eth_dev *dev)
 		if (conf->nb_queue_pools != ETH_16_POOLS &&
 			   conf->nb_queue_pools != ETH_32_POOLS) {
 			PMD_INIT_LOG(ERR, " VMDQ+DCB selected, "
-					"number of TX qqueue pools must be %d or %d\n",
+					"number of TX queue pools must be %d or %d\n",
 					ETH_16_POOLS, ETH_32_POOLS);
 			return (-EINVAL);
 		}
diff --git a/lib/librte_pmd_ixgbe/ixgbe_pf.c b/lib/librte_pmd_ixgbe/ixgbe_pf.c
index 255c996..8411445 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_pf.c
+++ b/lib/librte_pmd_ixgbe/ixgbe_pf.c
@@ -137,7 +137,7 @@ int ixgbe_pf_host_init(struct rte_eth_dev *eth_dev)
 
 
 /*
- * Functin that make SRIOV configuration, based on device configuration,
+ * Function that make SRIOV configuration, based on device configuration,
  * number of requested queues and number of VF created.
  * Function returns:
  * 1 - SRIOV is not enabled (no VF created)
@@ -191,7 +191,7 @@ ixgbe_pf_configure_mq_sriov(struct rte_eth_dev *dev)
 		break;
 	case ETH_MQ_RX_RSS:
 		PMD_INIT_LOG(INFO, " RSS (SRIOV active) mode, "
-				"Rx mq mode is changed from:"
+				"Rx mq mode is changed from "
 				"mq_mode %u into VMDQ mq_mode %u\n",
 				dev_conf->rxmode.mq_mode,
 				dev->data->dev_conf.rxmode.mq_mode);
@@ -295,7 +295,7 @@ ixgbe_pf_configure_mq_sriov(struct rte_eth_dev *dev)
 
 	/* Check if available queus count is not less than allocated.*/
 	if (dev->data->nb_rx_queues > sriov->nb_rx_q_per_pool ||
-			dev->data->nb_rx_queues > sriov->nb_tx_q_per_pool) {
+			dev->data->nb_tx_queues > sriov->nb_tx_q_per_pool) {
 		PMD_INIT_LOG(ERR, "SRIOV active, "
 				"rx/tx queue number must less or equal to %d/%d\n",
 				sriov->nb_rx_q_per_pool, sriov->nb_tx_q_per_pool);
@@ -305,7 +305,6 @@ ixgbe_pf_configure_mq_sriov(struct rte_eth_dev *dev)
 	return 0;
 }
 
-
 int ixgbe_pf_host_configure(struct rte_eth_dev *eth_dev)
 {
 	uint32_t vtctl, fcrth;
@@ -659,7 +658,9 @@ ixgbe_get_vf_queues(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)
 {
 	struct ixgbe_vf_info *vfinfo =
 		*IXGBE_DEV_PRIVATE_TO_P_VFDATA(dev->data->dev_private);
-	uint32_t default_q = vf * RTE_ETH_DEV_SRIOV(dev).nb_tx_q_per_pool;
+	struct ixgbe_dcb_config *dcbinfo =
+		IXGBE_DEV_PRIVATE_TO_DCB_CFG(dev->data->dev_private);
+	uint32_t default_q = RTE_ETH_DEV_SRIOV(dev).def_pool_q_idx;
 
 	/* Verify if the PF supports the mbox APIs version or not */
 	switch (vfinfo[vf].api_version) {
@@ -677,10 +678,10 @@ ixgbe_get_vf_queues(struct rte_eth_dev *dev, uint32_t vf, uint32_t *msgbuf)
 	/* Notify VF of default queue */
 	msgbuf[IXGBE_VF_DEF_QUEUE] = default_q;
 
-	/*
-	 * FIX ME if it needs fill msgbuf[IXGBE_VF_TRANS_VLAN]
-	 * for VLAN strip or VMDQ_DCB or VMDQ_DCB_RSS
-	 */
+	if (dcbinfo->num_tcs.pg_tcs)
+		msgbuf[IXGBE_VF_TRANS_VLAN] = dcbinfo->num_tcs.pg_tcs;
+	else
+		msgbuf[IXGBE_VF_TRANS_VLAN] = 1;
 
 	return 0;
 }
diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
index e6766b3..f845bb0 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
@@ -3166,10 +3166,9 @@ void ixgbe_configure_dcb(struct rte_eth_dev *dev)
 
 	/* check support mq_mode for DCB */
 	if ((dev_conf->rxmode.mq_mode != ETH_MQ_RX_VMDQ_DCB) &&
-	    (dev_conf->rxmode.mq_mode != ETH_MQ_RX_DCB))
-		return;
-
-	if (dev->data->nb_rx_queues != ETH_DCB_NUM_QUEUES)
+	    (dev_conf->rxmode.mq_mode != ETH_MQ_RX_DCB) &&
+	    (dev_conf->txmode.mq_mode != ETH_MQ_TX_VMDQ_DCB) &&
+	    (dev_conf->txmode.mq_mode != ETH_MQ_TX_DCB))
 		return;
 
 	/** Configure DCB hardware **/
-- 
1.9.1

  parent reply	other threads:[~2015-02-17 16:19 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-29 11:50 [PATCH 0/2] new headroom stats library and example application Pawel Wodkowski
     [not found] ` <1422532206-10662-1-git-send-email-pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-01-29 11:50   ` [PATCH 1/2] librte_headroom: New library for checking core/system/app load Pawel Wodkowski
2015-01-29 11:50   ` [PATCH 2/2] examples: introduce new l2fwd-headroom example Pawel Wodkowski
2015-01-29 13:25   ` [PATCH 0/2] new headroom stats library and example application Neil Horman
     [not found]     ` <20150129132522.GA1999-B26myB8xz7F8NnZeBjwnZQMhkBWG/bsMQH7oEaQurus@public.gmane.org>
2015-01-29 17:10       ` Wodkowski, PawelX
     [not found]         ` <F6F2A6264E145F47A18AB6DF8E87425D12B8F749-kPTMFJFq+rFP9JyJpTNKArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-01-29 19:13           ` Neil Horman
     [not found]             ` <20150129191326.GF1999-B26myB8xz7F8NnZeBjwnZQMhkBWG/bsMQH7oEaQurus@public.gmane.org>
2015-01-30 10:47               ` Wodkowski, PawelX
     [not found]                 ` <F6F2A6264E145F47A18AB6DF8E87425D12B8FD9E-kPTMFJFq+rFP9JyJpTNKArfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-01-30 18:02                   ` Neil Horman
2015-02-17 15:37   ` [PATCH v2 " Pawel Wodkowski
     [not found]     ` <1424187473-25853-1-git-send-email-pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-02-17 15:37       ` [PATCH v2 1/2] librte_headroom: New library for checking core/system/app load Pawel Wodkowski
2015-02-17 15:37       ` [PATCH v2 2/2] examples: introduce new l2fwd-headroom example Pawel Wodkowski
2015-02-17 16:19       ` [PATCH v3 0/2] new headroom stats library and example application Pawel Wodkowski
     [not found]         ` <1424189986-26219-1-git-send-email-pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-02-17 16:19           ` Pawel Wodkowski [this message]
2015-02-17 16:19           ` [PATCH v3 2/2] tespmd: fix DCB in SRIOV mode support Pawel Wodkowski
2015-02-17 16:33           ` [PATCH v3 0/2] new headroom stats library and example application Wodkowski, PawelX
2015-02-17 16:42           ` [PATCH v4 " Pawel Wodkowski
     [not found]             ` <1424191340-26451-1-git-send-email-pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-02-17 16:42               ` [PATCH v4 1/2] librte_headroom: New library for checking core/system/app load Pawel Wodkowski
     [not found]                 ` <1424191340-26451-2-git-send-email-pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-02-18 13:36                   ` De Lara Guarch, Pablo
2015-02-17 16:42               ` [PATCH v4 2/2] examples: introduce new l2fwd-headroom example Pawel Wodkowski
     [not found]                 ` <1424191340-26451-3-git-send-email-pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-02-18 13:41                   ` De Lara Guarch, Pablo
2015-02-19 12:18               ` [PATCH v5 0/3] new headroom stats library and example application Pawel Wodkowski
     [not found]                 ` <1424348324-29932-1-git-send-email-pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-02-19 12:18                   ` [PATCH v5 1/3] librte_headroom: New library for checking core/system/app load Pawel Wodkowski
     [not found]                     ` <1424348324-29932-2-git-send-email-pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-02-24  1:55                       ` Thomas Monjalon
2015-02-19 12:18                   ` [PATCH v5 2/3] examples: introduce new l2fwd-headroom example Pawel Wodkowski
2015-02-19 12:18                   ` [PATCH v5 3/3] MAINTAINERS: claim responsibility for headroom library and example app Pawel Wodkowski
2015-02-19 14:33                   ` [PATCH v5 0/3] new headroom stats library and example application Neil Horman
     [not found]                     ` <20150219143334.GH24069-B26myB8xz7F8NnZeBjwnZQMhkBWG/bsMQH7oEaQurus@public.gmane.org>
2015-02-20 15:46                       ` Jastrzebski, MichalX K
     [not found]                         ` <60ABE07DBB3A454EB7FAD707B4BB1582138EB174-kPTMFJFq+rHjxeytcECX8bfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-02-23 11:45                           ` Thomas Monjalon
2015-02-23 14:36                             ` Jastrzebski, MichalX K
     [not found]                               ` <60ABE07DBB3A454EB7FAD707B4BB1582138EB996-kPTMFJFq+rHjxeytcECX8bfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-02-23 14:46                                 ` Thomas Monjalon
2015-02-23 15:55                                   ` Jastrzebski, MichalX K
     [not found]                                     ` <60ABE07DBB3A454EB7FAD707B4BB1582138EBA65-kPTMFJFq+rHjxeytcECX8bfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-02-23 16:04                                       ` Thomas Monjalon
2015-02-24  8:44                                         ` Pawel Wodkowski
2015-02-24  9:49                                   ` Jastrzebski, MichalX K
     [not found]                                     ` <60ABE07DBB3A454EB7FAD707B4BB1582138EBD9C-kPTMFJFq+rHjxeytcECX8bfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-02-24 10:00                                       ` Thomas Monjalon
2015-02-24 10:05                                         ` Wodkowski, PawelX
2015-02-24 10:53                                         ` Wodkowski, PawelX
2015-02-24 16:33                   ` [PATCH v6 0/3] new rte_jobstats " Pawel Wodkowski
     [not found]                     ` <1424795605-2779-1-git-send-email-pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-02-24 16:33                       ` [PATCH v6 1/3] librte_jobstats: New library for checking core/system/app load Pawel Wodkowski
     [not found]                         ` <1424795605-2779-2-git-send-email-pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-02-24 21:18                           ` Thomas Monjalon
2015-02-24 16:33                       ` [PATCH v6 2/3] examples: introduce new l2fwd-jobstats example Pawel Wodkowski
     [not found]                         ` <1424795605-2779-3-git-send-email-pawelx.wodkowski-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-02-24 19:10                           ` De Lara Guarch, Pablo
     [not found]                             ` <E115CCD9D858EF4F90C690B0DCB4D897272639F7-kPTMFJFq+rEMvF1YICWikbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-02-24 19:16                               ` De Lara Guarch, Pablo
     [not found]                                 ` <E115CCD9D858EF4F90C690B0DCB4D89727263A28-kPTMFJFq+rEMvF1YICWikbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-02-24 20:08                                   ` Thomas Monjalon
2015-02-24 21:19                           ` Thomas Monjalon
2015-02-24 16:33                       ` [PATCH v6 3/3] MAINTAINERS: claim responsibility for rte_jobstats library and example app Pawel Wodkowski
2015-02-24 20:34                       ` [PATCH v6 0/3] new rte_jobstats library and example application De Lara Guarch, Pablo
     [not found]                         ` <E115CCD9D858EF4F90C690B0DCB4D89727263A8E-kPTMFJFq+rEMvF1YICWikbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-02-24 21:25                           ` Thomas Monjalon

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=1424189986-26219-2-git-send-email-pawelx.wodkowski@intel.com \
    --to=pawelx.wodkowski-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    /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).