Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756711AbbFBOYr (ORCPT ); Tue, 2 Jun 2015 10:24:47 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:46976 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755833AbbFBOYk (ORCPT ); Tue, 2 Jun 2015 10:24:40 -0400 Message-ID: <556DBCA4.10203@roeck-us.net> Date: Tue, 02 Jun 2015 07:24:36 -0700 From: Guenter Roeck User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Vivien Didelot , netdev@vger.kernel.org CC: "David S. Miller" , Florian Fainelli , Andrew Lunn , Scott Feldman , Jiri Pirko , Jerome Oufella , linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, Chris Healy Subject: Re: [RFC 7/9] net: dsa: mv88e6352: lock CPU port from learning addresses References: <1433208470-25338-1-git-send-email-vivien.didelot@savoirfairelinux.com> <1433208470-25338-8-git-send-email-vivien.didelot@savoirfairelinux.com> In-Reply-To: <1433208470-25338-8-git-send-email-vivien.didelot@savoirfairelinux.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Authenticated_sender: linux@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: linux@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2193 Lines: 62 On 06/01/2015 06:27 PM, Vivien Didelot wrote: > This commit disables SA learning and refreshing for the CPU port. > Hi Vivien, This patch also seems to be unrelated to the rest of the series. Can you add an explanation why it is needed ? With this in place, how does the CPU port SA find its way into the fdb ? Do we assume that it will be configured statically ? An explanation might be useful. Thanks, Guenter > Signed-off-by: Vivien Didelot > --- > drivers/net/dsa/mv88e6xxx.c | 8 +++++--- > drivers/net/dsa/mv88e6xxx.h | 1 + > 2 files changed, 6 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/dsa/mv88e6xxx.c b/drivers/net/dsa/mv88e6xxx.c > index d2beb10..ed49bd8 100644 > --- a/drivers/net/dsa/mv88e6xxx.c > +++ b/drivers/net/dsa/mv88e6xxx.c > @@ -1761,10 +1761,12 @@ static int mv88e6xxx_setup_port(struct dsa_switch *ds, int port) > /* Port Association Vector: when learning source addresses > * of packets, add the address to the address database using > * a port bitmap that has only the bit for this port set and > - * the other bits clear. > + * the other bits clear, except for the CPU port. > */ > - ret = _mv88e6xxx_reg_write(ds, REG_PORT(port), PORT_ASSOC_VECTOR, > - 1 << port); > + reg = BIT(port); > + if (dsa_is_cpu_port(ds, port)) > + reg |= PORT_ASSOC_VECTOR_LOCKED_PORT; > + ret = _mv88e6xxx_reg_write(ds, REG_PORT(port), PORT_ASSOC_VECTOR, reg); > if (ret) > goto abort; > > diff --git a/drivers/net/dsa/mv88e6xxx.h b/drivers/net/dsa/mv88e6xxx.h > index 412d14e..e26eb0c 100644 > --- a/drivers/net/dsa/mv88e6xxx.h > +++ b/drivers/net/dsa/mv88e6xxx.h > @@ -144,6 +144,7 @@ > #define PORT_RATE_CONTROL 0x09 > #define PORT_RATE_CONTROL_2 0x0a > #define PORT_ASSOC_VECTOR 0x0b > +#define PORT_ASSOC_VECTOR_LOCKED_PORT BIT(13) > #define PORT_ATU_CONTROL 0x0c > #define PORT_PRI_OVERRIDE 0x0d > #define PORT_ETH_TYPE 0x0f > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/