Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

virtio: Formally reserve bits 28-31 to be 'transport' features.

We assign feature bits as required, but it makes sense to reserve some
for the particular transport, rather than the particular device.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

+11
+5
drivers/virtio/virtio.c
··· 113 113 set_bit(f, dev->features); 114 114 } 115 115 116 + /* Transport features are always preserved to pass to set_features. */ 117 + for (i = VIRTIO_TRANSPORT_F_START; i < VIRTIO_TRANSPORT_F_END; i++) 118 + if (device_features & (1 << i)) 119 + set_bit(i, dev->features); 120 + 116 121 err = drv->probe(dev); 117 122 if (err) 118 123 add_status(dev, VIRTIO_CONFIG_S_FAILED);
+6
include/linux/virtio_config.h
··· 18 18 /* We've given up on this device. */ 19 19 #define VIRTIO_CONFIG_S_FAILED 0x80 20 20 21 + /* Some virtio feature bits (currently bits 28 through 31) are reserved for the 22 + * transport being used (eg. virtio_ring), the rest are per-device feature 23 + * bits. */ 24 + #define VIRTIO_TRANSPORT_F_START 28 25 + #define VIRTIO_TRANSPORT_F_END 32 26 + 21 27 /* Do we get callbacks when the ring is completely used, even if we've 22 28 * suppressed them? */ 23 29 #define VIRTIO_F_NOTIFY_ON_EMPTY 24