Commit 7d3c6fec authored by Jiri Pirko's avatar Jiri Pirko Committed by Jakub Kicinski

devlink: pass flags as an arg of dump_one() callback

In order to easily set NLM_F_DUMP_FILTERED for partial dumps, pass the
flags as an arg of dump_one() callback. Currently, it is always
NLM_F_MULTI.
Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Acked-by: default avatarJakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20230811155714.1736405-7-jiri@resnulli.usSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 24c8e56d
...@@ -218,11 +218,11 @@ int devlink_nl_get_doit(struct sk_buff *skb, struct genl_info *info) ...@@ -218,11 +218,11 @@ int devlink_nl_get_doit(struct sk_buff *skb, struct genl_info *info)
static int static int
devlink_nl_get_dump_one(struct sk_buff *msg, struct devlink *devlink, devlink_nl_get_dump_one(struct sk_buff *msg, struct devlink *devlink,
struct netlink_callback *cb) struct netlink_callback *cb, int flags)
{ {
return devlink_nl_fill(msg, devlink, DEVLINK_CMD_NEW, return devlink_nl_fill(msg, devlink, DEVLINK_CMD_NEW,
NETLINK_CB(cb->skb).portid, NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq, NLM_F_MULTI); cb->nlh->nlmsg_seq, flags);
} }
int devlink_nl_get_dumpit(struct sk_buff *msg, struct netlink_callback *cb) int devlink_nl_get_dumpit(struct sk_buff *msg, struct netlink_callback *cb)
...@@ -828,13 +828,13 @@ int devlink_nl_info_get_doit(struct sk_buff *skb, struct genl_info *info) ...@@ -828,13 +828,13 @@ int devlink_nl_info_get_doit(struct sk_buff *skb, struct genl_info *info)
static int static int
devlink_nl_info_get_dump_one(struct sk_buff *msg, struct devlink *devlink, devlink_nl_info_get_dump_one(struct sk_buff *msg, struct devlink *devlink,
struct netlink_callback *cb) struct netlink_callback *cb, int flags)
{ {
int err; int err;
err = devlink_nl_info_fill(msg, devlink, DEVLINK_CMD_INFO_GET, err = devlink_nl_info_fill(msg, devlink, DEVLINK_CMD_INFO_GET,
NETLINK_CB(cb->skb).portid, NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq, NLM_F_MULTI, cb->nlh->nlmsg_seq, flags,
cb->extack); cb->extack);
if (err == -EOPNOTSUPP) if (err == -EOPNOTSUPP)
err = 0; err = 0;
...@@ -1231,14 +1231,15 @@ int devlink_nl_selftests_get_doit(struct sk_buff *skb, struct genl_info *info) ...@@ -1231,14 +1231,15 @@ int devlink_nl_selftests_get_doit(struct sk_buff *skb, struct genl_info *info)
static int devlink_nl_selftests_get_dump_one(struct sk_buff *msg, static int devlink_nl_selftests_get_dump_one(struct sk_buff *msg,
struct devlink *devlink, struct devlink *devlink,
struct netlink_callback *cb) struct netlink_callback *cb,
int flags)
{ {
if (!devlink->ops->selftest_check) if (!devlink->ops->selftest_check)
return 0; return 0;
return devlink_nl_selftests_fill(msg, devlink, return devlink_nl_selftests_fill(msg, devlink,
NETLINK_CB(cb->skb).portid, NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq, NLM_F_MULTI, cb->nlh->nlmsg_seq, flags,
cb->extack); cb->extack);
} }
......
...@@ -115,7 +115,8 @@ struct devlink_nl_dump_state { ...@@ -115,7 +115,8 @@ struct devlink_nl_dump_state {
typedef int devlink_nl_dump_one_func_t(struct sk_buff *msg, typedef int devlink_nl_dump_one_func_t(struct sk_buff *msg,
struct devlink *devlink, struct devlink *devlink,
struct netlink_callback *cb); struct netlink_callback *cb,
int flags);
extern const struct genl_small_ops devlink_nl_small_ops[54]; extern const struct genl_small_ops devlink_nl_small_ops[54];
......
...@@ -386,7 +386,8 @@ int devlink_nl_health_reporter_get_doit(struct sk_buff *skb, ...@@ -386,7 +386,8 @@ int devlink_nl_health_reporter_get_doit(struct sk_buff *skb,
static int devlink_nl_health_reporter_get_dump_one(struct sk_buff *msg, static int devlink_nl_health_reporter_get_dump_one(struct sk_buff *msg,
struct devlink *devlink, struct devlink *devlink,
struct netlink_callback *cb) struct netlink_callback *cb,
int flags)
{ {
struct devlink_nl_dump_state *state = devlink_dump_state(cb); struct devlink_nl_dump_state *state = devlink_dump_state(cb);
struct devlink_health_reporter *reporter; struct devlink_health_reporter *reporter;
...@@ -404,7 +405,7 @@ static int devlink_nl_health_reporter_get_dump_one(struct sk_buff *msg, ...@@ -404,7 +405,7 @@ static int devlink_nl_health_reporter_get_dump_one(struct sk_buff *msg,
DEVLINK_CMD_HEALTH_REPORTER_GET, DEVLINK_CMD_HEALTH_REPORTER_GET,
NETLINK_CB(cb->skb).portid, NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq, cb->nlh->nlmsg_seq,
NLM_F_MULTI); flags);
if (err) { if (err) {
state->idx = idx; state->idx = idx;
return err; return err;
...@@ -421,7 +422,7 @@ static int devlink_nl_health_reporter_get_dump_one(struct sk_buff *msg, ...@@ -421,7 +422,7 @@ static int devlink_nl_health_reporter_get_dump_one(struct sk_buff *msg,
DEVLINK_CMD_HEALTH_REPORTER_GET, DEVLINK_CMD_HEALTH_REPORTER_GET,
NETLINK_CB(cb->skb).portid, NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq, cb->nlh->nlmsg_seq,
NLM_F_MULTI); flags);
if (err) { if (err) {
state->idx = idx; state->idx = idx;
return err; return err;
......
...@@ -1006,7 +1006,7 @@ static void devlink_rate_notify(struct devlink_rate *devlink_rate, ...@@ -1006,7 +1006,7 @@ static void devlink_rate_notify(struct devlink_rate *devlink_rate,
static int static int
devlink_nl_rate_get_dump_one(struct sk_buff *msg, struct devlink *devlink, devlink_nl_rate_get_dump_one(struct sk_buff *msg, struct devlink *devlink,
struct netlink_callback *cb) struct netlink_callback *cb, int flags)
{ {
struct devlink_nl_dump_state *state = devlink_dump_state(cb); struct devlink_nl_dump_state *state = devlink_dump_state(cb);
struct devlink_rate *devlink_rate; struct devlink_rate *devlink_rate;
...@@ -1022,8 +1022,7 @@ devlink_nl_rate_get_dump_one(struct sk_buff *msg, struct devlink *devlink, ...@@ -1022,8 +1022,7 @@ devlink_nl_rate_get_dump_one(struct sk_buff *msg, struct devlink *devlink,
continue; continue;
} }
err = devlink_nl_rate_fill(msg, devlink_rate, cmd, id, err = devlink_nl_rate_fill(msg, devlink_rate, cmd, id,
cb->nlh->nlmsg_seq, cb->nlh->nlmsg_seq, flags, NULL);
NLM_F_MULTI, NULL);
if (err) { if (err) {
state->idx = idx; state->idx = idx;
break; break;
...@@ -1100,7 +1099,7 @@ int devlink_nl_port_get_doit(struct sk_buff *skb, struct genl_info *info) ...@@ -1100,7 +1099,7 @@ int devlink_nl_port_get_doit(struct sk_buff *skb, struct genl_info *info)
static int static int
devlink_nl_port_get_dump_one(struct sk_buff *msg, struct devlink *devlink, devlink_nl_port_get_dump_one(struct sk_buff *msg, struct devlink *devlink,
struct netlink_callback *cb) struct netlink_callback *cb, int flags)
{ {
struct devlink_nl_dump_state *state = devlink_dump_state(cb); struct devlink_nl_dump_state *state = devlink_dump_state(cb);
struct devlink_port *devlink_port; struct devlink_port *devlink_port;
...@@ -1111,8 +1110,8 @@ devlink_nl_port_get_dump_one(struct sk_buff *msg, struct devlink *devlink, ...@@ -1111,8 +1110,8 @@ devlink_nl_port_get_dump_one(struct sk_buff *msg, struct devlink *devlink,
err = devlink_nl_port_fill(msg, devlink_port, err = devlink_nl_port_fill(msg, devlink_port,
DEVLINK_CMD_NEW, DEVLINK_CMD_NEW,
NETLINK_CB(cb->skb).portid, NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq, cb->nlh->nlmsg_seq, flags,
NLM_F_MULTI, cb->extack); cb->extack);
if (err) { if (err) {
state->idx = port_index; state->idx = port_index;
break; break;
...@@ -1856,7 +1855,8 @@ int devlink_nl_linecard_get_doit(struct sk_buff *skb, struct genl_info *info) ...@@ -1856,7 +1855,8 @@ int devlink_nl_linecard_get_doit(struct sk_buff *skb, struct genl_info *info)
static int devlink_nl_linecard_get_dump_one(struct sk_buff *msg, static int devlink_nl_linecard_get_dump_one(struct sk_buff *msg,
struct devlink *devlink, struct devlink *devlink,
struct netlink_callback *cb) struct netlink_callback *cb,
int flags)
{ {
struct devlink_nl_dump_state *state = devlink_dump_state(cb); struct devlink_nl_dump_state *state = devlink_dump_state(cb);
struct devlink_linecard *linecard; struct devlink_linecard *linecard;
...@@ -1872,8 +1872,7 @@ static int devlink_nl_linecard_get_dump_one(struct sk_buff *msg, ...@@ -1872,8 +1872,7 @@ static int devlink_nl_linecard_get_dump_one(struct sk_buff *msg,
err = devlink_nl_linecard_fill(msg, devlink, linecard, err = devlink_nl_linecard_fill(msg, devlink, linecard,
DEVLINK_CMD_LINECARD_NEW, DEVLINK_CMD_LINECARD_NEW,
NETLINK_CB(cb->skb).portid, NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq, cb->nlh->nlmsg_seq, flags,
NLM_F_MULTI,
cb->extack); cb->extack);
mutex_unlock(&linecard->state_lock); mutex_unlock(&linecard->state_lock);
if (err) { if (err) {
...@@ -2120,7 +2119,7 @@ int devlink_nl_sb_get_doit(struct sk_buff *skb, struct genl_info *info) ...@@ -2120,7 +2119,7 @@ int devlink_nl_sb_get_doit(struct sk_buff *skb, struct genl_info *info)
static int static int
devlink_nl_sb_get_dump_one(struct sk_buff *msg, struct devlink *devlink, devlink_nl_sb_get_dump_one(struct sk_buff *msg, struct devlink *devlink,
struct netlink_callback *cb) struct netlink_callback *cb, int flags)
{ {
struct devlink_nl_dump_state *state = devlink_dump_state(cb); struct devlink_nl_dump_state *state = devlink_dump_state(cb);
struct devlink_sb *devlink_sb; struct devlink_sb *devlink_sb;
...@@ -2135,8 +2134,7 @@ devlink_nl_sb_get_dump_one(struct sk_buff *msg, struct devlink *devlink, ...@@ -2135,8 +2134,7 @@ devlink_nl_sb_get_dump_one(struct sk_buff *msg, struct devlink *devlink,
err = devlink_nl_sb_fill(msg, devlink, devlink_sb, err = devlink_nl_sb_fill(msg, devlink, devlink_sb,
DEVLINK_CMD_SB_NEW, DEVLINK_CMD_SB_NEW,
NETLINK_CB(cb->skb).portid, NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq, cb->nlh->nlmsg_seq, flags);
NLM_F_MULTI);
if (err) { if (err) {
state->idx = idx; state->idx = idx;
break; break;
...@@ -2233,7 +2231,7 @@ int devlink_nl_sb_pool_get_doit(struct sk_buff *skb, struct genl_info *info) ...@@ -2233,7 +2231,7 @@ int devlink_nl_sb_pool_get_doit(struct sk_buff *skb, struct genl_info *info)
static int __sb_pool_get_dumpit(struct sk_buff *msg, int start, int *p_idx, static int __sb_pool_get_dumpit(struct sk_buff *msg, int start, int *p_idx,
struct devlink *devlink, struct devlink *devlink,
struct devlink_sb *devlink_sb, struct devlink_sb *devlink_sb,
u32 portid, u32 seq) u32 portid, u32 seq, int flags)
{ {
u16 pool_count = devlink_sb_pool_count(devlink_sb); u16 pool_count = devlink_sb_pool_count(devlink_sb);
u16 pool_index; u16 pool_index;
...@@ -2248,7 +2246,7 @@ static int __sb_pool_get_dumpit(struct sk_buff *msg, int start, int *p_idx, ...@@ -2248,7 +2246,7 @@ static int __sb_pool_get_dumpit(struct sk_buff *msg, int start, int *p_idx,
devlink_sb, devlink_sb,
pool_index, pool_index,
DEVLINK_CMD_SB_POOL_NEW, DEVLINK_CMD_SB_POOL_NEW,
portid, seq, NLM_F_MULTI); portid, seq, flags);
if (err) if (err)
return err; return err;
(*p_idx)++; (*p_idx)++;
...@@ -2258,7 +2256,7 @@ static int __sb_pool_get_dumpit(struct sk_buff *msg, int start, int *p_idx, ...@@ -2258,7 +2256,7 @@ static int __sb_pool_get_dumpit(struct sk_buff *msg, int start, int *p_idx,
static int static int
devlink_nl_sb_pool_get_dump_one(struct sk_buff *msg, struct devlink *devlink, devlink_nl_sb_pool_get_dump_one(struct sk_buff *msg, struct devlink *devlink,
struct netlink_callback *cb) struct netlink_callback *cb, int flags)
{ {
struct devlink_nl_dump_state *state = devlink_dump_state(cb); struct devlink_nl_dump_state *state = devlink_dump_state(cb);
struct devlink_sb *devlink_sb; struct devlink_sb *devlink_sb;
...@@ -2272,7 +2270,7 @@ devlink_nl_sb_pool_get_dump_one(struct sk_buff *msg, struct devlink *devlink, ...@@ -2272,7 +2270,7 @@ devlink_nl_sb_pool_get_dump_one(struct sk_buff *msg, struct devlink *devlink,
err = __sb_pool_get_dumpit(msg, state->idx, &idx, err = __sb_pool_get_dumpit(msg, state->idx, &idx,
devlink, devlink_sb, devlink, devlink_sb,
NETLINK_CB(cb->skb).portid, NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq); cb->nlh->nlmsg_seq, flags);
if (err == -EOPNOTSUPP) { if (err == -EOPNOTSUPP) {
err = 0; err = 0;
} else if (err) { } else if (err) {
...@@ -2436,7 +2434,7 @@ int devlink_nl_sb_port_pool_get_doit(struct sk_buff *skb, ...@@ -2436,7 +2434,7 @@ int devlink_nl_sb_port_pool_get_doit(struct sk_buff *skb,
static int __sb_port_pool_get_dumpit(struct sk_buff *msg, int start, int *p_idx, static int __sb_port_pool_get_dumpit(struct sk_buff *msg, int start, int *p_idx,
struct devlink *devlink, struct devlink *devlink,
struct devlink_sb *devlink_sb, struct devlink_sb *devlink_sb,
u32 portid, u32 seq) u32 portid, u32 seq, int flags)
{ {
struct devlink_port *devlink_port; struct devlink_port *devlink_port;
u16 pool_count = devlink_sb_pool_count(devlink_sb); u16 pool_count = devlink_sb_pool_count(devlink_sb);
...@@ -2455,8 +2453,7 @@ static int __sb_port_pool_get_dumpit(struct sk_buff *msg, int start, int *p_idx, ...@@ -2455,8 +2453,7 @@ static int __sb_port_pool_get_dumpit(struct sk_buff *msg, int start, int *p_idx,
devlink_sb, devlink_sb,
pool_index, pool_index,
DEVLINK_CMD_SB_PORT_POOL_NEW, DEVLINK_CMD_SB_PORT_POOL_NEW,
portid, seq, portid, seq, flags);
NLM_F_MULTI);
if (err) if (err)
return err; return err;
(*p_idx)++; (*p_idx)++;
...@@ -2468,7 +2465,7 @@ static int __sb_port_pool_get_dumpit(struct sk_buff *msg, int start, int *p_idx, ...@@ -2468,7 +2465,7 @@ static int __sb_port_pool_get_dumpit(struct sk_buff *msg, int start, int *p_idx,
static int static int
devlink_nl_sb_port_pool_get_dump_one(struct sk_buff *msg, devlink_nl_sb_port_pool_get_dump_one(struct sk_buff *msg,
struct devlink *devlink, struct devlink *devlink,
struct netlink_callback *cb) struct netlink_callback *cb, int flags)
{ {
struct devlink_nl_dump_state *state = devlink_dump_state(cb); struct devlink_nl_dump_state *state = devlink_dump_state(cb);
struct devlink_sb *devlink_sb; struct devlink_sb *devlink_sb;
...@@ -2482,7 +2479,7 @@ devlink_nl_sb_port_pool_get_dump_one(struct sk_buff *msg, ...@@ -2482,7 +2479,7 @@ devlink_nl_sb_port_pool_get_dump_one(struct sk_buff *msg,
err = __sb_port_pool_get_dumpit(msg, state->idx, &idx, err = __sb_port_pool_get_dumpit(msg, state->idx, &idx,
devlink, devlink_sb, devlink, devlink_sb,
NETLINK_CB(cb->skb).portid, NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq); cb->nlh->nlmsg_seq, flags);
if (err == -EOPNOTSUPP) { if (err == -EOPNOTSUPP) {
err = 0; err = 0;
} else if (err) { } else if (err) {
...@@ -2654,7 +2651,7 @@ static int __sb_tc_pool_bind_get_dumpit(struct sk_buff *msg, ...@@ -2654,7 +2651,7 @@ static int __sb_tc_pool_bind_get_dumpit(struct sk_buff *msg,
int start, int *p_idx, int start, int *p_idx,
struct devlink *devlink, struct devlink *devlink,
struct devlink_sb *devlink_sb, struct devlink_sb *devlink_sb,
u32 portid, u32 seq) u32 portid, u32 seq, int flags)
{ {
struct devlink_port *devlink_port; struct devlink_port *devlink_port;
unsigned long port_index; unsigned long port_index;
...@@ -2675,7 +2672,7 @@ static int __sb_tc_pool_bind_get_dumpit(struct sk_buff *msg, ...@@ -2675,7 +2672,7 @@ static int __sb_tc_pool_bind_get_dumpit(struct sk_buff *msg,
DEVLINK_SB_POOL_TYPE_INGRESS, DEVLINK_SB_POOL_TYPE_INGRESS,
DEVLINK_CMD_SB_TC_POOL_BIND_NEW, DEVLINK_CMD_SB_TC_POOL_BIND_NEW,
portid, seq, portid, seq,
NLM_F_MULTI); flags);
if (err) if (err)
return err; return err;
(*p_idx)++; (*p_idx)++;
...@@ -2693,7 +2690,7 @@ static int __sb_tc_pool_bind_get_dumpit(struct sk_buff *msg, ...@@ -2693,7 +2690,7 @@ static int __sb_tc_pool_bind_get_dumpit(struct sk_buff *msg,
DEVLINK_SB_POOL_TYPE_EGRESS, DEVLINK_SB_POOL_TYPE_EGRESS,
DEVLINK_CMD_SB_TC_POOL_BIND_NEW, DEVLINK_CMD_SB_TC_POOL_BIND_NEW,
portid, seq, portid, seq,
NLM_F_MULTI); flags);
if (err) if (err)
return err; return err;
(*p_idx)++; (*p_idx)++;
...@@ -2704,7 +2701,8 @@ static int __sb_tc_pool_bind_get_dumpit(struct sk_buff *msg, ...@@ -2704,7 +2701,8 @@ static int __sb_tc_pool_bind_get_dumpit(struct sk_buff *msg,
static int devlink_nl_sb_tc_pool_bind_get_dump_one(struct sk_buff *msg, static int devlink_nl_sb_tc_pool_bind_get_dump_one(struct sk_buff *msg,
struct devlink *devlink, struct devlink *devlink,
struct netlink_callback *cb) struct netlink_callback *cb,
int flags)
{ {
struct devlink_nl_dump_state *state = devlink_dump_state(cb); struct devlink_nl_dump_state *state = devlink_dump_state(cb);
struct devlink_sb *devlink_sb; struct devlink_sb *devlink_sb;
...@@ -2718,7 +2716,7 @@ static int devlink_nl_sb_tc_pool_bind_get_dump_one(struct sk_buff *msg, ...@@ -2718,7 +2716,7 @@ static int devlink_nl_sb_tc_pool_bind_get_dump_one(struct sk_buff *msg,
err = __sb_tc_pool_bind_get_dumpit(msg, state->idx, &idx, err = __sb_tc_pool_bind_get_dumpit(msg, state->idx, &idx,
devlink, devlink_sb, devlink, devlink_sb,
NETLINK_CB(cb->skb).portid, NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq); cb->nlh->nlmsg_seq, flags);
if (err == -EOPNOTSUPP) { if (err == -EOPNOTSUPP) {
err = 0; err = 0;
} else if (err) { } else if (err) {
...@@ -4185,7 +4183,8 @@ static void devlink_param_notify(struct devlink *devlink, ...@@ -4185,7 +4183,8 @@ static void devlink_param_notify(struct devlink *devlink,
static int devlink_nl_param_get_dump_one(struct sk_buff *msg, static int devlink_nl_param_get_dump_one(struct sk_buff *msg,
struct devlink *devlink, struct devlink *devlink,
struct netlink_callback *cb) struct netlink_callback *cb,
int flags)
{ {
struct devlink_nl_dump_state *state = devlink_dump_state(cb); struct devlink_nl_dump_state *state = devlink_dump_state(cb);
struct devlink_param_item *param_item; struct devlink_param_item *param_item;
...@@ -4196,8 +4195,7 @@ static int devlink_nl_param_get_dump_one(struct sk_buff *msg, ...@@ -4196,8 +4195,7 @@ static int devlink_nl_param_get_dump_one(struct sk_buff *msg,
err = devlink_nl_param_fill(msg, devlink, 0, param_item, err = devlink_nl_param_fill(msg, devlink, 0, param_item,
DEVLINK_CMD_PARAM_GET, DEVLINK_CMD_PARAM_GET,
NETLINK_CB(cb->skb).portid, NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq, cb->nlh->nlmsg_seq, flags);
NLM_F_MULTI);
if (err == -EOPNOTSUPP) { if (err == -EOPNOTSUPP) {
err = 0; err = 0;
} else if (err) { } else if (err) {
...@@ -4848,8 +4846,7 @@ int devlink_nl_region_get_doit(struct sk_buff *skb, struct genl_info *info) ...@@ -4848,8 +4846,7 @@ int devlink_nl_region_get_doit(struct sk_buff *skb, struct genl_info *info)
static int devlink_nl_cmd_region_get_port_dumpit(struct sk_buff *msg, static int devlink_nl_cmd_region_get_port_dumpit(struct sk_buff *msg,
struct netlink_callback *cb, struct netlink_callback *cb,
struct devlink_port *port, struct devlink_port *port,
int *idx, int *idx, int start, int flags)
int start)
{ {
struct devlink_region *region; struct devlink_region *region;
int err = 0; int err = 0;
...@@ -4863,7 +4860,7 @@ static int devlink_nl_cmd_region_get_port_dumpit(struct sk_buff *msg, ...@@ -4863,7 +4860,7 @@ static int devlink_nl_cmd_region_get_port_dumpit(struct sk_buff *msg,
DEVLINK_CMD_REGION_GET, DEVLINK_CMD_REGION_GET,
NETLINK_CB(cb->skb).portid, NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq, cb->nlh->nlmsg_seq,
NLM_F_MULTI, region); flags, region);
if (err) if (err)
goto out; goto out;
(*idx)++; (*idx)++;
...@@ -4875,7 +4872,8 @@ static int devlink_nl_cmd_region_get_port_dumpit(struct sk_buff *msg, ...@@ -4875,7 +4872,8 @@ static int devlink_nl_cmd_region_get_port_dumpit(struct sk_buff *msg,
static int devlink_nl_region_get_dump_one(struct sk_buff *msg, static int devlink_nl_region_get_dump_one(struct sk_buff *msg,
struct devlink *devlink, struct devlink *devlink,
struct netlink_callback *cb) struct netlink_callback *cb,
int flags)
{ {
struct devlink_nl_dump_state *state = devlink_dump_state(cb); struct devlink_nl_dump_state *state = devlink_dump_state(cb);
struct devlink_region *region; struct devlink_region *region;
...@@ -4892,8 +4890,8 @@ static int devlink_nl_region_get_dump_one(struct sk_buff *msg, ...@@ -4892,8 +4890,8 @@ static int devlink_nl_region_get_dump_one(struct sk_buff *msg,
err = devlink_nl_region_fill(msg, devlink, err = devlink_nl_region_fill(msg, devlink,
DEVLINK_CMD_REGION_GET, DEVLINK_CMD_REGION_GET,
NETLINK_CB(cb->skb).portid, NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq, cb->nlh->nlmsg_seq, flags,
NLM_F_MULTI, region); region);
if (err) { if (err) {
state->idx = idx; state->idx = idx;
return err; return err;
...@@ -4903,7 +4901,7 @@ static int devlink_nl_region_get_dump_one(struct sk_buff *msg, ...@@ -4903,7 +4901,7 @@ static int devlink_nl_region_get_dump_one(struct sk_buff *msg,
xa_for_each(&devlink->ports, port_index, port) { xa_for_each(&devlink->ports, port_index, port) {
err = devlink_nl_cmd_region_get_port_dumpit(msg, cb, port, &idx, err = devlink_nl_cmd_region_get_port_dumpit(msg, cb, port, &idx,
state->idx); state->idx, flags);
if (err) { if (err) {
state->idx = idx; state->idx = idx;
return err; return err;
...@@ -5699,7 +5697,7 @@ int devlink_nl_trap_get_doit(struct sk_buff *skb, struct genl_info *info) ...@@ -5699,7 +5697,7 @@ int devlink_nl_trap_get_doit(struct sk_buff *skb, struct genl_info *info)
static int devlink_nl_trap_get_dump_one(struct sk_buff *msg, static int devlink_nl_trap_get_dump_one(struct sk_buff *msg,
struct devlink *devlink, struct devlink *devlink,
struct netlink_callback *cb) struct netlink_callback *cb, int flags)
{ {
struct devlink_nl_dump_state *state = devlink_dump_state(cb); struct devlink_nl_dump_state *state = devlink_dump_state(cb);
struct devlink_trap_item *trap_item; struct devlink_trap_item *trap_item;
...@@ -5714,8 +5712,7 @@ static int devlink_nl_trap_get_dump_one(struct sk_buff *msg, ...@@ -5714,8 +5712,7 @@ static int devlink_nl_trap_get_dump_one(struct sk_buff *msg,
err = devlink_nl_trap_fill(msg, devlink, trap_item, err = devlink_nl_trap_fill(msg, devlink, trap_item,
DEVLINK_CMD_TRAP_NEW, DEVLINK_CMD_TRAP_NEW,
NETLINK_CB(cb->skb).portid, NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq, cb->nlh->nlmsg_seq, flags);
NLM_F_MULTI);
if (err) { if (err) {
state->idx = idx; state->idx = idx;
break; break;
...@@ -5910,7 +5907,8 @@ int devlink_nl_trap_group_get_doit(struct sk_buff *skb, struct genl_info *info) ...@@ -5910,7 +5907,8 @@ int devlink_nl_trap_group_get_doit(struct sk_buff *skb, struct genl_info *info)
static int devlink_nl_trap_group_get_dump_one(struct sk_buff *msg, static int devlink_nl_trap_group_get_dump_one(struct sk_buff *msg,
struct devlink *devlink, struct devlink *devlink,
struct netlink_callback *cb) struct netlink_callback *cb,
int flags)
{ {
struct devlink_nl_dump_state *state = devlink_dump_state(cb); struct devlink_nl_dump_state *state = devlink_dump_state(cb);
struct devlink_trap_group_item *group_item; struct devlink_trap_group_item *group_item;
...@@ -5926,8 +5924,7 @@ static int devlink_nl_trap_group_get_dump_one(struct sk_buff *msg, ...@@ -5926,8 +5924,7 @@ static int devlink_nl_trap_group_get_dump_one(struct sk_buff *msg,
err = devlink_nl_trap_group_fill(msg, devlink, group_item, err = devlink_nl_trap_group_fill(msg, devlink, group_item,
DEVLINK_CMD_TRAP_GROUP_NEW, DEVLINK_CMD_TRAP_GROUP_NEW,
NETLINK_CB(cb->skb).portid, NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq, cb->nlh->nlmsg_seq, flags);
NLM_F_MULTI);
if (err) { if (err) {
state->idx = idx; state->idx = idx;
break; break;
...@@ -6205,7 +6202,8 @@ int devlink_nl_trap_policer_get_doit(struct sk_buff *skb, ...@@ -6205,7 +6202,8 @@ int devlink_nl_trap_policer_get_doit(struct sk_buff *skb,
static int devlink_nl_trap_policer_get_dump_one(struct sk_buff *msg, static int devlink_nl_trap_policer_get_dump_one(struct sk_buff *msg,
struct devlink *devlink, struct devlink *devlink,
struct netlink_callback *cb) struct netlink_callback *cb,
int flags)
{ {
struct devlink_nl_dump_state *state = devlink_dump_state(cb); struct devlink_nl_dump_state *state = devlink_dump_state(cb);
struct devlink_trap_policer_item *policer_item; struct devlink_trap_policer_item *policer_item;
...@@ -6220,8 +6218,7 @@ static int devlink_nl_trap_policer_get_dump_one(struct sk_buff *msg, ...@@ -6220,8 +6218,7 @@ static int devlink_nl_trap_policer_get_dump_one(struct sk_buff *msg,
err = devlink_nl_trap_policer_fill(msg, devlink, policer_item, err = devlink_nl_trap_policer_fill(msg, devlink, policer_item,
DEVLINK_CMD_TRAP_POLICER_NEW, DEVLINK_CMD_TRAP_POLICER_NEW,
NETLINK_CB(cb->skb).portid, NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq, cb->nlh->nlmsg_seq, flags);
NLM_F_MULTI);
if (err) { if (err) {
state->idx = idx; state->idx = idx;
break; break;
......
...@@ -182,7 +182,7 @@ int devlink_nl_dumpit(struct sk_buff *msg, struct netlink_callback *cb, ...@@ -182,7 +182,7 @@ int devlink_nl_dumpit(struct sk_buff *msg, struct netlink_callback *cb,
devl_lock(devlink); devl_lock(devlink);
if (devl_is_registered(devlink)) if (devl_is_registered(devlink))
err = dump_one(msg, devlink, cb); err = dump_one(msg, devlink, cb, NLM_F_MULTI);
else else
err = 0; err = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment