qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] fdec16: net/socket: learn to talk with a unix


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] fdec16: net/socket: learn to talk with a unix dgram socket
Date: Fri, 29 Mar 2019 05:27:08 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: fdec16e3c2a614e2861f3086b05d444b5d8c3406
      
https://github.com/qemu/qemu/commit/fdec16e3c2a614e2861f3086b05d444b5d8c3406
  Author: Marc-André Lureau <address@hidden>
  Date:   2019-03-29 (Fri, 29 Mar 2019)

  Changed paths:
    M net/socket.c

  Log Message:
  -----------
  net/socket: learn to talk with a unix dgram socket

-net socket has a fd argument, and may be passed pre-opened sockets.

TCP sockets use framing.
UDP sockets have datagram boundaries.

When given a unix dgram socket, it will be able to read from it, but
will attempt to send on the dgram_dst, which is unset. The other end
will not receive the data.

Let's teach -net socket to recognize a UNIX DGRAM socket, and use the
regular send() command (without dgram_dst).

This makes running slirp out-of-process possible that
way (python pseudo-code):

a, b = socket.socketpair(socket.AF_UNIX, socket.SOCK_DGRAM)

subprocess.Popen('qemu -net socket,fd=%d -net user' % a.fileno(), shell=True)
subprocess.Popen('qemu ... -net nic -net socket,fd=%d' % b.fileno(), shell=True)

Signed-off-by: Marc-André Lureau <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: 157628d067072118b15569661f0adf9141c34383
      
https://github.com/qemu/qemu/commit/157628d067072118b15569661f0adf9141c34383
  Author: yuchenlin <address@hidden>
  Date:   2019-03-29 (Fri, 29 Mar 2019)

  Changed paths:
    M hw/net/e1000.c

  Log Message:
  -----------
  e1000: Delay flush queue when receive RCTL

Due to too early RCT0 interrput, win10x32 may hang on booting.
This problem can be reproduced by doing power cycle on win10x32 guest.
In our environment, we have 10 win10x32 and stress power cycle.
The problem will happen about 20 rounds.

Below shows some log with comment:

The normal case:

address@hidden:e1000x_rx_disabled Received packet dropped
because receive is disabled RCTL = 0
address@hidden:e1000x_rx_disabled Received packet dropped
because receive is disabled RCTL = 0
address@hidden:e1000x_rx_disabled Received packet dropped
because receive is disabled RCTL = 0
e1000: set_ics 0, ICR 0, IMR 0
e1000: set_ics 0, ICR 0, IMR 0
e1000: set_ics 0, ICR 0, IMR 0
e1000: RCTL: 0, mac_reg[RCTL] = 0x0
address@hidden:e1000x_rx_disabled Received packet dropped
because receive is disabled RCTL = 0
e1000: set_ics 0, ICR 0, IMR 0
e1000: ICR read: 0
e1000: set_ics 0, ICR 0, IMR 0
e1000: set_ics 0, ICR 0, IMR 0
e1000: RCTL: 0, mac_reg[RCTL] = 0x0
address@hidden:e1000x_rx_disabled Received packet dropped
because receive is disabled RCTL = 0
e1000: set_ics 0, ICR 0, IMR 0
e1000: ICR read: 0
e1000: set_ics 2, ICR 0, IMR 0
e1000: set_ics 2, ICR 2, IMR 0
e1000: RCTL: 0, mac_reg[RCTL] = 0x0
address@hidden:e1000x_rx_disabled Received packet dropped
because receive is disabled RCTL = 0
address@hidden:e1000x_rx_disabled Received packet dropped
because receive is disabled RCTL = 0
e1000: RCTL: 255, mac_reg[RCTL] = 0x40002 <- win10x32 says it can handle
RX now
e1000: set_ics 0, ICR 2, IMR 9d <- unmask interrupt
e1000: RCTL: 255, mac_reg[RCTL] = 0x48002
e1000: set_ics 80, ICR 2, IMR 9d <- interrupt and work!
...

The bad case:

