netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH net-next 0/2] Add multicast filtering support for ICSSG driver
@ 2024-05-16  9:17 MD Danish Anwar
  2024-05-16  9:17 ` [RFC PATCH net-next 1/2] net: ti: icssg-prueth: Add helper functions to configure FDB MD Danish Anwar
  2024-05-16  9:17 ` [RFC PATCH net-next 2/2] net: ti: icssg-prueth: Add multicast filtering support MD Danish Anwar
  0 siblings, 2 replies; 4+ messages in thread
From: MD Danish Anwar @ 2024-05-16  9:17 UTC (permalink / raw)
  To: Dan Carpenter, Diogo Ivo, Jan Kiszka, Andrew Lunn, Paolo Abeni,
	Jakub Kicinski, Eric Dumazet, David S. Miller
  Cc: linux-kernel, netdev, linux-arm-kernel, srk, Vignesh Raghavendra,
	r-gunasekaran, Roger Quadros, MD Danish Anwar

This series add multicast filtering support for ICSSG driver.

The patch 1/2 of the series introduces helper APIs needed to configure
FDB tables maintained by firmware.

Patch 2/2 introduces the support for multicast filtering.

The driver will keep a copy of multicast addresses in emac->mcast_list.
This list will be kept in sync with the netdev list and to add / del
multicast address icssg_prueth_mac_add_mcast / icssg_prueth_mac_del_mcast
APIs will be called.

To add a mac_address for a port, driver need to call icssg_fdb_add_del()
and pass the mac_address and BIT(port_id) to the API. The ICSSG firmware
will then configure the rules and allow filtering.

If a mac_address is added to port0 and the same mac_address needs to be
added for port1, driver needs to pass BIT(port0) | BIT(port1) to the 
icssg_fdb_add_del() API. If driver just pass BIT(port1) then the entry for
port0 will be overwritten / lost. This is a design constraint on the
firmware side.

To overcome this in the driver, to add any mac_address for let's say portX
driver first checks if the same mac_address is already added for any other
port. If yes driver calls icssg_fdb_add_del() with BIT(portX) | 
BIT(other_existing_port). If not, driver calls icssg_fdb_add_del() with 
BIT(portX).

The same thing is applicable for deleting mac_addresses as well. This
logic is in icssg_prueth_mac_add_mcast / icssg_prueth_mac_del_mcast APIs.

MD Danish Anwar (2):
  net: ti: icssg-prueth: Add helper functions to configure FDB
  net: ti: icssg-prueth: Add multicast filtering support

 drivers/net/ethernet/ti/icssg/icssg_config.c | 186 ++++++++++++++++++-
 drivers/net/ethernet/ti/icssg/icssg_config.h |  19 ++
 drivers/net/ethernet/ti/icssg/icssg_prueth.c |  50 ++++-
 drivers/net/ethernet/ti/icssg/icssg_prueth.h |  15 ++
 4 files changed, 263 insertions(+), 7 deletions(-)


base-commit: 654de42f3fc6edc29d743c1dbcd1424f7793f63d
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-30 19:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-16  9:17 [RFC PATCH net-next 0/2] Add multicast filtering support for ICSSG driver MD Danish Anwar
2024-05-16  9:17 ` [RFC PATCH net-next 1/2] net: ti: icssg-prueth: Add helper functions to configure FDB MD Danish Anwar
2024-05-16  9:17 ` [RFC PATCH net-next 2/2] net: ti: icssg-prueth: Add multicast filtering support MD Danish Anwar
2024-05-30 19:08   ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).