From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from aserp2130.oracle.com ([141.146.126.79]:44726 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751901AbeCPQVc (ORCPT ); Fri, 16 Mar 2018 12:21:32 -0400 Subject: Re: [PATCH v2 07/15] ice: Add support for VSI allocation and deallocation To: Anirudh Venkataramanan , intel-wired-lan@lists.osuosl.org Cc: netdev@vger.kernel.org References: <20180315234802.31336-1-anirudh.venkataramanan@intel.com> <20180315234802.31336-8-anirudh.venkataramanan@intel.com> From: Shannon Nelson Message-ID: Date: Fri, 16 Mar 2018 09:21:27 -0700 MIME-Version: 1.0 In-Reply-To: <20180315234802.31336-8-anirudh.venkataramanan@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org List-ID: On 3/15/2018 4:47 PM, Anirudh Venkataramanan wrote: > This patch introduces data structures and functions to alloc/free > VSIs. The driver represents a VSI using the ice_vsi structure. > > Some noteworthy points about VSI allocation: > > 1) A VSI is allocated in the firmware using the "add VSI" admin queue > command (implemented as ice_aq_add_vsi). The firmware returns an > identifier for the allocated VSI. The VSI context is used to program > certain aspects (loopback, queue map, etc.) of the VSI's configuration. > > 2) A VSI is deleted using the "free VSI" admin queue command (implemented > as ice_aq_free_vsi). > > 3) The driver represents a VSI using struct ice_vsi. This is allocated > and initialized as part of the ice_vsi_alloc flow, and deallocated > as part of the ice_vsi_delete flow. > > 4) Once the VSI is created, a netdev is allocated and associated with it. > The VSI's ring and vector related data structures are also allocated > and initialized. > > 5) A VSI's queues can either be contiguous or scattered. To do this, the > driver maintains a bitmap (vsi->avail_txqs) which is kept in sync with > the firmware's VSI queue allocation imap. If the VSI can't get a > contiguous queue allocation, it will fallback to scatter. This is > implemented in ice_vsi_get_qs which is called as part of the VSI setup > flow. In the release flow, the VSI's queues are released and the bitmap > is updated to reflect this by ice_vsi_put_qs. > > CC: Shannon Nelson > Signed-off-by: Anirudh Venkataramanan > --- > v2: Addressed Shannon Nelson's comments by > 1) using a new define ICE_NO_VSI instead of the magic number 0xffff. > 2) adding missing curly braces and break statements. > > Also, ice_set_def_vsi_ctx was changed to ice_set_dflt_vsi_ctx for clarity. Thanks, sln Acked-by: Shannon Nelson