[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 43/50] igb: Implement Tx timestamp
|
From: |
Jason Wang |
|
Subject: |
[PULL 43/50] igb: Implement Tx timestamp |
|
Date: |
Tue, 23 May 2023 15:32:31 +0800 |
From: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Sriram Yagnaraman <sriram.yagnaraman@est.tech>
Signed-off-by: Jason Wang <jasowang@redhat.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 43d23c7..49d1917 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);
}
diff --git a/hw/net/igb_regs.h b/hw/net/igb_regs.h
index 8947055..82ff195 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.7.4
- [PULL 29/50] e1000e: Rename a variable in e1000e_receive_internal(), (continued)
- [PULL 29/50] e1000e: Rename a variable in e1000e_receive_internal(), Jason Wang, 2023/05/23
- [PULL 31/50] net/eth: Use void pointers, Jason Wang, 2023/05/23
- [PULL 30/50] igb: Rename a variable in igb_receive_internal(), Jason Wang, 2023/05/23
- [PULL 33/50] hw/net/net_rx_pkt: Enforce alignment for eth_header, Jason Wang, 2023/05/23
- [PULL 40/50] igb: Filter with the second VLAN tag for extended VLAN, Jason Wang, 2023/05/23
- [PULL 34/50] tests/qtest/libqos/igb: Set GPIE.Multiple_MSIX, Jason Wang, 2023/05/23
- [PULL 35/50] igb: Implement MSI-X single vector mode, Jason Wang, 2023/05/23
- [PULL 44/50] e1000e: Notify only new interrupts, Jason Wang, 2023/05/23
- [PULL 37/50] igb: Implement Rx SCTP CSO, Jason Wang, 2023/05/23
- [PULL 41/50] igb: Implement igb-specific oversize check, Jason Wang, 2023/05/23
- [PULL 43/50] igb: Implement Tx timestamp,
Jason Wang <=
- [PULL 42/50] igb: Implement Rx PTP2 timestamp, Jason Wang, 2023/05/23
- [PULL 36/50] igb: Use UDP for RSS hash, Jason Wang, 2023/05/23
- [PULL 38/50] igb: Implement Tx SCTP CSO, Jason Wang, 2023/05/23
- [PULL 39/50] igb: Strip the second VLAN tag for extended VLAN, Jason Wang, 2023/05/23
- [PULL 46/50] igb: Clear-on-read ICR when ICR.INTA is set, Jason Wang, 2023/05/23
- [PULL 50/50] rtl8139: fix large_send_mss divide-by-zero, Jason Wang, 2023/05/23
- [PULL 45/50] igb: Notify only new interrupts, Jason Wang, 2023/05/23
- [PULL 32/50] net/eth: Always add VLAN tag, Jason Wang, 2023/05/23
- [PULL 47/50] vmxnet3: Do not depend on PC, Jason Wang, 2023/05/23
- [PULL 48/50] MAINTAINERS: Add a reviewer for network packet abstractions, Jason Wang, 2023/05/23