From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) by dpdk.org (Postfix) with ESMTP id D7AA358D5 for ; Mon, 21 Oct 2013 10:35:15 +0200 (CEST) Received: by mail-wg0-f45.google.com with SMTP id z12so6204555wgg.12 for ; Mon, 21 Oct 2013 01:36:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:organization:to:subject:date:user-agent:cc :references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=UGdXDdWpsGRmRDifBfILvLGulVNJ7175f21hH7xdctY=; b=KABDoMsyyG56LGNJ+M54kRzfwQrOfJC9ACRlk+9gRCE2zviuVg73h1wWEbi2N5lLKO vSQ28pHBzZh6hxGe/lIZ3y3YdP/UqsRjYen3K3ZsFQtjWKA6wOggZv80MlJlTk/5932D bhvH3u/gmSlK7wdjuRvq+WeP6MG768rzrdJBcsnWFG/PYNMj6KO1yehNDcg3lvXBCND0 JALocynSl2L9Sxnj3P/ZYO488XirBAICL4JizJkdiBl7kJJZo/et2C/3pBpSTpZyUrqX xEn4o8RMRaf7qIlbQdXcc/zw+mvb8V2zZMZXha2eFsgzrvQPrLExyB1mz9uDBvp8c5B3 PRTQ== X-Gm-Message-State: ALoCoQnuy6UPzGhprhhbjqhJeoQ1p14rUTUzL48IeDf97S3p4ejplNgp0RzkxkseZtLC7BpbcBPu X-Received: by 10.180.98.228 with SMTP id el4mr8971984wib.4.1382344564151; Mon, 21 Oct 2013 01:36:04 -0700 (PDT) Received: from angus.localnet (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id q3sm21790906wib.5.2013.10.21.01.36.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Oct 2013 01:36:03 -0700 (PDT) From: Thomas Monjalon Organization: 6WIND To: Qinglai Xiao Date: Mon, 21 Oct 2013 10:36:01 +0200 User-Agent: KMail/1.13.7 (Linux/3.2.0-4-amd64; KDE/4.8.4; x86_64; ; ) References: <1382339384-44601-1-git-send-email-jigsaw@gmail.com> In-Reply-To: <1382339384-44601-1-git-send-email-jigsaw@gmail.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201310211036.01561.thomas.monjalon@6wind.com> Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] ixgbe 82599: Query assignment of queues to Virtual Function. X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2013 08:35:16 -0000 Hi, 21/10/2013 09:09, Qinglai Xiao : > 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 > --- Thanks for the patch, your comments are clear. > +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++; > + } > +} I have comments about the mbox API: 1) Why not call directly ixgbevf_negotiate_api_version for ixgbe_mbox_api_11 only ? It seems that only version 1.1 supports ixgbevf_get_queues. 2) If a loop is still needed, why not use a simple "for loop" ? 3) If ixgbevf_negotiate_api is still needed, I'd prefer to have "_mbx" in its name. Thank you -- Thomas