qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 3e2305: hw/net: create common collection of M


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 3e2305: hw/net: create common collection of MII definition...
Date: Mon, 27 Jul 2015 08:30:06 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 3e230569bf16aa36562967cd76b742c6824481b1
      
https://github.com/qemu/qemu/commit/3e230569bf16aa36562967cd76b742c6824481b1
  Author: Greg Ungerer <address@hidden>
  Date:   2015-07-27 (Mon, 27 Jul 2015)

  Changed paths:
    M include/hw/net/allwinner_emac.h
    A include/hw/net/mii.h

  Log Message:
  -----------
  hw/net: create common collection of MII definitions

Create a common set of definitions of address and register values for
ethernet MII phys. A few of the current ethernet drivers have at least
a partial set of these definitions. Others just use hard coded raw
constant numbers.

This initial set is copied directly from the allwinner_emac code.

Signed-off-by: Greg Ungerer <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 3634869b27b6b2ff538bcc5bf8dfd1235ede7034
      
https://github.com/qemu/qemu/commit/3634869b27b6b2ff538bcc5bf8dfd1235ede7034
  Author: Greg Ungerer <address@hidden>
  Date:   2015-07-27 (Mon, 27 Jul 2015)

  Changed paths:
    M include/hw/net/mii.h

  Log Message:
  -----------
  hw/net: add ANLPAR bit definitions to generic mii

Add a base set of bit definitions for the standard MII phy "Auto-Negotiation
Link Partner Ability Register" (ANLPAR).

The original definitions moved into mii.h from the allwinner_emac driver
did not define these.

Signed-off-by: Greg Ungerer <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 299f7bec5a109db7563e1286cedf1f4d84e69e6d
      
https://github.com/qemu/qemu/commit/299f7bec5a109db7563e1286cedf1f4d84e69e6d
  Author: Greg Ungerer <address@hidden>
  Date:   2015-07-27 (Mon, 27 Jul 2015)

  Changed paths:
    M hw/net/mcf_fec.c
    M include/hw/net/mii.h

  Log Message:
  -----------
  hw/net: add simple phy support to mcf_fec driver

The Linux fec driver needs at least basic phy support to probe and work.
The current qemu mcf_fec emulation has no support for the reading or
writing of the MDIO lines to access an attached phy.

This code adds a very simple set of register results for a fixed phy
setup - very similar to that used on an m5208evb board. This is enough
to probe and identify an emulated attached phy.

Signed-off-by: Greg Ungerer <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 491a1f494ed4c0d1a8593dd04b645f8e63c4cfae
      
https://github.com/qemu/qemu/commit/491a1f494ed4c0d1a8593dd04b645f8e63c4cfae
  Author: Greg Ungerer <address@hidden>
  Date:   2015-07-27 (Mon, 27 Jul 2015)

  Changed paths:
    M hw/net/mcf_fec.c

  Log Message:
  -----------
  hw/net: fix mcf_fec driver receiver

The network mcf_fec driver emulated receive side method is returning a
result of 0 causing the network layer to disable receive for this emulated
device. This results in the guest only ever receiving one packet.

Fix the recieve side processing to return the number of bytes that we
passed back through to the guest.

Signed-off-by: Greg Ungerer <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 8c8c460c5f38f878675631a66286a6e87bb4d111
      
https://github.com/qemu/qemu/commit/8c8c460c5f38f878675631a66286a6e87bb4d111
  Author: Fam Zheng <address@hidden>
  Date:   2015-07-27 (Mon, 27 Jul 2015)

  Changed paths:
    M hw/net/xgmac.c

  Log Message:
  -----------
  xgmac: Drop packets with eth_can_rx is false.

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Jason Wang <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: b0ba0b9b6b402d738f11f27eea6c94d97bf84cbf
      
https://github.com/qemu/qemu/commit/b0ba0b9b6b402d738f11f27eea6c94d97bf84cbf
  Author: Fam Zheng <address@hidden>
  Date:   2015-07-27 (Mon, 27 Jul 2015)

  Changed paths:
    M hw/net/lance.c
    M hw/net/pcnet-pci.c
    M hw/net/pcnet.c
    M hw/net/pcnet.h

  Log Message:
  -----------
  pcnet: Drop pcnet_can_receive

