[PULL 00/13] Net patches

Jason Wang posted 13 patches 4 years ago
Test docker-mingw@fedora failed
Test docker-quick@centos7 failed
Test checkpatch passed
Test FreeBSD passed
Test asan passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1585307647-24456-1-git-send-email-jasowang@redhat.com
Maintainers: Richard Henderson <rth@twiddle.net>, Sven Schnelle <svens@stackframe.org>, Peter Chubb <peter.chubb@nicta.com.au>, Dmitry Fleytman <dmitry.fleytman@gmail.com>, Andrew Jeffery <andrew@aj.id.au>, Zhang Chen <chen.zhang@intel.com>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Joel Stanley <joel@jms.id.au>, "Michael S. Tsirkin" <mst@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, Li Zhijian <lizhijian@cn.fujitsu.com>, Max Filippov <jcmvbkbc@gmail.com>, David Gibson <david@gibson.dropbear.id.au>, Beniamino Galvani <b.galvani@gmail.com>, "Cédric Le Goater" <clg@kaod.org>, Jason Wang <jasowang@redhat.com>, Alistair Francis <alistair@alistair23.me>
There is a newer version of this series
hw/net/allwinner-sun8i-emac.c | 12 ++----
hw/net/allwinner_emac.c       |  2 +-
hw/net/cadence_gem.c          |  8 ++--
hw/net/can/can_sja1000.c      |  8 ++--
hw/net/can/can_sja1000.h      |  2 +-
hw/net/dp8393x.c              |  8 ++--
hw/net/e1000.c                |  2 +-
hw/net/e1000e.c               |  4 +-
hw/net/e1000e_core.c          |  2 +-
hw/net/e1000e_core.h          |  2 +-
hw/net/ftgmac100.c            |  6 +--
hw/net/i82596.c               | 66 ++++++++++++++++++++----------
hw/net/i82596.h               |  2 +-
hw/net/imx_fec.c              |  2 +-
hw/net/opencores_eth.c        |  5 +--
hw/net/rtl8139.c              | 22 +++++-----
hw/net/smc91c111.c            | 10 ++---
hw/net/spapr_llan.c           |  4 +-
hw/net/sungem.c               |  6 +--
hw/net/sunhme.c               |  4 +-
hw/net/tulip.c                | 36 ++++++++++++----
hw/net/virtio-net.c           | 10 ++---
hw/net/xilinx_ethlite.c       |  2 +-
include/net/can_emu.h         |  2 +-
include/net/net.h             |  2 +-
net/can/can_socketcan.c       |  4 +-
net/colo-compare.c            | 95 ++++++++++++++++++++++++++++++++++++++++---
net/filter-buffer.c           |  2 +-
net/hub.c                     |  6 +--
qemu-options.hx               | 10 +++--
30 files changed, 235 insertions(+), 111 deletions(-)
[PULL 00/13] Net patches
Posted by Jason Wang 4 years ago
The following changes since commit cfe68ae025f704f336d7dd3d1903ce37b445831d:

  Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.0-pull-request' into staging (2020-03-26 20:55:54 +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 f3b364f4f77fcb24cec468f518bf5e093dc27cb7:

  hw/net/allwinner-sun8i-emac.c: Fix REG_ADDR_HIGH/LOW reads (2020-03-27 18:59:47 +0800)

----------------------------------------------------------------

----------------------------------------------------------------
Andrew Melnychenko (1):
      Fixed integer overflow in e1000e

Peter Maydell (2):
      hw/net/i82596.c: Avoid reading off end of buffer in i82596_receive()
      hw/net/allwinner-sun8i-emac.c: Fix REG_ADDR_HIGH/LOW reads

Philippe Mathieu-Daudé (7):
      hw/net/i82596: Correct command bitmask (CID 1419392)
      hw/net/e1000e_core: Let e1000e_can_receive() return a boolean
      hw/net/smc91c111: Let smc91c111_can_receive() return a boolean
      hw/net/rtl8139: Simplify if/else statement
      hw/net/rtl8139: Update coding style to make checkpatch.pl happy
      hw/net: Make NetCanReceive() return a boolean
      hw/net/can: Make CanBusClientInfo::can_receive() return a boolean

Prasad J Pandit (1):
      net: tulip: check frame size and r/w data length

