Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp866925ybk; Wed, 20 May 2020 14:10:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxaWA3WDL81p37ht+qYPHWTM4qbe6djySBYr73JW3KbXGyawU584gvTNef3z3zyymwugjk+ X-Received: by 2002:a17:906:4e87:: with SMTP id v7mr804742eju.431.1590009024865; Wed, 20 May 2020 14:10:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590009024; cv=none; d=google.com; s=arc-20160816; b=AVkacerWQcn7H9+03MoGnSnPerd4RBf3ZBNVFJ73/zJtbo8G9msaT38H77/qqsRTHa jYy8QL+Q0bSrP0XeTaijPeuBmUJ35NTQjyaCh9O9ZFgG2ck0JCwv87upv6d+H6unDi7P pSSIIJqBEohNL0XhIE+I7edSrvyOm71gHbO4gkL05EOjOzs5XN5kEyj8q/Tridx4IoLt izbqIPZYwd85Rig5lWgYedsIjc1bHtN0d3sz8pAia4Dt1XwnGaqzyrZI8VdkFH6sDlna yL8nioIEGPqxIuMYNYT/i+O2+eBJZ+yTaoRgGavV5GzSR4U9lQJIFHKNw3lJBEAi09xs AJIQ== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=lWXzQrPFR9Lcw+5SW4hwIaU2PgvaZO2VHf6mCuF6GT8=; b=l73R2y5lGk9e+9wqEs23xAOwW9g6/5rD5xD8Sz05OmhzPGERCIP+IL9E5azU/++uSW cys6iEu3h5q9TabPkTGSgPcT+9ZVh6mwzpDExQssj8XQo1Hd78xhQbzGSXKOQ9EZtlUS Lsiedvf1/i9lyoACiE/aG5PQRWD0rfVyonTlTpf7L15L3/zr45g/hPWDxSC+GrLc9CP1 OzKoME3Gh4rtwhBSV7BvnsoNHZW1eIdCr2K+xIVDZJ4LiVg/pjRx9kNqn9cU5BRkZNDv YyvgR0F2D8U+9qmt1jXPX9wL01Br8wZagQ0X3Wewl3vz0yStfaskeCAq1K09+B3eLOVy BF9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HX47MK5o; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id la1si2332709ejb.235.2020.05.20.14.10.02; Wed, 20 May 2020 14:10:24 -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; dkim=pass header.i=@kernel.org header.s=default header.b=HX47MK5o; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728299AbgETVGU (ORCPT + 99 others); Wed, 20 May 2020 17:06:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:33396 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727083AbgETVGU (ORCPT ); Wed, 20 May 2020 17:06:20 -0400 Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (unknown [163.114.132.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 25925207E8; Wed, 20 May 2020 21:06:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590008779; bh=mktoGDJQC/fAa97P3VOHLea8UoOhJlAvmqvYbVJFscE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=HX47MK5oOBict8yLT59bQJghOiHzwvgpFJdeyaOY3EwTej10p7dzPjGKR3m+XTxKM kc56F/fnmKO4n51HvcIlzFauJcGO+ESvcYSPrMcrc3L+JYBMd9OfGshOg45xBpG9Bp Mc3dMtW1mgo+QDRQSCZBT/ih8W5imzgBrBwzzw04= Date: Wed, 20 May 2020 14:06:17 -0700 From: Jakub Kicinski To: Huazhong Tan Cc: , , , , , , GuoJia Liao Subject: Re: [PATCH net-next 1/2] net: hns3: adds support for dynamic VLAN mode Message-ID: <20200520140617.6d8338bf@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <1589937613-40545-2-git-send-email-tanhuazhong@huawei.com> References: <1589937613-40545-1-git-send-email-tanhuazhong@huawei.com> <1589937613-40545-2-git-send-email-tanhuazhong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). > 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