@@ -848,6 +848,9 @@ static int vdpa_dev_net_config_fill(struct vdpa_device *vdev, struct sk_buff *ms
VDPA_ATTR_PAD))
return -EMSGSIZE;
+ if (nla_put_u8(msg, VDPA_ATTR_DEV_ENDIAN, le))
+ return -EMSGSIZE;
+
return vdpa_dev_net_mq_config_fill(vdev, msg, features, &config);
}
@@ -51,6 +51,7 @@ enum vdpa_attr {
VDPA_ATTR_DEV_QUEUE_INDEX, /* u32 */
VDPA_ATTR_DEV_VENDOR_ATTR_NAME, /* string */
VDPA_ATTR_DEV_VENDOR_ATTR_VALUE, /* u64 */
+ VDPA_ATTR_DEV_ENDIAN, /* u8 */
/* new attributes must be added above here */
VDPA_ATTR_MAX,
This commit introduces a new netlink attr VDPA_ATTR_DEV_ENDIAN to report device endian-ness to usersapce. So the userspace tools can be aware of the endian-ness of the device, even uninitialized legacy/transitional devices. Signed-off-by: Zhu Lingshan <lingshan.zhu@intel.com> --- drivers/vdpa/vdpa.c | 3 +++ include/uapi/linux/vdpa.h | 1 + 2 files changed, 4 insertions(+)