Zhang Chen (2):
      net/colo-compare.c: Expose "compare_timeout" to users
      net/colo-compare.c: Expose "expired_scan_cycle" to users

 hw/net/allwinner-sun8i-emac.c | 12 ++----
 hw/net/allwinner_emac.c       |  2 +-
 hw/net/cadence_gem.c          |  8 ++--
 hw/net/can/can_sja1000.c      |  8 ++--
 hw/net/can/can_sja1000.h      |  2 +-
 hw/net/dp8393x.c              |  8 ++--
 hw/net/e1000.c                |  2 +-
 hw/net/e1000e.c               |  4 +-
 hw/net/e1000e_core.c          |  2 +-
 hw/net/e1000e_core.h          |  2 +-
 hw/net/ftgmac100.c            |  6 +--
 hw/net/i82596.c               | 66 ++++++++++++++++++++----------
 hw/net/i82596.h               |  2 +-
 hw/net/imx_fec.c              |  2 +-
 hw/net/opencores_eth.c        |  5 +--
 hw/net/rtl8139.c              | 22 +++++-----
 hw/net/smc91c111.c            | 10 ++---
 hw/net/spapr_llan.c           |  4 +-
 hw/net/sungem.c               |  6 +--
 hw/net/sunhme.c               |  4 +-
 hw/net/tulip.c                | 36 ++++++++++++----
 hw/net/virtio-net.c           | 10 ++---
 hw/net/xilinx_ethlite.c       |  2 +-
 include/net/can_emu.h         |  2 +-
 include/net/net.h             |  2 +-
 net/can/can_socketcan.c       |  4 +-
 net/colo-compare.c            | 95 ++++++++++++++++++++++++++++++++++++++++---
 net/filter-buffer.c           |  2 +-
 net/hub.c                     |  6 +--
 qemu-options.hx               | 10 +++--
 30 files changed, 235 insertions(+), 111 deletions(-)



Re: [PULL 00/13] Net patches
Posted by Peter Maydell 4 years ago
On Fri, 27 Mar 2020 at 11:14, Jason Wang <jasowang@redhat.com> wrote:
>
> The following changes since commit cfe68ae025f704f336d7dd3d1903ce37b445831d:
>
>   Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.0-pull-request' into staging (2020-03-26 20:55:54 +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 f3b364f4f77fcb24cec468f518bf5e093dc27cb7:
>
>   hw/net/allwinner-sun8i-emac.c: Fix REG_ADDR_HIGH/LOW reads (2020-03-27 18:59:47 +0800)
>
> ----------------------------------------------------------------
>
> ----------------------------------------------------------------

Hi; this fails to compile (all platforms):

/home/petmay01/qemu-for-merges/hw/net/allwinner-sun8i-emac.c:773:20:
error: initialization from incompatible pointer type
[-Werror=incompatible-pointer-types]
     .can_receive = allwinner_sun8i_emac_can_receive,
                    ^
/home/petmay01/qemu-for-merges/hw/net/allwinner-sun8i-emac.c:773:20:
note: (near initialization for
'net_allwinner_sun8i_emac_info.can_receive')


There's also this one, though not every compiler picked it up:

/home/peter.maydell/qemu/hw/net/i82596.c: In function 'i82596_receive':
/home/peter.maydell/qemu/hw/net/i82596.c:657:30: error: comparison of
unsigned expression >= 0 is always true [-Werror=type-limits]
                 assert(bufsz >= 0);
                              ^
/home/peter.maydell/qemu/hw/net/i82596.c:657:30: error: comparison of
unsigned expression >= 0 is always true [-Werror=type-limits]
                 assert(bufsz >= 0);
                              ^


For the first error, I think this needs squashing into
"hw/net: Make NetCanReceive() return a boolean":

diff --git a/hw/net/allwinner-sun8i-emac.c b/hw/net/allwinner-sun8i-emac.c
index fc67a1be70..28637ff4c1 100644
--- a/hw/net/allwinner-sun8i-emac.c
+++ b/hw/net/allwinner-sun8i-emac.c
@@ -395,7 +395,7 @@ static void
allwinner_sun8i_emac_flush_desc(FrameDescriptor *desc,
     cpu_physical_memory_write(phys_addr, desc, sizeof(*desc));
 }

