Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1087589rwi; Thu, 27 Oct 2022 11:00:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM74Nhmcyn3Ow3ZZWtqdFARBlnfGTm5ofYPqjVxvxYmJGsIdF8fOr0JemNuTb5l/p5RdGBSx X-Received: by 2002:a63:8942:0:b0:46e:c02e:2eb5 with SMTP id v63-20020a638942000000b0046ec02e2eb5mr28793160pgd.141.1666893632703; Thu, 27 Oct 2022 11:00:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666893632; cv=none; d=google.com; s=arc-20160816; b=urHcxIGsB8shN3r3RmPo2+IhRQDDQ7Wsg44bJaGzHVM7Uzb+HXifulp0cHmaLIkCLr +E9T1Mg4fBr6wDKdTGov7BiDaUd6QtuGfgKC9sdWrH8spUKF04XxHInT3PbF9dkU+JrJ izsvzrXAgCFTAP32bh3ebD7pa9fiPjpPCFqBg7nlJ4PdI21J9CJMN3bcAA/4BQ0gozU/ NRT449Lfsc8UAOqhiq65RaWQwOCozwdUuyqlgmoBQfv515VSmuR+/mwtK/XwJIbf72QY mEiz2HFb4OGdE1brLYpCGx5X3pFvYvypeLPtLyAyY0z/w907C4bILRagVhtI6SDc4LnV qYTA== 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=5CHCNYh4rHVTPWKhbeifwNLikouiIV39GFNOmLjJyOU=; b=qskDilYETNbnTHJw64NN2Bh2yvGGOOvNSDgCeYpB4dPWCbTY3CnldDJ+0KbqZ8CbaQ aoPIrwEbteaDhheEctyj4VLqGUCEE6z27rHXwDh8uUXVrybe/AGFb5VWAXV1U+1DH9xp IgKbG1YHZwUtLhBdAT+Jvfn+0NYqLvFmqARDGGXgaV5+zcOSx6L6QV36uvbub5YC9IsV kauvRH0rcPKxPkKHW++YOYGbvA+cNlRrcmte9haVG2C0KaJY1dKzi6z2tawFJB7g3pMc S+RpVhUOan3n3V4UtSuvEpfU0BgoOXlXhtmfU3+GmiuM52AA/d19eLPOeeSnN6bf8o1F fI4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=b8Uyrz4x; 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 m4-20020a625804000000b00562cafb2856si2359137pfb.78.2022.10.27.11.00.19; Thu, 27 Oct 2022 11:00:32 -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=b8Uyrz4x; 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 S235626AbiJ0R63 (ORCPT + 99 others); Thu, 27 Oct 2022 13:58:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233548AbiJ0R61 (ORCPT ); Thu, 27 Oct 2022 13:58:27 -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 12D141781C6; Thu, 27 Oct 2022 10:58:27 -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 A1488623A7; Thu, 27 Oct 2022 17:58:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C1FC3C433D6; Thu, 27 Oct 2022 17:58:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666893506; bh=5CHCNYh4rHVTPWKhbeifwNLikouiIV39GFNOmLjJyOU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=b8Uyrz4xrdSNdUZTKWhO81HsQENUaTUZFh4X2b3zePG/N2Qu08luPneNUfA7cVMY2 +j3U+7BuhoH86ewnfvOYsXk1qZTUP2KDuARVfbhtFmzk0CbsCm6+SXZkzjMbzRumFO ptW7MQ992Z8kith8VQlIQx2Oqa6wGWZ9UMrII5/sb2WlPKEkGw+dXWjJ1+huFwsYGN H3YfKYeKA2YXPxZeUYpzdw3O7dyqddscQYDv1YLDH7x1suL2LiBwGmcKLOm0gSG6QR XZyN6VE7LIITSQRw1/GpaTuxIBpTngNAQXnBpnU6kL6SVJrpcwh7vv8KqNtMeyBw3h p7XhZB7vN9RfA== Date: Thu, 27 Oct 2022 10:58:24 -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: <20221027105824.1c2157a2@kernel.org> In-Reply-To: <20221026121330.2042989-1-vladimir.oltean@nxp.com> References: <20221026121330.2042989-1-vladimir.oltean@nxp.com> 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 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 ?