Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1126405rwi; Thu, 27 Oct 2022 11:30:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4pOOzFduGikdpzZLwT3Ca2lsuOXk3Vjve18NqWL34si+qx9IDCmBCzyvMJQwYtlCI8O4KK X-Received: by 2002:a05:6402:33c4:b0:448:e63e:4f40 with SMTP id a4-20020a05640233c400b00448e63e4f40mr46441072edc.203.1666895455983; Thu, 27 Oct 2022 11:30:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1666895455; cv=pass; d=google.com; s=arc-20160816; b=IFAg+BZGVo/oOmZmS4X9nxvyUv6V6JRnWz9YirJF2EUz3Z5gjCPIYa38S2Bd1fT3dD 0pyZV3RR3zTLaBK/q4w0mziz5XQiU2RDwzUaCtxIAfN3VWrEPnM0gj0LVnRI8I9K9XV+ AGGwJaQYDp2hUocmEq0XqocmzBt3wvZQ6LHDfgN+fOv3LFgrAcIdtjZH3cO/jHevtQfN lnZbF2UU03dUWqXBX706HgV0TK341DWV4MGY2aEmWbBIbFHTjs937+ucFjhFiflZgRg/ vHrkPtablQhzfGoENfS9uImQ+EvvPkLlo/J1Va+VZSizAhDDLOdIoFocGE42cj8pbJ1N xdxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=pNtVPhlGJ+YP1MHWMNsWZnVcZs6bL4WNYlgOcRTRL/U=; b=JgQqgAZYWKsAITpDcv+IGcGp+o3fdFiVNannfxnSIAfe0ThA/qy7TMpyciMpiehFkc qSUcAuWhIQRm/BL4m2zNf7pgBAg5bY9mIC/RVzrUDR5/51yKLHwYvNf19Ji0uxCZm6Ue JEgfwtxo11saz8eGSQWJVpn93EjunVMx9yRkm3ZLWscfJx1O+GA4TVNoSzM1DsbnliU1 0TZvZSZgVaiierQaftZcCJNWYaPLQSuoTKjDO2C/poLIxRD8TrXT8i/VbVT2cV+vBeZw C3pRUwWZEOVvUV4mcKzJrxrPoCTslW14L9IZIaawlPCsBUnrNEMEi9FRjOR6h4ETL53Y pf7g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="eEdgii/B"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.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=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q8-20020a1709060f8800b007ad8a7a1a7asi1763545ejj.511.2022.10.27.11.30.25; Thu, 27 Oct 2022 11:30: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=@nxp.com header.s=selector2 header.b="eEdgii/B"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.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=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236230AbiJ0SDD (ORCPT + 99 others); Thu, 27 Oct 2022 14:03:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236117AbiJ0SCl (ORCPT ); Thu, 27 Oct 2022 14:02:41 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2089.outbound.protection.outlook.com [40.107.20.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5181C6952; Thu, 27 Oct 2022 11:02:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BA/9gvj2njTvs4NUsbKX2RTlOfGjFwwkZ80IRM+XvNyUZfqzTZvOS3YZBvxAIWPeCpEZcxJJ/pStgnKYG3SGjoWIaIXC9rvmCfP71ZSZDKvzUeA+Rg8Z5bFJ+R94ThoArJfst5gEiNWrSLHGXbGhJzO73RHIP5p/R5LenPNpivaPjQpNZ9n97CRgSn6uFYS1apjodwkIrJzvSj7cMDvKFirRpvHKJgli/hcfPonBIwLTSDNAEX9wYjaC0jixWv1UfE1KEsiODHkb2DXt7ll9IqMUKxrUGqXVJYccm/XpCyfZYdo9d1TYVyBsT76acPhXyfayv4omkNGHufWkp6GG5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pNtVPhlGJ+YP1MHWMNsWZnVcZs6bL4WNYlgOcRTRL/U=; b=dbqOEt27M82bDNDxjcVUizixK3KwnjT6cYCgJxyXpu0oabe2xqDR7Q7kvvdffeQKRqvbDH9dkfic1qgvP2GXR/J5FdykBuKyt46ffk/Q0bh6vIn9gcG7+a6UfmonV+WkGNHEqG3QQk1BH2AgPFJ1AEq60k6tR0rKfLI7y6PTchMF1/lN0XWPXrOKsed8M/Wjnys1KoPjKmqQjPO5s6rCXpDrTQAWelegBFicyWBiWXLX/p9bIoFFHWnwu0Xtq9AYy8sZSJg8F7tKkq9ZBFEVXVWpUcgOzEDJYGaQSZ3AOeq3e9pL+G/4ZaAgyAeGLEuKvLZbLf8F7Z/9qEdbWHS4bA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pNtVPhlGJ+YP1MHWMNsWZnVcZs6bL4WNYlgOcRTRL/U=; b=eEdgii/BGa4qmuUbWvyMtWE90QYvfIzkEm7NB2LBGA3ku+PFZc7p1IhWQJg8zW7UOasXDQU4Wcm96wnij0g3WXm+7OcFdmUbbqJ8Ehi2EBmh1KEXDaQQmpdg/POEoPteWtrEJjykTEkSJSROcVKPReBiMzqYiCKTGzwwlLKBcEw= Received: from VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) by DU2PR04MB8648.eurprd04.prod.outlook.com (2603:10a6:10:2df::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Thu, 27 Oct 2022 18:02:10 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::6710:c5fd:bc88:2035]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::6710:c5fd:bc88:2035%6]) with mapi id 15.20.5746.028; Thu, 27 Oct 2022 18:02:10 +0000 From: Vladimir Oltean To: Jakub Kicinski 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 Thread-Topic: [PATCH v2 net] net: enetc: survive memory pressure without crashing Thread-Index: AQHY6TRiZQ8LCqV8m0qJGRg70aV0FK4iiQEAgAABDIA= Date: Thu, 27 Oct 2022 18:02:09 +0000 Message-ID: <20221027180209.qunyi4bdikbtqfho@skbuf> References: <20221026121330.2042989-1-vladimir.oltean@nxp.com> <20221027105824.1c2157a2@kernel.org> In-Reply-To: <20221027105824.1c2157a2@kernel.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: VI1PR04MB5136:EE_|DU2PR04MB8648:EE_ x-ms-office365-filtering-correlation-id: 89fd1111-f7fa-48eb-7a75-08dab8455e3c x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: s+GWRqQgUJ+j5DmhFRsfWcdzer8JRtVw2FYoOWImBtS+o/Dy0bPFe2m7YKJTXb10OOupquaNjKT2DiTWffKuKSEL3az63NAv04ZxOPFAYdK1WZGWOwMhurlkhCF97Jyf3ujhhz/Gj1tmmJY0WdUODW38Qkd4sVMaqkEm1j4GLAABgtlD387Oir0nwckbI44RFG89MPrjMev7/upDuZzGe6v2rQT4s3BE/XNZCqYSUMIcJBPzXjyFuEaH/BVyFqR8+wqTRUCcwYY0xixs9B354m8WQcLuuwkspRlZn256uT8jVbe852Kfg9A47RY014hyNLZkpPFgdfBFcKVQplgPP6da8KgJ0eVFAKh3rUJItwFZeVcybOhJyOeT42jIrRV135Sw/8UC8CTsvpfaXRkZv07srottwLlEeaMBzmx3591ib34JKIpAdxqSbwac/gY8/pUwy2MlkaAq/hCjxz5IWG+sbCrGzU/yYYVelhTaqCpYAhfBaZxp1LHiLQxhS6DjHVawg7diV0DOOpjAe5W1vjyg0x8Qz3JlNaIIiM6XifA2KZ5br0MmgaKCrsPfluF5baIopfb0IxBDUsgRvAX09l/EYy4W/P2cBhK34Gnw7Q+b2TnTYPntMLXI9Oq74JvCfXwqgsmWfIm1Fh0CcaDz1oWYrjBvft2FhHRioVFWRV8IvSw2Bgb6v4avgoQ/LmBj2s2bjQorwFjT7zZDM0gLgJKAb6LHQ9Qo9eA36QxXjEGniRvejMlMU5YJQaj1yU5JBw+JLgDTUs+/OZB0LJKSGA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5136.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(7916004)(4636009)(366004)(39860400002)(396003)(346002)(376002)(136003)(451199015)(66946007)(66446008)(8936002)(8676002)(4326008)(6506007)(76116006)(66476007)(66556008)(64756008)(26005)(9686003)(6512007)(41300700001)(1076003)(86362001)(33716001)(186003)(2906002)(5660300002)(4744005)(44832011)(38100700002)(122000001)(38070700005)(71200400001)(478600001)(6486002)(316002)(6916009)(54906003);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?UuH8bnZDSSv+DsnMNMwEBAxzWE/4KZGVSSkwU5QoBpryzbZl76nihK85kJ4b?= =?us-ascii?Q?PL6NimzwZ4jsNb+wc92+w8+sgzE/BFpf7l/xyI2h1GfrCJP52t6JpS3ov+Ei?= =?us-ascii?Q?CNCnndVDWBQrWQR6hmwI5SMLb8acxW+rzfgiw4xk/TYOjN9dkjI0kepm9VeB?= =?us-ascii?Q?+Dsv7MkeSfi/gzqKhCxOWsJ7zeJHXYw4Rg+sIZ302oVemZTOwnoVK0aUnYed?= =?us-ascii?Q?qYFY+4/IFJT2wcNmxc3+ArPtitUAQRDyAPTC9XkaQZYvomPBU5QZlE+CsS9V?= =?us-ascii?Q?YNNrpf1DT43O+2z1xgN+aVa+/klSzADWISfXhVnvZvKQeMcVXPHavetLFsRT?= =?us-ascii?Q?zfOZRG+Naw+lTzNDfILX6uVrxYJJRKoi7pVGblPmsYAfq0qG+pvwuByXulUo?= =?us-ascii?Q?5ZnvsKDVkyP1ram4U6CqzBsjF+7bURKTn+sxBemDwQSOgrUGBY5+mReqrY/E?= =?us-ascii?Q?jYnKxpCRojIX4aokPP/Urwzy9TZ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OF7i02Y4+X7f66Cr9R64FSMvTFtS/6zvPFg+PncXoxeMwDMh7MCPg2l?= =?us-ascii?Q?xPFOVxUAUxodlWLkBQOJQ8TUqmkKpNUqw6fYEAV/WJyz2e5C6IwhrTcJiEMx?= =?us-ascii?Q?i84yu1oB5e7PTV77SjiX4fFLemCEE8sAkhEehd0yz6PEoiQuf2R60n7NaBKT?= =?us-ascii?Q?uDAnMgL/0x/PURSpBls02oIckN3RWSfxNE6cd48QCNSzZXJJfhxIlp3CT9yS?= =?us-ascii?Q?UQ=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-ID: <95573D1A1420B5469A7DEEF9B791C6E1@eurprd04.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 89fd1111-f7fa-48eb-7a75-08dab8455e3c X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Oct 2022 18:02:09.9466 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: wxKMoauaUDbVgWgP3rKlz4pYdAZC6tSJWjSC2PauOUhYzBO9zzO10jcugdri4bKhhd2hVhaICZpQwXYKyIPteA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8648 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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, 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. >=20 > 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. >=20 > 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?=