pcnet_receive already checks the conditions and drop packets if false.
Due to the new semantics since 6e99c63 ("net/socket: Drop
net_socket_can_send"), having .can_receive returning 0 requires us to
explicitly flush the queued packets when the conditions are becoming
true, but queuing the packets when guest driver is not ready doesn't
make much sense.

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Jason Wang <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 363db4b249244f31d3c47fbd5a8b128c95ba8fe7
      
https://github.com/qemu/qemu/commit/363db4b249244f31d3c47fbd5a8b128c95ba8fe7
  Author: Fam Zheng <address@hidden>
  Date:   2015-07-27 (Mon, 27 Jul 2015)

  Changed paths:
    M hw/net/eepro100.c

  Log Message:
  -----------
  eepro100: Drop nic_can_receive

nic_receive already checks the conditions and drop packets if false.
Due to the new semantics since 6e99c63 ("net/socket: Drop
net_socket_can_send"), having .can_receive returning 0 requires us to
explicitly flush the queued packets when the conditions are becoming
true, but queuing the packets when guest driver is not ready doesn't
make much sense.

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Jason Wang <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 913440249ea2e697177e9d43167ac325a8dfe907
      
https://github.com/qemu/qemu/commit/913440249ea2e697177e9d43167ac325a8dfe907
  Author: Fam Zheng <address@hidden>
  Date:   2015-07-27 (Mon, 27 Jul 2015)

  Changed paths:
    M hw/usb/dev-network.c

  Log Message:
  -----------
  usbnet: Drop usbnet_can_receive

usbnet_receive already drops packet if rndis_state is not
RNDIS_DATA_INITIALIZED, and queues packet if in buffer is not available.
The only difference is s->dev.config but that is similar to rndis_state.

Drop usbnet_can_receive and move these checks to usbnet_receive, so that
we don't need to explicitly flush the queue when s->dev.config changes
value.

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Jason Wang <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: b6cb6610c27c5b0773a340499f19c3477bf45aeb
      
https://github.com/qemu/qemu/commit/b6cb6610c27c5b0773a340499f19c3477bf45aeb
  Author: Fam Zheng <address@hidden>
  Date:   2015-07-27 (Mon, 27 Jul 2015)

  Changed paths:
    M hw/net/fsl_etsec/etsec.c
    M hw/net/fsl_etsec/etsec.h
    M hw/net/fsl_etsec/rings.c

  Log Message:
  -----------
  etsec: Move etsec_can_receive into etsec_receive

When etsec_reset returns 0, peer would queue the packet as if
.can_receive returns false. Drop etsec_can_receive and let etsec_receive
carry the semantics.

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Jason Wang <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 575bafd1f387c5f06b59cf2515f6bb1eff9d119d
      
https://github.com/qemu/qemu/commit/575bafd1f387c5f06b59cf2515f6bb1eff9d119d
  Author: Fam Zheng <address@hidden>
  Date:   2015-07-27 (Mon, 27 Jul 2015)

  Changed paths:
    M hw/net/fsl_etsec/etsec.c
    M hw/net/fsl_etsec/etsec.h
    M hw/net/fsl_etsec/rings.c

  Log Message:
  -----------
  etsec: Flush queue when rx buffer is consumed

The BH will be scheduled when etsec->rx_buffer_len is becoming 0, which
is the condition of queuing.

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Jason Wang <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: e813f0d8813944061fa9bde861cf6899379843e6
      
https://github.com/qemu/qemu/commit/e813f0d8813944061fa9bde861cf6899379843e6
  Author: Fam Zheng <address@hidden>
  Date:   2015-07-27 (Mon, 27 Jul 2015)

  Changed paths:
    M hw/net/mcf_fec.c

  Log Message:
  -----------
  mcf_fec: Drop mcf_fec_can_receive

The semantics of .can_receive requires us to flush the queue explicitly
when s->rx_enabled becomes true after it returns 0, but the packet being
queued is not meaningful since the guest hasn't activated the card.
Let's just drop the packet in this case.

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Jason Wang <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 3b7031e9609baf710823aa7880fd9802b39c4563
      
https://github.com/qemu/qemu/commit/3b7031e9609baf710823aa7880fd9802b39c4563
  Author: Fam Zheng <address@hidden>
  Date:   2015-07-27 (Mon, 27 Jul 2015)

  Changed paths:
    M hw/net/milkymist-minimac2.c
    M trace-events

  Log Message:
  -----------
  milkymist-minimac2: Flush queued packets when link comes up

Drop .can_receive and move the semantics into minimac2_rx, by returning
0.

That is once minimac2_rx returns 0, incoming packets will be queued
until the queue is explicitly flushed. We do this when s->regs[R_STATE0]
or s->regs[R_STATE1] is changed in minimac2_write.

Also drop the unused trace point.

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Jason Wang <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 1dd58ae0583c3d3fb15fa1d563d6b497558d3ad0
      
https://github.com/qemu/qemu/commit/1dd58ae0583c3d3fb15fa1d563d6b497558d3ad0
  Author: Fam Zheng <address@hidden>
  Date:   2015-07-27 (Mon, 27 Jul 2015)

  Changed paths:
    M hw/net/mipsnet.c

  Log Message:
  -----------
  mipsnet: Flush queued packets when receiving is enabled

Drop .can_receive and move the semantics to mipsnet_receive, by
returning 0.

After 0 is returned, we must flush the queue explicitly to restart it:
Call qemu_flush_queued_packets when s->busy or s->rx_count is being
updated.

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Jason Wang <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 1ef4a6069f8b4c09c3383cd4b8e27b6ff25b2d41
      
https://github.com/qemu/qemu/commit/1ef4a6069f8b4c09c3383cd4b8e27b6ff25b2d41
  Author: Fam Zheng <address@hidden>
  Date:   2015-07-27 (Mon, 27 Jul 2015)

  Changed paths:
    M hw/net/stellaris_enet.c

  Log Message:
  -----------
  stellaris_enet: Flush queued packets when read done

If s->np reaches 31, the queue will be disabled by peer when it sees
stellaris_enet_can_receive() returns false, until we explicitly flushes
it which notifies the peer. Do this when guest is done reading all
existing data.

Move the semantics to stellaris_enet_receive, by returning 0 when the
buffer is full, so that new packets will be queued.  In
stellaris_enet_read, flush and restart the queue when guest has done
reading.

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Jason Wang <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 4594f93a732f1f5936c3a5225481586e24bffa9e
      
https://github.com/qemu/qemu/commit/4594f93a732f1f5936c3a5225481586e24bffa9e
  Author: Fam Zheng <address@hidden>
  Date:   2015-07-27 (Mon, 27 Jul 2015)

  Changed paths:
    M hw/net/dp8393x.c

  Log Message:
  -----------
  dp8393x: Flush packets when link comes up

.can_receive callback changes semantics that once return 0, backend will
try sending again until explicitly flushed, change the device to meet
that.

dp8393x_can_receive checks SONIC_CR_RXEN bit in SONIC_CR register and
SONIC_ISR_RBE bit in SONIC_ISR register, try flushing the queue when
either bit is being updated.

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Jason Wang <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: f9f7492ea4a9dda538fedeec31399fb940533a16
      
https://github.com/qemu/qemu/commit/f9f7492ea4a9dda538fedeec31399fb940533a16
  Author: Fam Zheng <address@hidden>
  Date:   2015-07-27 (Mon, 27 Jul 2015)

  Changed paths:
    M hw/net/xilinx_axienet.c

  Log Message:
  -----------
  axienet: Flush queued packets when rx is done

eth_can_rx checks s->rxsize and returns false if it is non-zero. Because
of the .can_receive semantics change, this will make the incoming queue
disabled by peer, until it is explicitly flushed. So we should flush it
when s->rxsize is becoming zero.

Squash eth_can_rx semantics into etx_rx and drop .can_receive()
callback, also add flush when rx buffer becomes available again after a
packet gets queued.

The other conditions, "!axienet_rx_resetting(s) &&
axienet_rx_enabled(s)" are OK because enet_write already calls
qemu_flush_queued_packets when the register bits are changed.

Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Jason Wang <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 122e7dab8ac549c8c5a9e1e13aa2464190e888de
      
https://github.com/qemu/qemu/commit/122e7dab8ac549c8c5a9e1e13aa2464190e888de
  Author: Peter Maydell <address@hidden>
  Date:   2015-07-27 (Mon, 27 Jul 2015)

  Changed paths:
    M hw/net/dp8393x.c
    M hw/net/eepro100.c
    M hw/net/fsl_etsec/etsec.c
    M hw/net/fsl_etsec/etsec.h
    M hw/net/fsl_etsec/rings.c
    M hw/net/lance.c
    M hw/net/mcf_fec.c
    M hw/net/milkymist-minimac2.c
    M hw/net/mipsnet.c
    M hw/net/pcnet-pci.c
    M hw/net/pcnet.c
    M hw/net/pcnet.h
    M hw/net/stellaris_enet.c
    M hw/net/xgmac.c
    M hw/net/xilinx_axienet.c
    M hw/usb/dev-network.c
    M include/hw/net/allwinner_emac.h
    A include/hw/net/mii.h
    M trace-events

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/stefanha/tags/net-pull-request' into 
staging

Pull request

Here are NIC fixes from Fam Zheng that prevent rx hangs (caused by NIC models
where .can_receive() stops rx but qemu_flush_queued_packets() isn't called).

# gpg: Signature made Mon Jul 27 14:51:48 2015 BST using RSA key ID 81AB73C8
# gpg: Good signature from "Stefan Hajnoczi <address@hidden>"
# gpg:                 aka "Stefan Hajnoczi <address@hidden>"

* remotes/stefanha/tags/net-pull-request:
  axienet: Flush queued packets when rx is done
  dp8393x: Flush packets when link comes up
  stellaris_enet: Flush queued packets when read done
  mipsnet: Flush queued packets when receiving is enabled
  milkymist-minimac2: Flush queued packets when link comes up
  mcf_fec: Drop mcf_fec_can_receive
  etsec: Flush queue when rx buffer is consumed
  etsec: Move etsec_can_receive into etsec_receive
  usbnet: Drop usbnet_can_receive
  eepro100: Drop nic_can_receive
  pcnet: Drop pcnet_can_receive
  xgmac: Drop packets with eth_can_rx is false.
  hw/net: fix mcf_fec driver receiver
  hw/net: add simple phy support to mcf_fec driver
  hw/net: add ANLPAR bit definitions to generic mii
  hw/net: create common collection of MII definitions

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/e40db4c6d391...122e7dab8ac5

reply via email to

[Prev in Thread] Current Thread [Next in Thread]