OSDN Git Service

igb: respect E1000_VMOLR_RSSE
authorSriram Yagnaraman <sriram.yagnaraman@est.tech>
Fri, 24 Mar 2023 15:34:59 +0000 (16:34 +0100)
committerJason Wang <jasowang@redhat.com>
Tue, 28 Mar 2023 05:10:55 +0000 (13:10 +0800)
RSS for VFs is only enabled if VMOLR[n].RSSE is set.

Signed-off-by: Sriram Yagnaraman <sriram.yagnaraman@est.tech>
Signed-off-by: Jason Wang <jasowang@redhat.com>
hw/net/igb_core.c

index 38aa459..fd61c6c 100644 (file)
@@ -1057,8 +1057,15 @@ static uint16_t igb_receive_assign(IGBCore *core, const struct eth_header *ehdr,
         if (queues) {
             igb_rss_parse_packet(core, core->rx_pkt,
                                  external_tx != NULL, rss_info);
+            /* Sec 8.26.1: PQn = VFn + VQn*8 */
             if (rss_info->queue & 1) {
-                queues <<= 8;
+                for (i = 0; i < IGB_NUM_VM_POOLS; i++) {
+                    if ((queues & BIT(i)) &&
+                        (core->mac[VMOLR0 + i] & E1000_VMOLR_RSSE)) {
+                        queues |= BIT(i + IGB_NUM_VM_POOLS);
+                        queues &= ~BIT(i);
+                    }
+                }
             }
         }
     } else {