From: Alistair Francis <alistair.francis@xilinx.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Alistair Francis <alistair.francis@xilinx.com>,
QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v1 2/5] cadence_gem: Correct the multi-queue can rx logic
Date: Mon, 10 Apr 2017 13:25:18 -0700 [thread overview]
Message-ID: <CAKmqyKN4hmgL9L9QTCCkGxMOeAgTT0otvNkDLnpGjL-rumHwqQ@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA8-OO8AOKc4FD2Hj5WvJkcSkPV_1ef9i7ihgZDaf9ui3Q@mail.gmail.com>
On Mon, Apr 10, 2017 at 5:37 AM, Peter Maydell <peter.maydell@linaro.org> wrote:
> On 5 April 2017 at 00:40, Alistair Francis <alistair.francis@xilinx.com> wrote:
>> Correct the buffer descriptor busy logic to work correctly when using
>> multiple queues.
>>
>> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
>> ---
>>
>> hw/net/cadence_gem.c | 18 +++++++++++-------
>> 1 file changed, 11 insertions(+), 7 deletions(-)
>>
>> diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c
>> index 17c229d..3e37665 100644
>> --- a/hw/net/cadence_gem.c
>> +++ b/hw/net/cadence_gem.c
>> @@ -481,14 +481,18 @@ static int gem_can_receive(NetClientState *nc)
>> }
>>
>> for (i = 0; i < s->num_priority_queues; i++) {
>> - if (rx_desc_get_ownership(s->rx_desc[i]) == 1) {
>> - if (s->can_rx_state != 2) {
>> - s->can_rx_state = 2;
>> - DB_PRINT("can't receive - busy buffer descriptor (q%d) 0x%x\n",
>> - i, s->rx_desc_addr[i]);
>> - }
>> - return 0;
>> + if (rx_desc_get_ownership(s->rx_desc[i]) != 1) {
>> + break;
>> + }
>> + };
>> +
>> + if (i == s->num_priority_queues) {
>> + if (s->can_rx_state != 2) {
>> + s->can_rx_state = 2;
>> + DB_PRINT("can't receive - busy buffer descriptor (q%d) 0x%x\n",
>> + i, s->rx_desc_addr[i]);
>
> This looks a little odd -- surely i isn't the right index to use
> into rx_desc_addr[] any more now we're outside the loop and i
> is always larger than the largest valid queue number? It looks
> like the debug print should be rephrased somehow.
Yeah you are right. It means that they are all busy, we can either
iterate over all of them and print out this or just print one
statement saying that. Somehow I ended up half way between both.
I'll update it to just print that they are all busy. I don't see why
we need every address printed.
Thanks,
Alistair
>
> thanks
> -- PMM
next prev parent reply other threads:[~2017-04-10 20:25 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-04 23:40 [Qemu-devel] [PATCH v1 0/5] Improve the Cadence GEM multi-queue support Alistair Francis
2017-04-04 23:40 ` [Qemu-devel] [PATCH v1 1/5] cadence_gem: Read the correct queue descriptor Alistair Francis
2017-04-05 10:54 ` Philippe Mathieu-Daudé
2017-04-10 12:39 ` Peter Maydell
2017-04-04 23:40 ` [Qemu-devel] [PATCH v1 2/5] cadence_gem: Correct the multi-queue can rx logic Alistair Francis
2017-04-10 12:37 ` Peter Maydell
2017-04-10 20:25 ` Alistair Francis [this message]
2017-04-04 23:40 ` [Qemu-devel] [PATCH v1 3/5] cadence_gem: Only trigger interrupts if the status register is set Alistair Francis
2017-04-05 11:00 ` Philippe Mathieu-Daudé
2017-04-10 12:44 ` Peter Maydell
2017-04-10 22:23 ` Alistair Francis
2017-04-11 9:05 ` Peter Maydell
2017-04-11 16:00 ` Alistair Francis
2017-04-04 23:40 ` [Qemu-devel] [PATCH v1 4/5] cadence_gem: Make the revision a property Alistair Francis
2017-04-05 10:57 ` Philippe Mathieu-Daudé
2017-04-10 12:45 ` Peter Maydell
2017-04-04 23:40 ` [Qemu-devel] [PATCH v1 5/5] xlnx-zynqmp: Set the Cadence GEM revision Alistair Francis
2017-04-10 12:38 ` Peter Maydell
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=CAKmqyKN4hmgL9L9QTCCkGxMOeAgTT0otvNkDLnpGjL-rumHwqQ@mail.gmail.com \
--to=alistair.francis@xilinx.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.