From patchwork Tue Dec 31 20:22:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 854426 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp7090347wrq; Tue, 31 Dec 2024 12:26:44 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVu3ShW8m07GQXFyG4e+FgMe30j41xf+iviR6TOZ7qn5nqA63qPajHZ7r5fG5iT5wTecDYtTQ==@linaro.org X-Google-Smtp-Source: AGHT+IHVOfkGpIvB5bSs5RTFDljwcuAgOdiMd2jVVCp1PNbSLFLiocsgP5M5ldxMEhHCNE6afad4 X-Received: by 2002:a05:622a:4c7:b0:458:3c2a:1d6f with SMTP id d75a77b69052e-46a4a8ebb96mr557695401cf.31.1735676804258; Tue, 31 Dec 2024 12:26:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735676804; cv=none; d=google.com; s=arc-20240605; b=YfAQYfpMJCNQtPXfF63pNoHUeFxghi2mgtNgzZBzf7fQAGgzvvrFS/vbMvGnCuFvKn vh+DaFMyXgD1mRy1z+NTVbMxNUigNwj9QJWMwV/PKv4zKpYd6G0GYw6cWhF3Q/g93oFQ DB07J2M9N58r5e2NXITee3Nq7+kWxipgabI2RzCIV+IqO7BFzf+CSV5h2+G6UxqVmXps dgbtthTsQ14ABXX2tEnRWulELs7e1fZBbinyYPrqSDtVvTag+UQLjFGe7PpBaDYBxm+9 D8Ie0uZ/KpYEaPFbz5cSa3tT1+/PhRjtMJKT6xJpY5YfjMHQ1v0fS4p+uhNtSQDyf40N +OZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QvYdTYMW+dIfPF+uKcm/HE6zS5JfQaQKVI9r227X6ME=; fh=lA8KdGRRCLcXxei5dR52XWsTSutqQE1F1yBegzCCPPE=; b=ihLV7oFFf5eReW2GZY1pCMUZ+XEN24p8/YVRHF/ZIfOArK4dK4EwkBZpC+gNrH+aCQ B0jSKxF3fy8hhfrrysi8FWX2bPPSnILNISGpVkK2lIpQx6XvKTCpSMy94uSDob3ykVTL m0DF62lYKbwRd77pW7PKReusF9QvC1vPq6+m2wKjUXLZzSQDLb++oydT10mF068/sBGc RgiChyr/sfD0gSkmqm9HNbDx1GrC/nxxrbuQuZZ2jQ5AT2QBc2TvOCycVUW5IWwBYhFK MaTyZOFY3t+go6uc1vVNi7+c8DTD8nnyc1A8hnnU9rjVQheR1eWgzazxQJyaEHhB+jN+ zoPw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YKPz9dAz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-46a3ebd839fsi293203811cf.611.2024.12.31.12.26.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 31 Dec 2024 12:26:44 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YKPz9dAz; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tSimK-0003zB-VT; Tue, 31 Dec 2024 15:23:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tSimJ-0003nU-5s for qemu-devel@nongnu.org; Tue, 31 Dec 2024 15:23:47 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tSimH-0000tv-AN for qemu-devel@nongnu.org; Tue, 31 Dec 2024 15:23:46 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-38a34e8410bso3056299f8f.2 for ; Tue, 31 Dec 2024 12:23:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735676622; x=1736281422; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QvYdTYMW+dIfPF+uKcm/HE6zS5JfQaQKVI9r227X6ME=; b=YKPz9dAzPV5iJAf7q80r9sh9FkGmrA5vm5yviKyHbojPyaayRqTDsSWigj9z/mliYG ePgfUFbDMQnMLk5pYhF00JmHG5Gs4+OAQHDFGoupZ64w1kAlhNfwZinGweQ0+voGr4FM S/xKcir8pckAIRINEJfVauhISbD0XaGaTorRI+4jYOS83F8/+t03hjVb5Rd8FlJnHwSl wffIgndi4bbRLaBR1i7pLvveVkaaaC0OhRAfcCRuyTXiKNLwTJrIg0cqn+A5QdBv1S+h +KA8o9bNvJpIIBvtak/rTK11eCdiBcXlBlsGKywVo/1cS0Yu2YEiMIfz02GKKxe/gS5q wc+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735676622; x=1736281422; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QvYdTYMW+dIfPF+uKcm/HE6zS5JfQaQKVI9r227X6ME=; b=iDYqCEeKoUyvgFhCHbZx0w40cUPgEgMoV1pCx7adsu2gFZEThjd80hFnK4e+T9/YO2 rXG8DjwgN1WZARNfzF+2gNThK5TWumT2bFrlkf2DNzHFt/5UuUyEAoOhI9f8qRCMiZEr AKJ6+KzEtweVUqampdJVO/sbGBuIGbxc1eqcVP1ic5JWQi2+GAa4Ugtzkhr3h0P/cI2y furRS5y5IfnsFMoMjx1uILnPETUF7kuDa9ZjSph/hounHB1HV8xLcT3YPtqU7M7lsgWi BV81Pu5AG1iIcAYo4rC7V+/waW6xu4IXwu1NF3H0OvJ6B3+SczN6luut+GKYnuQZoL+a /gBg== X-Gm-Message-State: AOJu0YxSmX8X+UUlrBdTlvSdo7jTF9xc3fQyPbz0g90gJup7HOX8oQzQ oP9B6mK/nuWdtl3vlkPTbMP0m/kJeQabdUgOC4M43qjGkC9+Jt6UlEyFjLYzou+iuLyGG6a277e yvf8= X-Gm-Gg: ASbGncvXmVwIkZfSbb8yjozMRM5eraVXB8lPwZLZsVgtRW47WeqzRnf7pJfgJtIIq9N HRG/rSXD/KYjn1SokJfCKafLS5467DKpSLQtt7BI6VpjqPLrOoHUsoRKINQfRHtvdjoCstRhDv+ Z7AVpgGIRGXKXO7Ddx0+Wwwts30FXfD9Z4/f3ql7wfilpByHtiNx+qNor4Q0B3wNNi5cKAmpgYy cQv/PrZ4ryufIqkOh96esFf/ytMeAipxfuggXViGSemAGW8IkTiM7xhtEv50lZf8qovIPmtHh6x r1D99z7avsUVam+/NCz8hKBHx3vyZJ4= X-Received: by 2002:a05:6000:4615:b0:386:3328:6106 with SMTP id ffacd0b85a97d-38a222019d8mr38061343f8f.35.1735676622460; Tue, 31 Dec 2024 12:23:42 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436612008b1sm395392315e9.15.2024.12.31.12.23.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 31 Dec 2024 12:23:42 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Edgar E. Iglesias" Subject: [PULL 15/29] hw/net/xilinx_ethlite: Rename rxbuf -> port_index Date: Tue, 31 Dec 2024 21:22:14 +0100 Message-ID: <20241231202228.28819-16-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241231202228.28819-1-philmd@linaro.org> References: <20241231202228.28819-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.google.com 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 'rxbuf' is the index of the dual port RAM used. Rename it as 'port_index'. Reviewed-by: Edgar E. Iglesias Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20241112181044.92193-8-philmd@linaro.org> --- hw/net/xilinx_ethlite.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c index d54f96df243..4c0c7fcae3e 100644 --- a/hw/net/xilinx_ethlite.c +++ b/hw/net/xilinx_ethlite.c @@ -70,8 +70,7 @@ struct XlnxXpsEthLite uint32_t c_tx_pingpong; uint32_t c_rx_pingpong; - unsigned int txbuf; - unsigned int rxbuf; + unsigned int port_index; /* dual port RAM index */ uint32_t regs[R_MAX]; }; @@ -176,7 +175,7 @@ static const MemoryRegionOps eth_ops = { static bool eth_can_rx(NetClientState *nc) { XlnxXpsEthLite *s = qemu_get_nic_opaque(nc); - unsigned int rxbase = s->rxbuf * (0x800 / 4); + unsigned int rxbase = s->port_index * (0x800 / 4); return !(s->regs[rxbase + R_RX_CTRL0] & CTRL_S); } @@ -184,7 +183,7 @@ static bool eth_can_rx(NetClientState *nc) static ssize_t eth_rx(NetClientState *nc, const uint8_t *buf, size_t size) { XlnxXpsEthLite *s = qemu_get_nic_opaque(nc); - unsigned int rxbase = s->rxbuf * (0x800 / 4); + unsigned int rxbase = s->port_index * (0x800 / 4); /* DA filter. */ if (!(buf[0] & 0x80) && memcmp(&s->conf.macaddr.a[0], buf, 6)) @@ -207,7 +206,7 @@ static ssize_t eth_rx(NetClientState *nc, const uint8_t *buf, size_t size) } /* If c_rx_pingpong was set flip buffers. */ - s->rxbuf ^= s->c_rx_pingpong; + s->port_index ^= s->c_rx_pingpong; return size; } @@ -215,7 +214,7 @@ static void xilinx_ethlite_reset(DeviceState *dev) { XlnxXpsEthLite *s = XILINX_ETHLITE(dev); - s->rxbuf = 0; + s->port_index = 0; } static NetClientInfo net_xilinx_ethlite_info = {