[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/12] hw/net/net_tx_pkt: Ignore ECN bit
From: |
Jason Wang |
Subject: |
[PULL 03/12] hw/net/net_tx_pkt: Ignore ECN bit |
Date: |
Tue, 28 Mar 2023 13:19:08 +0800 |
From: Akihiko Odaki <akihiko.odaki@daynix.com>
No segmentation should be performed if gso type is
VIRTIO_NET_HDR_GSO_NONE even if ECN bit is set.
Fixes: e263cd49c7 ("Packet abstraction for VMWARE network devices")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1544
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
hw/net/net_tx_pkt.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/net/net_tx_pkt.c b/hw/net/net_tx_pkt.c
index cb606cc..efe80b1 100644
--- a/hw/net/net_tx_pkt.c
+++ b/hw/net/net_tx_pkt.c
@@ -796,11 +796,13 @@ bool net_tx_pkt_send_custom(struct NetTxPkt *pkt, bool
offload,
{
assert(pkt);
+ uint8_t gso_type = pkt->virt_hdr.gso_type & ~VIRTIO_NET_HDR_GSO_ECN;
+
/*
* Since underlying infrastructure does not support IP datagrams longer
* than 64K we should drop such packets and don't even try to send
*/
- if (VIRTIO_NET_HDR_GSO_NONE != pkt->virt_hdr.gso_type) {
+ if (VIRTIO_NET_HDR_GSO_NONE != gso_type) {
if (pkt->payload_len >
ETH_MAX_IP_DGRAM_LEN -
pkt->vec[NET_TX_PKT_L3HDR_FRAG].iov_len) {
@@ -808,7 +810,7 @@ bool net_tx_pkt_send_custom(struct NetTxPkt *pkt, bool
offload,
}
}
- if (offload || pkt->virt_hdr.gso_type == VIRTIO_NET_HDR_GSO_NONE) {
+ if (offload || gso_type == VIRTIO_NET_HDR_GSO_NONE) {
if (!offload && pkt->virt_hdr.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) {
net_tx_pkt_do_sw_csum(pkt, &pkt->vec[NET_TX_PKT_L2HDR_FRAG],
pkt->payload_frags +
NET_TX_PKT_PL_START_FRAG - 1,
--
2.7.4
- [PULL 00/12] Net patches, Jason Wang, 2023/03/28
- [PULL 01/12] igb: Save more Tx states, Jason Wang, 2023/03/28
- [PULL 05/12] MAINTAINERS: Add Sriram Yagnaraman as a igb reviewer, Jason Wang, 2023/03/28
- [PULL 06/12] igb: handle PF/VF reset properly, Jason Wang, 2023/03/28
- [PULL 07/12] igb: add ICR_RXDW, Jason Wang, 2023/03/28
- [PULL 02/12] igb: Fix DMA requester specification for Tx packet, Jason Wang, 2023/03/28
- [PULL 04/12] hw/net/net_tx_pkt: Align l3_hdr, Jason Wang, 2023/03/28
- [PULL 03/12] hw/net/net_tx_pkt: Ignore ECN bit,
Jason Wang <=
- [PULL 08/12] igb: implement VFRE and VFTE registers, Jason Wang, 2023/03/28
- [PULL 09/12] igb: check oversized packets for VMDq, Jason Wang, 2023/03/28
- [PULL 10/12] igb: respect E1000_VMOLR_RSSE, Jason Wang, 2023/03/28
- [PULL 11/12] igb: implement VF Tx and Rx stats, Jason Wang, 2023/03/28
- [PULL 12/12] igb: respect VMVIR and VMOLR for VLAN, Jason Wang, 2023/03/28
- Re: [PULL 00/12] Net patches, Peter Maydell, 2023/03/28