Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2741668pxb; Sat, 30 Jan 2021 12:50:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzpsHdGv/a9r9O5ZAtK1tnNFOc6dM0T4fjdIapSB4LeXaVquxafgmmojEcYSs1GJH2BSpcs X-Received: by 2002:a17:906:a082:: with SMTP id q2mr10556642ejy.483.1612039800020; Sat, 30 Jan 2021 12:50:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612039800; cv=none; d=google.com; s=arc-20160816; b=ZYezGItnQ3L6NhxhHg8YQsSpp4/3ZSbJI4DnRPS4naUZ0RRgU4In7zuBnNFjQ3n+cL 4aDQmUEh5c2cY0/SipONv78KM1uP0Wm2dtIayRL/Yt7raoQ/EHXX+12HV0rDgcNh5do2 N7JCJctmIUS2rHI16ik3KJr1naud1dBXWQgZoNHM/owtVVBNI8ZnaDpHzU/WsjTH5f+6 Pq2JdjGH6c6IoU4oweZmPYEjHnl5keSOg2chTb9tRq2YPQmhHrpxEkNES0wuhYEe6dAg jMUVG79fyUPGxTBBgrn3RbPmmwP2DCrddsLK394ircDqj5dtRvG/XF0on2AtyJxrP+Og 6axA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:to:from:dkim-signature; bh=HKVoS2rrydn4evqBfByv/fLsc4rWiOOxhn5xpMDPXuA=; b=BjU3BQcqPk/1+iZFcDaZKO0XozyWGy0Nzd1dsFqu++8NM7Hn//NxjiR/z2tLl9cRtp l4P/cMiWVuHJtEwvr2I3ssIoW48+KHh8jPMt7BJ/HKgAVYW+YNG1UmT8uf3CYl3ks7g1 MXBR2L2VJ/eR2vsuFhi30q/NW7D4iRR3/TTB5h3fmitvktAiN/6+HcyqXTR4G7JPG7Gv +ClXhHeCkei2mIcciamC9oVxn39CzGEMNCmaY3QFD/yM7RzI/C7HZKs+90k9gkhCG8ZA MYQ5G9DsowTwYR98UhE6vwpr+9F+35cMKVej0jP+TXvuBNtx0I2ZWEDWKT9EnDYSertQ +pDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@waldekranz-com.20150623.gappssmtp.com header.s=20150623 header.b=YYeRX8uA; 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 k26si8493113eds.213.2021.01.30.12.49.34; Sat, 30 Jan 2021 12:50:00 -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=@waldekranz-com.20150623.gappssmtp.com header.s=20150623 header.b=YYeRX8uA; 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 S232010AbhA3Urr (ORCPT + 99 others); Sat, 30 Jan 2021 15:47:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231690AbhA3Urp (ORCPT ); Sat, 30 Jan 2021 15:47:45 -0500 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79F22C061756 for ; Sat, 30 Jan 2021 12:47:05 -0800 (PST) Received: by mail-lj1-x230.google.com with SMTP id s18so14691546ljg.7 for ; Sat, 30 Jan 2021 12:47:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=waldekranz-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:in-reply-to:references:date:message-id:mime-version; bh=HKVoS2rrydn4evqBfByv/fLsc4rWiOOxhn5xpMDPXuA=; b=YYeRX8uAMTy24PjmszEhE+U3nh9+PUkvfH5lFjYKPjLlKQi4Y7wPwMdSXr73v5nGhT w7Qpwvnys9VY3g2E87RIaOt3Myz2aBYmjUuHJV/h5UggQBIDXwxEK8ub8z07JR3+3om5 FIf5Hpbw8zk+W5wiThS0kmC2WVUf95/yUFs0KWjmuPQg+LIryz9JbW0WltoaNcUk0+0Y O4rBaf6qEQSqYKagcRiBRdpHrV2bQLpst6Xl/+V0nlvjlQrdHsxEc/odK+wZIre0akpP 9QAidkVDhgIVua6uj4N6r91NWRbdszuihXIqboOhJPffqMl+ymIGgmZLC48yhd5bBwB5 h1PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=HKVoS2rrydn4evqBfByv/fLsc4rWiOOxhn5xpMDPXuA=; b=uZBATnWyfbSL9LUcPeJ707iZ9fTlJV1PLldjdy8nFwIHGgsXiEPdyco3Kpb4EyYsQ+ SDVAMSftPLWfObeuOVlsHaK2O+Q2q6XrN8RTDO3r+d+qWYfTvi4V2iPxsNI7NARoO4Og VjDtAxEAuCsFsqu2jbP9wAehKLD5KXp1Fibx95tjFKw1vEwhxb80KcjQuJFcuzQm90XI aVRlTYNdDAapwrtzLAFBDl07mj8WJgkE/HU0PGXMT3HU3eLPTfXoeWP4rwtQonAO9Pym V2HVdAuQQPRliZK54U0nvxTlI+J9D9Au0CUvVX20qBfUVGRSR1Lf65zauVpLTHwFGPTw t/yg== X-Gm-Message-State: AOAM530UHv8GiUDcUKFEAUg2aA3e2rNNSlxVJADXlEiaRh7gH6gZlG/y U3iGIs0m1iEOW9kckKf7ltn4kmhM5VcSNrFJ X-Received: by 2002:a2e:7812:: with SMTP id t18mr2128221ljc.168.1612039623579; Sat, 30 Jan 2021 12:47:03 -0800 (PST) Received: from wkz-x280 (h-236-82.A259.priv.bahnhof.se. [98.128.236.82]) by smtp.gmail.com with ESMTPSA id t7sm3088951ljc.87.2021.01.30.12.47.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Jan 2021 12:47:02 -0800 (PST) From: Tobias Waldekranz To: DENG Qingfang , Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] net: dsa: mv88e6xxx: override existent unicast portvec in port_fdb_add In-Reply-To: <20210130134334.10243-1-dqfext@gmail.com> References: <20210130134334.10243-1-dqfext@gmail.com> Date: Sat, 30 Jan 2021 21:47:02 +0100 Message-ID: <87eei25f09.fsf@waldekranz.com> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jan 30, 2021 at 21:43, DENG Qingfang wrote: > 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. Is this the layer we want to solve this problem at? What are the contents of the software FDB at this stage? Here is a quick example I tried on one of my systems: root@envoy:~# bridge fdb add 02:00:de:ad:00:01 dev eth1 static vlan 1 root@envoy:~# bridge fdb add 02:00:de:ad:00:01 dev eth2 static vlan 1 root@envoy:~# bridge fdb | grep de:ad 02:00:de:ad:00:01 dev eth2 vlan 1 self static 02:00:de:ad:00:01 dev eth1 vlan 1 self static Why does the second add operation succeed? Am I missing some magic flag? Presumably the bridge will only ever forward packets to which ever entry ends up being first in the relevant hash list. Is that not the real problem here? As it stands today, those commands will result in the following ATU config (eth1/2 being mapped to port 10/9): root@envoy:~# mvls atu ADDRESS FID STATE Q F 0 1 2 3 4 5 6 7 8 9 a ff:ff:ff:ff:ff:ff 0 static - - 0 1 2 3 4 5 6 7 8 9 a 02:00:de:ad:00:01 1 static - - . . . . . . . . . 9 a ff:ff:ff:ff:ff:ff 1 static - - 0 1 2 3 4 5 6 7 8 9 a One might argue that this is no more wrong than what would have been set up with this patch applied. The problem is that the bridge allows this configuration in the first place.