[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 42/48] igb: Implement Tx timestamp
From: |
Akihiko Odaki |
Subject: |
[PATCH v4 42/48] igb: Implement Tx timestamp |
Date: |
Wed, 26 Apr 2023 19:37:10 +0900 |
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Sriram Yagnaraman <sriram.yagnaraman@est.tech>
---
hw/net/igb_regs.h | 3 +++
hw/net/igb_core.c | 7 +++++++
2 files changed, 10 insertions(+)
diff --git a/hw/net/igb_regs.h b/hw/net/igb_regs.h
index 894705599d..82ff195dfc 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
diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c
index e0433ae7cf..57973c3ae4 100644
--- a/hw/net/igb_core.c
+++ b/hw/net/igb_core.c
@@ -659,6 +659,13 @@ igb_process_tx_desc(IGBCore *core,
tx->ctx[idx].vlan_macip_lens >> IGB_TX_FLAGS_VLAN_SHIFT,
!!(tx->first_cmd_type_len & E1000_TXD_CMD_VLE));
+ if ((tx->first_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);
+ }
+
if (igb_tx_pkt_send(core, tx, queue_index)) {
igb_on_tx_done_update_stats(core, tx->tx_pkt, queue_index);
}
--
2.40.0
- [PATCH v4 32/48] hw/net/net_rx_pkt: Enforce alignment for eth_header, (continued)
- [PATCH v4 32/48] hw/net/net_rx_pkt: Enforce alignment for eth_header, Akihiko Odaki, 2023/04/26
- [PATCH v4 33/48] tests/qtest/libqos/igb: Set GPIE.Multiple_MSIX, Akihiko Odaki, 2023/04/26
- [PATCH v4 34/48] igb: Implement MSI-X single vector mode, Akihiko Odaki, 2023/04/26
- [PATCH v4 35/48] igb: Use UDP for RSS hash, Akihiko Odaki, 2023/04/26
- [PATCH v4 36/48] igb: Implement Rx SCTP CSO, Akihiko Odaki, 2023/04/26
- [PATCH v4 37/48] igb: Implement Tx SCTP CSO, Akihiko Odaki, 2023/04/26
- [PATCH v4 38/48] igb: Strip the second VLAN tag for extended VLAN, Akihiko Odaki, 2023/04/26
- [PATCH v4 39/48] igb: Filter with the second VLAN tag for extended VLAN, Akihiko Odaki, 2023/04/26
- [PATCH v4 40/48] igb: Implement igb-specific oversize check, Akihiko Odaki, 2023/04/26
- [PATCH v4 41/48] igb: Implement Rx PTP2 timestamp, Akihiko Odaki, 2023/04/26
- [PATCH v4 42/48] igb: Implement Tx timestamp,
Akihiko Odaki <=
- [PATCH v4 43/48] e1000e: Notify only new interrupts, Akihiko Odaki, 2023/04/26
- [PATCH v4 44/48] igb: Notify only new interrupts, Akihiko Odaki, 2023/04/26
- [PATCH v4 45/48] igb: Clear-on-read ICR when ICR.INTA is set, Akihiko Odaki, 2023/04/26
- [PATCH v4 46/48] vmxnet3: Do not depend on PC, Akihiko Odaki, 2023/04/26
- [PATCH v4 47/48] MAINTAINERS: Add a reviewer for network packet abstractions, Akihiko Odaki, 2023/04/26
- [PATCH v4 48/48] docs/system/devices/igb: Note igb is tested for DPDK, Akihiko Odaki, 2023/04/26