]> Git Repo - qemu.git/commitdiff
cadence_gem: Correct the multi-queue can rx logic
authorAlistair Francis <[email protected]>
Thu, 20 Apr 2017 16:32:29 +0000 (17:32 +0100)
committerPeter Maydell <[email protected]>
Thu, 20 Apr 2017 16:39:17 +0000 (17:39 +0100)
Correct the buffer descriptor busy logic to work correctly when using
multiple queues.

Signed-off-by: Alistair Francis <[email protected]>
Message-id: 8a7e8059984e27d46a276a66299d035a0afd280f.1491947224[email protected]
Signed-off-by: Peter Maydell <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
hw/net/cadence_gem.c

index 17c229d486b8bd9a2186a1a040db674c36acac1f..a66a9cc9225ed46f9dbfaccb0b07663f9e603d82 100644 (file)
@@ -481,14 +481,17 @@ 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 - all the buffer descriptors are busy\n");
         }
+        return 0;
     }
 
     if (s->can_rx_state != 0) {
This page took 0.028562 seconds and 4 git commands to generate.