Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp330782pxb; Wed, 13 Jan 2021 04:58:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJxEDpJZ38EWiLpyc7ilqIXWypiAJFsAYpjZ05nPgqCLiq4zpRaFY8rbVNfghAQt5IAU6L6Z X-Received: by 2002:a17:906:4bc5:: with SMTP id x5mr1479885ejv.55.1610542719901; Wed, 13 Jan 2021 04:58:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610542719; cv=none; d=google.com; s=arc-20160816; b=ZG2EAaeHixUHL0vQ2DeDJc/P+JbcYPyYoEuGhGn+4622X6cY0PK1bXBV4refM/YERa YU4VzOv9b0gMJFHh3A/hjrs0eycpwKklzlaq4e7spIfY4EwtDuyy95GXMw174wrjFkEA runNEv8UukfIxrPK2BsYalZkWJzsr8XihhoCnyaHkfPlL6Nk+PRmJQWOne7/CIaEWslI 5+Vk4rlSAWafIjJNrydF5zBlLy6PO28Z7uYScvUXapA2ejaVCH6fbBdALCdSBpLqThUx 9l+7hl1o3YiW7BHyAX5Nq6GDyngoPgOTrUa8muIXqjnz/Q5d/EzMIqiGSm+2Bj9e8gSV j04A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=OMak7N55H45bPgCtRYwzSIEG/+sSSjc2zqqmYa4hl0Y=; b=FbTq90CxvB/u0pbL+iJa3vn9E8VWzVqgSGzrzOIgY6fZmwZEFfoZaQNz8dzt6JBhDI MrI/zL1qNO31kEVpe/qszXvtS6p+hNefRu/WrnKc/obsmvr6r+5wPsPFN8foCA3hGrvY swLRoSzG43YvdpwYSCtHZVZD1L2AUYEe2ZvSHhNQyfs/pJTg/rj8Nczxy8X3HtCbYs/U m9U4DYHqGJWDL/YMAHeibrCHVWVA1s9TmXTHwkhMiCypxnvWDZzlBnW5kXDd9AKxYGTJ +V1aJa2pCOTOrh4BOhMETqvBxFOLTFg+wCuHlc6FCjhLV/zt5/5KqTUeGZWiPH0KQEq/ UMYA== 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 h13si934171ejx.477.2021.01.13.04.58.16; Wed, 13 Jan 2021 04:58:39 -0800 (PST) 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 S1727287AbhAMM4E (ORCPT + 99 others); Wed, 13 Jan 2021 07:56:04 -0500 Received: from mail.savoirfairelinux.com ([208.88.110.44]:39116 "EHLO mail.savoirfairelinux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727172AbhAMMzu (ORCPT ); Wed, 13 Jan 2021 07:55:50 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 2C1899C0DCF; Wed, 13 Jan 2021 07:45:38 -0500 (EST) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 7nsceJMoUmDn; Wed, 13 Jan 2021 07:45:37 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id C8E0E9C0DCB; Wed, 13 Jan 2021 07:45:37 -0500 (EST) X-Virus-Scanned: amavisd-new at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id accOWXalYQb3; Wed, 13 Jan 2021 07:45:37 -0500 (EST) Received: from gdo-desktop.home (pop.92-184-98-96.mobile.abo.orange.fr [92.184.98.96]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id D0B8B9C0DCD; Wed, 13 Jan 2021 07:45:35 -0500 (EST) From: Gilles DOFFE To: netdev@vger.kernel.org Cc: Woojung Huh , UNGLinuxDriver@microchip.com, Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , linux-kernel@vger.kernel.org Subject: [PATCH net 2/6] net: dsa: ksz: move tag/untag action Date: Wed, 13 Jan 2021 13:45:18 +0100 Message-Id: <8e1cd9b167bd39c0f82ca8970a355cdfbc0fe885.1610540603.git.gilles.doffe@savoirfairelinux.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move tag/untag action at the end of the function to avoid tagging or untagging traffic if only vlan 0 is handled. Signed-off-by: Gilles DOFFE --- drivers/net/dsa/microchip/ksz8795.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microc= hip/ksz8795.c index 6962ba4ee125..4b060503b2e8 100644 --- a/drivers/net/dsa/microchip/ksz8795.c +++ b/drivers/net/dsa/microchip/ksz8795.c @@ -840,8 +840,6 @@ static void ksz8795_port_vlan_add(struct dsa_switch *= ds, int port, u8 fid, member, valid; int ret; =20 - ksz_port_cfg(dev, port, P_TAG_CTRL, PORT_REMOVE_TAG, untagged); - for (vid =3D vlan->vid_begin; vid <=3D vlan->vid_end; vid++) { if (vid =3D=3D 0) continue; @@ -874,6 +872,8 @@ static void ksz8795_port_vlan_add(struct dsa_switch *= ds, int port, vid |=3D new_pvid; ksz_pwrite16(dev, port, REG_PORT_CTRL_VID, vid); } + + ksz_port_cfg(dev, port, P_TAG_CTRL, PORT_REMOVE_TAG, untagged); } =20 static int ksz8795_port_vlan_del(struct dsa_switch *ds, int port, --=20 2.25.1