From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C5737390CAC; Fri, 13 Mar 2026 13:31:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408680; cv=none; b=twKwn1Yy7YVs9bGIsJPw9cDrMwk//OVQtNCphjSzoMA7lJcTT91Q9O8q2O34Qlt74CWTO4OXBuvip4Pb7ybcy+9jBiAaYnZ1ZmIQXgqJO+mNg+qEYmkCcg9BJQDYF9M0foT+WUrqc3pdS6veRKNy9Rp+dLYroQNcABXsiRYbVSk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408680; c=relaxed/simple; bh=rjDxboEbN9PBbRfJRIEBNS24aeg6irTXidxj5ateeII=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=b33C79n3AYIdLw0Md1H3rPhe0ksZK2J30ZlXLEBsi0M/bFm6SqRJPd3EGoQm6Gnwnk2ig8agSfjIAR4RCVBlUs2x1QaTwEfmsDhdyLj+HvlPwSxaivkWwRRAI16m9Y7e99iG3hSwu/6a0dVRioZoPdF2jnORUR+5oJOWq9CnmFo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DWjdx58w; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DWjdx58w" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03FCAC19421; Fri, 13 Mar 2026 13:31:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773408680; bh=rjDxboEbN9PBbRfJRIEBNS24aeg6irTXidxj5ateeII=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DWjdx58wOVYhoSoJR4FcnGaavF+YH3YlsFNH428rWhwV0xwvYXeoC869SDVfXZwTV k53lIQ2crmAWyD4Vq2fPYN8YQuTVYH8DI6zS1tR1CzNYAmfob+s2zJlrQWfRulxhd7 hZdlFqRNnD5avftUsauqGZR39Wb3yioCecz+S2tAttstBnRtH+aSno0VoWFHU3Dg++ 2idSw6g9i9+IEUCcxJprhjvWvqrYsAabqzSXznSVLkYGSOZIUi6m308foPG42kniva k8yuh6rGI1K0lbpatLeDoDhHh/jhKLTsd+hg27bIbr28jhSGSzYY1ey74u6ay6kpMo VS9g4dUeIKZKQ== Date: Fri, 13 Mar 2026 13:31:15 +0000 From: Simon Horman To: MD Danish Anwar Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Meghana Malladi , Jacob Keller , linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Roger Quadros Subject: Re: [PATCH net-next v2] net: ti: icssg-prueth: Add HSR multicast FDB port membership management Message-ID: <20260313133115.GY461701@kernel.org> References: <20260311082923.2962937-1-danishanwar@ti.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260311082923.2962937-1-danishanwar@ti.com> On Wed, Mar 11, 2026 at 01:59:23PM +0530, MD Danish Anwar wrote: > In HSR offload mode, multicast addresses can be added via HSR master > (hsr0) or directly to slave ports (eth1/eth2). The FDB must track port > membership: P0 (0x1) for HSR master, P1 (0x2) for slave port 1, and P2 > (0x4) for slave port 2. When the same address is added from multiple > paths, memberships must accumulate. > > Implement a hybrid approach using __dev_mc_sync() callbacks to track > basic add/delete operations, checking netdev_hw_addr->synced to > distinguish HSR-synced addresses from direct additions. Post-process > to handle overlapping memberships by checking refcount: > - refcount=2 with synced=1: HSR only (P0) > - refcount>=3 with synced=1: HSR + direct (P0|P1/P2) > - synced=0 with P0 set: HSR removed, clean up orphaned P0 > > On add operations, accumulate new membership with existing ports. On > delete operations, remove only the specific port and clean up orphaned > P0 bits if needed. > > Add error handling for icssg_fdb_lookup() which can return negative > error codes (e.g., -ETIMEDOUT). On lookup failure in add/delete path, > default to no existing membership. In the post-processing path, skip > the address update to avoid corrupting FDB entries with garbage values. > > VLAN Interface Handling: > Add support for multicast addresses added to VLAN interfaces on the HSR > master (e.g., hsr0.7). These addresses require P0 (HSR master) bit to be > set along with the port bits, since VLAN-tagged packets use separate FDB > entries per VLAN ID. Without P0, the HSR master would not receive > multicast packets on VLAN interfaces. > > Track whether the add/del operation came from a VLAN interface path and > set P0 when in HSR offload mode with VLAN interfaces. Update orphaned P0 > cleanup logic to preserve P0 for VLAN interfaces. > > Signed-off-by: MD Danish Anwar > --- > v1 -> v2: > Added a helper function as suggested by Simon Horman Thanks for the update. Reviewed-by: Simon Horman It is unclear to me why this is marked as Not Applicable in patchwork.