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

Signed-off-by: Pawel Wodkowski <pawelx.wodkowski at intel.com>
---
 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

Reply via email to