From: Kurt Kanzenbach <kurt@linutronix.de>
To: Vladimir Oltean <vladimir.oltean@nxp.com>,
netdev@vger.kernel.org, Jakub Kicinski <kuba@kernel.org>,
"David S. Miller" <davem@davemloft.net>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Vladimir Oltean <olteanv@gmail.com>,
Hauke Mehrtens <hauke@hauke-m.de>,
Egil Hjelmeland <privat@egil-hjelmeland.no>
Subject: Re: [PATCH net 1/4] net: dsa: hellcreek: fix broken backpressure in .port_fdb_dump
Date: Tue, 10 Aug 2021 13:39:36 +0200 [thread overview]
Message-ID: <87wnotle9z.fsf@kurt> (raw)
In-Reply-To: <20210810111956.1609499-2-vladimir.oltean@nxp.com>
[-- Attachment #1: Type: text/plain, Size: 1256 bytes --]
On Tue Aug 10 2021, Vladimir Oltean wrote:
> rtnl_fdb_dump() has logic to split a dump of PF_BRIDGE neighbors into
> multiple netlink skbs if the buffer provided by user space is too small
> (one buffer will typically handle a few hundred FDB entries).
>
> When the current buffer becomes full, nlmsg_put() in
> dsa_slave_port_fdb_do_dump() returns -EMSGSIZE and DSA saves the index
> of the last dumped FDB entry, returns to rtnl_fdb_dump() up to that
> point, and then the dump resumes on the same port with a new skb, and
> FDB entries up to the saved index are simply skipped.
>
> Since dsa_slave_port_fdb_do_dump() is pointed to by the "cb" passed to
> drivers, then drivers must check for the -EMSGSIZE error code returned
> by it. Otherwise, when a netlink skb becomes full, DSA will no longer
> save newly dumped FDB entries to it, but the driver will continue
> dumping. So FDB entries will be missing from the dump.
>
> Fix the broken backpressure by propagating the "cb" return code and
> allow rtnl_fdb_dump() to restart the FDB dump with a new skb.
>
> Fixes: e4b27ebc780f ("net: dsa: Add DSA driver for Hirschmann Hellcreek switches")
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Acked-by: Kurt Kanzenbach <kurt@linutronix.de>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]
next prev parent reply other threads:[~2021-08-10 11:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-10 11:19 [PATCH net 0/4] Fix broken backpressure during FDB dump in DSA drivers Vladimir Oltean
2021-08-10 11:19 ` [PATCH net 1/4] net: dsa: hellcreek: fix broken backpressure in .port_fdb_dump Vladimir Oltean
2021-08-10 11:39 ` Kurt Kanzenbach [this message]
2021-08-10 11:19 ` [PATCH net 2/4] net: dsa: lan9303: " Vladimir Oltean
2021-08-10 11:19 ` [PATCH net 3/4] net: dsa: lantiq: " Vladimir Oltean
2021-08-10 11:19 ` [PATCH net 4/4] net: dsa: sja1105: " Vladimir Oltean
2021-08-10 12:20 ` [PATCH net 0/4] Fix broken backpressure during FDB dump in DSA drivers 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=87wnotle9z.fsf@kurt \
--to=kurt@linutronix.de \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=hauke@hauke-m.de \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=privat@egil-hjelmeland.no \
--cc=vivien.didelot@gmail.com \
--cc=vladimir.oltean@nxp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.