diff mbox series

[net-next,01/11] net: Add MDB net device operations

Message ID 20230313145349.3557231-2-idosch@nvidia.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series vxlan: Add MDB support | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next, async
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: 4349 this patch: 4349
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/build_clang success Errors and warnings before: 1003 this patch: 1003
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: 4558 this patch: 4558
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 33 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Ido Schimmel March 13, 2023, 2:53 p.m. UTC
Add MDB net device operations that will be invoked by rtnetlink code in
response to received RTM_{NEW,DEL,GET}MDB messages. Subsequent patches
will implement these operations in the bridge and VXLAN drivers.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
 include/linux/netdevice.h | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

Comments

Nikolay Aleksandrov March 14, 2023, 11:41 a.m. UTC | #1
On 13/03/2023 16:53, Ido Schimmel wrote:
> Add MDB net device operations that will be invoked by rtnetlink code in
> response to received RTM_{NEW,DEL,GET}MDB messages. Subsequent patches
> will implement these operations in the bridge and VXLAN drivers.
> 
> Signed-off-by: Ido Schimmel <idosch@nvidia.com>
> ---
>  include/linux/netdevice.h | 21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index ee483071cf59..23b0d7eaaadd 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -1307,6 +1307,17 @@ struct netdev_net_notifier {
>   *	Used to add FDB entries to dump requests. Implementers should add
>   *	entries to skb and update idx with the number of entries.
>   *
> + * int (*ndo_mdb_add)(struct net_device *dev, struct nlattr *tb[],
> + *		      u16 nlmsg_flags, struct netlink_ext_ack *extack);
> + *	Adds an MDB entry to dev.
> + * int (*ndo_mdb_del)(struct net_device *dev, struct nlattr *tb[],
> + *		      struct netlink_ext_ack *extack);
> + *	Deletes the MDB entry from dev.
> + * int (*ndo_mdb_dump)(struct net_device *dev, struct sk_buff *skb,
> + *		       struct netlink_callback *cb);
> + *	Dumps MDB entries from dev. The first argument (marker) in the netlink
> + *	callback is used by core rtnetlink code.
> + *
>   * int (*ndo_bridge_setlink)(struct net_device *dev, struct nlmsghdr *nlh,
>   *			     u16 flags, struct netlink_ext_ack *extack)
>   * int (*ndo_bridge_getlink)(struct sk_buff *skb, u32 pid, u32 seq,
> @@ -1569,6 +1580,16 @@ struct net_device_ops {
>  					       const unsigned char *addr,
>  					       u16 vid, u32 portid, u32 seq,
>  					       struct netlink_ext_ack *extack);
> +	int			(*ndo_mdb_add)(struct net_device *dev,
> +					       struct nlattr *tb[],
> +					       u16 nlmsg_flags,
> +					       struct netlink_ext_ack *extack);
> +	int			(*ndo_mdb_del)(struct net_device *dev,
> +					       struct nlattr *tb[],
> +					       struct netlink_ext_ack *extack);
> +	int			(*ndo_mdb_dump)(struct net_device *dev,
> +						struct sk_buff *skb,
> +						struct netlink_callback *cb);
>  	int			(*ndo_bridge_setlink)(struct net_device *dev,
>  						      struct nlmsghdr *nlh,
>  						      u16 flags,

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

Patch

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ee483071cf59..23b0d7eaaadd 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1307,6 +1307,17 @@  struct netdev_net_notifier {
  *	Used to add FDB entries to dump requests. Implementers should add
  *	entries to skb and update idx with the number of entries.
  *
+ * int (*ndo_mdb_add)(struct net_device *dev, struct nlattr *tb[],
+ *		      u16 nlmsg_flags, struct netlink_ext_ack *extack);
+ *	Adds an MDB entry to dev.
+ * int (*ndo_mdb_del)(struct net_device *dev, struct nlattr *tb[],
+ *		      struct netlink_ext_ack *extack);
+ *	Deletes the MDB entry from dev.
+ * int (*ndo_mdb_dump)(struct net_device *dev, struct sk_buff *skb,
+ *		       struct netlink_callback *cb);
+ *	Dumps MDB entries from dev. The first argument (marker) in the netlink
+ *	callback is used by core rtnetlink code.
+ *
  * int (*ndo_bridge_setlink)(struct net_device *dev, struct nlmsghdr *nlh,
  *			     u16 flags, struct netlink_ext_ack *extack)
  * int (*ndo_bridge_getlink)(struct sk_buff *skb, u32 pid, u32 seq,
@@ -1569,6 +1580,16 @@  struct net_device_ops {
 					       const unsigned char *addr,
 					       u16 vid, u32 portid, u32 seq,
 					       struct netlink_ext_ack *extack);
+	int			(*ndo_mdb_add)(struct net_device *dev,
+					       struct nlattr *tb[],
+					       u16 nlmsg_flags,
+					       struct netlink_ext_ack *extack);
+	int			(*ndo_mdb_del)(struct net_device *dev,
+					       struct nlattr *tb[],
+					       struct netlink_ext_ack *extack);
+	int			(*ndo_mdb_dump)(struct net_device *dev,
+						struct sk_buff *skb,
+						struct netlink_callback *cb);
 	int			(*ndo_bridge_setlink)(struct net_device *dev,
 						      struct nlmsghdr *nlh,
 						      u16 flags,