Skip to contentSkip to conversation

e1000: Never increment the RX undersize count register

PATCH Applied Mark Kanda 3 participants 4 messages Apr 4, 2019 – Apr 15, 2019

lore
Share & tools
lore

Mark Kanda

author
#0 lore raw

PATCH 1/1 e1000: Never increment the RX undersize count register

From: Chris Kenna <[email protected]>

In situations where e1000 receives an undersized Ethernet frame, QEMU increments the emulated "Receive Undersize Count (RUC)" register when padding the frame.

This is incorrect because this an expected scenario (e.g. with VLAN tag stripping) and not an error. As such, QEMU should not increment the emulated RUC.

Fixes 3b2743017749 ("e1000: Implementing various counters")
---
 hw/net/e1000.c | 1 -
 1 file changed, 1 deletion(-)
hw/net/e1000.c +0 -1
index 9b39bcc..121452d 100644
@@ -901,7 +901,6 @@ e1000_receive_iov(NetClientState *nc, const struct iovec *iov, int iovcnt)
     if (size < sizeof(min_buf)) {
         iov_to_buf(iov, iovcnt, 0, min_buf, size);
         memset(&min_buf[size], 0, sizeof(min_buf) - size);
-        e1000x_inc_reg_if_not_full(s->mac_reg, RUC);
         min_iov.iov_base = filter_buf = min_buf;
         min_iov.iov_len = size = sizeof(min_buf);
         iovcnt = 1;
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Mark Kanda

From: Chris Kenna <[email protected]>

In situations where e1000 receives an undersized Ethernet frame, QEMU increments the emulated "Receive Undersize Count (RUC)" register when padding the frame.

This is incorrect because this an expected scenario (e.g. with VLAN tag stripping) and not an error. As such, QEMU should not increment the emulated RUC.

Quoted 8 lines
Fixes 3b2743017749 ("e1000: Implementing various counters")
---
 hw/net/e1000.c | 1 -
 1 file changed, 1 deletion(-)

CCing Jason.

LGTM, if we don't discard it, we shouldn't increase the RUC counter.

Thanks,
Stefano

Applied
#2 lore raw
Quoted 19 lines · Stefano Garzarella
Quoted 10 lines · Mark Kanda

From: Chris Kenna <[email protected]>

In situations where e1000 receives an undersized Ethernet frame, QEMU increments the emulated "Receive Undersize Count (RUC)" register when padding the frame.

This is incorrect because this an expected scenario (e.g. with VLAN tag stripping) and not an error. As such, QEMU should not increment the emulated RUC.

Quoted 8 lines
Fixes 3b2743017749 ("e1000: Implementing various counters")
---
  hw/net/e1000.c | 1 -
  1 file changed, 1 deletion(-)
Quoted 9 lines

CCing Jason.

LGTM, if we don't discard it, we shouldn't increase the RUC counter.

Thanks,
Stefano

Applied.

Thanks

#3 lore raw
Quoted 27 lines · Jason Wang
Quoted 25 lines · Stefano Garzarella
Quoted 10 lines · Mark Kanda

From: Chris Kenna <[email protected]>

In situations where e1000 receives an undersized Ethernet frame, QEMU increments the emulated "Receive Undersize Count (RUC)" register when padding the frame.

This is incorrect because this an expected scenario (e.g. with VLAN tag stripping) and not an error. As such, QEMU should not increment the emulated RUC.

Quoted 8 lines
Fixes 3b2743017749 ("e1000: Implementing various counters")

---
  hw/net/e1000.c | 1 -

  1 file changed, 1 deletion(-)

CCing Jason.

LGTM, if we don't discard it, we shouldn't increase the RUC counter.

Quoted 7 lines
Quoted 3 lines

Thanks,
Stefano

Applied.

Thanks

Actually queued for 4.1 consider it was not a series issue.

Thanks