.B qidx
.I QUEUE_INDEX
+.ti -8
+.B vdpa dev set
+.B name
+.I NAME
+.B mac
+.RI "[ " MACADDR " ]"
.SH "DESCRIPTION"
.SS vdpa dev show - display vdpa device attributes
.BI qidx " QUEUE_INDEX"
- specifies the virtqueue index to query
+.SS vdpa dev set - set the configuration to the vdpa device.
+
+.BI name " NAME"
+-Name of the vdpa device to configure.
+
+.BI mac " MACADDR"
+- specifies the mac address for the vdpa device.
+This is applicable only for the network type of vdpa device.
+
.SH "EXAMPLES"
.PP
vdpa dev show
.RS 4
Shows vendor specific statistics information for vdpa device vdpa0 and virtqueue index 1
.RE
+.PP
+vdpa dev set name vdpa0 mac 00:11:22:33:44:55
+.RS 4
+Set a specific MAC address to vdpa device vdpa0
+.RE
.SH SEE ALSO
.BR vdpa (8),
return mnlu_gen_socket_sndrcv(&vdpa->nlg, nlh, NULL, NULL);
}
+static int cmd_dev_set(struct vdpa *vdpa, int argc, char **argv)
+{
+ struct nlmsghdr *nlh;
+ int err;
+
+ nlh = mnlu_gen_socket_cmd_prepare(&vdpa->nlg, VDPA_CMD_DEV_ATTR_SET,
+ NLM_F_REQUEST | NLM_F_ACK);
+ err = vdpa_argv_parse_put(nlh, vdpa, argc, argv,
+ VDPA_OPT_VDEV_NAME,
+ VDPA_OPT_VDEV_MAC);
+ if (err)
+ return err;
+
+ return mnlu_gen_socket_sndrcv(&vdpa->nlg, nlh, NULL, NULL);
+}
+
static void pr_out_dev_net_config(struct vdpa *vdpa, struct nlattr **tb)
{
SPRINT_BUF(macaddr);
return cmd_dev_config(vdpa, argc - 1, argv + 1);
} else if (!strcmp(*argv, "vstats")) {
return cmd_dev_vstats(vdpa, argc - 1, argv + 1);
+ } else if (!strcmp(*argv, "set")) {
+ return cmd_dev_set(vdpa, argc - 1, argv + 1);
}
fprintf(stderr, "Command \"%s\" not found\n", *argv);
return -ENOENT;