[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 37/40] igb: Implement Tx timestamp
From: |
Akihiko Odaki |
Subject: |
[PATCH 37/40] igb: Implement Tx timestamp |
Date: |
Fri, 14 Apr 2023 20:37:34 +0900 |
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
hw/net/igb_core.c | 7 +++++++
hw/net/igb_regs.h | 3 +++
2 files changed, 10 insertions(+)
diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c
index c716f400fd..38b53676d4 100644
--- a/hw/net/igb_core.c
+++ b/hw/net/igb_core.c
@@ -614,6 +614,13 @@ igb_process_tx_desc(IGBCore *core,
tx->first_olinfo_status =
le32_to_cpu(tx_desc->read.olinfo_status);
tx->first = false;
}
+
+ if ((cmd_type_len & E1000_ADVTXD_MAC_TSTAMP) &&
+ (core->mac[TSYNCTXCTL] & E1000_TSYNCTXCTL_ENABLED) &&
+ !(core->mac[TSYNCTXCTL] & E1000_TSYNCTXCTL_VALID)) {
+ core->mac[TSYNCTXCTL] |= E1000_TSYNCTXCTL_VALID;
+ e1000x_timestamp(core->mac, core->timadj, TXSTMPL, TXSTMPH);
+ }
} else if ((cmd_type_len & E1000_ADVTXD_DTYP_CTXT) ==
E1000_ADVTXD_DTYP_CTXT) {
/* advanced transmit context descriptor */
diff --git a/hw/net/igb_regs.h b/hw/net/igb_regs.h
index b88dc9f1f1..808b587a36 100644
--- a/hw/net/igb_regs.h
+++ b/hw/net/igb_regs.h
@@ -322,6 +322,9 @@ union e1000_adv_rx_desc {
/* E1000_EITR_CNT_IGNR is only for 82576 and newer */
#define E1000_EITR_CNT_IGNR 0x80000000 /* Don't reset counters on write */
+#define E1000_TSYNCTXCTL_VALID 0x00000001 /* tx timestamp valid */
+#define E1000_TSYNCTXCTL_ENABLED 0x00000010 /* enable tx timestampping */
+
/* PCI Express Control */
#define E1000_GCR_CMPL_TMOUT_MASK 0x0000F000
#define E1000_GCR_CMPL_TMOUT_10ms 0x00001000
--
2.40.0
- [PATCH 28/40] tests/qtest/libqos/igb: Set GPIE.Multiple_MSIX, (continued)
- [PATCH 28/40] tests/qtest/libqos/igb: Set GPIE.Multiple_MSIX, Akihiko Odaki, 2023/04/14
- [PATCH 27/40] hw/net/net_rx_pkt: Enforce alignment for eth_header, Akihiko Odaki, 2023/04/14
- [PATCH 29/40] igb: Implement MSI-X single vector mode, Akihiko Odaki, 2023/04/14
- [PATCH 30/40] igb: Implement igb-specific oversize check, Akihiko Odaki, 2023/04/14
- [PATCH 31/40] igb: Use UDP for RSS hash, Akihiko Odaki, 2023/04/14
- [PATCH 38/40] vmxnet3: Do not depend on PC, Akihiko Odaki, 2023/04/14
- [PATCH 37/40] igb: Implement Tx timestamp,
Akihiko Odaki <=
- [PATCH 33/40] igb: Implement Tx SCTP CSO, Akihiko Odaki, 2023/04/14
- [PATCH 39/40] MAINTAINERS: Add a reviewer for network packet abstractions, Akihiko Odaki, 2023/04/14
- [PATCH 34/40] igb: Strip the second VLAN tag for extended VLAN, Akihiko Odaki, 2023/04/14
- [PATCH 40/40] docs/system/devices/igb: Note igb is tested for DPDK, Akihiko Odaki, 2023/04/14
- [PATCH 36/40] igb: Implement Rx PTP2 timestamp, Akihiko Odaki, 2023/04/14
- [PATCH 32/40] igb: Implement Rx SCTP CSO, Akihiko Odaki, 2023/04/14
- [PATCH 35/40] igb: Filter with the second VLAN tag for extended VLAN, Akihiko Odaki, 2023/04/14