Received: from eggs.gnu.org ([2001:4830:134:3::10]:46013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFHSU-0005YV-3Y for qemu-devel@nongnu.org; Wed, 15 Jul 2015 03:50:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZFHSP-00009m-4Q for qemu-devel@nongnu.org; Wed, 15 Jul 2015 03:50:26 -0400 Received: from ssl.serverraum.org ([88.198.40.39]:45550) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZFHSO-00009g-UW for qemu-devel@nongnu.org; Wed, 15 Jul 2015 03:50:21 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 15 Jul 2015 09:50:19 +0200 From: Michael Walle In-Reply-To: <20150714110734.GA22250@ad.nay.redhat.com> References: <1436860421-4604-1-git-send-email-famz@redhat.com> <1436860421-4604-9-git-send-email-famz@redhat.com> <0e59f1d9503695e4d32cb4eb3110b724@walle.cc> <20150714110734.GA22250@ad.nay.redhat.com> Message-ID: Subject: Re: [Qemu-devel] [PATCH for-2.4 08/12] milkymist-minimac2: Flush queued packets when link comes up List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Peter Maydell , Peter Crosthwaite , Rob Herring , jasowang@redhat.com, qemu-devel@nongnu.org, Gerd Hoffmann , stefanha@redhat.com, "Edgar E. Iglesias" Am 2015-07-14 13:07, schrieb Fam Zheng: > On Tue, 07/14 13:02, Michael Walle wrote: >> Am 2015-07-14 09:53, schrieb Fam Zheng: >> >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. >> > >> >Signed-off-by: Fam Zheng >> >--- >> > hw/net/milkymist-minimac2.c | 12 ++++++------ >> > 1 file changed, 6 insertions(+), 6 deletions(-) >> > >> >diff --git a/hw/net/milkymist-minimac2.c b/hw/net/milkymist-minimac2.c >> >index f06afaa..cd38a06 100644 >> >--- a/hw/net/milkymist-minimac2.c >> >+++ b/hw/net/milkymist-minimac2.c >> >@@ -303,8 +303,7 @@ static ssize_t minimac2_rx(NetClientState *nc, >> >const uint8_t *buf, size_t size) >> > r_state = R_STATE1; >> > rx_buf = s->rx1_buf; >> > } else { >> >- trace_milkymist_minimac2_drop_rx_frame(buf); >> >- return size; >> >+ return 0; >> >> trace removed? > > Because the frame is no longer dropped as we return 0 - it is queued > and will > be sent again when we do qemu_flush_queued_packets later. Should I > rename the > trace point? ah, ok. no i guess we won't need a tracepoint for that event. but please remove the tracepoint from trace-events, too. -michael