qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] net/hub: remove can_receive handler
@ 2013-04-18 11:31 Sergey Fedorov
  2013-04-22 11:47 ` Stefan Hajnoczi
  0 siblings, 1 reply; 20+ messages in thread
From: Sergey Fedorov @ 2013-04-18 11:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Sergey Fedorov, aliguori, a.basov, stefanha

Network hub should always receive incoming packets. Then forward them to
the appropriate port queue and let the qemu_send_packet() do the right
things. If the destination queue cannot receive the packet it will be
appended to the queue. When the receiver call
qemu_flush_queued_packets() later the queue will be really flushed and
no packets will be stalled in the sender network queue.

Signed-off-by: Sergey Fedorov <s.fedorov@samsung.com>
---
 net/hub.c |   20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/net/hub.c b/net/hub.c
index df32074..552e970 100644
--- a/net/hub.c
+++ b/net/hub.c
@@ -87,25 +87,6 @@ static NetHub *net_hub_new(int id)
     return hub;
 }
 
-static int net_hub_port_can_receive(NetClientState *nc)
-{
-    NetHubPort *port;
-    NetHubPort *src_port = DO_UPCAST(NetHubPort, nc, nc);
-    NetHub *hub = src_port->hub;
-
-    QLIST_FOREACH(port, &hub->ports, next) {
-        if (port == src_port) {
-            continue;
-        }
-
-        if (qemu_can_send_packet(&port->nc)) {
-            return 1;
-        }
-    }
-
-    return 0;
-}
-
 static ssize_t net_hub_port_receive(NetClientState *nc,
                                     const uint8_t *buf, size_t len)
 {
@@ -132,7 +113,6 @@ static void net_hub_port_cleanup(NetClientState *nc)
 static NetClientInfo net_hub_port_info = {
     .type = NET_CLIENT_OPTIONS_KIND_HUBPORT,
     .size = sizeof(NetHubPort),
-    .can_receive = net_hub_port_can_receive,
     .receive = net_hub_port_receive,
     .receive_iov = net_hub_port_receive_iov,
     .cleanup = net_hub_port_cleanup,
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2013-10-30 12:55 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-18 11:31 [Qemu-devel] [PATCH] net/hub: remove can_receive handler Sergey Fedorov
2013-04-22 11:47 ` Stefan Hajnoczi
2013-04-22 12:26   ` Fedorov Sergey
2013-04-22 14:57     ` Stefan Hajnoczi
2013-04-22 15:27       ` Fedorov Sergey
2013-04-22 16:09         ` Paolo Bonzini
2013-04-23  7:27           ` Fedorov Sergey
2013-04-23  6:58         ` Stefan Hajnoczi
2013-04-23  7:41           ` Fedorov Sergey
2013-04-23 12:00             ` Stefan Hajnoczi
2013-04-23 13:14               ` Fedorov Sergey
2013-10-21 11:44               ` Fedorov Sergey
2013-10-21 11:52                 ` Fedorov Sergey
2013-10-28  7:26                   ` Fedorov Sergey
2013-10-29 14:55                 ` Stefan Hajnoczi
2013-10-30 10:29                   ` Fedorov Sergey
2013-10-30 12:55                     ` Stefan Hajnoczi
2013-04-23  9:32           ` Fedorov Sergey
2013-04-23 11:48             ` Stefan Hajnoczi
2013-04-23 11:58               ` Fedorov Sergey

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).