[ovs-dev] [PATCH] pinsched: Clear next_txq pointer when destroying pinqueue

Tony van der Peet Tony.vanderPeet at alliedtelesis.co.nz
Thu Mar 9 01:52:58 UTC 2017


Yes, your change is better. If I get some time I'll do a build with this and re-run our test, but by inspection I would say that this is solid.

Thanks
Tony
________________________________________
From: Ben Pfaff <blp at ovn.org>
Sent: Thursday, 9 March 2017 2:04 p.m.
To: Tony van der Peet
Cc: dev at openvswitch.org
Subject: Re: [ovs-dev] [PATCH] pinsched: Clear next_txq pointer when destroying pinqueue

On Fri, Feb 24, 2017 at 09:09:19AM +1300, Tony van der Peet wrote:
> When a packet-in queue is destroyed, clear next_txq if it is referencing
> the destroyed queue. NULL is a valid value for next_txq.
>
> Signed-off-by: Tony van der Peet <tony.vanderpeet at alliedtelesis.co.nz>
> ---
>  ofproto/pinsched.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/ofproto/pinsched.c b/ofproto/pinsched.c
> index 51f176050..a1f696e62 100644
> --- a/ofproto/pinsched.c
> +++ b/ofproto/pinsched.c
> @@ -94,6 +94,9 @@ adjust_limits(int *rate_limit, int *burst_limit)
>  static void
>  pinqueue_destroy(struct pinsched *ps, struct pinqueue *q)
>  {
> +    if (ps->next_txq == q) {
> +        ps->next_txq = NULL;
> +    }
>      hmap_remove(&ps->queues, &q->node);
>      free(q);
>  }

Thanks for the patch!

I suspect that, to maintain the round robin nature, this should be more
like the following:

    if (ps->next_txq == q) {
        advance_txq(ps);
        if (ps->next_txq == q) {
            ps->next_txq = NULL;
        }
    }

Does that make sense?

Thanks,

Ben.


More information about the dev mailing list