qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [PATCH 37/40] igb: Implement Tx timestamp


From: Sriram Yagnaraman
Subject: RE: [PATCH 37/40] igb: Implement Tx timestamp
Date: Sat, 15 Apr 2023 20:13:03 +0000


> -----Original Message-----
> From: Akihiko Odaki <akihiko.odaki@daynix.com>
> Sent: Friday, 14 April 2023 13:38
> Cc: Sriram Yagnaraman <sriram.yagnaraman@est.tech>; Jason Wang
> <jasowang@redhat.com>; Dmitry Fleytman <dmitry.fleytman@gmail.com>;
> Michael S. Tsirkin <mst@redhat.com>; Alex Bennée <alex.bennee@linaro.org>;
> Philippe Mathieu-Daudé <philmd@linaro.org>; Thomas Huth
> <thuth@redhat.com>; Wainer dos Santos Moschetta
> <wainersm@redhat.com>; Beraldo Leal <bleal@redhat.com>; Cleber Rosa
> <crosa@redhat.com>; Laurent Vivier <lvivier@redhat.com>; Paolo Bonzini
> <pbonzini@redhat.com>; qemu-devel@nongnu.org; Akihiko Odaki
> <akihiko.odaki@daynix.com>
> Subject: [PATCH 37/40] igb: Implement Tx timestamp
> 
> 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) &&

Should ^ be tx->first_cmd_type_len?
Otherwise, Reviewed-by: Sriram Yagnaraman <sriram.yagnaraman@est.tech>

> +                (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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]