From: Jonas Rebmann <jre@pengutronix.de>
To: "David S. Miller" <davem@davemloft.net>,
David Ahern <dsahern@kernel.org>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
Madalin Bucur <madalin.bucur@nxp.com>,
Sean Anderson <sean.anderson@seco.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel@pengutronix.de, Jonas Rebmann <jre@pengutronix.de>
Subject: [PATCH 0/2] improve multicast join group performance
Date: Mon, 07 Oct 2024 16:17:10 +0200 [thread overview]
Message-ID: <20241007-igmp-speedup-v1-0-6c0a387890a5@pengutronix.de> (raw)
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>
next reply other threads:[~2024-10-07 14:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-07 14:17 Jonas Rebmann [this message]
2024-10-07 14:17 ` [PATCH 1/2] net: ipv4: igmp: optimize ____ip_mc_inc_group() using mc_hash Jonas Rebmann
2024-10-07 19:06 ` Eric Dumazet
2024-10-07 14:17 ` [PATCH 2/2] net: dpaa: use __dev_mc_sync in dpaa_set_rx_mode() Jonas Rebmann
2024-10-07 14:50 ` Sean Anderson
2024-10-07 14:30 ` [PATCH 0/2] improve multicast join group performance Jonas Rebmann
2024-10-07 15:30 ` Jakub Kicinski
2024-10-09 12:00 ` patchwork-bot+netdevbpf
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=20241007-igmp-speedup-v1-0-6c0a387890a5@pengutronix.de \
--to=jre@pengutronix.de \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=madalin.bucur@nxp.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sean.anderson@seco.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;
as well as URLs for NNTP newsgroup(s).