Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1035191ybk; Wed, 20 May 2020 19:30:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpmVRB2bTEC4bsCJESRXIwCDO5bK7JJ5xjmnsliTKZyls51V0yKGF9gEicjEuWm92lOw1u X-Received: by 2002:aa7:d1ce:: with SMTP id g14mr5915731edp.146.1590028225210; Wed, 20 May 2020 19:30:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590028225; cv=none; d=google.com; s=arc-20160816; b=ETXNz/PbIodut3SW18l/Qvk7TIZZ9LGDIEFrD5v2L5BCYtMjD5FGDSJV5hjcnsUc+o VVd1iFBMLTS7aSKvqXa8THBJ0u+HnXEsscj8HkwYzurAKTYXz5osG7x/X0ZMaXy/KiB4 kCYqJuafWqT2Q3nZBCHceQC13ytL0kP2t0/h4Pq5wyTUcobnCAms/p8K3PezE9vuYpVF d4fvtq5+l7f2DRHUG7ox+8fGo2A4SkqHAARik/wxG+SkZ4WJENPrCE5BmvQpyykvoEfj vO9Qj9FPaZsVsW0hvrRZMiQCabgTqc9X5odzPFkk1diQGLOFiDi3CIzbMOuKQOqBARy+ mAkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=RiHMPK3VD4ELUQAgx7amnDBNB3+A5lP0bW/uE2SSVlA=; b=x4WfHTFjob1akvSfC0jNxxc4ahGxVEv4xUKeuqmddf7semn+hDHrNCgaucS35Bm3XB tjw2ktbWxpsQydWV6rFWpdHPvwDrrTlYoFEwOBvfJGR5AJcIUiKzFrH20PWeTHx3vHBI CZWRQF4dN22LfJrQHu2lJc2dsoR9E8FgiGh3ph12uoKro4UF1k6gW8M5kkcPqd/grtc0 yYpPE/pBfvQJWMCcEj39sjmHpwZKAgrmSwIugjOUa8Z90iG9xSBJeAOMj+y+YwjkBGlI 9d4WD4/A+pZ3lbKGyoJ7omOQLmGF/j0n5sZfnjhVsOd5fmuLSe8OB7A0zoETJHlyB97l Cbkw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a63si2514782ede.399.2020.05.20.19.30.01; Wed, 20 May 2020 19:30:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727958AbgEUC0O (ORCPT + 99 others); Wed, 20 May 2020 22:26:14 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:4876 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726833AbgEUC0N (ORCPT ); Wed, 20 May 2020 22:26:13 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 13751DBF44B0FC6D655D; Thu, 21 May 2020 10:26:11 +0800 (CST) Received: from [127.0.0.1] (10.74.149.191) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Thu, 21 May 2020 10:26:03 +0800 Subject: Re: [PATCH net-next 1/2] net: hns3: adds support for dynamic VLAN mode To: Jakub Kicinski CC: , , , , , , GuoJia Liao References: <1589937613-40545-1-git-send-email-tanhuazhong@huawei.com> <1589937613-40545-2-git-send-email-tanhuazhong@huawei.com> <20200520140617.6d8338bf@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <91bd81dc-5513-f717-559f-b225ab380fbc@huawei.com> <20200520183639.5e82bc09@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> From: tanhuazhong Message-ID: <4875e2a7-b216-3e13-1d80-f32e0e849502@huawei.com> Date: Thu, 21 May 2020 10:26:02 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20200520183639.5e82bc09@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.74.149.191] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/5/21 9:36, Jakub Kicinski wrote: > On Thu, 21 May 2020 09:33:14 +0800 tanhuazhong wrote: >> On 2020/5/21 5:06, Jakub Kicinski wrote: >>> On Wed, 20 May 2020 09:20:12 +0800 Huazhong Tan wrote: >>>> From: GuoJia Liao >>>> >>>> There is a scenario which needs vNICs enable the VLAN filter >>>> in access port, while disable the VLAN filter in trunk port. >>>> Access port and trunk port can switch according to the user's >>>> configuration. >>>> >>>> This patch adds support for the dynamic VLAN mode. then the >>>> HNS3 driver can support two VLAN modes: default VLAN mode and >>>> dynamic VLAN mode. User can switch the mode through the >>>> configuration file. >>> >>> What configuration file? Sounds like you're reimplementing trusted >>> VFs (ndo_set_vf_trust). >>> >> >> Hi, Jakub. >> >> Maybe this configuration file here is a little misleading, >> this VLAN mode is decided by the firmware, the driver will >> query the VLAN mode from firmware during intializing. > > And the FW got that configuration from? > It depends on the user's demand, the user can choose the firmware which supports the default VLAN mode or the dynamic VLAN mode. >> I will modified this description in V2. BTW, is there any >> other suggestion about this patch? > > The other suggestion was to trusted vf. What's the difference between > trusted VF and "dynamic VLAN mode"? > Trust VF is not related to dynamic VLAN mode. So far it's only be used for privilege checking for the VF promisc. And dynamic VLAN mode is designed to adapt specified scenario which want enable/disable VLAN filter base on VLAN used. Thanks. >>>> In default VLAN mode, port based VLAN filter and VF VLAN >>>> filter should always be enabled. >>>> >>>> In dynamic VLAN mode, port based VLAN filter is disabled, and >>>> VF VLAN filter is disabled defaultly, and should be enabled >>>> when there is a non-zero VLAN ID. In addition, VF VLAN filter >>>> is enabled if PVID is enabled for vNIC. >>>> >>>> When enable promisc, VLAN filter should be disabled. When disable >>>> promisc, VLAN filter's status depends on the value of >>>> 'vport->vf_vlan_en', which is used to record the VF VLAN filter >>>> status. >>>> >>>> In default VLAN mode, 'vport->vf_vlan_en' always be 'true', so >>>> VF VLAN filter will set to be enabled after disabling promisc. >>>> >>>> In dynamic VLAN mode, 'vport->vf_vlan_en' lies on whether there >>>> is a non-zero VLAN ID. >>>> >>>> Signed-off-by: GuoJia Liao >>>> Signed-off-by: Huazhong Tan > > > . >