From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:a19:ee01:0:0:0:0:0 with SMTP id g1csp955474lfb; Wed, 6 May 2020 05:43:19 -0700 (PDT) X-Google-Smtp-Source: APiQypLRe6jZKqnMgpTFEmuuvaWsvsowOuLUw7yN6z5SNerXMu8oUhi6ocOcj6UjYIy+p5KYkKL0 X-Received: by 2002:ac8:6043:: with SMTP id k3mr7010570qtm.99.1588768999180; Wed, 06 May 2020 05:43:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588768999; cv=none; d=google.com; s=arc-20160816; b=phSY/sBQ4kapopnsvt9YaHRbk0ZxB0yo/wPBz7u6nkPCy0yLTk0yLwMHr01bRnx/Cq 7LckF5f2ZNR8QGXRFTEPB8grHfhkKQ+AIPZg6sRidEDiMyUKphxphvJ03+9KlUBdNAwN hVGiPRJgcQ7GZLnUqhIXmV1y+ZDBkINQoqVElgOaXvPzqux2uc2HrLerTbGkyOqbcy7A M6VYor+2jO3MbRssyftSDduRTj2lKrBj9KagzE4owU0Jzgga2Y00gIRTZrrOld4e73B3 +BVetdvdxDRS6YpoZZDVX06TMr9Ot8Ivi3ABo4NT3kebpmIta5eVINcQgYyuJLDqc3mv j7kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature; bh=nOQSLGpGO3TwX+eyRCdr9lG1bDd+uzfPjZvAcBu5KYU=; b=Lc06F35j1Qq4ZhZ1hKAAqgEUIIQsUC1gvk2JBYBLOTettObwlKIR+NP/jkGkbJNv/K Sv3rrhPa84pQ6SeKwCCtVBlTyl78oSz1e0ba4izwbF/w0j6NC4U86Vt6AiCU/hcWWkVx d0Er7VLQDKSQC0xnUhEUKLUUBvwGkmAGcmom3S2Bz6NVv2EVeJKU01OzzJy+Lq+nSoMM sX/WMIMEudCYB4Wj/R0CQtHrmsHvhWstcdz7RDM41z2j5LjYmM2djet9Q9Tt8Ck8yRaT ijQoi/aSgAUfZR2W4IlyR7arP2/4hqJ4ITwV+DoYqhpk5AE14hcIOgpWdFKa2Ji3Nxmn Q05g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=CNnD6LMK; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 2001:470:142::17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:470:142::17]) by mx.google.com with ESMTPS id q1si856704qtf.337.2020.05.06.05.43.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 May 2020 05:43:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 2001:470:142::17 as permitted sender) client-ip=2001:470:142::17; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=CNnD6LMK; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 2001:470:142::17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from localhost ([::1]:50410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWJOQ-0005qk-H1 for alex.bennee@linaro.org; Wed, 06 May 2020 08:43:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34110) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWJNd-0004fS-O0; Wed, 06 May 2020 08:42:29 -0400 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]:42559) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jWJNc-0008Ui-Fs; Wed, 06 May 2020 08:42:29 -0400 Received: by mail-lj1-x242.google.com with SMTP id a21so2160593ljb.9; Wed, 06 May 2020 05:42:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=nOQSLGpGO3TwX+eyRCdr9lG1bDd+uzfPjZvAcBu5KYU=; b=CNnD6LMKxH/UHRdV/AtJzu7v6vhha/ireUVs6C9lbk6Uv1YCVk6Ed+wt5nw9PZ0MSB mfKvpczQnxyj8saG0EYxa4ah4bHqiMcLO5FUO6ZVESdpnaD43of7bxZmRpd9C1dB3VNO SdxNOHRIo9Rro+uRMjXyyeRozB6SBfap75Vksj82YCv0uvti6C54v+xLQqA4crGlwNYL zI5byQ1tjxR8xnhHfLx4Ag92++TlmOCB5sZQD84YpnAiOqwD7BayNuTFW6DKLRktevNJ Ty59TWDceKPMsnopVQXRafPKlierpdI4UzxtXhycGSYxHOELtWljAV6D1B7pF0/xUwSX Fjsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=nOQSLGpGO3TwX+eyRCdr9lG1bDd+uzfPjZvAcBu5KYU=; b=SNBms1hVFbIdAiDSb4bIGJgqq/TrS5EeHZ48ljZH7y7hjaGmvguIT5rQA1Ylo4E6iH +8urVQq+VlQS0wCz4x0f+J/owbaSDq/jNZXtwnkC4KS0HYn5+WSfuSZXIArfNRo43p5S AyNevfh2HV3VdjXPqlQZZDQQ6l8kzQvq7kioKsXGHREYIuEWWtCpV/obTigOaSmESTk1 M4gz+fKR9/yOFpk3Sb67x9JfR/R8OLbkEbbVVgvbxhaLraoBhkNcXDZOIpqhTPYWHaPu 5mGptuVvCH3wrEl7+Z4iUepT3AYxFHuxn/eMWPy7VYVzym3unr+U6OP42ipUwmb5NzKH /TTA== X-Gm-Message-State: AGi0PuZGkkixL1I16UIiszQtivJGZi+/2G9LY7wIIiFRyvxY4plbPBAi NCfWA6549gBPIbeYb/gq2AQ= X-Received: by 2002:a2e:740f:: with SMTP id p15mr4910495ljc.151.1588768946065; Wed, 06 May 2020 05:42:26 -0700 (PDT) Received: from localhost (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id s11sm1605438lfo.86.2020.05.06.05.42.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2020 05:42:25 -0700 (PDT) Date: Wed, 6 May 2020 14:42:09 +0200 From: "Edgar E. Iglesias" To: Philippe =?iso-8859-1?Q?Mathieu-Daud=E9?= Subject: Re: [PATCH v2 5/9] hw/core: stream: Add an end-of-packet flag Message-ID: <20200506124209.GK5519@toto> References: <20200506082513.18751-1-edgar.iglesias@gmail.com> <20200506082513.18751-6-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Received-SPF: pass client-ip=2a00:1450:4864:20::242; envelope-from=edgar.iglesias@gmail.com; helo=mail-lj1-x242.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: damien.hedde@greensocs.com, peter.maydell@linaro.org, sstabellini@kernel.org, edgar.iglesias@xilinx.com, sai.pavan.boddu@xilinx.com, frasse.iglesias@gmail.com, jasowang@redhat.com, alistair@alistair23.me, qemu-devel@nongnu.org, frederic.konrad@adacore.com, qemu-arm@nongnu.org, figlesia@xilinx.com, luc.michel@greensocs.com Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: xtWw1DDsKslc On Wed, May 06, 2020 at 01:53:33PM +0200, Philippe Mathieu-Daudé wrote: > Hi Edgar, Hi Philippe, > > On 5/6/20 10:25 AM, Edgar E. Iglesias wrote: > > From: "Edgar E. Iglesias" > > > > Some stream clients stream an endless stream of data while > > other clients stream data in packets. Stream interfaces > > usually have a way to signal the end of a packet or the > > last beat of a transfer. > > > > This adds an end-of-packet flag to the push interface. > > > > Reviewed-by: Alistair Francis > > Reviewed-by: Francisco Iglesias > > Signed-off-by: Edgar E. Iglesias > > --- > > include/hw/stream.h | 5 +++-- > > hw/core/stream.c | 4 ++-- > > hw/dma/xilinx_axidma.c | 10 ++++++---- > > hw/net/xilinx_axienet.c | 14 ++++++++++---- > > hw/ssi/xilinx_spips.c | 2 +- > > 5 files changed, 22 insertions(+), 13 deletions(-) > > > > diff --git a/include/hw/stream.h b/include/hw/stream.h > > index d02f62ca89..ed09e83683 100644 > > --- a/include/hw/stream.h > > +++ b/include/hw/stream.h > > @@ -39,12 +39,13 @@ typedef struct StreamSlaveClass { > > * @obj: Stream slave to push to > > * @buf: Data to write > > * @len: Maximum number of bytes to write > > + * @eop: End of packet flag > > */ > > - size_t (*push)(StreamSlave *obj, unsigned char *buf, size_t len); > > + size_t (*push)(StreamSlave *obj, unsigned char *buf, size_t len, bool eop); > > I'd split this patch, first add EOP in the push handler, keeping current > code working, then the following patches (implementing the feature in the > backend handlers), then ... > > > } StreamSlaveClass; > > size_t > > -stream_push(StreamSlave *sink, uint8_t *buf, size_t len); > > +stream_push(StreamSlave *sink, uint8_t *buf, size_t len, bool eop); > > ... this final patch, enable the feature and let the frontends use it. > > > bool > > stream_can_push(StreamSlave *sink, StreamCanPushNotifyFn notify, > > diff --git a/hw/core/stream.c b/hw/core/stream.c > > index 39b1e595cd..a65ad1208d 100644 > > --- a/hw/core/stream.c > > +++ b/hw/core/stream.c > > @@ -3,11 +3,11 @@ > > #include "qemu/module.h" > > size_t > > -stream_push(StreamSlave *sink, uint8_t *buf, size_t len) > > +stream_push(StreamSlave *sink, uint8_t *buf, size_t len, bool eop) > > { > > StreamSlaveClass *k = STREAM_SLAVE_GET_CLASS(sink); > > - return k->push(sink, buf, len); > > + return k->push(sink, buf, len, eop); > > So in this first part patch I'd use 'false' here, and update by 'eop' in the > other part (last patch in series). Does it make sense? Current code implicitly assumes eop = true, so this patch keeps things working as before. It just makes the assumption explicit and guarding backends with asserts. The support for eop = false is then added (where relevant) in future patches, roughly the way you describe it. I can add something to the commit message to clarify that. Best regards, Edgar