Skip to content

Commit 9edbe6f

Browse files
Jiri Pirkokuba-moo
authored andcommitted
devlink: push linecard related code into separate file
Cut out another chunk from leftover.c and put linecard related code into a separate file. Signed-off-by: Jiri Pirko <jiri@nvidia.com> Link: https://lore.kernel.org/r/20230828061657.300667-13-jiri@resnulli.us Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 7cc7194 commit 9edbe6f

4 files changed

Lines changed: 626 additions & 615 deletions

File tree

net/devlink/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# SPDX-License-Identifier: GPL-2.0
22

33
obj-y := leftover.o core.o netlink.o netlink_gen.o dev.o port.o sb.o dpipe.o \
4-
resource.o param.o region.o health.o trap.o rate.o
4+
resource.o param.o region.o health.o trap.o rate.o linecard.o

net/devlink/devl_internal.h

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ void devlink_traps_notify_register(struct devlink *devlink);
168168
void devlink_traps_notify_unregister(struct devlink *devlink);
169169
void devlink_rates_notify_register(struct devlink *devlink);
170170
void devlink_rates_notify_unregister(struct devlink *devlink);
171+
void devlink_linecards_notify_register(struct devlink *devlink);
172+
void devlink_linecards_notify_unregister(struct devlink *devlink);
171173

172174
/* Ports */
173175
#define ASSERT_DEVLINK_PORT_INITIALIZED(devlink_port) \
@@ -182,21 +184,6 @@ devlink_port_get_from_info(struct devlink *devlink, struct genl_info *info);
182184
struct devlink_port *devlink_port_get_from_attrs(struct devlink *devlink,
183185
struct nlattr **attrs);
184186

185-
/* Linecards */
186-
struct devlink_linecard {
187-
struct list_head list;
188-
struct devlink *devlink;
189-
unsigned int index;
190-
const struct devlink_linecard_ops *ops;
191-
void *priv;
192-
enum devlink_linecard_state state;
193-
struct mutex state_lock; /* Protects state */
194-
const char *type;
195-
struct devlink_linecard_type *types;
196-
unsigned int types_count;
197-
struct devlink *nested_devlink;
198-
};
199-
200187
/* Reload */
201188
bool devlink_reload_actions_valid(const struct devlink_ops *ops);
202189
int devlink_reload(struct devlink *devlink, struct net *dest_net,
@@ -222,6 +209,21 @@ int devlink_resources_validate(struct devlink *devlink,
222209
int devlink_rate_nodes_check(struct devlink *devlink, u16 mode,
223210
struct netlink_ext_ack *extack);
224211

212+
/* Linecards */
213+
struct devlink_linecard {
214+
struct list_head list;
215+
struct devlink *devlink;
216+
unsigned int index;
217+
const struct devlink_linecard_ops *ops;
218+
void *priv;
219+
enum devlink_linecard_state state;
220+
struct mutex state_lock; /* Protects state */
221+
const char *type;
222+
struct devlink_linecard_type *types;
223+
unsigned int types_count;
224+
struct devlink *nested_devlink;
225+
};
226+
225227
/* Devlink nl cmds */
226228
int devlink_nl_cmd_reload(struct sk_buff *skb, struct genl_info *info);
227229
int devlink_nl_cmd_eswitch_get_doit(struct sk_buff *skb, struct genl_info *info);
@@ -283,3 +285,5 @@ int devlink_nl_cmd_trap_policer_set_doit(struct sk_buff *skb,
283285
int devlink_nl_cmd_rate_set_doit(struct sk_buff *skb, struct genl_info *info);
284286
int devlink_nl_cmd_rate_new_doit(struct sk_buff *skb, struct genl_info *info);
285287
int devlink_nl_cmd_rate_del_doit(struct sk_buff *skb, struct genl_info *info);
288+
int devlink_nl_cmd_linecard_set_doit(struct sk_buff *skb,
289+
struct genl_info *info);

0 commit comments

Comments
 (0)