Skip to contentSkip to conversation

net: update nic info during device reset

PATCH Applied Amos Kong 3 participants 3 messages Oct 17, 2013 – Oct 18, 2013

lore
Share & tools
lore

Amos Kong

author
#0 lore raw

PATCH 1/1 net: update nic info during device reset

macaddr is reset during device reset, but nic info isn't updated, this problem exists in e1000 & rtl8139

---
 hw/net/e1000.c   | 1 +
 hw/net/rtl8139.c | 1 +
 2 files changed, 2 insertions(+)
hw/net/e1000.c +1 -0
index 7769be0..70a59fd 100644
@@ -401,6 +401,7 @@ static void e1000_reset(void *opaque)
         d->mac_reg[RA] |= macaddr[i] << (8 * i);
         d->mac_reg[RA + 1] |= (i < 2) ? macaddr[i + 4] << (8 * i) : 0;
     }
+    qemu_format_nic_info_str(qemu_get_queue(d->nic), macaddr);
 }
 
 static void
hw/net/rtl8139.c +1 -0
index 248d9e9..3225f3d 100644
@@ -1214,6 +1214,7 @@ static void rtl8139_reset(DeviceState *d)
 
     /* restore MAC address */
     memcpy(s->phys, s->conf.macaddr.a, 6);
+    qemu_format_nic_info_str(qemu_get_queue(s->nic), s->phys);
 
     /* reset interrupt mask */
     s->IntrStatus = 0;
Signature · 1 line
1.8.3.1
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Amos Kong

macaddr is reset during device reset, but nic info isn't updated, this problem exists in e1000 & rtl8139

Quoted 31 lines
---
 hw/net/e1000.c   | 1 +
 hw/net/rtl8139.c | 1 +
 2 files changed, 2 insertions(+)
hw/net/e1000.c +1 -0
index 7769be0..70a59fd 100644
@@ -401,6 +401,7 @@ static void e1000_reset(void *opaque)
         d->mac_reg[RA] |= macaddr[i] << (8 * i);
         d->mac_reg[RA + 1] |= (i < 2) ? macaddr[i + 4] << (8 * i) : 0;
     }
+    qemu_format_nic_info_str(qemu_get_queue(d->nic), macaddr);
 }
 
 static void
hw/net/rtl8139.c +1 -0
index 248d9e9..3225f3d 100644
@@ -1214,6 +1214,7 @@ static void rtl8139_reset(DeviceState *d)
 
     /* restore MAC address */
     memcpy(s->phys, s->conf.macaddr.a, 6);
+    qemu_format_nic_info_str(qemu_get_queue(s->nic), s->phys);
 
     /* reset interrupt mask */
     s->IntrStatus = 0;
Signature · 1 line
1.8.3.1