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" ] } } }
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -23,6 +23,9 @@ enum vdpa_command { · 22 unmodified lines | |||
| 23 | enum vdpa_attr { | 23 | enum vdpa_attr { |
| 24 | VDPA_ATTR_UNSPEC, | 24 | VDPA_ATTR_UNSPEC, |
| 25 | 25 | ||
| 26 | /* Pad attribute for 64b alignment */ | ||
| 27 | VDPA_ATTR_PAD = VDPA_ATTR_UNSPEC, | ||
| 28 | |||
| 26 | /* bus name (optional) + dev name together make the parent device handle */ | 29 | /* bus name (optional) + dev name together make the parent device handle */ |
| 27 | VDPA_ATTR_MGMTDEV_BUS_NAME, /* string */ | 30 | VDPA_ATTR_MGMTDEV_BUS_NAME, /* string */ |
| 28 | VDPA_ATTR_MGMTDEV_DEV_NAME, /* string */ | 31 | VDPA_ATTR_MGMTDEV_DEV_NAME, /* string */ |
| @@ -40,6 +43,7 @@ enum vdpa_attr { · 11 unmodified lines | |||
| 40 | VDPA_ATTR_DEV_NET_CFG_MAX_VQP, /* u16 */ | 43 | VDPA_ATTR_DEV_NET_CFG_MAX_VQP, /* u16 */ |
| 41 | VDPA_ATTR_DEV_NET_CFG_MTU, /* u16 */ | 44 | VDPA_ATTR_DEV_NET_CFG_MTU, /* u16 */ |
| 42 | 45 | ||
| 46 | VDPA_ATTR_DEV_NEGOTIATED_FEATURES, /* u64 */ | ||
| 43 | /* new attributes must be added above here */ | 47 | /* new attributes must be added above here */ |
| 44 | VDPA_ATTR_MAX, | 48 | VDPA_ATTR_MAX, |
| 45 | }; | 49 | }; |