qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH arm-devs v1 12/13] net/cadence_gem: Improve can_


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH arm-devs v1 12/13] net/cadence_gem: Improve can_receive debug printfery
Date: Mon, 2 Dec 2013 12:30:38 +0000

On 2 December 2013 07:15, Peter Crosthwaite
<address@hidden> wrote:
> Currently this just floods indicating that can_receive has been called
> by the net framework. Instead, save the result of the most recent
> can_recieve callback as state and only print a message if the result
> changes (indicating some sort of actual state change in GEM). Make said
> debug message more meaningful as well.
>
> Signed-off-by: Peter Crosthwaite <address@hidden>
> ---
>
>  hw/net/cadence_gem.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c
> index 7f79925..8c2d8fc 100644
> --- a/hw/net/cadence_gem.c
> +++ b/hw/net/cadence_gem.c
> @@ -380,6 +380,8 @@ typedef struct GemState {
>      uint32_t rx_desc_addr;
>      uint32_t tx_desc_addr;
>
> +    uint8_t can_rx_state; /* Debug only */
> +
>      unsigned rx_desc[2];
>
>      bool sar_active[4];
> @@ -452,13 +454,19 @@ static int gem_can_receive(NetClientState *nc)
>
>      s = qemu_get_nic_opaque(nc);
>
> -    DB_PRINT("\n");
> -
>      /* Do nothing if receive is not enabled. */
>      if (!(s->regs[GEM_NWCTRL] & GEM_NWCTRL_RXENA)) {
> +        if (s->can_rx_state != 1) {
> +            s->can_rx_state = 1;
> +            DB_PRINT("cant receive - noenable\n");

"can't".

thanks
-- PMM



reply via email to

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