[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 22/47] e1000e: Reset packet state after emptying Tx queue
From: |
Akihiko Odaki |
Subject: |
[PATCH v3 22/47] e1000e: Reset packet state after emptying Tx queue |
Date: |
Sun, 23 Apr 2023 13:18:08 +0900 |
Keeping Tx packet state after the transmit queue is emptied has some
problems:
- The datasheet says the descriptors can be reused after the transmit
queue is emptied, but the Tx packet state may keep references to them.
- The Tx packet state cannot be migrated so it can be reset anytime the
migration happens.
Always reset Tx packet state always after the queue is emptied.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
hw/net/e1000e_core.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c
index d4a9984fe4..27124bba07 100644
--- a/hw/net/e1000e_core.c
+++ b/hw/net/e1000e_core.c
@@ -959,6 +959,8 @@ e1000e_start_xmit(E1000ECore *core, const E1000E_TxRing
*txr)
if (!ide || !e1000e_intrmgr_delay_tx_causes(core, &cause)) {
e1000e_set_interrupt_cause(core, cause);
}
+
+ net_tx_pkt_reset(txr->tx->tx_pkt, net_tx_pkt_unmap_frag_pci, core->owner);
}
static bool
@@ -3389,8 +3391,6 @@ e1000e_core_pci_uninit(E1000ECore *core)
qemu_del_vm_change_state_handler(core->vmstate);
for (i = 0; i < E1000E_NUM_QUEUES; i++) {
- net_tx_pkt_reset(core->tx[i].tx_pkt,
- net_tx_pkt_unmap_frag_pci, core->owner);
net_tx_pkt_uninit(core->tx[i].tx_pkt);
}
@@ -3515,8 +3515,6 @@ static void e1000e_reset(E1000ECore *core, bool sw)
e1000x_reset_mac_addr(core->owner_nic, core->mac, core->permanent_mac);
for (i = 0; i < ARRAY_SIZE(core->tx); i++) {
- net_tx_pkt_reset(core->tx[i].tx_pkt,
- net_tx_pkt_unmap_frag_pci, core->owner);
memset(&core->tx[i].props, 0, sizeof(core->tx[i].props));
core->tx[i].skip_cp = false;
}
--
2.40.0
- [PATCH v3 12/47] tests/avocado: Remove test_igb_nomsi_kvm, (continued)
- [PATCH v3 12/47] tests/avocado: Remove test_igb_nomsi_kvm, Akihiko Odaki, 2023/04/23
- [PATCH v3 13/47] hw/net/net_tx_pkt: Remove net_rx_pkt_get_l4_info, Akihiko Odaki, 2023/04/23
- [PATCH v3 14/47] net/eth: Rename eth_setup_vlan_headers_ex, Akihiko Odaki, 2023/04/23
- [PATCH v3 15/47] e1000x: Share more Rx filtering logic, Akihiko Odaki, 2023/04/23
- [PATCH v3 16/47] e1000x: Take CRC into consideration for size check, Akihiko Odaki, 2023/04/23
- [PATCH v3 17/47] e1000x: Rename TcpIpv6 into TcpIpv6Ex, Akihiko Odaki, 2023/04/23
- [PATCH v3 19/47] igb: Always log status after building rx metadata, Akihiko Odaki, 2023/04/23
- [PATCH v3 21/47] igb: Read DCMD.VLE of the first Tx descriptor, Akihiko Odaki, 2023/04/23
- [PATCH v3 23/47] vmxnet3: Reset packet state after emptying Tx queue, Akihiko Odaki, 2023/04/23
- [PATCH v3 20/47] igb: Remove goto, Akihiko Odaki, 2023/04/23
- [PATCH v3 22/47] e1000e: Reset packet state after emptying Tx queue,
Akihiko Odaki <=
- [PATCH v3 18/47] e1000e: Always log status after building rx metadata, Akihiko Odaki, 2023/04/23
- [PATCH v3 24/47] igb: Add more definitions for Tx descriptor, Akihiko Odaki, 2023/04/23
- [PATCH v3 25/47] igb: Share common VF constants, Akihiko Odaki, 2023/04/23
- [PATCH v3 26/47] igb: Fix igb_mac_reg_init coding style alignment, Akihiko Odaki, 2023/04/23
- [PATCH v3 27/47] igb: Clear EICR bits for delayed MSI-X interrupts, Akihiko Odaki, 2023/04/23
- [PATCH v3 29/47] igb: Rename a variable in igb_receive_internal(), Akihiko Odaki, 2023/04/23
- [PATCH v3 30/47] net/eth: Use void pointers, Akihiko Odaki, 2023/04/23
- [PATCH v3 28/47] e1000e: Rename a variable in e1000e_receive_internal(), Akihiko Odaki, 2023/04/23
- [PATCH v3 31/47] net/eth: Always add VLAN tag, Akihiko Odaki, 2023/04/23