Commit 8570a6e72c5bfb1aee8225b8c4814cdc28417a20

Authored by Asias He
Committed by Michael S. Tsirkin
1 parent b1ad8496c9

vhost: Move VHOST_NET_FEATURES to net.c

vhost.h should not depend on device specific marcos like
VHOST_NET_F_VIRTIO_NET_HDR and VIRTIO_NET_F_MRG_RXBUF.

Signed-off-by: Asias He <asias@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

Showing 2 changed files with 6 additions and 3 deletions Side-by-side Diff

... ... @@ -59,6 +59,12 @@
59 59 #define VHOST_DMA_IS_DONE(len) ((len) >= VHOST_DMA_DONE_LEN)
60 60  
61 61 enum {
  62 + VHOST_NET_FEATURES = VHOST_FEATURES |
  63 + (1ULL << VHOST_NET_F_VIRTIO_NET_HDR) |
  64 + (1ULL << VIRTIO_NET_F_MRG_RXBUF),
  65 +};
  66 +
  67 +enum {
62 68 VHOST_NET_VQ_RX = 0,
63 69 VHOST_NET_VQ_TX = 1,
64 70 VHOST_NET_VQ_MAX = 2,
drivers/vhost/vhost.h
... ... @@ -178,9 +178,6 @@
178 178 (1ULL << VIRTIO_RING_F_INDIRECT_DESC) |
179 179 (1ULL << VIRTIO_RING_F_EVENT_IDX) |
180 180 (1ULL << VHOST_F_LOG_ALL),
181   - VHOST_NET_FEATURES = VHOST_FEATURES |
182   - (1ULL << VHOST_NET_F_VIRTIO_NET_HDR) |
183   - (1ULL << VIRTIO_NET_F_MRG_RXBUF),
184 181 };
185 182  
186 183 static inline int vhost_has_feature(struct vhost_dev *dev, int bit)