Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107546029
D27855.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D27855.diff
View Options
diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c
--- a/sys/dev/virtio/network/if_vtnet.c
+++ b/sys/dev/virtio/network/if_vtnet.c
@@ -640,13 +640,10 @@
sc->vtnet_flags |= VTNET_FLAG_MAC;
}
- if (virtio_with_feature(dev, VIRTIO_NET_F_MRG_RXBUF))
+ if (virtio_with_feature(dev, VIRTIO_NET_F_MRG_RXBUF)) {
sc->vtnet_flags |= VTNET_FLAG_MRG_RXBUFS;
-
- if (virtio_with_feature(dev, VIRTIO_NET_F_MRG_RXBUF) ||
- virtio_with_feature(dev, VIRTIO_F_VERSION_1))
sc->vtnet_hdr_size = sizeof(struct virtio_net_hdr_mrg_rxbuf);
- else
+ } else
sc->vtnet_hdr_size = sizeof(struct virtio_net_hdr);
if (sc->vtnet_flags & VTNET_FLAG_MRG_RXBUFS)
@@ -1462,10 +1459,9 @@
sglist_reset(sg);
if ((sc->vtnet_flags & VTNET_FLAG_MRG_RXBUFS) == 0) {
- MPASS(sc->vtnet_hdr_size == sizeof(rxhdr->vrh_uhdr.hdr) ||
- sc->vtnet_hdr_size == sizeof(rxhdr->vrh_uhdr.mhdr));
+ MPASS(sc->vtnet_hdr_size == sizeof(struct virtio_net_hdr));
rxhdr = (struct vtnet_rx_header *) mdata;
- sglist_append(sg, &rxhdr->vrh_uhdr, sc->vtnet_hdr_size);
+ sglist_append(sg, &rxhdr->vrh_hdr, sc->vtnet_hdr_size);
offset = sizeof(struct vtnet_rx_header);
} else
offset = 0;
@@ -1819,10 +1815,9 @@
adjsz = sizeof(struct vtnet_rx_header);
/*
* Account for our pad inserted between the header
- * and the actual start of the frame. This includes
- * the unused num_buffers when using a legacy device.
+ * and the actual start of the frame.
*/
- len += adjsz - sc->vtnet_hdr_size;
+ len += VTNET_RX_HEADER_PAD;
} else {
mhdr = mtod(m, struct virtio_net_hdr_mrg_rxbuf *);
nbufs = mhdr->num_buffers;
diff --git a/sys/dev/virtio/network/if_vtnetvar.h b/sys/dev/virtio/network/if_vtnetvar.h
--- a/sys/dev/virtio/network/if_vtnetvar.h
+++ b/sys/dev/virtio/network/if_vtnetvar.h
@@ -219,20 +219,15 @@
* When mergeable buffers are not negotiated, the vtnet_rx_header structure
* below is placed at the beginning of the mbuf data. Use 4 bytes of pad to
* both keep the VirtIO header and the data non-contiguous and to keep the
- * frame's payload 4 byte aligned. Note that non-legacy drivers still want
- * room for a full mergeable buffer header.
+ * frame's payload 4 byte aligned.
*
* When mergeable buffers are negotiated, the host puts the VirtIO header in
* the beginning of the first mbuf's data.
*/
#define VTNET_RX_HEADER_PAD 4
struct vtnet_rx_header {
- union {
- struct virtio_net_hdr hdr;
- struct virtio_net_hdr_mrg_rxbuf mhdr;
- } vrh_uhdr;
-
- char vrh_pad[VTNET_RX_HEADER_PAD];
+ struct virtio_net_hdr vrh_hdr;
+ char vrh_pad[VTNET_RX_HEADER_PAD];
} __packed;
/*
@@ -301,8 +296,7 @@
VIRTIO_NET_F_MRG_RXBUF | \
VIRTIO_NET_F_MQ | \
VIRTIO_RING_F_EVENT_IDX | \
- VIRTIO_RING_F_INDIRECT_DESC | \
- VIRTIO_F_VERSION_1)
+ VIRTIO_RING_F_INDIRECT_DESC)
/*
* The VIRTIO_NET_F_HOST_TSO[46] features permit us to send the host
diff --git a/sys/dev/virtio/virtio.c b/sys/dev/virtio/virtio.c
--- a/sys/dev/virtio/virtio.c
+++ b/sys/dev/virtio/virtio.c
@@ -78,7 +78,7 @@
{ VIRTIO_RING_F_INDIRECT_DESC, "RingIndirect" },
{ VIRTIO_RING_F_EVENT_IDX, "EventIdx" },
{ VIRTIO_F_BAD_FEATURE, "BadFeature" },
- { VIRTIO_F_VERSION_1, "Version1" },
+
{ 0, NULL }
};
diff --git a/sys/dev/virtio/virtqueue.c b/sys/dev/virtio/virtqueue.c
--- a/sys/dev/virtio/virtqueue.c
+++ b/sys/dev/virtio/virtqueue.c
@@ -142,7 +142,6 @@
mask = (1 << VIRTIO_TRANSPORT_F_START) - 1;
mask |= VIRTIO_RING_F_INDIRECT_DESC;
mask |= VIRTIO_RING_F_EVENT_IDX;
- mask |= VIRTIO_F_VERSION_1;
return (features & mask);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 16, 5:05 PM (21 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15827520
Default Alt Text
D27855.diff (3 KB)
Attached To
Mode
D27855: Summary: Revert prior VirtIO "V1" network support to simplify upcoming V1 changes
Attached
Detach File
Event Timeline
Log In to Comment