Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2532760pxb; Sat, 30 Jan 2021 05:47:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJzQLrNA0nUJGXbqIr3eU8fC89Oadr6N7s7QDeZ2V1GTuLfquAL0OWxB1zqmY+H0UjA3gs7J X-Received: by 2002:a17:907:7289:: with SMTP id dt9mr9131306ejc.446.1612014425952; Sat, 30 Jan 2021 05:47:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612014425; cv=none; d=google.com; s=arc-20160816; b=H2rf5u08lqnKQuuvoBFVM4CQH3huV5GZaKZN3+EnK9Ki3Vlt2fCN/ItenZNAOj9wcu fqafHQFR3VjpSRCXb2oVQM3mRbC0lpsHwgpp7PxHztjBx7TTUgPMPQ6C0ZaM+gtMA4Mt pvu+cyZgXclvCvKMK61b0wO4blzLSnVFs2AXvEhMMHcXkngi5mOg4+Be8o4GGEvPC65D eKDULeuHjvcY0TPveRkSn3kKnifGyXwOWQmRTwL527okd4fr+RK6MEsdyy/plLUJcDvc ZUbkmT3io7Yj7xUvu0Y57ig2FfgI4p9xlZRrUIf7H0AAaTZHNUmo5QXCl9ixrxwjxfGp cQEw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=pXf19g1065wNWBhJVun5K/h2HFDi9av6GCTtkJcQ4oQ=; b=V54GdWwElpc1ZkBFRsA0ZRodFLu33vMajI3hyVxG+8Zd6tISOh8kNHu6t8klto7L8+ /dQjAyn7KpLLVCiA6YeIWQ0eWdV28HSWdrwABVLNuQOh2Nmcr7hRwpa47sEXODMRvGz0 FWthrNOCTIve9hA7ArMNPeVogV8o+WZIAlOA7dnjmL0vpeeIX5ztHUiIRg2xQpm9AkxO YI9hWs8VbI2RZuyyLFxWD8IX9dTlc4FIXBsxpJciTlxAUTTl4lATd/iT2ZCMgb3uOUJT S54OKXLJvSe5Bb6o0W+Z/Va5vIH1uQUgHRQBCrLQ3iBht4wsa4ywDUTRKd9pU3PNzY+s HRow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EPP7VyKD; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id sa14si6519354ejb.355.2021.01.30.05.46.29; Sat, 30 Jan 2021 05:47:05 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EPP7VyKD; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230484AbhA3Noc (ORCPT + 99 others); Sat, 30 Jan 2021 08:44:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229885AbhA3Noa (ORCPT ); Sat, 30 Jan 2021 08:44:30 -0500 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33A7BC061573; Sat, 30 Jan 2021 05:43:50 -0800 (PST) Received: by mail-pg1-x52c.google.com with SMTP id j2so6881180pgl.0; Sat, 30 Jan 2021 05:43:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=pXf19g1065wNWBhJVun5K/h2HFDi9av6GCTtkJcQ4oQ=; b=EPP7VyKD6pGX2BXlfpgYQt/Sxl7Cpo8UUvOPjWSJt9KxinW86pRGQ6EoHoG7fJDFAR W68G0/v+ENMjmLux1nD41PzcsDvRkcWNoFv5YyPotn928MUJuNHm0UDoseDFGxJ7vFXj QRpV0UuQWi3MmA/jqs+/pHsId20erXNjIArr886ahpQta2VxYb8VleMo+quURkN04KEX WC1EKGimnKiJkDt6GveKT4NyLMQVsUqzRm+yDoF5wmnuWr7bMVWfEu8zEtXQ2UuvO6du Mzc4boKUV/VT34HwaIhKC568/IuG7fu2l203fQiq8O2tMGmcvZYqPhy43Xz8v0j92Zmp lfTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=pXf19g1065wNWBhJVun5K/h2HFDi9av6GCTtkJcQ4oQ=; b=RHNJ5ISoHflw+qH98s8Lry+IaprNaE9wdyzrlYsugqmXYVnZv3A7UcTbyOydFIWfym hxOqRFQ4hDWrrYULmYJK53MZeILlIAlV+pP62AMM/2z9pad/KjOsQ7PKfZM+VnDdDkkd s4lX3tx20YyUopfeFSw3WxpUXOi5CmA0SdAu0xf9+EiHMrWh25N7JaKnq32UwZdAfAZI 793oJLneq0EgvFH0ITDrXXOCVhN/L6IYJzQU66B2v9Yox65OHKWYi9nXNMygqwyAr2OB Kogkn5aIqrJWMvwBrgm5luFJiIJJP91SVqM/uHEkUG5adj6Wcec9eLiLOWqQwjHr0IA1 PNOQ== X-Gm-Message-State: AOAM533BJk3WQ8KBoxvZDaU2NDgY83M1+v+Fzfo4vFroznNxyo+x9YCd zfKAotKlffifdRYkoZKbIl0= X-Received: by 2002:a63:50a:: with SMTP id 10mr8731220pgf.273.1612014229346; Sat, 30 Jan 2021 05:43:49 -0800 (PST) Received: from container-ubuntu.lan ([61.188.25.180]) by smtp.gmail.com with ESMTPSA id c3sm12171253pfj.105.2021.01.30.05.43.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Jan 2021 05:43:48 -0800 (PST) From: DENG Qingfang To: Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Tobias Waldekranz Subject: [PATCH net] net: dsa: mv88e6xxx: override existent unicast portvec in port_fdb_add Date: Sat, 30 Jan 2021 21:43:34 +0800 Message-Id: <20210130134334.10243-1-dqfext@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Having multiple destination ports for a unicast address does not make sense. Make port_db_load_purge override existent unicast portvec instead of adding a new port bit. Fixes: 884729399260 ("net: dsa: mv88e6xxx: handle multiple ports in ATU") Signed-off-by: DENG Qingfang --- drivers/net/dsa/mv88e6xxx/chip.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index b99f27b8c084..ae0b490f00cd 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -1686,7 +1686,11 @@ static int mv88e6xxx_port_db_load_purge(struct mv88e6xxx_chip *chip, int port, if (!entry.portvec) entry.state = 0; } else { - entry.portvec |= BIT(port); + if (state == MV88E6XXX_G1_ATU_DATA_STATE_UC_STATIC) + entry.portvec = BIT(port); + else + entry.portvec |= BIT(port); + entry.state = state; } -- 2.25.1