[Qemu-devel] [PATCH] e1000: Never increment the RX undersize count register

Mark Kanda posted 1 patch 5 years, 1 month ago
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Test checkpatch passed
Test asan passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1554391286-26981-1-git-send-email-mark.kanda@oracle.com
Maintainers: Jason Wang <jasowang@redhat.com>
hw/net/e1000.c | 1 -
1 file changed, 1 deletion(-)
[Qemu-devel] [PATCH] e1000: Never increment the RX undersize count register
Posted by Mark Kanda 5 years, 1 month ago
From: Chris Kenna <chris.kenna@oracle.com>

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>
Signed-off-by: Chris Kenna <chris.kenna@oracle.com>
---
 hw/net/e1000.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/hw/net/e1000.c b/hw/net/e1000.c
index 9b39bcc..121452d 100644
--- a/hw/net/e1000.c
+++ b/hw/net/e1000.c
@@ -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;
-- 
1.8.3.1


Re: [Qemu-devel] [PATCH] e1000: Never increment the RX undersize count register
Posted by Stefano Garzarella 5 years, 1 month ago
On Thu, Apr 04, 2019 at 10:21:26AM -0500, Mark Kanda wrote:
> From: Chris Kenna <chris.kenna@oracle.com>
> 
> 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>
> Signed-off-by: Chris Kenna <chris.kenna@oracle.com>
> ---
>  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.

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>

Thanks,
Stefano

Re: [Qemu-devel] [PATCH] e1000: Never increment the RX undersize count register
Posted by Jason Wang 5 years, 1 month ago
On 2019/4/5 下午6:31, Stefano Garzarella wrote:
> On Thu, Apr 04, 2019 at 10:21:26AM -0500, Mark Kanda wrote:
>> From: Chris Kenna <chris.kenna@oracle.com>
>>
>> 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>
>> Signed-off-by: Chris Kenna <chris.kenna@oracle.com>
>> ---
>>   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.
>
> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
>
> Thanks,
> Stefano
>

Applied.

Thanks


Re: [Qemu-devel] [PATCH] e1000: Never increment the RX undersize count register
Posted by Jason Wang 5 years, 1 month ago
On 2019/4/15 上午11:29, Jason Wang wrote:
>
> On 2019/4/5 下午6:31, Stefano Garzarella wrote:
>> On Thu, Apr 04, 2019 at 10:21:26AM -0500, Mark Kanda wrote:
>>> From: Chris Kenna <chris.kenna@oracle.com>
>>>
>>> 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>
>>> Signed-off-by: Chris Kenna <chris.kenna@oracle.com>
>>> ---
>>>   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.
>>
>> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
>>
>> Thanks,
>> Stefano
>>
>
> Applied.
>
> Thanks


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

Thanks