[PATCH 0/2] improve multicast join group performance

Jonas Rebmann posted 2 patches 1 month, 3 weeks ago
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c   | 20 +++++++++--
drivers/net/ethernet/freescale/fman/fman_dtsec.c |  1 -
drivers/net/ethernet/freescale/fman/fman_memac.c |  1 -
drivers/net/ethernet/freescale/fman/fman_tgec.c  |  1 -
drivers/net/ethernet/freescale/fman/mac.c        | 42 ------------------------
drivers/net/ethernet/freescale/fman/mac.h        |  2 --
net/ipv4/igmp.c                                  | 26 ++++++++++++---
7 files changed, 39 insertions(+), 54 deletions(-)
[PATCH 0/2] improve multicast join group performance
Posted by Jonas Rebmann 1 month, 3 weeks ago
This series seeks to improve performance on updating igmp group
memberships such as with IP_ADD_MEMBERSHIP or MCAST_JOIN_SOURCE_GROUP.

Our use case was to add 2000 multicast memberships on a TQMLS1046A which
took about 3.6 seconds for the membership additions alone. Our userspace
reproducer tool was instrumented to log runtimes of the individual
setsockopt invocations which clearly indicated quadratic complexity of
setting up the membership with regard to the total number of multicast
groups to be joined. We used perf to locate the hotspots and
subsequently optimized the most costly sections of code.

This series includes a patch to Linux igmp handling as well as a patch
to the DPAA/Freescale driver. With both patches applied, our memberships can
be set up in only about 87 miliseconds, which corresponds to a speedup
of around 40.

While we have acheived practically linear run-time complexity on the
kernel side, a small quadratic factor remains in parts of the freescale
driver code which we haven't yet optimized. We have by now payed little
attention to the optimization potential in dropping group memberships,
yet the dpaa patch applies to joining and leaving groups alike.

Overall, this patch series brings great improvements in use cases
involving large numbers of multicast groups, particularly when using the
fsl_dpa driver, without noteworthy drawbacks in other scenarios.

Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
---
Jonas Rebmann (2):
      net: ipv4: igmp: optimize ____ip_mc_inc_group() using mc_hash
      net: dpaa: use __dev_mc_sync in dpaa_set_rx_mode()

 drivers/net/ethernet/freescale/dpaa/dpaa_eth.c   | 20 +++++++++--
 drivers/net/ethernet/freescale/fman/fman_dtsec.c |  1 -
 drivers/net/ethernet/freescale/fman/fman_memac.c |  1 -
 drivers/net/ethernet/freescale/fman/fman_tgec.c  |  1 -
 drivers/net/ethernet/freescale/fman/mac.c        | 42 ------------------------
 drivers/net/ethernet/freescale/fman/mac.h        |  2 --
 net/ipv4/igmp.c                                  | 26 ++++++++++++---
 7 files changed, 39 insertions(+), 54 deletions(-)
---
base-commit: 8b641b5e4c782464c8818a71b443eeef8984bf34
change-id: 20241007-igmp-speedup-2ca0c7b9189d

Best regards,
-- 
Jonas Rebmann <jre@pengutronix.de>
Re: [PATCH 0/2] improve multicast join group performance
Posted by Jonas Rebmann 1 month, 3 weeks ago
On 07/10/2024 16.17, Jonas Rebmann wrote:
> This series seeks to improve performance on updating igmp group
> memberships such as with IP_ADD_MEMBERSHIP or MCAST_JOIN_SOURCE_GROUP.

Sorry, I forgot: This should have been tagged for net-next. Will be 
fixed in v2.

Regards,
Jonas

-- 
Pengutronix e.K.                           | Jonas Rebmann               |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-9    |
Re: [PATCH 0/2] improve multicast join group performance
Posted by Jakub Kicinski 1 month, 3 weeks ago
On Mon, 7 Oct 2024 16:30:47 +0200 Jonas Rebmann wrote:
> On 07/10/2024 16.17, Jonas Rebmann wrote:
> > This series seeks to improve performance on updating igmp group
> > memberships such as with IP_ADD_MEMBERSHIP or MCAST_JOIN_SOURCE_GROUP.  
> 
> Sorry, I forgot: This should have been tagged for net-next. Will be 
> fixed in v2.

No need to repost just for that.