Skip to content

Commit 275487b

Browse files
siwliu-kernelmstsirkin
authored andcommitted
vdpa: fix improper error message when adding vdpa dev
In below example, before the fix, mtu attribute is supported by the parent mgmtdev, but the error message showing "All provided are not supported" is just misleading. $ vdpa mgmtdev show vdpasim_net: supported_classes net max_supported_vqs 3 dev_features MTU MAC CTRL_VQ CTRL_MAC_ADDR ANY_LAYOUT VERSION_1 ACCESS_PLATFORM $ vdpa dev add mgmtdev vdpasim_net name vdpasim0 mtu 5000 max_vqp 2 Error: vdpa: All provided attributes are not supported. kernel answers: Operation not supported After fix, the relevant error message will be like: $ vdpa dev add mgmtdev vdpasim_net name vdpasim0 mtu 5000 max_vqp 2 Error: vdpa: Some provided attributes are not supported: 0x1000. kernel answers: Operation not supported Fixes: d8ca2fa ("vdpa: Enable user to set mac and mtu of vdpa device") Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com> Reviewed-by: Parav Pandit <parav@nvidia.com> Reviewed-by: Eli Cohen <elic@nvidia.com> Message-Id: <1675725124-7375-2-git-send-email-si-wei.liu@oracle.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
1 parent c04e214 commit 275487b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

drivers/vdpa/vdpa.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,9 +627,11 @@ static int vdpa_nl_cmd_dev_add_set_doit(struct sk_buff *skb, struct genl_info *i
627627
err = PTR_ERR(mdev);
628628
goto err;
629629
}
630+
630631
if ((config.mask & mdev->config_attr_mask) != config.mask) {
631-
NL_SET_ERR_MSG_MOD(info->extack,
632-
"All provided attributes are not supported");
632+
NL_SET_ERR_MSG_FMT_MOD(info->extack,
633+
"Some provided attributes are not supported: 0x%llx",
634+
config.mask & ~mdev->config_attr_mask);
633635
err = -EOPNOTSUPP;
634636
goto err;
635637
}

0 commit comments

Comments
 (0)