From: Qinglai Xiao <jigsaw-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: dev-VfR2kkLFssw@public.gmane.org
Subject: [PATCH] ixgbe 82599: Query assignment of queues to Virtual Function.
Date: Mon, 21 Oct 2013 10:09:44 +0300 [thread overview]
Message-ID: <1382339384-44601-1-git-send-email-jigsaw@gmail.com> (raw)
Physical Function assignes Tx/Rx queues to each VF 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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
index f217564..991e1b3 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
+++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
@@ -750,6 +750,34 @@ eth_ixgbe_dev_init(__attribute__((unused)) struct eth_driver *eth_drv,
return 0;
}
+static void ixgbevf_negotiate_api(struct ixgbe_hw *hw)
+{
+ int api[] = { ixgbe_mbox_api_11,
+ ixgbe_mbox_api_10,
+ ixgbe_mbox_api_unknown };
+ int err = 0, idx = 0;
+
+ while (api[idx] != ixgbe_mbox_api_unknown) {
+ err = ixgbevf_negotiate_api_version(hw, api[idx]);
+ if (!err)
+ break;
+ idx++;
+ }
+}
+
+static void ixgbevf_get_queue_num(struct ixgbe_hw *hw)
+{
+ /* Traffic classes are not supported by now */
+ unsigned int tcs, tc;
+
+ /*
+ * In case that PF fails to provide Rx/Tx queue number,
+ * max_tx_queues and max_rx_queues remain to be 1.
+ */
+ ixgbevf_get_queues(hw, &tcs, &tc);
+}
+
+
/*
* Virtual Function device init
*/
@@ -818,6 +846,10 @@ 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_negotiate_api(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);
--
1.7.1
next reply other threads:[~2013-10-21 7:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-21 7:09 Qinglai Xiao [this message]
[not found] ` <1382339384-44601-1-git-send-email-jigsaw-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-10-21 8:36 ` [PATCH] ixgbe 82599: Query assignment of queues to Virtual Function Thomas Monjalon
[not found] ` <201310211036.01561.thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2013-10-21 11:28 ` jigsaw
[not found] ` <CAHVfvh79jQp5jUTPYHtuKf7WprMu86daa-cd8c0ffpuwMbtCrA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-10-21 13:04 ` Thomas Monjalon
[not found] ` <201310211504.59791.thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2013-10-21 13:32 ` jigsaw
-- strict thread matches above, loose matches on Subject: below --
2013-10-21 14:11 Qinglai Xiao
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=1382339384-44601-1-git-send-email-jigsaw@gmail.com \
--to=jigsaw-re5jqeeqqe8avxtiumwx3w@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.