Commit 0f4d44f6 authored by Jiri Pirko's avatar Jiri Pirko Committed by Jakub Kicinski

netlink: specs: devlink: fix reply command values

Make sure that the command values used for replies are correct. This is
only affecting generated userspace helpers, no change on kernel code.

Fixes: 7199c862 ("netlink: specs: devlink: add commands that do per-instance dump")
Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Link: https://lore.kernel.org/r/20231012115811.298129-1-jiri@resnulli.usSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent c68681ae
...@@ -323,7 +323,7 @@ operations: ...@@ -323,7 +323,7 @@ operations:
- dev-name - dev-name
- sb-index - sb-index
reply: &sb-get-reply reply: &sb-get-reply
value: 11 value: 13
attributes: *sb-id-attrs attributes: *sb-id-attrs
dump: dump:
request: request:
...@@ -350,7 +350,7 @@ operations: ...@@ -350,7 +350,7 @@ operations:
- sb-index - sb-index
- sb-pool-index - sb-pool-index
reply: &sb-pool-get-reply reply: &sb-pool-get-reply
value: 15 value: 17
attributes: *sb-pool-id-attrs attributes: *sb-pool-id-attrs
dump: dump:
request: request:
...@@ -378,7 +378,7 @@ operations: ...@@ -378,7 +378,7 @@ operations:
- sb-index - sb-index
- sb-pool-index - sb-pool-index
reply: &sb-port-pool-get-reply reply: &sb-port-pool-get-reply
value: 19 value: 21
attributes: *sb-port-pool-id-attrs attributes: *sb-port-pool-id-attrs
dump: dump:
request: request:
...@@ -407,7 +407,7 @@ operations: ...@@ -407,7 +407,7 @@ operations:
- sb-pool-type - sb-pool-type
- sb-tc-index - sb-tc-index
reply: &sb-tc-pool-bind-get-reply reply: &sb-tc-pool-bind-get-reply
value: 23 value: 25
attributes: *sb-tc-pool-bind-id-attrs attributes: *sb-tc-pool-bind-id-attrs
dump: dump:
request: request:
...@@ -538,7 +538,7 @@ operations: ...@@ -538,7 +538,7 @@ operations:
- dev-name - dev-name
- trap-name - trap-name
reply: &trap-get-reply reply: &trap-get-reply
value: 61 value: 63
attributes: *trap-id-attrs attributes: *trap-id-attrs
dump: dump:
request: request:
...@@ -564,7 +564,7 @@ operations: ...@@ -564,7 +564,7 @@ operations:
- dev-name - dev-name
- trap-group-name - trap-group-name
reply: &trap-group-get-reply reply: &trap-group-get-reply
value: 65 value: 67
attributes: *trap-group-id-attrs attributes: *trap-group-id-attrs
dump: dump:
request: request:
...@@ -590,7 +590,7 @@ operations: ...@@ -590,7 +590,7 @@ operations:
- dev-name - dev-name
- trap-policer-id - trap-policer-id
reply: &trap-policer-get-reply reply: &trap-policer-get-reply
value: 69 value: 71
attributes: *trap-policer-id-attrs attributes: *trap-policer-id-attrs
dump: dump:
request: request:
...@@ -617,7 +617,7 @@ operations: ...@@ -617,7 +617,7 @@ operations:
- port-index - port-index
- rate-node-name - rate-node-name
reply: &rate-get-reply reply: &rate-get-reply
value: 74 value: 76
attributes: *rate-id-attrs attributes: *rate-id-attrs
dump: dump:
request: request:
...@@ -643,7 +643,7 @@ operations: ...@@ -643,7 +643,7 @@ operations:
- dev-name - dev-name
- linecard-index - linecard-index
reply: &linecard-get-reply reply: &linecard-get-reply
value: 78 value: 80
attributes: *linecard-id-attrs attributes: *linecard-id-attrs
dump: dump:
request: request:
......
...@@ -16,19 +16,19 @@ ...@@ -16,19 +16,19 @@
static const char * const devlink_op_strmap[] = { static const char * const devlink_op_strmap[] = {
[3] = "get", [3] = "get",
[7] = "port-get", [7] = "port-get",
[DEVLINK_CMD_SB_GET] = "sb-get", [13] = "sb-get",
[DEVLINK_CMD_SB_POOL_GET] = "sb-pool-get", [17] = "sb-pool-get",
[DEVLINK_CMD_SB_PORT_POOL_GET] = "sb-port-pool-get", [21] = "sb-port-pool-get",
[DEVLINK_CMD_SB_TC_POOL_BIND_GET] = "sb-tc-pool-bind-get", [25] = "sb-tc-pool-bind-get",
[DEVLINK_CMD_PARAM_GET] = "param-get", [DEVLINK_CMD_PARAM_GET] = "param-get",
[DEVLINK_CMD_REGION_GET] = "region-get", [DEVLINK_CMD_REGION_GET] = "region-get",
[DEVLINK_CMD_INFO_GET] = "info-get", [DEVLINK_CMD_INFO_GET] = "info-get",
[DEVLINK_CMD_HEALTH_REPORTER_GET] = "health-reporter-get", [DEVLINK_CMD_HEALTH_REPORTER_GET] = "health-reporter-get",
[DEVLINK_CMD_TRAP_GET] = "trap-get", [63] = "trap-get",
[DEVLINK_CMD_TRAP_GROUP_GET] = "trap-group-get", [67] = "trap-group-get",
[DEVLINK_CMD_TRAP_POLICER_GET] = "trap-policer-get", [71] = "trap-policer-get",
[DEVLINK_CMD_RATE_GET] = "rate-get", [76] = "rate-get",
[DEVLINK_CMD_LINECARD_GET] = "linecard-get", [80] = "linecard-get",
[DEVLINK_CMD_SELFTESTS_GET] = "selftests-get", [DEVLINK_CMD_SELFTESTS_GET] = "selftests-get",
}; };
...@@ -838,7 +838,7 @@ devlink_sb_get(struct ynl_sock *ys, struct devlink_sb_get_req *req) ...@@ -838,7 +838,7 @@ devlink_sb_get(struct ynl_sock *ys, struct devlink_sb_get_req *req)
rsp = calloc(1, sizeof(*rsp)); rsp = calloc(1, sizeof(*rsp));
yrs.yarg.data = rsp; yrs.yarg.data = rsp;
yrs.cb = devlink_sb_get_rsp_parse; yrs.cb = devlink_sb_get_rsp_parse;
yrs.rsp_cmd = DEVLINK_CMD_SB_GET; yrs.rsp_cmd = 13;
err = ynl_exec(ys, nlh, &yrs); err = ynl_exec(ys, nlh, &yrs);
if (err < 0) if (err < 0)
...@@ -876,7 +876,7 @@ devlink_sb_get_dump(struct ynl_sock *ys, struct devlink_sb_get_req_dump *req) ...@@ -876,7 +876,7 @@ devlink_sb_get_dump(struct ynl_sock *ys, struct devlink_sb_get_req_dump *req)
yds.ys = ys; yds.ys = ys;
yds.alloc_sz = sizeof(struct devlink_sb_get_list); yds.alloc_sz = sizeof(struct devlink_sb_get_list);
yds.cb = devlink_sb_get_rsp_parse; yds.cb = devlink_sb_get_rsp_parse;
yds.rsp_cmd = DEVLINK_CMD_SB_GET; yds.rsp_cmd = 13;
yds.rsp_policy = &devlink_nest; yds.rsp_policy = &devlink_nest;
nlh = ynl_gemsg_start_dump(ys, ys->family_id, DEVLINK_CMD_SB_GET, 1); nlh = ynl_gemsg_start_dump(ys, ys->family_id, DEVLINK_CMD_SB_GET, 1);
...@@ -987,7 +987,7 @@ devlink_sb_pool_get(struct ynl_sock *ys, struct devlink_sb_pool_get_req *req) ...@@ -987,7 +987,7 @@ devlink_sb_pool_get(struct ynl_sock *ys, struct devlink_sb_pool_get_req *req)
rsp = calloc(1, sizeof(*rsp)); rsp = calloc(1, sizeof(*rsp));
yrs.yarg.data = rsp; yrs.yarg.data = rsp;
yrs.cb = devlink_sb_pool_get_rsp_parse; yrs.cb = devlink_sb_pool_get_rsp_parse;
yrs.rsp_cmd = DEVLINK_CMD_SB_POOL_GET; yrs.rsp_cmd = 17;
err = ynl_exec(ys, nlh, &yrs); err = ynl_exec(ys, nlh, &yrs);
if (err < 0) if (err < 0)
...@@ -1026,7 +1026,7 @@ devlink_sb_pool_get_dump(struct ynl_sock *ys, ...@@ -1026,7 +1026,7 @@ devlink_sb_pool_get_dump(struct ynl_sock *ys,
yds.ys = ys; yds.ys = ys;
yds.alloc_sz = sizeof(struct devlink_sb_pool_get_list); yds.alloc_sz = sizeof(struct devlink_sb_pool_get_list);
yds.cb = devlink_sb_pool_get_rsp_parse; yds.cb = devlink_sb_pool_get_rsp_parse;
yds.rsp_cmd = DEVLINK_CMD_SB_POOL_GET; yds.rsp_cmd = 17;
yds.rsp_policy = &devlink_nest; yds.rsp_policy = &devlink_nest;
nlh = ynl_gemsg_start_dump(ys, ys->family_id, DEVLINK_CMD_SB_POOL_GET, 1); nlh = ynl_gemsg_start_dump(ys, ys->family_id, DEVLINK_CMD_SB_POOL_GET, 1);
...@@ -1147,7 +1147,7 @@ devlink_sb_port_pool_get(struct ynl_sock *ys, ...@@ -1147,7 +1147,7 @@ devlink_sb_port_pool_get(struct ynl_sock *ys,
rsp = calloc(1, sizeof(*rsp)); rsp = calloc(1, sizeof(*rsp));
yrs.yarg.data = rsp; yrs.yarg.data = rsp;
yrs.cb = devlink_sb_port_pool_get_rsp_parse; yrs.cb = devlink_sb_port_pool_get_rsp_parse;
yrs.rsp_cmd = DEVLINK_CMD_SB_PORT_POOL_GET; yrs.rsp_cmd = 21;
err = ynl_exec(ys, nlh, &yrs); err = ynl_exec(ys, nlh, &yrs);
if (err < 0) if (err < 0)
...@@ -1187,7 +1187,7 @@ devlink_sb_port_pool_get_dump(struct ynl_sock *ys, ...@@ -1187,7 +1187,7 @@ devlink_sb_port_pool_get_dump(struct ynl_sock *ys,
yds.ys = ys; yds.ys = ys;
yds.alloc_sz = sizeof(struct devlink_sb_port_pool_get_list); yds.alloc_sz = sizeof(struct devlink_sb_port_pool_get_list);
yds.cb = devlink_sb_port_pool_get_rsp_parse; yds.cb = devlink_sb_port_pool_get_rsp_parse;
yds.rsp_cmd = DEVLINK_CMD_SB_PORT_POOL_GET; yds.rsp_cmd = 21;
yds.rsp_policy = &devlink_nest; yds.rsp_policy = &devlink_nest;
nlh = ynl_gemsg_start_dump(ys, ys->family_id, DEVLINK_CMD_SB_PORT_POOL_GET, 1); nlh = ynl_gemsg_start_dump(ys, ys->family_id, DEVLINK_CMD_SB_PORT_POOL_GET, 1);
...@@ -1316,7 +1316,7 @@ devlink_sb_tc_pool_bind_get(struct ynl_sock *ys, ...@@ -1316,7 +1316,7 @@ devlink_sb_tc_pool_bind_get(struct ynl_sock *ys,
rsp = calloc(1, sizeof(*rsp)); rsp = calloc(1, sizeof(*rsp));
yrs.yarg.data = rsp; yrs.yarg.data = rsp;
yrs.cb = devlink_sb_tc_pool_bind_get_rsp_parse; yrs.cb = devlink_sb_tc_pool_bind_get_rsp_parse;
yrs.rsp_cmd = DEVLINK_CMD_SB_TC_POOL_BIND_GET; yrs.rsp_cmd = 25;
err = ynl_exec(ys, nlh, &yrs); err = ynl_exec(ys, nlh, &yrs);
if (err < 0) if (err < 0)
...@@ -1356,7 +1356,7 @@ devlink_sb_tc_pool_bind_get_dump(struct ynl_sock *ys, ...@@ -1356,7 +1356,7 @@ devlink_sb_tc_pool_bind_get_dump(struct ynl_sock *ys,
yds.ys = ys; yds.ys = ys;
yds.alloc_sz = sizeof(struct devlink_sb_tc_pool_bind_get_list); yds.alloc_sz = sizeof(struct devlink_sb_tc_pool_bind_get_list);
yds.cb = devlink_sb_tc_pool_bind_get_rsp_parse; yds.cb = devlink_sb_tc_pool_bind_get_rsp_parse;
yds.rsp_cmd = DEVLINK_CMD_SB_TC_POOL_BIND_GET; yds.rsp_cmd = 25;
yds.rsp_policy = &devlink_nest; yds.rsp_policy = &devlink_nest;
nlh = ynl_gemsg_start_dump(ys, ys->family_id, DEVLINK_CMD_SB_TC_POOL_BIND_GET, 1); nlh = ynl_gemsg_start_dump(ys, ys->family_id, DEVLINK_CMD_SB_TC_POOL_BIND_GET, 1);
...@@ -2183,7 +2183,7 @@ devlink_trap_get(struct ynl_sock *ys, struct devlink_trap_get_req *req) ...@@ -2183,7 +2183,7 @@ devlink_trap_get(struct ynl_sock *ys, struct devlink_trap_get_req *req)
rsp = calloc(1, sizeof(*rsp)); rsp = calloc(1, sizeof(*rsp));
yrs.yarg.data = rsp; yrs.yarg.data = rsp;
yrs.cb = devlink_trap_get_rsp_parse; yrs.cb = devlink_trap_get_rsp_parse;
yrs.rsp_cmd = DEVLINK_CMD_TRAP_GET; yrs.rsp_cmd = 63;
err = ynl_exec(ys, nlh, &yrs); err = ynl_exec(ys, nlh, &yrs);
if (err < 0) if (err < 0)
...@@ -2223,7 +2223,7 @@ devlink_trap_get_dump(struct ynl_sock *ys, ...@@ -2223,7 +2223,7 @@ devlink_trap_get_dump(struct ynl_sock *ys,
yds.ys = ys; yds.ys = ys;
yds.alloc_sz = sizeof(struct devlink_trap_get_list); yds.alloc_sz = sizeof(struct devlink_trap_get_list);
yds.cb = devlink_trap_get_rsp_parse; yds.cb = devlink_trap_get_rsp_parse;
yds.rsp_cmd = DEVLINK_CMD_TRAP_GET; yds.rsp_cmd = 63;
yds.rsp_policy = &devlink_nest; yds.rsp_policy = &devlink_nest;
nlh = ynl_gemsg_start_dump(ys, ys->family_id, DEVLINK_CMD_TRAP_GET, 1); nlh = ynl_gemsg_start_dump(ys, ys->family_id, DEVLINK_CMD_TRAP_GET, 1);
...@@ -2336,7 +2336,7 @@ devlink_trap_group_get(struct ynl_sock *ys, ...@@ -2336,7 +2336,7 @@ devlink_trap_group_get(struct ynl_sock *ys,
rsp = calloc(1, sizeof(*rsp)); rsp = calloc(1, sizeof(*rsp));
yrs.yarg.data = rsp; yrs.yarg.data = rsp;
yrs.cb = devlink_trap_group_get_rsp_parse; yrs.cb = devlink_trap_group_get_rsp_parse;
yrs.rsp_cmd = DEVLINK_CMD_TRAP_GROUP_GET; yrs.rsp_cmd = 67;
err = ynl_exec(ys, nlh, &yrs); err = ynl_exec(ys, nlh, &yrs);
if (err < 0) if (err < 0)
...@@ -2376,7 +2376,7 @@ devlink_trap_group_get_dump(struct ynl_sock *ys, ...@@ -2376,7 +2376,7 @@ devlink_trap_group_get_dump(struct ynl_sock *ys,
yds.ys = ys; yds.ys = ys;
yds.alloc_sz = sizeof(struct devlink_trap_group_get_list); yds.alloc_sz = sizeof(struct devlink_trap_group_get_list);
yds.cb = devlink_trap_group_get_rsp_parse; yds.cb = devlink_trap_group_get_rsp_parse;
yds.rsp_cmd = DEVLINK_CMD_TRAP_GROUP_GET; yds.rsp_cmd = 67;
yds.rsp_policy = &devlink_nest; yds.rsp_policy = &devlink_nest;
nlh = ynl_gemsg_start_dump(ys, ys->family_id, DEVLINK_CMD_TRAP_GROUP_GET, 1); nlh = ynl_gemsg_start_dump(ys, ys->family_id, DEVLINK_CMD_TRAP_GROUP_GET, 1);
...@@ -2483,7 +2483,7 @@ devlink_trap_policer_get(struct ynl_sock *ys, ...@@ -2483,7 +2483,7 @@ devlink_trap_policer_get(struct ynl_sock *ys,
rsp = calloc(1, sizeof(*rsp)); rsp = calloc(1, sizeof(*rsp));
yrs.yarg.data = rsp; yrs.yarg.data = rsp;
yrs.cb = devlink_trap_policer_get_rsp_parse; yrs.cb = devlink_trap_policer_get_rsp_parse;
yrs.rsp_cmd = DEVLINK_CMD_TRAP_POLICER_GET; yrs.rsp_cmd = 71;
err = ynl_exec(ys, nlh, &yrs); err = ynl_exec(ys, nlh, &yrs);
if (err < 0) if (err < 0)
...@@ -2523,7 +2523,7 @@ devlink_trap_policer_get_dump(struct ynl_sock *ys, ...@@ -2523,7 +2523,7 @@ devlink_trap_policer_get_dump(struct ynl_sock *ys,
yds.ys = ys; yds.ys = ys;
yds.alloc_sz = sizeof(struct devlink_trap_policer_get_list); yds.alloc_sz = sizeof(struct devlink_trap_policer_get_list);
yds.cb = devlink_trap_policer_get_rsp_parse; yds.cb = devlink_trap_policer_get_rsp_parse;
yds.rsp_cmd = DEVLINK_CMD_TRAP_POLICER_GET; yds.rsp_cmd = 71;
yds.rsp_policy = &devlink_nest; yds.rsp_policy = &devlink_nest;
nlh = ynl_gemsg_start_dump(ys, ys->family_id, DEVLINK_CMD_TRAP_POLICER_GET, 1); nlh = ynl_gemsg_start_dump(ys, ys->family_id, DEVLINK_CMD_TRAP_POLICER_GET, 1);
...@@ -2642,7 +2642,7 @@ devlink_rate_get(struct ynl_sock *ys, struct devlink_rate_get_req *req) ...@@ -2642,7 +2642,7 @@ devlink_rate_get(struct ynl_sock *ys, struct devlink_rate_get_req *req)
rsp = calloc(1, sizeof(*rsp)); rsp = calloc(1, sizeof(*rsp));
yrs.yarg.data = rsp; yrs.yarg.data = rsp;
yrs.cb = devlink_rate_get_rsp_parse; yrs.cb = devlink_rate_get_rsp_parse;
yrs.rsp_cmd = DEVLINK_CMD_RATE_GET; yrs.rsp_cmd = 76;
err = ynl_exec(ys, nlh, &yrs); err = ynl_exec(ys, nlh, &yrs);
if (err < 0) if (err < 0)
...@@ -2682,7 +2682,7 @@ devlink_rate_get_dump(struct ynl_sock *ys, ...@@ -2682,7 +2682,7 @@ devlink_rate_get_dump(struct ynl_sock *ys,
yds.ys = ys; yds.ys = ys;
yds.alloc_sz = sizeof(struct devlink_rate_get_list); yds.alloc_sz = sizeof(struct devlink_rate_get_list);
yds.cb = devlink_rate_get_rsp_parse; yds.cb = devlink_rate_get_rsp_parse;
yds.rsp_cmd = DEVLINK_CMD_RATE_GET; yds.rsp_cmd = 76;
yds.rsp_policy = &devlink_nest; yds.rsp_policy = &devlink_nest;
nlh = ynl_gemsg_start_dump(ys, ys->family_id, DEVLINK_CMD_RATE_GET, 1); nlh = ynl_gemsg_start_dump(ys, ys->family_id, DEVLINK_CMD_RATE_GET, 1);
...@@ -2786,7 +2786,7 @@ devlink_linecard_get(struct ynl_sock *ys, struct devlink_linecard_get_req *req) ...@@ -2786,7 +2786,7 @@ devlink_linecard_get(struct ynl_sock *ys, struct devlink_linecard_get_req *req)
rsp = calloc(1, sizeof(*rsp)); rsp = calloc(1, sizeof(*rsp));
yrs.yarg.data = rsp; yrs.yarg.data = rsp;
yrs.cb = devlink_linecard_get_rsp_parse; yrs.cb = devlink_linecard_get_rsp_parse;
yrs.rsp_cmd = DEVLINK_CMD_LINECARD_GET; yrs.rsp_cmd = 80;
err = ynl_exec(ys, nlh, &yrs); err = ynl_exec(ys, nlh, &yrs);
if (err < 0) if (err < 0)
...@@ -2825,7 +2825,7 @@ devlink_linecard_get_dump(struct ynl_sock *ys, ...@@ -2825,7 +2825,7 @@ devlink_linecard_get_dump(struct ynl_sock *ys,
yds.ys = ys; yds.ys = ys;
yds.alloc_sz = sizeof(struct devlink_linecard_get_list); yds.alloc_sz = sizeof(struct devlink_linecard_get_list);
yds.cb = devlink_linecard_get_rsp_parse; yds.cb = devlink_linecard_get_rsp_parse;
yds.rsp_cmd = DEVLINK_CMD_LINECARD_GET; yds.rsp_cmd = 80;
yds.rsp_policy = &devlink_nest; yds.rsp_policy = &devlink_nest;
nlh = ynl_gemsg_start_dump(ys, ys->family_id, DEVLINK_CMD_LINECARD_GET, 1); nlh = ynl_gemsg_start_dump(ys, ys->family_id, DEVLINK_CMD_LINECARD_GET, 1);
......
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