Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4120019pxb; Mon, 8 Feb 2021 08:24:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJw1qjtK0rg+mRop9HIDeu8DUv5zVH/wdIbcy3k2UBpTjui6cppugNbvX+8ETax6vvVW/QWw X-Received: by 2002:a50:e40d:: with SMTP id d13mr17553007edm.286.1612801471871; Mon, 08 Feb 2021 08:24:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612801471; cv=none; d=google.com; s=arc-20160816; b=O/7WOhtyeZ6H5M2M2p+rz/jkJBly9s4KXL7vPp+CnpOUGeiWU33+fya57iFLFbiNKn HPZETToNfxoCnSqWItUxm4E02kAEJx/TN4uv/HfOWymnf5Zyj8WDFIKKD28nLqp/2/Io a2Ll+jOMzkDCyB1PU1TRmltRTP2QwTrMtTriFtkDl76jW9vaP9yYZzwl96syQ9ElGkdb ZQFx8/xdd/Fnc0VYYFhiHZLEhiMgIwdEeRo1Gncg2u616kKakDA6oiGWNMbKfKXCt/ig Uhs2gYkN+8QuLiDvIgLP0LpOdQpIy1Ofxbmgvowt3Pfz5Ez148nfFyWRr/KNIR4nmFsI MRIA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=R7pYzwNPbtS6WUelbUQ3xMDVYYE4/eQp1NMRY7VcfkY=; b=YiW+XpxHmBo6F/jL95ke3W0PPun8xuGA2UyhnFUk4V1YRPKMiLXuTzk6hHXv4e3fwm eWQ4OOy1tXDPwMd00ufKRmJiGE7CLyhcs0BdnVbi5e9N9EN5At8jw9FCID+6aDIXGIvR JumiYtrRLoF+OPzu+R24RtdSo0wKiykwEcYeHKMe2B8xU3RpikLSzzB626jTFETQh/zr DQ9+m6bcYSLL4OfM07o2wGw2lHc6cfmPqn5l7strK2fZ2A4r16Qu0DFDD7JJzey12zdH 6mveBuZJ/t4cARnNxXDL27aSbEArJZ5BXm7Kswbz1wbEwD2zHnfQYVsHTgQrpGWfDJZQ KS0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JPIQ3yIv; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e6si14840795edz.361.2021.02.08.08.24.06; Mon, 08 Feb 2021 08:24:31 -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=@linuxfoundation.org header.s=korg header.b=JPIQ3yIv; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233358AbhBHQX3 (ORCPT + 99 others); Mon, 8 Feb 2021 11:23:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:55232 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231858AbhBHPJs (ORCPT ); Mon, 8 Feb 2021 10:09:48 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 63D3264ECF; Mon, 8 Feb 2021 15:07:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612796821; bh=PeRpHfP0z20bjDsgIF/jCZ8Y+qqhnkh0Rwhh0c3Ksy8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JPIQ3yIvksEYHcE3YFBM3xbhIFCFHlH6X5HoGiDR1vkoNUkWQ+Z7Rk7OReKWquy7O HVSFDGXNBAeGooUxnK//nrDTvb36xbTTGO3rqrKmhF5c+gLcO6tNoQ4Gw2h73eSfAS eB8m8bOrDM4+rWf37NYDBJeEC1GYMppuFou1PRD4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, DENG Qingfang , Vladimir Oltean , Jakub Kicinski Subject: [PATCH 4.14 30/30] net: dsa: mv88e6xxx: override existent unicast portvec in port_fdb_add Date: Mon, 8 Feb 2021 16:01:16 +0100 Message-Id: <20210208145806.449755046@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210208145805.239714726@linuxfoundation.org> References: <20210208145805.239714726@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: DENG Qingfang commit f72f2fb8fb6be095b98af5d740ac50cffd0b0cae upstream. 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 Reviewed-by: Vladimir Oltean Link: https://lore.kernel.org/r/20210130134334.10243-1-dqfext@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/dsa/mv88e6xxx/chip.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -1364,7 +1364,11 @@ static int mv88e6xxx_port_db_load_purge( if (!entry.portvec) entry.state = MV88E6XXX_G1_ATU_DATA_STATE_UNUSED; } 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; }