-static int allwinner_sun8i_emac_can_receive(NetClientState *nc)
+static bool allwinner_sun8i_emac_can_receive(NetClientState *nc)
 {
     AwSun8iEmacState *s = qemu_get_nic_opaque(nc);
     FrameDescriptor desc;


Squashing this into my
"hw/net/i82596.c: Avoid reading off end of buffer in i82596_receive()"
commit fixes the second error.

diff --git a/hw/net/i82596.c b/hw/net/i82596.c
index a9bdbac339..055c3a1470 100644
--- a/hw/net/i82596.c
+++ b/hw/net/i82596.c
@@ -653,8 +653,8 @@ ssize_t i82596_receive(NetClientState *nc, const
uint8_t *buf, size_t sz)

             if (bufcount > 0) {
                 /* Still some of the actual data buffer to transfer */
+                assert(bufsz >= bufcount);
                 bufsz -= bufcount;
-                assert(bufsz >= 0);
                 address_space_write(&address_space_memory, rba,
                                     MEMTXATTRS_UNSPECIFIED, buf, bufcount);
                 rba += bufcount;

thanks
-- PMM

Re: [PULL 00/13] Net patches
Posted by Jason Wang 4 years ago
On 2020/3/27 下午7:36, Peter Maydell wrote:
> On Fri, 27 Mar 2020 at 11:14, Jason Wang <jasowang@redhat.com> wrote:
>> The following changes since commit cfe68ae025f704f336d7dd3d1903ce37b445831d:
>>
>>    Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.0-pull-request' into staging (2020-03-26 20:55:54 +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 f3b364f4f77fcb24cec468f518bf5e093dc27cb7:
>>
>>    hw/net/allwinner-sun8i-emac.c: Fix REG_ADDR_HIGH/LOW reads (2020-03-27 18:59:47 +0800)
>>
>> ----------------------------------------------------------------
>>
>> ----------------------------------------------------------------
> Hi; this fails to compile (all platforms):


My bad, forget to run full docker test before sending the pull request.


>
> /home/petmay01/qemu-for-merges/hw/net/allwinner-sun8i-emac.c:773:20:
> error: initialization from incompatible pointer type
> [-Werror=incompatible-pointer-types]
>       .can_receive = allwinner_sun8i_emac_can_receive,
>                      ^
> /home/petmay01/qemu-for-merges/hw/net/allwinner-sun8i-emac.c:773:20:
> note: (near initialization for
> 'net_allwinner_sun8i_emac_info.can_receive')
>
>
> There's also this one, though not every compiler picked it up:
>
> /home/peter.maydell/qemu/hw/net/i82596.c: In function 'i82596_receive':
> /home/peter.maydell/qemu/hw/net/i82596.c:657:30: error: comparison of
> unsigned expression >= 0 is always true [-Werror=type-limits]
>                   assert(bufsz >= 0);
>                                ^
> /home/peter.maydell/qemu/hw/net/i82596.c:657:30: error: comparison of
> unsigned expression >= 0 is always true [-Werror=type-limits]
>                   assert(bufsz >= 0);
>                                ^
>
>
> For the first error, I think this needs squashing into
> "hw/net: Make NetCanReceive() return a boolean":
>
> diff --git a/hw/net/allwinner-sun8i-emac.c b/hw/net/allwinner-sun8i-emac.c
> index fc67a1be70..28637ff4c1 100644
> --- a/hw/net/allwinner-sun8i-emac.c
> +++ b/hw/net/allwinner-sun8i-emac.c
> @@ -395,7 +395,7 @@ static void
> allwinner_sun8i_emac_flush_desc(FrameDescriptor *desc,
>       cpu_physical_memory_write(phys_addr, desc, sizeof(*desc));
>   }
>
> -static int allwinner_sun8i_emac_can_receive(NetClientState *nc)
> +static bool allwinner_sun8i_emac_can_receive(NetClientState *nc)
>   {
>       AwSun8iEmacState *s = qemu_get_nic_opaque(nc);
>       FrameDescriptor desc;
>
>
> Squashing this into my
> "hw/net/i82596.c: Avoid reading off end of buffer in i82596_receive()"
> commit fixes the second error.
>
> diff --git a/hw/net/i82596.c b/hw/net/i82596.c
> index a9bdbac339..055c3a1470 100644
> --- a/hw/net/i82596.c
> +++ b/hw/net/i82596.c
> @@ -653,8 +653,8 @@ ssize_t i82596_receive(NetClientState *nc, const
> uint8_t *buf, size_t sz)
>
>               if (bufcount > 0) {
>                   /* Still some of the actual data buffer to transfer */
> +                assert(bufsz >= bufcount);
>                   bufsz -= bufcount;
> -                assert(bufsz >= 0);
>                   address_space_write(&address_space_memory, rba,
>                                       MEMTXATTRS_UNSPECIFIED, buf, bufcount);
>                   rba += bufcount;
>
> thanks
> -- PMM
>

Right, will fix them.

Thanks



Re: [PULL 00/13] Net patches
Posted by no-reply@patchew.org 4 years ago
Patchew URL: https://patchew.org/QEMU/1585307647-24456-1-git-send-email-jasowang@redhat.com/



Hi,

This series failed the docker-mingw@fedora build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#! /bin/bash
export ARCH=x86_64
make docker-image-fedora V=1 NETWORK=1
time make docker-test-mingw@fedora J=14 NETWORK=1
=== TEST SCRIPT END ===

  CC      hw/net/rocker/rocker_world.o
  CC      hw/net/rocker/rocker_of_dpa.o
  CC      hw/net/can/can_sja1000.o
/tmp/qemu-test/src/hw/net/allwinner-sun8i-emac.c:773:20: error: initialization of '_Bool (*)(NetClientState *)' {aka '_Bool (*)(struct NetClientState *)'} from incompatible pointer type 'int (*)(NetClientState *)' {aka 'int (*)(struct NetClientState *)'} [-Werror=incompatible-pointer-types]
     .can_receive = allwinner_sun8i_emac_can_receive,
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/qemu-test/src/hw/net/allwinner-sun8i-emac.c:773:20: note: (near initialization for 'net_allwinner_sun8i_emac_info.can_receive')
cc1: all warnings being treated as errors
make: *** [/tmp/qemu-test/src/rules.mak:69: hw/net/allwinner-sun8i-emac.o] Error 1
make: *** Waiting for unfinished jobs....
  CC      hw/net/can/can_kvaser_pci.o
Traceback (most recent call last):
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=5f98328ddc9546e3a22732b69d331039', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-25jm6435/src/docker-src.2020-03-27-08.03.37.24872:/var/tmp/qemu:z,ro', 'qemu:fedora', '/var/tmp/qemu/run', 'test-mingw']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=5f98328ddc9546e3a22732b69d331039
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-25jm6435/src'
make: *** [docker-run-test-mingw@fedora] Error 2

real    2m1.238s
user    0m8.179s


The full log is available at
http://patchew.org/logs/1585307647-24456-1-git-send-email-jasowang@redhat.com/testing.docker-mingw@fedora/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Re: [PULL 00/13] Net patches
Posted by no-reply@patchew.org 4 years ago
Patchew URL: https://patchew.org/QEMU/1585307647-24456-1-git-send-email-jasowang@redhat.com/



Hi,

This series failed the docker-quick@centos7 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===

  CC      hw/net/can/can_pcm3680_pci.o
  CC      hw/net/can/can_mioe3680_pci.o
  CC      hw/nvram/eeprom93xx.o
/tmp/qemu-test/src/hw/net/allwinner-sun8i-emac.c:773:5: error: initialization from incompatible pointer type [-Werror]
     .can_receive = allwinner_sun8i_emac_can_receive,
     ^
/tmp/qemu-test/src/hw/net/allwinner-sun8i-emac.c:773:5: error: (near initialization for 'net_allwinner_sun8i_emac_info.can_receive') [-Werror]
cc1: all warnings being treated as errors
make: *** [hw/net/allwinner-sun8i-emac.o] Error 1
make: *** Waiting for unfinished jobs....
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 664, in <module>
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--label', 'com.qemu.instance.uuid=9de76a7b115b4ab8a94068ca9c2cad7f', '-u', '1003', '--security-opt', 'seccomp=unconfined', '--rm', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew2/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-tnhlej87/src/docker-src.2020-03-27-08.00.45.17095:/var/tmp/qemu:z,ro', 'qemu:centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=9de76a7b115b4ab8a94068ca9c2cad7f
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-tnhlej87/src'
make: *** [docker-run-test-quick@centos7] Error 2

real    2m20.630s
user    0m8.048s


The full log is available at
http://patchew.org/logs/1585307647-24456-1-git-send-email-jasowang@redhat.com/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com