Merge branch 'main' into next

Signed-off-by: David Ahern <dsahern@kernel.org>
This commit is contained in:
David Ahern 2021-11-04 09:45:31 -06:00
commit 50b668bdbf
5 changed files with 44 additions and 28 deletions

View File

@ -3036,6 +3036,7 @@ static int cmd_dev_param_show_cb(const struct nlmsghdr *nlh, void *data)
struct param_ctx {
struct dl *dl;
int nla_type;
bool cmode_found;
union {
uint8_t vu8;
uint16_t vu16;
@ -3088,6 +3089,7 @@ static int cmd_dev_param_set_cb(const struct nlmsghdr *nlh, void *data)
cmode = mnl_attr_get_u8(nla_value[DEVLINK_ATTR_PARAM_VALUE_CMODE]);
if (cmode == dl->opts.cmode) {
ctx->cmode_found = true;
val_attr = nla_value[DEVLINK_ATTR_PARAM_VALUE_DATA];
switch (nla_type) {
case MNL_TYPE_U8:
@ -3140,6 +3142,10 @@ static int cmd_dev_param_set(struct dl *dl)
err = mnlu_gen_socket_sndrcv(&dl->nlg, nlh, cmd_dev_param_set_cb, &ctx);
if (err)
return err;
if (!ctx.cmode_found) {
pr_err("Configuration mode not supported\n");
return -ENOTSUP;
}
nlh = mnlu_gen_socket_cmd_prepare(&dl->nlg, DEVLINK_CMD_PARAM_SET,
NLM_F_REQUEST | NLM_F_ACK);

View File

@ -1 +1 @@
static const char version[] = "5.14.0";
static const char version[] = "5.15.0";

View File

@ -3307,8 +3307,7 @@ bool iproute2_is_map_in_map(const char *libbpf_map_name, struct bpf_elf_map *ima
continue;
if (!ctx->maps[i].id ||
ctx->maps[i].inner_id ||
ctx->maps[i].inner_idx == -1)
ctx->maps[i].inner_id)
continue;
*imap = ctx->maps[i];

View File

@ -45,17 +45,15 @@ devlink-port \- devlink port configuration
.ti -8
.BI "devlink port add"
.RB "["
.RB "{"
.IR "DEV | DEV/PORT_INDEX"
.RB "] "
.RB "} "
.RB "[ " flavour
.IR FLAVOUR " ]"
.RB "[ " pcipf
.RB "[ " pfnum
.IR PFNUMBER " ]"
.br
.RB "{ " pcisf
.IR SFNUMBER " }"
.br
.RB "[ " sfnum
.IR SFNUMBER " ]"
.RB "[ " controller
.IR CNUM " ]"
.br
@ -102,7 +100,7 @@ devlink-port \- devlink port configuration
.SS devlink port set - change devlink port attributes
.PP
.B "DEV/PORT_INDEX"
.I "DEV/PORT_INDEX"
- specifies the devlink port to operate on.
.in +4
@ -126,7 +124,7 @@ set port type
.SS devlink port split - split devlink port into more
.PP
.B "DEV/PORT_INDEX"
.I "DEV/PORT_INDEX"
- specifies the devlink port to operate on.
.TP
@ -137,7 +135,7 @@ number of ports to split to.
Could be performed on any split port of the same split group.
.PP
.B "DEV/PORT_INDEX"
.I "DEV/PORT_INDEX"
- specifies the devlink port to operate on.
.SS devlink port show - display devlink port attributes
@ -154,11 +152,11 @@ Is an alias for
.ti -8
.SS devlink port add - add a devlink port
.PP
.B "DEV"
.I "DEV"
- specifies the devlink device to operate on. or
.PP
.B "DEV/PORT_INDEX"
.I "DEV/PORT_INDEX"
- specifies the devlink port index to use for the requested new port.
This is optional. When omitted, driver allocates unique port index.
@ -173,17 +171,17 @@ set port flavour
- PCI SF port
.TP
.BR pfnum " { " pfnumber " } "
.BI pfnum " PFNUMBER "
Specifies PCI pfnumber to use on which a SF device to create
.TP
.BR sfnum " { " sfnumber " } "
.BI sfnum " SFNUMBER "
Specifies sfnumber to assign to the device of the SF.
This field is optional for those devices which supports auto assignment of the
SF number.
.TP
.BR controller " { " controller " } "
.BI controller " CNUM "
Specifies controller number for which the SF port is created.
This field is optional. It is used only when SF port is created for the
external controller.
@ -192,17 +190,17 @@ external controller.
.SS devlink port function set - Set the port function attribute(s).
.PP
.B "DEV/PORT_INDEX"
.I "DEV/PORT_INDEX"
- specifies the devlink port to operate on.
.TP
.BR hw_addr " ADDR"
- hardware address of the function to set. This is a Ethernet MAC address when
.BI hw_addr " ADDR"
Hardware address of the function to set. This is a Ethernet MAC address when
port type is Ethernet.
.TP
.BR state " { " active " | " inactive " } "
- new state of the function to change to.
New state of the function to change to.
.I active
- Once configuration of the function is done, activate the function.
@ -213,13 +211,13 @@ port type is Ethernet.
.ti -8
.SS devlink port del - delete a devlink port
.PP
.B "DEV/PORT_INDEX"
.I "DEV/PORT_INDEX"
- specifies the devlink port to delete.
.ti -8
.SS devlink port param set - set new value to devlink port configuration parameter
.PP
.B "DEV/PORT_INDEX"
.I "DEV/PORT_INDEX"
- specifies the devlink port to operate on.
.TP
@ -246,7 +244,7 @@ Configuration mode in which the new value is set.
.SS devlink port param show - display devlink port supported configuration parameters attributes
.PP
.B "DEV/PORT_INDEX"
.I "DEV/PORT_INDEX"
- specifies the devlink port to operate on.
.B name

View File

@ -26,11 +26,24 @@ static void print_type(struct rd *rd, uint32_t val)
srq_types_to_str(val));
}
static void print_qps(const char *str)
static void print_qps(char *qp_str)
{
if (!strlen(str))
char *qpn;
if (!strlen(qp_str))
return;
print_color_string(PRINT_ANY, COLOR_NONE, "lqpn", "lqpn %s ", str);
open_json_array(PRINT_ANY, "lqpn");
print_color_string(PRINT_FP, COLOR_NONE, NULL, " ", NULL);
qpn = strtok(qp_str, ",");
while (qpn) {
print_color_string(PRINT_ANY, COLOR_NONE, NULL, "%s", qpn);
qpn = strtok(NULL, ",");
if (qpn)
print_color_string(PRINT_FP, COLOR_NONE, NULL, ",", NULL);
}
print_color_string(PRINT_FP, COLOR_NONE, NULL, " ", NULL);
close_json_array(PRINT_JSON, NULL);
}
static int filter_srq_range_qps(struct rd *rd, struct nlattr **qp_line,