]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
e1000: Never increment the RX undersize count register
authorChris Kenna <chris.kenna@oracle.com>
Thu, 4 Apr 2019 15:21:26 +0000 (10:21 -0500)
committerJason Wang <jasowang@redhat.com>
Fri, 17 May 2019 09:00:12 +0000 (17:00 +0800)
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")
Reviewed-by: Mark Kanda <mark.kanda@oracle.com>
Reviewed-by: Bhavesh Davda <bhavesh.davda@oracle.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Chris Kenna <chris.kenna@oracle.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
hw/net/e1000.c

index 9b39bccfb27db035975e7ff6d5623df28018e6d1..121452d5082e3ac3b2b182c308a54bf6654201b2 100644 (file)
@@ -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;