summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorQinglai Xiao <jigsaw@gmail.com>2013-10-21 17:11:14 +0300
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-01-15 18:11:18 +0100
commit5e08d18b0ef5afa6b55614ad4ae25f74787f99e9 (patch)
treeabfa45126764d704fbe2fd9a2ae4282f8131775d /lib
parenta0d491a92af743363546e3319f13e537583b3d56 (diff)
downloaddpdk-5e08d18b0ef5afa6b55614ad4ae25f74787f99e9.zip
dpdk-5e08d18b0ef5afa6b55614ad4ae25f74787f99e9.tar.gz
dpdk-5e08d18b0ef5afa6b55614ad4ae25f74787f99e9.tar.xz
ixgbe: query assignment of VF queues
Physical Function assignes Tx/Rx queues to each Virtual Function according to different schemes[1]. By querying through mailbox, VF is able to get number of Tx/Rx queues assigned to it. Note that current Intel ixgbe driver ixgbe-3.18.7 does not fully support mailbox message IXGBE_VF_GET_QUEUES. The service routine for IXGBE_VF_GET_QUEUES must be fixed, otherwise PF always return 1 as Tx/Rx queue number. [1] See section 7.2.1.2.1, 7.1.2.2 and 7.10.2.7.2 of Intel 82599 10 Gbe Controller Datasheet. Signed-off-by: Qinglai Xiao <jigsaw@gmail.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/librte_pmd_ixgbe/ixgbe_ethdev.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
index 787ed23..7b89944 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
+++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
@@ -771,6 +771,21 @@ eth_ixgbe_dev_init(__attribute__((unused)) struct eth_driver *eth_drv,
return 0;
}
+static void ixgbevf_get_queue_num(struct ixgbe_hw *hw)
+{
+ /* Traffic classes are not supported by now */
+ unsigned int tcs, tc;
+
+ /*
+ * Must let PF know we are at mailbox API version 1.1.
+ * Otherwise PF won't answer properly.
+ * In case that PF fails to provide Rx/Tx queue number,
+ * max_tx_queues and max_rx_queues remain to be 1.
+ */
+ if (!ixgbevf_negotiate_api_version(hw, ixgbe_mbox_api_11))
+ ixgbevf_get_queues(hw, &tcs, &tc);
+}
+
/*
* Virtual Function device init
*/
@@ -839,6 +854,9 @@ eth_ixgbevf_dev_init(__attribute__((unused)) struct eth_driver *eth_drv,
return (diag);
}
+ /* Get Rx/Tx queue count via mailbox, which is ready after reset_hw */
+ ixgbevf_get_queue_num(hw);
+
/* Allocate memory for storing MAC addresses */
eth_dev->data->mac_addrs = rte_zmalloc("ixgbevf", ETHER_ADDR_LEN *
hw->mac.num_rar_entries, 0);