Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752464AbbGOOXi (ORCPT ); Wed, 15 Jul 2015 10:23:38 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:58251 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751981AbbGOOXh (ORCPT ); Wed, 15 Jul 2015 10:23:37 -0400 Date: Wed, 15 Jul 2015 07:23:22 -0700 From: Guenter Roeck To: Vivien Didelot Cc: netdev@vger.kernel.org, "David S. Miller" , linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com Subject: Re: [PATCH] net: dsa: mv88e6xxx: fix fid_mask when leaving bridge Message-ID: <20150715142322.GA32367@roeck-us.net> References: <1436969227-30006-1-git-send-email-vivien.didelot@savoirfairelinux.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1436969227-30006-1-git-send-email-vivien.didelot@savoirfairelinux.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Authenticated_sender: guenter@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: guenter@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: 1136 Lines: 26 On Wed, Jul 15, 2015 at 10:07:07AM -0400, Vivien Didelot wrote: > The mv88e6xxx_priv_state structure contains an fid_mask, where 1 means > the FID is free to use, 0 means the FID is in use. > > This patch fixes the bit clear in mv88e6xxx_leave_bridge() when > assigning a new FID to a port. > > Example scenario: I have 7 ports, port 5 is CPU, port 6 is unused (no > PHY). After setting the ports 0, 1 and 2 in bridge br0, and ports 3 and > 4 in bridge br1, I have the following fid_mask: 0b111110010110 (0xf96). > > Indeed, br0 uses FID 0, and br1 uses FID 3. > > After setting nomaster for port 0, I get the wrong fid_mask: 0b10 (0x2). > > With this patch we correctly get 0b111110010100 (0xf94), meaning port 0 > uses FID 1, br0 uses FID 0, and br1 uses FID 3. > > Signed-off-by: Vivien Didelot Reviewed-by: Guenter Roeck -- 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/