qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Leonid Bloch <leonid.bloch@ravellosystems.com>, qemu-devel@nongnu.org
Cc: Dmitry Fleytman <dmitry@daynix.com>,
	Leonid Bloch <leonid@daynix.com>,
	Shmulik Ladkani <shmulik.ladkani@ravellosystems.com>
Subject: Re: [Qemu-devel] [PATCH v4 7/7] e1000: Implementing various counters
Date: Wed, 4 Nov 2015 10:46:43 +0800	[thread overview]
Message-ID: <56397193.3020004@redhat.com> (raw)
In-Reply-To: <1446549255-26172-8-git-send-email-leonid.bloch@ravellosystems.com>



On 11/03/2015 07:14 PM, Leonid Bloch wrote:
> This implements the following Statistic registers (various counters)
> according to Intel's specs:
>
> TSCTC  GOTCL  GOTCH  GORCL  GORCH  MPRC   BPRC   RUC    ROC
> BPTC   MPTC   PTC... PRC...
>
> Signed-off-by: Leonid Bloch <leonid.bloch@ravellosystems.com>
> Signed-off-by: Dmitry Fleytman <dmitry.fleytman@ravellosystems.com>
> ---
>  hw/net/e1000.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----
>  1 file changed, 73 insertions(+), 5 deletions(-)
>
> diff --git a/hw/net/e1000.c b/hw/net/e1000.c
> index af97e8a..fbda0d1 100644
> --- a/hw/net/e1000.c
> +++ b/hw/net/e1000.c
> @@ -37,6 +37,8 @@
>  
>  #include "e1000_regs.h"
>  

[...]

>  
> @@ -1111,6 +1164,7 @@ e1000_receive_iov(NetClientState *nc, const struct iovec *iov, int iovcnt)
>          }
>      } while (desc_offset < total_size);
>  
> +    increase_size_stats(s, PRCregs, total_size);
>      inc_reg_if_not_full(s, TPR);
>      s->mac_reg[GPRC] = s->mac_reg[TPR];
>      /* TOR - Total Octets Received:
> @@ -1119,6 +1173,8 @@ e1000_receive_iov(NetClientState *nc, const struct iovec *iov, int iovcnt)
>       * Always include FCS length (4) in size.
>       */
>      grow_8reg_if_not_full(s, TORL, size+4);
> +    s->mac_reg[GORCL] = s->mac_reg[TORL];
> +    s->mac_reg[GORCH] = s->mac_reg[TORH];
>  
>      n = E1000_ICS_RXT0;
>      if ((rdt = s->mac_reg[RDT]) < s->mac_reg[RDH])
> @@ -1307,11 +1363,23 @@ static uint32_t (*macreg_readops[])(E1000State *, int) = {
>      getreg(TNCRS),    getreg(SEC),      getreg(CEXTERR),  getreg(RLEC),
>      getreg(XONRXC),   getreg(XONTXC),   getreg(XOFFRXC),  getreg(XOFFTXC),
>      getreg(RFC),      getreg(RJC),      getreg(RNBC),     getreg(TSCTFC),
> -    getreg(MGTPRC),   getreg(MGTPDC),   getreg(MGTPTC),
> +    getreg(MGTPRC),   getreg(MGTPDC),   getreg(MGTPTC),   getreg(GORCL),
> +    getreg(GOTCL),
>  
>      [TOTH]    = mac_read_clr8,      [TORH]    = mac_read_clr8,
> +    [GOTCH]   = mac_read_clr8,      [GORCH]   = mac_read_clr8,
> +    [PRC64]   = mac_read_clr4,      [PRC127]  = mac_read_clr4,
> +    [PRC255]  = mac_read_clr4,      [PRC511]  = mac_read_clr4,
> +    [PRC1023] = mac_read_clr4,      [PRC1522] = mac_read_clr4,
> +    [PTC64]   = mac_read_clr4,      [PTC127]  = mac_read_clr4,
> +    [PTC255]  = mac_read_clr4,      [PTC511]  = mac_read_clr4,
> +    [PTC1023] = mac_read_clr4,      [PTC1522] = mac_read_clr4,
>      [GPRC]    = mac_read_clr4,      [GPTC]    = mac_read_clr4,
>      [TPT]     = mac_read_clr4,      [TPR]     = mac_read_clr4,
> +    [RUC]     = mac_read_clr4,      [ROC]     = mac_read_clr4,
> +    [BPRC]    = mac_read_clr4,      [MPRC]    = mac_read_clr4,
> +    [TSCTC]   = mac_read_clr4,      [BPTC]    = mac_read_clr4,
> +    [MPTC]    = mac_read_clr4,
>      [ICR]     = mac_icr_read,       [EECD]    = get_eecd,
>      [EERD]    = flash_eerd_read,
>      [RDFH]    = mac_low13_read_prt, [RDFT]    = mac_low13_read_prt,

Same issue with patch 3. Need limit the function of those registers
works only for 2.5 and post 2.5.

  reply	other threads:[~2015-11-04  2:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-03 11:14 [Qemu-devel] [PATCH v4 0/7] e1000: Various fixes and registers' implementation Leonid Bloch
2015-11-03 11:14 ` [Qemu-devel] [PATCH v4 1/7] e1000: Cosmetic and alignment fixes Leonid Bloch
2015-11-03 11:14 ` [Qemu-devel] [PATCH v4 2/7] e1000: Add support for migrating the entire MAC registers' array Leonid Bloch
2015-11-04  2:35   ` Jason Wang
2015-11-04 14:48     ` Leonid Bloch
2015-11-05  2:35       ` Jason Wang
2015-11-03 11:14 ` [Qemu-devel] [PATCH v4 3/7] e1000: Trivial implementation of various MAC registers Leonid Bloch
2015-11-04  2:44   ` Jason Wang
2015-11-04 15:21     ` Leonid Bloch
2015-11-05  2:57       ` Jason Wang
2015-11-03 11:14 ` [Qemu-devel] [PATCH v4 4/7] e1000: Fixing the received/transmitted packets' counters Leonid Bloch
2015-11-03 11:14 ` [Qemu-devel] [PATCH v4 5/7] e1000: Fixing the received/transmitted octets' counters Leonid Bloch
2015-11-03 11:14 ` [Qemu-devel] [PATCH v4 6/7] e1000: Fixing the packet address filtering procedure Leonid Bloch
2015-11-03 11:14 ` [Qemu-devel] [PATCH v4 7/7] e1000: Implementing various counters Leonid Bloch
2015-11-04  2:46   ` Jason Wang [this message]
2015-11-04 15:44     ` Leonid Bloch
2015-11-05  3:16       ` Jason Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56397193.3020004@redhat.com \
    --to=jasowang@redhat.com \
    --cc=dmitry@daynix.com \
    --cc=leonid.bloch@ravellosystems.com \
    --cc=leonid@daynix.com \
    --cc=qemu-devel@nongnu.org \
    --cc=shmulik.ladkani@ravellosystems.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).