From: Ferruh Yigit Subject: Re: [PATCH 10/17] net/fm10k/base: improve VF's multi-bit VLAN update requests Date: Sun, 5 Mar 2017 11:42:22 +0000 Message-ID: <5883b2cf-bf1d-2300-810b-e58a85342d9f@intel.com> References: <20170303031727.461-1-qi.z.zhang@intel.com> <20170303031727.461-11-qi.z.zhang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: helin.zhang@intel.com, dev@dpdk.org To: Qi Zhang , jing.d.chen@intel.com 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) In-Reply-To: <20170303031727.461-11-qi.z.zhang@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 <...>