public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Siddharth Vadapalli <s-vadapalli@ti.com>
To: Chintan Vankar <c-vankar@ti.com>
Cc: Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@kernel.org>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	Vadim Fedorenko <vadim.fedorenko@linux.dev>,
	Matthias Schiffer <matthias.schiffer@ew.tq-group.com>,
	Nishanth Menon <nm@ti.com>, Michael Walle <mwalle@kernel.org>,
	Simon Horman <horms@kernel.org>,
	Roger Quadros <rogerq@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>, Jakub Kicinski <kuba@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	Andrew Lunn <andrew+netdev@lunn.ch>, <linux-omap@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
	<s-vadapalli@ti.com>
Subject: Re: [PATCH net 1/2] net: ethernet: ti: am65-cpsw-nuss: Update port_mask while adding multicast entry
Date: Thu, 5 Feb 2026 20:31:52 +0530	[thread overview]
Message-ID: <fecaeb94-c004-40f0-86e6-6b7c553a2fd8@ti.com> (raw)
In-Reply-To: <fd5c557f-b6a6-44e0-b66d-8fd7defc7203@ti.com>

On 05/02/26 5:05 PM, Chintan Vankar wrote:
> Hello Siddharth
> 
> On 05/02/26 13:45, Siddharth Vadapalli wrote:
>> On Thu, 2026-02-05 at 12:39 +0530, Chintan Vankar wrote:
>>> Multicast entry rules are mainly evaluated for receiving traffic and 
>>> do not
>>> require MAC ports to be explicitly associated with them. However, 
>>> setting
>>> associated MAC port's bit to the port_mask of the ALE entry ensures
>>> technical correctness and helps maintaining ALE entries linked to MAC
>>> ports.
>>>
>>> Signed-off-by: Chintan Vankar <c-vankar@ti.com>
>>> ---
>>>   drivers/net/ethernet/ti/am65-cpsw-nuss.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ 
>>> ethernet/ti/am65-cpsw-nuss.c
>>> index 5924db6be3fe..967918050433 100644
>>> --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
>>> +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
>>> @@ -391,7 +391,7 @@ static void 
>>> am65_cpsw_nuss_ndo_slave_set_rx_mode(struct net_device *ndev)
>>>       cpsw_ale_set_allmulti(common->ale,
>>>                     ndev->flags & IFF_ALLMULTI, port->port_id);
>>> -    port_mask = ALE_PORT_HOST;
>>> +    port_mask = BIT(port->port_id) | ALE_PORT_HOST;
>>
>> Since the port_mask setup above is passed to 'cpsw_ale_flush_multicast()'
>> below, wouldn't it temporarily cause the forwarded multicast traffic 
>> to be
>> dropped?
>>
>>>       /* Clear all mcast from ALE */
>>>       cpsw_ale_flush_multicast(common->ale, port_mask, -1);
>>>
>>>
>>
>> The code in the driver following the above function call is:
>>
>>     if (!netdev_mc_empty(ndev)) {
>>         struct netdev_hw_addr *ha;
>>
>>         /* program multicast address list into ALE register */
>>         netdev_for_each_mc_addr(ha, ndev) {
>>             cpsw_ale_add_mcast(common->ale, ha->addr,
>>                        port_mask, 0, 0, 0);
>>         }
>>     }
>>
>> So we do add back the multicast entries for the same 'port_mask' that we
>> removed earlier during cpsw_ale_flush_multicast(), but, there is a delay
>> between flushing the entries in cpsw_ale_flush_multicast() and adding 
>> them
>> back via cpsw_ale_add_mcast(). During that period, the multicast 
>> traffic on
>> the forwarding path between MAC Ports will be momentarily dropped. Please
>> clarify if that isn't the case.
>>
> 
> When "cpsw_ale_flush_multicast()" is called, it only deletes entries
> where the resulting port_mask becomes "0x0" or "ALE_PORT_HOST" (as per
> the function implementation "cpsw_ale_flush_multicast()" in cpsw_ale.c).
> 
> For multicast entries shared across multiple ports, the function only
> clears the specific port's bit from the port_mask without deleting the
> entry itself. This prevents any traffic disruption for other active
> ports.

Consider two MAC Ports P1 and P2. P1 belongs to multicast group M1 and 
M2, while P2 belongs only to multicast group M2.

If M1 is deleted from the interface for P1, it will trigger the 
execution of 'am65_cpsw_nuss_ndo_slave_set_rx_mode()' function.
In the function, we have:

	port_mask = BIT(port->port_id) | ALE_PORT_HOST;
	cpsw_ale_flush_multicast(common->ale, port_mask, -1);

	=> At this point, M2 would have also been removed in addition
	   to M1 for P1. As a result, Multicast traffic M2 from P2 to
	   P1 is dropped.

	if (!netdev_mc_empty(ndev)) {
		struct netdev_hw_addr *ha;

		/* program multicast address list into ALE register */
		netdev_for_each_mc_addr(ha, ndev) {
		cpsw_ale_add_mcast(common->ale, ha->addr,
				   port_mask, 0, 0, 0);
		}
	}

	=> We are adding back M2 to P1 above, but since it is not
	   instantaneous, it will take time for the Multicast traffic
	   M2 to be forwarded from P2 to P1.

Please let me know if I have overlooked something.

Regards,
Siddharth.

  reply	other threads:[~2026-02-05 15:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-05  7:09 [PATCH net 0/2] Modify multicast entry handling in ALE table Chintan Vankar
2026-02-05  7:09 ` [PATCH net 1/2] net: ethernet: ti: am65-cpsw-nuss: Update port_mask while adding multicast entry Chintan Vankar
2026-02-05  8:15   ` Siddharth Vadapalli
2026-02-05 11:35     ` Chintan Vankar
2026-02-05 15:01       ` Siddharth Vadapalli [this message]
2026-02-16 18:15         ` Chintan Vankar
2026-02-17  4:52           ` Siddharth Vadapalli
2026-02-05  7:09 ` [PATCH net 2/2] net: ethernet: ti: cpsw_ale: Update multicast entry handling in ALE Table Chintan Vankar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fecaeb94-c004-40f0-86e6-6b7c553a2fd8@ti.com \
    --to=s-vadapalli@ti.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=c-vankar@ti.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=matthias.schiffer@ew.tq-group.com \
    --cc=mingo@kernel.org \
    --cc=mwalle@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=pabeni@redhat.com \
    --cc=rogerq@kernel.org \
    --cc=tglx@kernel.org \
    --cc=vadim.fedorenko@linux.dev \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox