[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220901101601.61420-5-lingshan.zhu@intel.com>
Date: Thu, 1 Sep 2022 18:16:01 +0800
From: Zhu Lingshan <lingshan.zhu@...el.com>
To: jasowang@...hat.com, mst@...hat.com
Cc: virtualization@...ts.linux-foundation.org, netdev@...r.kernel.org,
kvm@...r.kernel.org, Zhu Lingshan <lingshan.zhu@...el.com>
Subject: [RFC 4/4] vDPA: report device endian-ness to userspace through netlink
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@...el.com>
---
drivers/vdpa/vdpa.c | 3 +++
include/uapi/linux/vdpa.h | 1 +
2 files changed, 4 insertions(+)
diff --git a/drivers/vdpa/vdpa.c b/drivers/vdpa/vdpa.c
index 8a08caf573d1..d361f951ff63 100644
--- a/drivers/vdpa/vdpa.c
+++ b/drivers/vdpa/vdpa.c
@@ -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);
}
diff --git a/include/uapi/linux/vdpa.h b/include/uapi/linux/vdpa.h
index 25c55cab3d7c..bb9797781f97 100644
--- a/include/uapi/linux/vdpa.h
+++ b/include/uapi/linux/vdpa.h
@@ -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,
--
2.31.1
Powered by blists - more mailing lists