address@hidden:e1000x_rx_disabled Received packet dropped
because receive is disabled RCTL = 0
address@hidden:e1000x_rx_disabled Received packet dropped
because receive is disabled RCTL = 0
e1000: set_ics 0, ICR 0, IMR 0
e1000: set_ics 0, ICR 0, IMR 0
e1000: set_ics 0, ICR 0, IMR 0
e1000: RCTL: 0, mac_reg[RCTL] = 0x0
address@hidden:e1000x_rx_disabled Received packet dropped
because receive is disabled RCTL = 0
e1000: set_ics 0, ICR 0, IMR 0
e1000: ICR read: 0
e1000: set_ics 0, ICR 0, IMR 0
e1000: set_ics 0, ICR 0, IMR 0
e1000: RCTL: 0, mac_reg[RCTL] = 0x0
address@hidden:e1000x_rx_disabled Received packet dropped
because receive is disabled RCTL = 0
e1000: set_ics 0, ICR 0, IMR 0
e1000: ICR read: 0
e1000: set_ics 2, ICR 0, IMR 0
e1000: set_ics 2, ICR 2, IMR 0
e1000: RCTL: 0, mac_reg[RCTL] = 0x0
address@hidden:e1000x_rx_disabled Received packet dropped
because receive is disabled RCTL = 0
address@hidden:e1000x_rx_disabled Received packet dropped
because receive is disabled RCTL = 0
e1000: RCTL: 255, mac_reg[RCTL] = 0x40002 <- win10x32 says it can handle
RX now
e1000: set_ics 80, ICR 2, IMR 0 <- flush queue (caused by setting RCTL)
e1000: set_ics 0, ICR 82, IMR 9d <- unmask interrupt and because 0x82&0x9d
!= 0 generate interrupt, hang on here...

To workaround this problem, simply delay flush queue. Also stop receiving
when timer is going to run.

Tested on CentOS, Win7SP1x64 and Win10x32.

Signed-off-by: yuchenlin <address@hidden>
Reviewed-by: Dmitry Fleytman <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: c6bf50ff72c2eefbb041c71a0944426df685a9df
      
https://github.com/qemu/qemu/commit/c6bf50ff72c2eefbb041c71a0944426df685a9df
  Author: Zhang Chen <address@hidden>
  Date:   2019-03-29 (Fri, 29 Mar 2019)

  Changed paths:
    M MAINTAINERS

  Log Message:
  -----------
  MAINTAINERS: Update the latest email address

Signed-off-by: Zhang Chen <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: ab79237a15e8f8c23310291b672d83374cf17935
      
https://github.com/qemu/qemu/commit/ab79237a15e8f8c23310291b672d83374cf17935
  Author: Li Qiang <address@hidden>
  Date:   2019-03-29 (Fri, 29 Mar 2019)

  Changed paths:
    M net/tap.c

  Log Message:
  -----------
  net: tap: use qemu_set_nonblock

The fcntl will change the flags directly, use qemu_set_nonblock()
instead.

Reviewed-by: Daniel P. Berrangé <address@hidden>
Acked-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Li Qiang <address@hidden>
Signed-off-by: Jason Wang <address@hidden>


  Commit: c503849bb5400cc4a7a293603067e8f995e46280
      
https://github.com/qemu/qemu/commit/c503849bb5400cc4a7a293603067e8f995e46280
  Author: Peter Maydell <address@hidden>
  Date:   2019-03-29 (Fri, 29 Mar 2019)

  Changed paths:
    M MAINTAINERS
    M hw/net/e1000.c
    M net/socket.c
    M net/tap.c

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

# gpg: Signature made Fri 29 Mar 2019 07:30:26 GMT
# gpg:                using RSA key EF04965B398D6211
# gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <address@hidden>" 
[marginal]
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg:          It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211

* remotes/jasowang/tags/net-pull-request:
  net: tap: use qemu_set_nonblock
  MAINTAINERS: Update the latest email address
  e1000: Delay flush queue when receive RCTL
  net/socket: learn to talk with a unix dgram socket

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


Compare: https://github.com/qemu/qemu/compare/94c01767aa95...c503849bb540



reply via email to

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