Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1159034rwi; Thu, 27 Oct 2022 12:00:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4LfiGY88mBHnQd3mTja912ErxGcF9Zf0CpwuAY5mRi/R8+SLIHnvtl4LH3Xcry98dfEUG1 X-Received: by 2002:a17:90a:9902:b0:213:1122:feb9 with SMTP id b2-20020a17090a990200b002131122feb9mr11526540pjp.58.1666897255745; Thu, 27 Oct 2022 12:00:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666897255; cv=none; d=google.com; s=arc-20160816; b=rQr9yzj6BXBJILPs36x71oKmuvLzaaHaZbfx4Y3ecvo6SmfH21KMW0e50gC6AI86j1 MTu2SXBOIr9qU4FGC8AHMOei/x/uLLLy0i56yHash3S76ueLIpZedvL6I4MxKgjcDbx1 BjQ5iiT43zJVBziE9cdAJe+1gsll/081QknL3tcstxVMIvZ2P+qYwZ3ahmB1JzXJSBMm ckwrHWwDmK+vbixJBrOhPHfLyHSirV44iWBeQYY1UZN157A+8n9KBySSAkhzsHWIoHPL 2ffPCK7jUEKKnM5AcyIt/xid4UK2O+xi0x6nKegw82q0FDLVOO9+oXRwKaa2AcTaMPhs Ensw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=wmZMw3pIw9/hjtgXukK5JXiiaO4XzNLv17lM+jN3HWM=; b=BPsWPxdnSPSSg/xW6w1mfIy3rlDk983jmA9vRuKHiaXtmz06/pytL92Woep3p9KUTB wuhupK0G+WEdI1mtIX8tsT3h7Sd3sheN46DUdnp+KSMlzGZrsJ17sXzV1l1V9tXsb/ZJ kkc2PHmcTosb077DaMxzLJEOZVRy/DZIN7TGAe/NdiQ/KcJZa1iO7ddiFUdlp3Zcrxlj kh9pdlOmxaK+X3PKyQiYVJIdZuwsUSjd+rTnaoj3e7HSIKFy+USHNt2fbby1wkbC6JT1 uFXlHfAL8PV0SsLPl+2tTSKA0Eb8YQd7X95utM76C6Bds5fa0WwChIt+gjsH4a3mvqHa L4Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NFluZKLy; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g2-20020a625202000000b0056c882d7065si2447592pfb.179.2022.10.27.12.00.42; Thu, 27 Oct 2022 12:00:55 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NFluZKLy; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235682AbiJ0SXU (ORCPT + 99 others); Thu, 27 Oct 2022 14:23:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235586AbiJ0SXS (ORCPT ); Thu, 27 Oct 2022 14:23:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57DDE4333C; Thu, 27 Oct 2022 11:23:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EBBFA62418; Thu, 27 Oct 2022 18:23:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27A52C433C1; Thu, 27 Oct 2022 18:23:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666894997; bh=J9JnUfcFNrF4jRVggLXQMWFImgx3+vGRcRHAGD32U30=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=NFluZKLyKIgUH4tiiSuCbDJSgZvMDfp4rKckS9qBM5H6eUiAqEZ098aYF22PdqlvK ambl92JayvdEofWQ85XXWNZsd5IHVN9FUF/ut1PQLPBoCRsuuigg0+5oHMwvBWRQ0l MumdJrC2qmKMpdqdASg2h832EzeZUabVnFyEiTL05tsiCX7ruL4IfmUeOGpvyeO7Ay pm0w73XMcAyS5JElOJKso3PNXHN7j5LbD91T9F6aBnHtoqYkW8iT6GQT77NturCWmg gH584ls/GccnYpzkpEuioxGg8u9KqfuwLdsDZ5TLS7TwaGIK+nqemPZNEEG3wTb00S nWrfLCxfNe54Q== Date: Thu, 27 Oct 2022 11:23:16 -0700 From: Jakub Kicinski To: Vladimir Oltean Cc: "netdev@vger.kernel.org" , "David S. Miller" , Eric Dumazet , Paolo Abeni , Claudiu Manoil , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2 net] net: enetc: survive memory pressure without crashing Message-ID: <20221027112316.377ccf10@kernel.org> In-Reply-To: <20221027180209.qunyi4bdikbtqfho@skbuf> References: <20221026121330.2042989-1-vladimir.oltean@nxp.com> <20221027105824.1c2157a2@kernel.org> <20221027180209.qunyi4bdikbtqfho@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 On Thu, 27 Oct 2022 18:02:09 +0000 Vladimir Oltean wrote: > On Thu, Oct 27, 2022 at 10:58:24AM -0700, Jakub Kicinski wrote: > > On Wed, 26 Oct 2022 15:13:30 +0300 Vladimir Oltean wrote: > > > To fix this problem, memset the DMA coherent area used for RX buffer > > > descriptors in enetc_dma_alloc_bdr(). This makes all BDs be "not ready" > > > by default, which makes enetc_clean_rx_ring() exit early from the BD > > > processing loop when there is no valid buffer available. > > > > IIRC dma_alloc_coherent() always zeros, and I'd guess there is a cocci > > script that checks this judging but the number of "fixes" we got for > > this in the past. > > > > scripts/coccinelle/api/alloc/zalloc-simple.cocci ? > > Yeah, ok, fair, I guess only the producer/consumer indices were the problem, > then. The "junk" I was seeing in the buffer descriptors was the "Ready" > bit caused by the hardware thinking it owns all BDs when in fact it > owned none of them. > > Is there a chance the patch makes it for this week's PR if I amend it > really quick? Yeah, you got 15min :)