Received: by 2002:ab2:7988:0:b0:1f4:b336:87c4 with SMTP id g8csp99517lqj; Thu, 11 Apr 2024 10:55:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU1QjNG295aqETMiPLNgq8g8L7A7WJWuFM7IjJTFdBjF/u+pFxEp3kNN0XVIr6b5pGQTcNT4FKmnrZgTyN+dg7Ocs1VkxtMT2p1Z8SufA== X-Google-Smtp-Source: AGHT+IEfvWnyQbg7/AROBj/OyHGYJipy3I5J0euZ9L3sZvPTvncpl+i7K0f2rGGN1cI9hXvD6UB4 X-Received: by 2002:a05:6402:5295:b0:56b:f2d8:1552 with SMTP id en21-20020a056402529500b0056bf2d81552mr2922953edb.13.1712858138649; Thu, 11 Apr 2024 10:55:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712858138; cv=pass; d=google.com; s=arc-20160816; b=rrWY8cl03/8B+LFxaR3OBtWkY6Etcatdmb695Sr1ajQfpp7KVgj/CwYe9seYYzrutp iRQMo/gxi1KwI8JqW5deBXAKh1+8fqfaZ9oTbLFRQmcqPXqAswJRDxANEp+De2A49PPB KejJ4DA4Ci0dxxf5oaAienVtJesUE/wGnHFYzNlCL5nCpy+q2vgBP9ANX8U2fFSQySZa OsV0ps0gxsIDhQq6hf2Lm8J6v0QqgPup3b/Sg9vWmup4giPHmoAB8yT8UP0vKXHhPwCG 2zqpRSfZ/bySPhPDhDcfA+jU4971HGv2wZ6pkbCfLp8ryvsnouOiQrLVIt8wi53Z7B2s xeYg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=h7/28Nf9MRi4/YDbLP7+SNYwbUCDP/+KqMSZ1ucT37c=; fh=sxorC0j7DMlOzBbPy8wTgiTTHmeRULP/kNU/8DH2ZWg=; b=YarP7Sj4r30hKNXRn9HKqFA3mIzpk868vXUhCNNq9Dd6XRwrBLuiCv7Rc5+emJ4FvL BsmN5lqS/YYuipOTdTGK37+OXlHXHuhinAojd0UmP1C6P18dYTaX01YehCgs7EHuTylo jJbvXCiIb8KEzrAM7zANEddLFTgGWSokql88V+5ZD7yqCMjyAwqxWMiFVzpS9VCIEvmr KGamMRUWVSvXd3AbyMUbKSpCRvwn0/naWIc7iiyyplDKC2/yQx4iaNj40ZdFyM0FgUfU uehNVypm3fto0RqgoCc7E4wQlih8fD02Q8M00nwjFcABxJ7oBBHqGfeJSk6IUV6rLLzO +jeQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=omp.ru); spf=pass (google.com: domain of linux-kernel+bounces-141331-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141331-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ig8-20020a056402458800b0056e113a5a26si918910edb.464.2024.04.11.10.55.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 10:55:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141331-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=omp.ru); spf=pass (google.com: domain of linux-kernel+bounces-141331-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141331-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B4C811F241B2 for ; Thu, 11 Apr 2024 17:55:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 06B7B17D12A; Thu, 11 Apr 2024 16:38:00 +0000 (UTC) Received: from mx01.omp.ru (mx01.omp.ru [90.154.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B57E03D556; Thu, 11 Apr 2024 16:37:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.154.21.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712853479; cv=none; b=YC9oHBIs4u1x1lBOH7bfUgiS+pi4Hn7q3+SMzJSmhik7FygM5HEiGj9Lli8HwHKrBlTeXgV8ji7BtC60NPWIUnFOvIvyoWO8opNWYTV+BYVmIHZZIN/g7RxV/6+M58l6v0HDuUjHHCEQUY+NKTFXfNJe5afCuNMgWPFPLyXHI8E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712853479; c=relaxed/simple; bh=i8WjgJLurDb8Kln+Wggv/7WyFRxJfZDM6BejyA8W21s=; h=Subject:To:CC:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=baWu/aj6BraBfgt0xFMFV5TBBzJAl7NOh221PO/VATBG48+rL3p5iOw4bDThEQ+WA2M0Ivuuxm5GcvL9g4eCb8n3k3Hxh15P5fvbv4BYf5dIMTWSnUU76lirQL3fssmFPtp5mQsER/CnrL3P7ECfW9ePK9zRv+aBjwnSQlMDgao= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru; spf=pass smtp.mailfrom=omp.ru; arc=none smtp.client-ip=90.154.21.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=omp.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=omp.ru Received: from [192.168.1.105] (178.176.74.224) by msexch01.omp.ru (10.188.4.12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.1258.12; Thu, 11 Apr 2024 19:37:51 +0300 Subject: Re: [PATCH net 2/4] net: ravb: Allow RX loop to move past DMA mapping errors To: Paul Barker , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , =?UTF-8?Q?Niklas_S=c3=b6derlund?= , Geert Uytterhoeven CC: , , References: <20240411114434.26186-1-paul.barker.ct@bp.renesas.com> <20240411114434.26186-3-paul.barker.ct@bp.renesas.com> From: Sergey Shtylyov Organization: Open Mobile Platform Message-ID: Date: Thu, 11 Apr 2024 19:37:50 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: <20240411114434.26186-3-paul.barker.ct@bp.renesas.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: msexch01.omp.ru (10.188.4.12) To msexch01.omp.ru (10.188.4.12) X-KSE-ServerInfo: msexch01.omp.ru, 9 X-KSE-AntiSpam-Interceptor-Info: scan successful X-KSE-AntiSpam-Version: 6.1.0, Database issued on: 04/11/2024 16:21:58 X-KSE-AntiSpam-Status: KAS_STATUS_NOT_DETECTED X-KSE-AntiSpam-Method: none X-KSE-AntiSpam-Rate: 0 X-KSE-AntiSpam-Info: Lua profiles 184677 [Apr 11 2024] X-KSE-AntiSpam-Info: Version: 6.1.0.4 X-KSE-AntiSpam-Info: Envelope from: s.shtylyov@omp.ru X-KSE-AntiSpam-Info: LuaCore: 16 0.3.16 6e64c33514fcbd07e515710c86ba61de7f56194e X-KSE-AntiSpam-Info: {rep_avail} X-KSE-AntiSpam-Info: {Tracking_from_domain_doesnt_match_to} X-KSE-AntiSpam-Info: 127.0.0.199:7.1.2;omp.ru:7.1.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1 X-KSE-AntiSpam-Info: ApMailHostAddress: 178.176.74.224 X-KSE-AntiSpam-Info: Rate: 0 X-KSE-AntiSpam-Info: Status: not_detected X-KSE-AntiSpam-Info: Method: none X-KSE-AntiSpam-Info: Auth:dmarc=temperror header.from=omp.ru;spf=temperror smtp.mailfrom=omp.ru;dkim=none X-KSE-Antiphishing-Info: Clean X-KSE-Antiphishing-ScanningType: Heuristic X-KSE-Antiphishing-Method: None X-KSE-Antiphishing-Bases: 04/11/2024 16:25:00 X-KSE-Antivirus-Interceptor-Info: scan successful X-KSE-Antivirus-Info: Clean, bases: 4/11/2024 10:51:00 AM X-KSE-Attachment-Filter-Triggered-Rules: Clean X-KSE-Attachment-Filter-Triggered-Filters: Clean X-KSE-BulkMessagesFiltering-Scan-Result: InTheLimit On 4/11/24 2:44 PM, Paul Barker wrote: > The RX loops in ravb_rx_gbeth() and ravb_rx_rcar() skip to the next loop > interation if a zero-length descriptor is seen (indicating a DMA mapping Iteration. :-) > error). However, the current rx descriptor index `priv->cur_rx[q]` was RX? > incremented at the end of the loop and so would not be incremented when > we skip to the next loop iteration. This would cause the loop to keep > seeing the same zero-length descriptor instead of moving on to the next > descriptor. > > As the loop counter `i` still increments, the loop would eventually > terminate so there is no risk of being stuck here forever - but we > should still fix this to avoid wasting cycles. > > To fix this, the rx descriptor index is incremented at the top of the RX? > loop, in the for statement itself. The assignments of `entry` and `desc` > are brought into the loop to avoid the need for duplication. > > Fixes: d8b48911fd24 ("ravb: fix ring memory allocation") > Signed-off-by: Paul Barker Reviewed-by: Sergey Shtylyov [...] MBR, Sergey