Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp6137653iob; Tue, 10 May 2022 11:10:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyNERy6UWv1IuXZ8dW2rW8pxzTgoblN4WMTrOcjZRZmA9lSl7bBhv3hOHpeGFwRH7w0iw/ X-Received: by 2002:a63:24d:0:b0:3c2:2f74:2ddb with SMTP id 74-20020a63024d000000b003c22f742ddbmr18115938pgc.83.1652206210990; Tue, 10 May 2022 11:10:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652206210; cv=none; d=google.com; s=arc-20160816; b=wR1ipXBuUbInC/4tOyA/KrIyW7X8SYGqOpXuWLlZEx+BeLfpL4onsLA+KmGtlKGSa8 Y+ihhwTlVzXabEQw9kkSxtJ1tRUZbgPgkKslYQg0JvPualgVEmpQ/BejpMv+bp8IRRGv YNo3xjr39wjYU5YFaW1BaL7ERKaFzGZGUIEYCB0pefBCyGX6LOtPQLoRvs5X9BiV+K7w yhPOU1pbazm2fmMyviul4CUrsd80d4z3WN+Ly/zrYhzMcUBaCXq0DpFQWT0Q5uDpOsDg yGjvvmm7byoOLCM9XoE3AG/pprOfl1CTPN3jVkwUkPYpVIodmMMqVv2z3CGZy2IRtMzW QhQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=kLUsJJIOjnBzu7Fn+p8pQABeh5O/fVn3NLgRAHyO7K0=; b=hDuSTvSMxCRfVJeek2JfZ5NcF3/kHsp6dGcfPOMVzUm8k35K6ff81oz2mkTlEHuFPW ysiWk89CX1QQXcNutCJCO+AEoQiNE0FoPmDFYZqooD80Xm2+yfhMshER3b+ltnZ6iFm4 S8iRRzXeXDhtPcQDAiSBezK0RwlNY4ssTwRHoJw5y7Ed+qM1lAms5YL3DxF3AjYAM5Cr y96jGZdhtSgQmM9lhuXDvtWKWuD0enw0b5COxEMnOL5BXRa+Y11ul1nqVacICL75Fl5w UM/joEX20IS/k/QHTR3U5dKXZafmid3dTbA1Zv/84AaE0u8nnFOsjQWD/CTeteFRL3lA 7MlA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xilinx.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h1-20020a63c001000000b003c62783c1c9si51475pgg.397.2022.05.10.11.09.53; Tue, 10 May 2022 11:10:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xilinx.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346525AbiEJOnJ (ORCPT + 99 others); Tue, 10 May 2022 10:43:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345157AbiEJOlD (ORCPT ); Tue, 10 May 2022 10:41:03 -0400 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DD042F7367; Tue, 10 May 2022 06:57:45 -0700 (PDT) Received: by mail-wr1-f50.google.com with SMTP id c11so23920688wrn.8; Tue, 10 May 2022 06:57:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kLUsJJIOjnBzu7Fn+p8pQABeh5O/fVn3NLgRAHyO7K0=; b=rVD9dGOLZ+KIygSPWyoOgiNbqk5Y7O5EI5WSPu309CM/BWGmLBiQqPVs+eT+pcOZ3M /304vDKX7fLNVfp26psi7TsjMF+5mF3LZcp7Z9ZaTBhYGuYCyglaU+ww/WKlwa2L7uO4 jLHRe1P98OQpTcGQACbdmc8g04qJjk4cWPAmSiRX69E7MmDeWBhe1+mwAzxbiKqdLSTy 0KGdTOLpxx9nUIMslBX2OzZqkBHcjHv56G6KXtv/Z+vrD7PNRtw6rWxnXRyomEVlSyTT cSXDSHxYPQuQJTj8Qf1JZIrS47rV0zTaqtn/3leQ7D9JK2CyJcFugN6i5E15r3YfnF2U jANg== X-Gm-Message-State: AOAM532F5qv0uzP+f5GfeZivy8wsu1/L6KBLGhJcK1LN7CAs367+09+5 8KjMvvLMvKFmcO4RUZeWuVux920EV81iAI8m/QQ= X-Received: by 2002:a05:6000:2a7:b0:20c:4d42:189b with SMTP id l7-20020a05600002a700b0020c4d42189bmr18882068wry.16.1652191053526; Tue, 10 May 2022 06:57:33 -0700 (PDT) MIME-Version: 1.0 References: <20220509121958.3976-1-harini.katakam@xilinx.com> <19e704ace63483a765a3298610218c5d110bb0e4.camel@redhat.com> In-Reply-To: <19e704ace63483a765a3298610218c5d110bb0e4.camel@redhat.com> From: Harini Katakam Date: Tue, 10 May 2022 19:27:22 +0530 Message-ID: Subject: Re: [PATCH] net: macb: Increment rx bd head after allocating skb and buffer To: Paolo Abeni Cc: Harini Katakam , Nicolas Ferre , David Miller , Claudiu Beznea , Jakub Kicinski , dumazet@google.com, netdev , Linux Kernel Mailing List , Michal Simek , Radhey Shyam Pandey Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Paolo, On Tue, May 10, 2022 at 6:54 PM Paolo Abeni wrote: > > Hello, > > On Mon, 2022-05-09 at 17:49 +0530, Harini Katakam wrote: > > In gem_rx_refill rx_prepared_head is incremented at the beginning of > > the while loop preparing the skb and data buffers. If the skb or data > > buffer allocation fails, this BD will be unusable BDs until the head > > loops back to the same BD (and obviously buffer allocation succeeds). > > In the unlikely event that there's a string of allocation failures, > > there will be an equal number of unusable BDs and an inconsistent RX > > BD chain. Hence increment the head at the end of the while loop to be > > clean. > > > > Signed-off-by: Harini Katakam > > Signed-off-by: Michal Simek > > Signed-off-by: Radhey Shyam Pandey > > This looks like targeting the "net" tree, please repost adding a > suitable Fixes tag. Thanks for the review. This behavior would theoretically have been the same since GEM RX path handling was introduced ~9 yrs ago but I'm not sure since I cannot reproduce. Probably this? https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/net/ethernet/cadence?id=4df95131ea803bcb94f472d465c73ed57015c470 Also, this patch can't be backported to stable branches so far back since the driver files have changed. It can also be queued for net-next instead. Regards, Harini