aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Benditovich <yuri.benditovich@daynix.com>2020-05-08 15:59:34 +0300
committerMichael Roth <mdroth@linux.vnet.ibm.com>2020-09-09 18:51:39 -0500
commit5e817ece11e8fff09f1635dc9667175ef2234c28 (patch)
tree1b0e49f9915e59de3b5da2bffca206fccab223a0
parentb57df52546762549aec6591f5f38523111702fa9 (diff)
downloadqemu-5e817ece11e8fff09f1635dc9667175ef2234c28.zip
qemu-5e817ece11e8fff09f1635dc9667175ef2234c28.tar.gz
qemu-5e817ece11e8fff09f1635dc9667175ef2234c28.tar.bz2
virtio-net: align RSC fields with updated virtio-net header
Removal of duplicated RSC definitions. Changing names of the fields to ones defined in the Linux header. Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com> Signed-off-by: Jason Wang <jasowang@redhat.com> (cherry picked from commit dd3d85e89123c907be7628957457af3d03e3b85b) Conflicts: hw/net/virtio-net.c *drop context dep. on 590790297c0 Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r--hw/net/virtio-net.c27
1 files changed, 4 insertions, 23 deletions
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index e7e2c2a..6cb1448 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -77,25 +77,6 @@
tso/gso/gro 'off'. */
#define VIRTIO_NET_RSC_DEFAULT_INTERVAL 300000
-/* temporary until standard header include it */
-#if !defined(VIRTIO_NET_HDR_F_RSC_INFO)
-
-#define VIRTIO_NET_HDR_F_RSC_INFO 4 /* rsc_ext data in csum_ fields */
-#define VIRTIO_NET_F_RSC_EXT 61
-
-static inline __virtio16 *virtio_net_rsc_ext_num_packets(
- struct virtio_net_hdr *hdr)
-{
- return &hdr->csum_start;
-}
-
-static inline __virtio16 *virtio_net_rsc_ext_num_dupacks(
- struct virtio_net_hdr *hdr)
-{
- return &hdr->csum_offset;
-}
-
-#endif
static VirtIOFeature feature_sizes[] = {
{.flags = 1ULL << VIRTIO_NET_F_MAC,
@@ -1539,15 +1520,15 @@ static size_t virtio_net_rsc_drain_seg(VirtioNetRscChain *chain,
VirtioNetRscSeg *seg)
{
int ret;
- struct virtio_net_hdr *h;
+ struct virtio_net_hdr_v1 *h;
- h = (struct virtio_net_hdr *)seg->buf;
+ h = (struct virtio_net_hdr_v1 *)seg->buf;
h->flags = 0;
h->gso_type = VIRTIO_NET_HDR_GSO_NONE;
if (seg->is_coalesced) {
- *virtio_net_rsc_ext_num_packets(h) = seg->packets;
- *virtio_net_rsc_ext_num_dupacks(h) = seg->dup_ack;
+ h->rsc.segments = seg->packets;
+ h->rsc.dup_acks = seg->dup_ack;
h->flags = VIRTIO_NET_HDR_F_RSC_INFO;
if (chain->proto == ETH_P_IP) {
h->gso_type = VIRTIO_NET_HDR_GSO_TCPV4;