* [Qemu-devel] [PULL 0/3] Net patches
@ 2016-12-05 9:52 Jason Wang
2016-12-05 9:52 ` [Qemu-devel] [PULL 1/3] net: mcf: check receive buffer size register value Jason Wang
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Jason Wang @ 2016-12-05 9:52 UTC (permalink / raw)
To: peter.maydell, stefanha, qemu-devel; +Cc: Jason Wang
The following changes since commit bd8ef5060dd2124a54578241da9a572faf7658dd:
Merge remote-tracking branch 'dgibson/tags/ppc-for-2.8-20161201' into staging (2016-12-01 13:39:29 +0000)
are available in the git repository at:
https://github.com/jasowang/qemu.git tags/net-pull-request
for you to fetch changes up to 18766d28848f2a4c309e78c6706b872f2cb32786:
fsl_etsec: Fix various small problems in hexdump code (2016-12-05 17:45:14 +0800)
----------------------------------------------------------------
----------------------------------------------------------------
Andrey Smirnov (2):
fsl_etsec: Pad short payloads with zeros
fsl_etsec: Fix various small problems in hexdump code
Prasad J Pandit (1):
net: mcf: check receive buffer size register value
hw/net/fsl_etsec/etsec.c | 4 ++--
hw/net/fsl_etsec/rings.c | 7 +++++++
hw/net/mcf_fec.c | 2 +-
3 files changed, 10 insertions(+), 3 deletions(-)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Qemu-devel] [PULL 1/3] net: mcf: check receive buffer size register value
2016-12-05 9:52 [Qemu-devel] [PULL 0/3] Net patches Jason Wang
@ 2016-12-05 9:52 ` Jason Wang
2016-12-05 9:52 ` [Qemu-devel] [PULL 2/3] fsl_etsec: Pad short payloads with zeros Jason Wang
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Jason Wang @ 2016-12-05 9:52 UTC (permalink / raw)
To: peter.maydell, stefanha, qemu-devel; +Cc: Prasad J Pandit, Jason Wang
From: Prasad J Pandit <pjp@fedoraproject.org>
ColdFire Fast Ethernet Controller uses a receive buffer size
register(EMRBR) to hold maximum size of all receive buffers.
It is set by a user before any operation. If it was set to be
zero, ColdFire emulator would go into an infinite loop while
receiving data in mcf_fec_receive. Add check to avoid it.
Reported-by: Wjjzhang <wjjzhang@tencent.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
hw/net/mcf_fec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/net/mcf_fec.c b/hw/net/mcf_fec.c
index dc61bac..4025eb3 100644
--- a/hw/net/mcf_fec.c
+++ b/hw/net/mcf_fec.c
@@ -393,7 +393,7 @@ static void mcf_fec_write(void *opaque, hwaddr addr,
s->tx_descriptor = s->etdsr;
break;
case 0x188:
- s->emrbr = value & 0x7f0;
+ s->emrbr = value > 0 ? value & 0x7F0 : 0x7F0;
break;
default:
hw_error("mcf_fec_write Bad address 0x%x\n", (int)addr);
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Qemu-devel] [PULL 2/3] fsl_etsec: Pad short payloads with zeros
2016-12-05 9:52 [Qemu-devel] [PULL 0/3] Net patches Jason Wang
2016-12-05 9:52 ` [Qemu-devel] [PULL 1/3] net: mcf: check receive buffer size register value Jason Wang
@ 2016-12-05 9:52 ` Jason Wang
2016-12-05 9:52 ` [Qemu-devel] [PULL 3/3] fsl_etsec: Fix various small problems in hexdump code Jason Wang
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Jason Wang @ 2016-12-05 9:52 UTC (permalink / raw)
To: peter.maydell, stefanha, qemu-devel; +Cc: Andrey Smirnov, Jason Wang
From: Andrey Smirnov <andrew.smirnov@gmail.com>
Depending on QEMU network setup it is possible for us to receive a
complete Ethernet packet that is less 64 bytes long. One such example is
when QEMU is configured to use a standalone TAP device (not set to be a
part of any bridge) receives and ARP packet. In cases like that we need
to add more than just 4-bytes of CRC padding and ensure that our payload
is at least 60 bytes long, such that, when combined with CRC padding
bytes the resulting size is at least 802.3 minimum MTU bytes
long (64). Failing to do that results in code in etsec_walk_rx_ring()
setting BD_RX_SH which, in turn, makes corresponding Linux driver of
emulated host to reject buffer as a runt packet
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
hw/net/fsl_etsec/rings.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/hw/net/fsl_etsec/rings.c b/hw/net/fsl_etsec/rings.c
index 79d2f14..1434c91 100644
--- a/hw/net/fsl_etsec/rings.c
+++ b/hw/net/fsl_etsec/rings.c
@@ -474,6 +474,13 @@ static void rx_init_frame(eTSEC *etsec, const uint8_t *buf, size_t size)
/* CRC padding (We don't have to compute the CRC) */
etsec->rx_padding = 4;
+ /*
+ * Ensure that payload length + CRC length is at least 802.3
+ * minimum MTU size bytes long (64)
+ */
+ if (etsec->rx_buffer_len < 60)
+ etsec->rx_padding += 60 - etsec->rx_buffer_len;
+
etsec->rx_first_in_frame = 1;
etsec->rx_remaining_data = etsec->rx_buffer_len;
RING_DEBUG("%s: rx_buffer_len:%u rx_padding+crc:%u\n", __func__,
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Qemu-devel] [PULL 3/3] fsl_etsec: Fix various small problems in hexdump code
2016-12-05 9:52 [Qemu-devel] [PULL 0/3] Net patches Jason Wang
2016-12-05 9:52 ` [Qemu-devel] [PULL 1/3] net: mcf: check receive buffer size register value Jason Wang
2016-12-05 9:52 ` [Qemu-devel] [PULL 2/3] fsl_etsec: Pad short payloads with zeros Jason Wang
@ 2016-12-05 9:52 ` Jason Wang
2016-12-05 10:42 ` [Qemu-devel] [PULL 0/3] Net patches no-reply
2016-12-05 14:35 ` Stefan Hajnoczi
4 siblings, 0 replies; 7+ messages in thread
From: Jason Wang @ 2016-12-05 9:52 UTC (permalink / raw)
To: peter.maydell, stefanha, qemu-devel; +Cc: Andrey Smirnov, Jason Wang
From: Andrey Smirnov <andrew.smirnov@gmail.com>
Fix various small problems in hexdump code, such as:
- Reference to non-existing field etsec->nic->nc.name is replaced
with nc->name
- Type mismatch warnings
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
hw/net/fsl_etsec/etsec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/net/fsl_etsec/etsec.c b/hw/net/fsl_etsec/etsec.c
index 951c5f0..fadf9c8 100644
--- a/hw/net/fsl_etsec/etsec.c
+++ b/hw/net/fsl_etsec/etsec.c
@@ -348,8 +348,8 @@ static ssize_t etsec_receive(NetClientState *nc,
eTSEC *etsec = qemu_get_nic_opaque(nc);
#if defined(HEX_DUMP)
- fprintf(stderr, "%s receive size:%d\n", etsec->nic->nc.name, size);
- qemu_hexdump(buf, stderr, "", size);
+ fprintf(stderr, "%s receive size:%zd\n", nc->name, size);
+ qemu_hexdump((void *)buf, stderr, "", size);
#endif
/* Flush is unnecessary as are already in receiving path */
etsec->need_flush = false;
--
2.7.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PULL 0/3] Net patches
2016-12-05 9:52 [Qemu-devel] [PULL 0/3] Net patches Jason Wang
` (2 preceding siblings ...)
2016-12-05 9:52 ` [Qemu-devel] [PULL 3/3] fsl_etsec: Fix various small problems in hexdump code Jason Wang
@ 2016-12-05 10:42 ` no-reply
2016-12-05 14:35 ` Stefan Hajnoczi
4 siblings, 0 replies; 7+ messages in thread
From: no-reply @ 2016-12-05 10:42 UTC (permalink / raw)
To: jasowang; +Cc: famz, peter.maydell, stefanha, qemu-devel
Hi,
Your series seems to have some coding style problems. See output below for
more information:
Subject: [Qemu-devel] [PULL 0/3] Net patches
Type: series
Message-id: 1480931523-5769-1-git-send-email-jasowang@redhat.com
=== TEST SCRIPT BEGIN ===
#!/bin/bash
BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0
# Useful git options
git config --local diff.renamelimit 0
git config --local diff.renames True
commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
failed=1
echo
fi
n=$((n+1))
done
exit $failed
=== TEST SCRIPT END ===
Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
18cd9a6 fsl_etsec: Fix various small problems in hexdump code
947509b fsl_etsec: Pad short payloads with zeros
e2362ab net: mcf: check receive buffer size register value
=== OUTPUT BEGIN ===
Checking PATCH 1/3: net: mcf: check receive buffer size register value...
Checking PATCH 2/3: fsl_etsec: Pad short payloads with zeros...
ERROR: braces {} are necessary for all arms of this statement
#33: FILE: hw/net/fsl_etsec/rings.c:481:
+ if (etsec->rx_buffer_len < 60)
[...]
total: 1 errors, 0 warnings, 13 lines checked
Your patch has style problems, please review. If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
Checking PATCH 3/3: fsl_etsec: Fix various small problems in hexdump code...
=== OUTPUT END ===
Test command exited with code: 1
---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PULL 0/3] Net patches
2016-12-05 9:52 [Qemu-devel] [PULL 0/3] Net patches Jason Wang
` (3 preceding siblings ...)
2016-12-05 10:42 ` [Qemu-devel] [PULL 0/3] Net patches no-reply
@ 2016-12-05 14:35 ` Stefan Hajnoczi
2016-12-06 2:32 ` Jason Wang
4 siblings, 1 reply; 7+ messages in thread
From: Stefan Hajnoczi @ 2016-12-05 14:35 UTC (permalink / raw)
To: Jason Wang; +Cc: peter.maydell, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 707 bytes --]
On Mon, Dec 05, 2016 at 05:52:00PM +0800, Jason Wang wrote:
> The following changes since commit bd8ef5060dd2124a54578241da9a572faf7658dd:
>
> Merge remote-tracking branch 'dgibson/tags/ppc-for-2.8-20161201' into staging (2016-12-01 13:39:29 +0000)
>
> are available in the git repository at:
>
> https://github.com/jasowang/qemu.git tags/net-pull-request
>
> for you to fetch changes up to 18766d28848f2a4c309e78c6706b872f2cb32786:
>
> fsl_etsec: Fix various small problems in hexdump code (2016-12-05 17:45:14 +0800)
>
> ----------------------------------------------------------------
Please resend with the coding style violation fixed. See the patchew
email for details.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Qemu-devel] [PULL 0/3] Net patches
2016-12-05 14:35 ` Stefan Hajnoczi
@ 2016-12-06 2:32 ` Jason Wang
0 siblings, 0 replies; 7+ messages in thread
From: Jason Wang @ 2016-12-06 2:32 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: peter.maydell, qemu-devel
On 2016年12月05日 22:35, Stefan Hajnoczi wrote:
> On Mon, Dec 05, 2016 at 05:52:00PM +0800, Jason Wang wrote:
>> The following changes since commit bd8ef5060dd2124a54578241da9a572faf7658dd:
>>
>> Merge remote-tracking branch 'dgibson/tags/ppc-for-2.8-20161201' into staging (2016-12-01 13:39:29 +0000)
>>
>> are available in the git repository at:
>>
>> https://github.com/jasowang/qemu.git tags/net-pull-request
>>
>> for you to fetch changes up to 18766d28848f2a4c309e78c6706b872f2cb32786:
>>
>> fsl_etsec: Fix various small problems in hexdump code (2016-12-05 17:45:14 +0800)
>>
>> ----------------------------------------------------------------
> Please resend with the coding style violation fixed. See the patchew
> email for details.
V2 posted.
Thanks
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-12-06 2:32 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-05 9:52 [Qemu-devel] [PULL 0/3] Net patches Jason Wang
2016-12-05 9:52 ` [Qemu-devel] [PULL 1/3] net: mcf: check receive buffer size register value Jason Wang
2016-12-05 9:52 ` [Qemu-devel] [PULL 2/3] fsl_etsec: Pad short payloads with zeros Jason Wang
2016-12-05 9:52 ` [Qemu-devel] [PULL 3/3] fsl_etsec: Fix various small problems in hexdump code Jason Wang
2016-12-05 10:42 ` [Qemu-devel] [PULL 0/3] Net patches no-reply
2016-12-05 14:35 ` Stefan Hajnoczi
2016-12-06 2:32 ` Jason Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).