[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL V2 07/33] virtio-net: align RSC fields with updated virtio-net hea
From: |
Jason Wang |
Subject: |
[PULL V2 07/33] virtio-net: align RSC fields with updated virtio-net header |
Date: |
Thu, 18 Jun 2020 21:21:22 +0800 |
From: Yuri Benditovich <yuri.benditovich@daynix.com>
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>
---
hw/net/virtio-net.c | 28 ++++------------------------
1 file changed, 4 insertions(+), 24 deletions(-)
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 2a5da29..aff67a9 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -88,26 +88,6 @@
VIRTIO_NET_RSS_HASH_TYPE_TCP_EX | \
VIRTIO_NET_RSS_HASH_TYPE_UDP_EX)
-/* 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
-
-#endif
-
-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;
-}
-
static VirtIOFeature feature_sizes[] = {
{.flags = 1ULL << VIRTIO_NET_F_MAC,
.end = endof(struct virtio_net_config, mac)},
@@ -1821,15 +1801,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;
--
2.5.0
- [PULL V2 00/33] Net patches, Jason Wang, 2020/06/18
- [PULL V2 01/33] virtio-net: implement RSS configuration command, Jason Wang, 2020/06/18
- [PULL V2 03/33] tap: allow extended virtio header with hash info, Jason Wang, 2020/06/18
- [PULL V2 02/33] virtio-net: implement RX RSS processing, Jason Wang, 2020/06/18
- [PULL V2 04/33] virtio-net: reference implementation of hash report, Jason Wang, 2020/06/18
- [PULL V2 07/33] virtio-net: align RSC fields with updated virtio-net header,
Jason Wang <=
- [PULL V2 06/33] virtio-net: add migration support for RSS and hash report, Jason Wang, 2020/06/18
- [PULL V2 05/33] vmstate.h: provide VMSTATE_VARRAY_UINT16_ALLOC macro, Jason Wang, 2020/06/18
- [PULL V2 08/33] Fix tulip breakage, Jason Wang, 2020/06/18
- [PULL V2 10/33] hw/net/tulip: Log descriptor overflows, Jason Wang, 2020/06/18
- [PULL V2 09/33] hw/net/tulip: Fix 'Descriptor Error' definition, Jason Wang, 2020/06/18
- [PULL V2 11/33] net: cadence_gem: Fix debug statements, Jason Wang, 2020/06/18
- [PULL V2 12/33] net: cadence_gem: Fix the queue address update during wrap around, Jason Wang, 2020/06/18
- [PULL V2 13/33] net: cadence_gem: Fix irq update w.r.t queue, Jason Wang, 2020/06/18
- [PULL V2 14/33] net: cadence_gem: Define access permission for interrupt registers, Jason Wang, 2020/06/18
- [PULL V2 15/33] net: cadence_gem: Set ISR according to queue in use, Jason Wang, 2020/06/18