History

vdpa: Add support for returning device configuration information

Add netlink attribute to store the negotiated features. This can be used by userspace to get the current state of the vdpa instance. Examples: $ vdpa dev config show vdpa-a vdpa-a: mac 00:00:00:00:88:88 link up link_announce false max_vq_pairs 16 mtu 1500 negotiated_features CSUM GUEST_CSUM MTU MAC HOST_TSO4 HOST_TSO6 STATUS \ CTRL_VQ MQ CTRL_MAC_ADDR VERSION_1 ACCESS_PLATFORM $ vdpa -j dev config show vdpa-a {"config":{"vdpa-a":{"mac":"00:00:00:00:88:88","link ":"up","link_announce":false, \ "max_vq_pairs":16,"mtu":1500,"negotiated_features":["CSUM","GUEST_CSUM","MTU","MAC", \ "HOST_TSO4","HOST_TSO6","STATUS","CTRL_VQ","MQ","CTRL_MAC_ADDR","VERSION_1", \ "ACCESS_PLATFORM"]}}} $ vdpa -jp dev config show vdpa-a { "config": { "vdpa-a": { "mac": "00:00:00:00:88:88", "link ": "up", "link_announce ": false, "max_vq_pairs": 16, "mtu": 1500, "negotiated_features": [ "CSUM","GUEST_CSUM","MTU","MAC","HOST_TSO4","HOST_TSO6","STATUS","CTRL_VQ","MQ", \ "CTRL_MAC_ADDR","VERSION_1","ACCESS_PLATFORM" ] } } }

Eli Cohen committed 4 years ago

Commit 612f3301 parent 75560522 files · +7 −0Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/vdpa.h+4−0
@@ -23,6 +23,9 @@ enum vdpa_command { · 22 unmodified lines
2323 enum vdpa_attr {
2424 VDPA_ATTR_UNSPEC,
2525
26+ /* Pad attribute for 64b alignment */
27+ VDPA_ATTR_PAD = VDPA_ATTR_UNSPEC,
28+
2629 /* bus name (optional) + dev name together make the parent device handle */
2730 VDPA_ATTR_MGMTDEV_BUS_NAME, /* string */
2831 VDPA_ATTR_MGMTDEV_DEV_NAME, /* string */
@@ -40,6 +43,7 @@ enum vdpa_attr { · 11 unmodified lines
4043 VDPA_ATTR_DEV_NET_CFG_MAX_VQP, /* u16 */
4144 VDPA_ATTR_DEV_NET_CFG_MTU, /* u16 */
4245
46+ VDPA_ATTR_DEV_NEGOTIATED_FEATURES, /* u64 */
4347 /* new attributes must be added above here */
4448 VDPA_ATTR_MAX,
4549 };