From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ie0-x232.google.com (mail-ie0-x232.google.com [IPv6:2607:f8b0:4001:c03::232]) by dpdk.org (Postfix) with ESMTP id 5C78F58D0 for ; Mon, 21 Oct 2013 13:27:52 +0200 (CEST) Received: by mail-ie0-f178.google.com with SMTP id to1so15400476ieb.9 for ; Mon, 21 Oct 2013 04:28:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=B7Lj8rZHaPmQ5TDMLmgO51PDaF5/+3B0/IF1pD59law=; b=jdMc1w/M4QcpyMLn4boWozViFw4/mJ/lEAAnP7OKLF47SO5BzuujfWVMyPzziNFKjF 0Pm+xPvLxCOYq3rPsHrAyoaqwwZKMTlJnh44m8AI90v72Mu1oiOSJCgDOevKTy9vgw1T uLww6Qh44qUVxKqHKQ8zQFg+5isfZfm0Ne4sspJPCxd8+wk6NIJPG0P0UQjHaSYexXJ0 jqjrY3xbGUUKn1mM0zsOWW6lE4z+d9SBp7iyegQVvFWAyadHSYBLxPSFiSEng7TIprSy XZpigaWp3ZQg2/KcAnIF3oQLvfUZ1Fu2JeErNixlih3JZukEGqWRSH3lqmQ8rmp2LM2G sdPw== MIME-Version: 1.0 X-Received: by 10.50.73.66 with SMTP id j2mr9038100igv.1.1382354920544; Mon, 21 Oct 2013 04:28:40 -0700 (PDT) Received: by 10.42.67.205 with HTTP; Mon, 21 Oct 2013 04:28:40 -0700 (PDT) In-Reply-To: <201310211036.01561.thomas.monjalon@6wind.com> References: <1382339384-44601-1-git-send-email-jigsaw@gmail.com> <201310211036.01561.thomas.monjalon@6wind.com> Date: Mon, 21 Oct 2013 14:28:40 +0300 Message-ID: From: jigsaw To: Thomas Monjalon Content-Type: text/plain; charset=ISO-8859-1 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 11:27:52 -0000 Hi Thomas, Thanks for comment. The ixgbevf_negotiate_api is copied from Intel's VF driver. The while loop is not quite usual, indeed. A direct call to ixgbevf_negotiate_api_version(hw, ixgbe_mbox_api_11) is sufficient, I think. Coz PF is supposed to be satisfied with ver 1.1. I will make another attempt with elimination of ixgbevf_negotiate_api. Any other comment? thx & rgds, -ql On Mon, Oct 21, 2013 at 11:36 AM, Thomas Monjalon wrote: > 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