Skip to content

Commit 98a8215

Browse files
Zhu Lingshanmstsirkin
authored andcommitted
vDPA: code clean for vhost_vdpa uapi
This commit cleans up the uapi for vhost_vdpa by better naming some of the enums which report blk information to user space, and they are not in any official releases yet. Fixes: 1ac61dd ("vDPA: report virtio-blk flush info to user space") Fixes: ae1374b ("vDPA: report virtio-block read-only info to user space") Fixes: 330b8ae ("vDPA: report virtio-block max segment size to user space") Signed-off-by: Zhu Lingshan <[email protected]> Message-Id: <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]>
1 parent 0bbac3f commit 98a8215

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

drivers/vdpa/vdpa.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ vdpa_dev_blk_seg_size_config_fill(struct sk_buff *msg, u64 features,
967967

968968
val_u32 = __virtio32_to_cpu(true, config->size_max);
969969

970-
return nla_put_u32(msg, VDPA_ATTR_DEV_BLK_CFG_SEG_SIZE, val_u32);
970+
return nla_put_u32(msg, VDPA_ATTR_DEV_BLK_CFG_SIZE_MAX, val_u32);
971971
}
972972

973973
/* fill the block size*/
@@ -1089,7 +1089,7 @@ static int vdpa_dev_blk_ro_config_fill(struct sk_buff *msg, u64 features)
10891089
u8 ro;
10901090

10911091
ro = ((features & BIT_ULL(VIRTIO_BLK_F_RO)) == 0) ? 0 : 1;
1092-
if (nla_put_u8(msg, VDPA_ATTR_DEV_BLK_CFG_READ_ONLY, ro))
1092+
if (nla_put_u8(msg, VDPA_ATTR_DEV_BLK_READ_ONLY, ro))
10931093
return -EMSGSIZE;
10941094

10951095
return 0;
@@ -1100,7 +1100,7 @@ static int vdpa_dev_blk_flush_config_fill(struct sk_buff *msg, u64 features)
11001100
u8 flush;
11011101

11021102
flush = ((features & BIT_ULL(VIRTIO_BLK_F_FLUSH)) == 0) ? 0 : 1;
1103-
if (nla_put_u8(msg, VDPA_ATTR_DEV_BLK_CFG_FLUSH, flush))
1103+
if (nla_put_u8(msg, VDPA_ATTR_DEV_BLK_FLUSH, flush))
11041104
return -EMSGSIZE;
11051105

11061106
return 0;

include/uapi/linux/vdpa.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ enum vdpa_attr {
5757
VDPA_ATTR_DEV_FEATURES, /* u64 */
5858

5959
VDPA_ATTR_DEV_BLK_CFG_CAPACITY, /* u64 */
60-
VDPA_ATTR_DEV_BLK_CFG_SEG_SIZE, /* u32 */
60+
VDPA_ATTR_DEV_BLK_CFG_SIZE_MAX, /* u32 */
6161
VDPA_ATTR_DEV_BLK_CFG_BLK_SIZE, /* u32 */
6262
VDPA_ATTR_DEV_BLK_CFG_SEG_MAX, /* u32 */
6363
VDPA_ATTR_DEV_BLK_CFG_NUM_QUEUES, /* u16 */
@@ -70,8 +70,8 @@ enum vdpa_attr {
7070
VDPA_ATTR_DEV_BLK_CFG_DISCARD_SEC_ALIGN,/* u32 */
7171
VDPA_ATTR_DEV_BLK_CFG_MAX_WRITE_ZEROES_SEC, /* u32 */
7272
VDPA_ATTR_DEV_BLK_CFG_MAX_WRITE_ZEROES_SEG, /* u32 */
73-
VDPA_ATTR_DEV_BLK_CFG_READ_ONLY, /* u8 */
74-
VDPA_ATTR_DEV_BLK_CFG_FLUSH, /* u8 */
73+
VDPA_ATTR_DEV_BLK_READ_ONLY, /* u8 */
74+
VDPA_ATTR_DEV_BLK_FLUSH, /* u8 */
7575

7676
/* new attributes must be added above here */
7777
VDPA_ATTR_MAX,

0 commit comments

Comments
 (0)