diff mbox series

[net-next,4/9] rtnetlink: bridge: Invoke MDB bulk deletion when needed

Message ID 20231217083244.4076193-5-idosch@nvidia.com (mailing list archive)
State Accepted
Commit d8e81f131178dad603c6817421056030ed2f4ac2
Delegated to: Netdev Maintainers
Headers show
Series Add MDB bulk deletion support | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next, async
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1117 this patch: 1117
netdev/cc_maintainers warning 1 maintainers not CCed: lucien.xin@gmail.com
netdev/build_clang success Errors and warnings before: 1143 this patch: 1143
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1144 this patch: 1144
netdev/checkpatch warning WARNING: line length of 92 exceeds 80 columns
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Ido Schimmel Dec. 17, 2023, 8:32 a.m. UTC
Invoke the new MDB bulk deletion device operation when the 'NLM_F_BULK'
flag is set in the netlink message header.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
---
 net/core/rtnetlink.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Nikolay Aleksandrov Dec. 18, 2023, 10:09 a.m. UTC | #1
On 17/12/2023 10:32, Ido Schimmel wrote:
> Invoke the new MDB bulk deletion device operation when the 'NLM_F_BULK'
> flag is set in the netlink message header.
> 
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> Reviewed-by: Petr Machata <petrm@nvidia.com>
> ---
>   net/core/rtnetlink.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index 30f030a672f2..349255151ad0 100644
> --- a/net/core/rtnetlink.c
> +++ b/net/core/rtnetlink.c
> @@ -6494,6 +6494,14 @@ static int rtnl_mdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,
>   		return -EINVAL;
>   	}
>   
> +	if (del_bulk) {
> +		if (!dev->netdev_ops->ndo_mdb_del_bulk) {
> +			NL_SET_ERR_MSG(extack, "Device does not support MDB bulk deletion");
> +			return -EOPNOTSUPP;
> +		}
> +		return dev->netdev_ops->ndo_mdb_del_bulk(dev, tb, extack);
> +	}
> +
>   	if (!dev->netdev_ops->ndo_mdb_del) {
>   		NL_SET_ERR_MSG(extack, "Device does not support MDB operations");
>   		return -EOPNOTSUPP;

Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
diff mbox series

Patch

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 30f030a672f2..349255151ad0 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -6494,6 +6494,14 @@  static int rtnl_mdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,
 		return -EINVAL;
 	}
 
+	if (del_bulk) {
+		if (!dev->netdev_ops->ndo_mdb_del_bulk) {
+			NL_SET_ERR_MSG(extack, "Device does not support MDB bulk deletion");
+			return -EOPNOTSUPP;
+		}
+		return dev->netdev_ops->ndo_mdb_del_bulk(dev, tb, extack);
+	}
+
 	if (!dev->netdev_ops->ndo_mdb_del) {
 		NL_SET_ERR_MSG(extack, "Device does not support MDB operations");
 		return -EOPNOTSUPP;