qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v4 16/16] hub: add the support for hub own flow


From: Zhi Yong Wu
Subject: Re: [Qemu-devel] [PATCH v4 16/16] hub: add the support for hub own flow control
Date: Fri, 25 May 2012 19:10:14 +0800

On Fri, May 25, 2012 at 7:05 PM, Paolo Bonzini <address@hidden> wrote:
> Il 25/05/2012 12:52, address@hidden ha scritto:
>> From: Zhi Yong Wu <address@hidden>
>>
>> Only when all other hub port's *peer* .can_receive() all return 1, the 
>> source hub port .can_receive() return 1.
>>
>> Signed-off-by: Zhi Yong Wu <address@hidden>
>> ---
>>  net/hub.c |   27 ++++++++++++++++++++++++---
>>  1 files changed, 24 insertions(+), 3 deletions(-)
>>
>> diff --git a/net/hub.c b/net/hub.c
>> index 357ca87..478cce1 100644
>> --- a/net/hub.c
>> +++ b/net/hub.c
>> @@ -15,6 +15,7 @@
>>  #include "monitor.h"
>>  #include "net.h"
>>  #include "hub.h"
>> +#include "iov.h"
>>
>>  /*
>>   * A hub broadcasts incoming packets to all its ports except the source 
>> port.
>> @@ -59,16 +60,16 @@ static ssize_t net_hub_receive_iov(NetHub *hub, 
>> NetHubPort *source_port,
>>                                     const struct iovec *iov, int iovcnt)
>>  {
>>      NetHubPort *port;
>> -    ssize_t ret = 0;
>> +    ssize_t len = iov_size(iov, iovcnt);
>>
>>      QLIST_FOREACH(port, &hub->ports, next) {
>>          if (port == source_port) {
>>              continue;
>>          }
>>
>> -        ret = qemu_sendv_packet(&port->nc, iov, iovcnt);
>> +        qemu_sendv_packet(&port->nc, iov, iovcnt);
>
> I think you still need to apply flow control, otherwise you're cheating.
>  But perhaps this is acceptable, I'll leave it to more expert people.
Great. thanks. any comments for other patches?

>
> Paolo



-- 
Regards,

Zhi Yong Wu



reply via email to

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