From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 53A1B6CB4 for ; Sun, 5 Mar 2017 12:42:27 +0100 (CET) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Mar 2017 03:42:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,247,1484035200"; d="scan'208";a="72389883" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.254.188.125]) ([10.254.188.125]) by fmsmga005.fm.intel.com with ESMTP; 05 Mar 2017 03:42:23 -0800 To: Qi Zhang , jing.d.chen@intel.com References: <20170303031727.461-1-qi.z.zhang@intel.com> <20170303031727.461-11-qi.z.zhang@intel.com> Cc: helin.zhang@intel.com, dev@dpdk.org From: Ferruh Yigit Message-ID: <5883b2cf-bf1d-2300-810b-e58a85342d9f@intel.com> Date: Sun, 5 Mar 2017 11:42:22 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <20170303031727.461-11-qi.z.zhang@intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 10/17] net/fm10k/base: improve VF's multi-bit VLAN update requests X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Mar 2017 11:42:27 -0000 On 3/3/2017 3:17 AM, Qi Zhang wrote: > The VF uses a multi-bit update request to clear unused VLANs whenever it > resets. However, an accident in a previous refector broke multi-bit s/refector/refactor > updates for VFs, due to misreading a comment in fm10k_vf.c and > attempting to reduce code duplication. The problem occurs because > a multi-bit request has a non-zero length, and the PF would simply drop > any request with the upper 16 bits set. In addition, a multi-bit vlan > update does not have a concept for "VLAN 0" as the single bit update > does. > > A previous revision of this patch resolved the issue by simply removing > the upper 16 bit check and the iov_select_vid checks. However, this would > remove the checks for default VID and for ensuring no other VLANs can be > enabled except pf_vid when it has been set. To resolve that issue, this > revision uses the iov_select_vid when we have a single-bit update, and > denies any multi-bit update when the VLAN was administratively set by > the PF. This should be ok since the PF properly updates VLAN_TABLE when > it assigns the PF vid. This ensures that requests to add or "remove" the > PF vid work as expected, but a rogue VF could not use the multi-bit > update as a loophole to attempt receiving traffic on other VLANs. > > Signed-off-by: Qi Zhang <...>