From nobody Tue Feb 10 01:35:17 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1588264372; cv=none; d=zohomail.com; s=zohoarc; b=Rs/oDfW/jii/PyFLe+XL0WdmbluZ08FYcZtHa12t95dFi3MSNCjfCztUAcEVClvXKJHQ3+mt5t6t+3ntVjUjRM9mK1MdgHm2TUjzd91DzvMLt6K6NY2mMA435FZaJrw+YGWNxjBzVjuA+lkRW7Hp8Fb1xNbUIoC0Kv93cP26ibA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588264372; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SupxvvkaQXyN9EdBNwThK6ET+TCX07xPKPS0LjTpIqo=; b=U+0O43xd/efMa7lR7hR5ZTrSswnNIg1wTiVJF3mVLt+WuNpHsL9+6ulfh7sk0UoKUkVejiRNtrHgWdgjn2ngSOK6hro9/jj+OfbMeQEWb6yULaZ8LuU8k4ibgEaXK2o7yuTYlQFnSBTYOvQGY2WjMyWzZqIshjttzqC9MIqMKvQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1588264372514493.8462374877091; Thu, 30 Apr 2020 09:32:52 -0700 (PDT) Received: from localhost ([::1]:35490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUC7H-0006ea-45 for importer@patchew.org; Thu, 30 Apr 2020 12:32:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48620) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUC06-0004zA-6t for qemu-devel@nongnu.org; Thu, 30 Apr 2020 12:26:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUBzY-0002Ns-F6 for qemu-devel@nongnu.org; Thu, 30 Apr 2020 12:25:25 -0400 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]:34228) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jUBzY-0002NX-23; Thu, 30 Apr 2020 12:24:52 -0400 Received: by mail-lj1-x244.google.com with SMTP id f11so2499ljp.1; Thu, 30 Apr 2020 09:24:51 -0700 (PDT) Received: from gmail.com (81-231-232-130-no39.tbcn.telia.com. [81.231.232.130]) by smtp.gmail.com with ESMTPSA id t16sm150172ljg.41.2020.04.30.09.24.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 09:24:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SupxvvkaQXyN9EdBNwThK6ET+TCX07xPKPS0LjTpIqo=; b=cSjQsqDpB6yIB6FBDFvmrnAXqeDXnQBJiXV0AmrF5QhMR3FNX3GGJ7pxvTEYHv2xHt 6n05oLZXF49cb0SncqnVKglVsOhbPiLuwzfFYT97jFFjPVqWg2Av/qvpbn69bLJ3JEmV vbO81l79xndJxP0LuV4DyWV/ybKOb++R5Oq/RUVEZfmsiVX8xJ9d0dJz9IVkNdyZ8vjS AZnVNdT3gAXtNiGAFDEz90zU1rR5CAQCPFMlr+miJWELLGpd2/SNN30baKqq4Z5HzI/3 No2NPVdf9Ze8P1UdLN1CR0wvVbfs9FD5b1x1rfTTWz+DJdEa3i6Li+chbsFKXL2hioUE MTrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SupxvvkaQXyN9EdBNwThK6ET+TCX07xPKPS0LjTpIqo=; b=gWSnJK7l15NJIteEl+o0B85I1OrNzCgbXs8orzTMfliD4FvEnkHlUE0W6MDnnmbMta G4rKzIv34o6Sg7HRK8QDiAQqlROhtJlbGqfJoIyc8JwQ1yKCI5LaFzpj7vtiCm742vvi DgSbmwJJt5DtACqXNSrA5ApqyTc27cKvYq0uI8U5ppJZ5eaXuQO9dJe0D9Dls/oVXUyy zoMKHazvRKSbzpNGwqsO6mV7C7aqRP0LEBi6juqEIAJnt1rm+0YhUyaEPxeTOQLhjKyg mKjrks/FHWX5UbJlte+L6S+wh0zppFyFbWpoudESLGshm6hHFcaZiFzEGocp0609RVeX mDOg== X-Gm-Message-State: AGi0PuaLlKJSB89luDzVgOujtVQ4oEt3sic4AKt1yP+mcBsF2Z+gOj80 IiEBk0XBcKXr0T4/mAC9k4MHykq8ikQ= X-Google-Smtp-Source: APiQypIyGX0nWAhPB/9dbJregXrN/bpsPhTQ7Nz9vk8T3+oO/6p7Old+vTXcfk0gcjdnOpqjtNZ2Bw== X-Received: by 2002:a2e:994a:: with SMTP id r10mr52814ljj.105.1588263889890; Thu, 30 Apr 2020 09:24:49 -0700 (PDT) From: "Edgar E. Iglesias" To: qemu-devel@nongnu.org Subject: [PATCH v1 7/9] hw/dma/xilinx_axidma: mm2s: Stream descriptor by descriptor Date: Thu, 30 Apr 2020 18:24:37 +0200 Message-Id: <20200430162439.2659-8-edgar.iglesias@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200430162439.2659-1-edgar.iglesias@gmail.com> References: <20200430162439.2659-1-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::244; envelope-from=edgar.iglesias@gmail.com; helo=mail-lj1-x244.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::244 X-BeenThere: qemu-devel@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, frederic.konrad@adacore.com, qemu-arm@nongnu.org, philmd@redhat.com, luc.michel@greensocs.com, figlesia@xilinx.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: "Edgar E. Iglesias" Stream descriptor by descriptor from memory instead of buffering entire packets before pushing. This enables non-packet streaming clients to work and also lifts the limitation that our internal DMA buffer needs to be able to hold entire packets. Signed-off-by: Edgar E. Iglesias Reviewed-by: Alistair Francis --- hw/dma/xilinx_axidma.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/hw/dma/xilinx_axidma.c b/hw/dma/xilinx_axidma.c index a770e12c96..101d32a965 100644 --- a/hw/dma/xilinx_axidma.c +++ b/hw/dma/xilinx_axidma.c @@ -111,7 +111,6 @@ struct Stream { int nr; =20 struct SDesc desc; - int pos; unsigned int complete_cnt; uint32_t regs[R_MAX]; uint8_t app[20]; @@ -267,7 +266,9 @@ static void stream_process_mem2s(struct Stream *s, Stre= amSlave *tx_data_dev, StreamSlave *tx_control_dev) { uint32_t prev_d; - unsigned int txlen; + uint32_t txlen; + uint64_t addr; + bool eop; =20 if (!stream_running(s) || stream_idle(s)) { return; @@ -282,24 +283,26 @@ static void stream_process_mem2s(struct Stream *s, St= reamSlave *tx_data_dev, } =20 if (stream_desc_sof(&s->desc)) { - s->pos =3D 0; stream_push(tx_control_dev, s->desc.app, sizeof(s->desc.app), = true); } =20 txlen =3D s->desc.control & SDESC_CTRL_LEN_MASK; - if ((txlen + s->pos) > sizeof s->txbuf) { - hw_error("%s: too small internal txbuf! %d\n", __func__, - txlen + s->pos); - } =20 - address_space_read(&s->dma->as, s->desc.buffer_address, - MEMTXATTRS_UNSPECIFIED, - s->txbuf + s->pos, txlen); - s->pos +=3D txlen; + eop =3D stream_desc_eof(&s->desc); + addr =3D s->desc.buffer_address; + while (txlen) { + unsigned int len; + + len =3D txlen > sizeof s->txbuf ? sizeof s->txbuf : txlen; + address_space_read(&s->dma->as, addr, + MEMTXATTRS_UNSPECIFIED, + s->txbuf, len); + stream_push(tx_data_dev, s->txbuf, len, eop && len =3D=3D txle= n); + txlen -=3D len; + addr +=3D len; + } =20 - if (stream_desc_eof(&s->desc)) { - stream_push(tx_data_dev, s->txbuf, s->pos, true); - s->pos =3D 0; + if (eop) { stream_complete(s); } =20 --=20 2.20.1