Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp254219rwi; Thu, 27 Oct 2022 00:17:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ZHBd2oh9AAPnftZMjJALpvZzeHBOwy+92bMfqe7zCggDWxK6eEaTChIDGOl9rOdizP/og X-Received: by 2002:a17:906:2699:b0:781:a473:9791 with SMTP id t25-20020a170906269900b00781a4739791mr41129998ejc.644.1666855042559; Thu, 27 Oct 2022 00:17:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1666855042; cv=pass; d=google.com; s=arc-20160816; b=NiYIOJCk6r7+911G4MXRwxI+cjqQnmBZXngJfummXyt2t88DO6mlPKwUzpBbJR7qhP Eb+k9YomYjDOxssXGXYSXLh5KanDHnw18+e44+BTs4+v04yHjvzjDdrN6YN4QrY1VGml XMb3ECkwm8AfGi8maOxXdJgRv2YgxOdoa/4TaJGsQtsr/KUeu3Me4ZQ7g0RTv7MQZ/Mw umnMOGK+tJqGTOyOzjANEx5vOtW0eqyHEcs/B+n3KgvyYsnhQHK4/BYfVUdUdssZbs+I yw6sn0kW9ZtctG031UC1JZWUzlXrRD1xaMDCRMILd47n0vOF/ctovmfiH3/b+4izSp+/ BC/Q== 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-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=y9elMg3cn1uEMbldYjYL8v2HbLQMBQjmrz/Xxs7viBo=; b=CDIdHh2VIcbqD1kUum+P3WYnyHtOutg7dLzzkEeqNwrASS/wjLHUhIr/RK0rCfT/7y 5a6l1Uuyf/CWplrDwXPrNvNKmdjSLsASF8+K8h1fsbkL+oDubPc+lmf/pTS9BOVPYbF+ nZ/0GJlHm1AVgPEwEUyVt/WbWWU2XvBkyajhWq3ugjRN91FO4jDG3TvrJfFJBEuXBrse 9+hiz/QMHJcfKiUnbxxazCnfcJVajuBPtP0HoCbflUwblhUYZszjE5iNAFNxn0vAg2UF Sez3OfSIm09wsEIOzdwXTYkAEEn98XX5V1Fl8UfrUrQxz7HoUyFeWzu8Ah7Tp7t7J+sd VZBQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Fl7zs5x0; 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 v25-20020a50d099000000b0045d4a88c735si833664edd.220.2022.10.27.00.16.57; Thu, 27 Oct 2022 00:17:22 -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=Fl7zs5x0; 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 S234618AbiJ0HDi (ORCPT + 99 others); Thu, 27 Oct 2022 03:03:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234336AbiJ0HDf (ORCPT ); Thu, 27 Oct 2022 03:03:35 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80047.outbound.protection.outlook.com [40.107.8.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC8A2149DC5; Thu, 27 Oct 2022 00:03:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f1y0WkYtgk32/yQg6umxS0OFCIga41oZfb+J+M/n+SI9hCLicQ1q6BkhpwwRoD37rm0l3l/3VVnPBD0T05a1wQBB0qUdjS0m54qX1iBHHR+p/BNmxBu7pJIRkXUzZYXPX8mC+vLfTS4NaBxDMDbz7WRXQ3QzVS6oXncvNY3q1yOq2Jv5vDhVArDAf7Gtix7j5QWq0QluUOH6rU1ES6zHXYHWcnvUq9xsFpUuqYcLfVX7uPaCsrVJ2/n/MbbHpVo929L/IjOGWtm6Zq+O3HFGdgmeO4qbQ1a30+Z9lkEu6aR8sDUV8MnBZNiY6kS647vJI7KQOzOCPioIVEVbSFVvoA== 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=y9elMg3cn1uEMbldYjYL8v2HbLQMBQjmrz/Xxs7viBo=; b=enm39VYcuUpbgdfjzBYKcxzHJeGzw8QaUi3X5MXGDassIiz7OLA8flqid78f+tOKKYFAWOqxudhIDqhBEXMF76v7+e3sVwzquJrEr1/UB7z4xnrpYp5ktiIgAjAIAJ1gyMNV8b9/NXdht0OSVpSd61chZCjzOayibJj0OmeipkadYud5qpspJK/txHbJhBkodJNWb8TdDnmMA/hsoL9AxAGeWTwrmRP3B/MeeLdMhOa835rK9iBQScRt8fsyxFvRC2CTWbPbkDoToWXCpdqVdtct9BI+FgYhPIHA1c14VDIKp+WqQh8IKFZZwk4Ri63g5TrKyPQO3oTWV5F2jJ2aZg== 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=y9elMg3cn1uEMbldYjYL8v2HbLQMBQjmrz/Xxs7viBo=; b=Fl7zs5x01VW93+9uZ+EILrYLEhxi26ZMRAnbuDvaU/WDWNyB5uJxlGmO+0I6AeTVlOAgilMKg4ZFvLWw7DP68YxQN+L9MQ2YlWMkCctkugbYvu46f+ORV10+zHET7EigyVA5JevbpLzQmmll8BecBKpuv/KqZjt6EghRpc8K4RA= Received: from AM9PR04MB8397.eurprd04.prod.outlook.com (2603:10a6:20b:3b5::5) by DB8PR04MB7148.eurprd04.prod.outlook.com (2603:10a6:10:12d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.14; Thu, 27 Oct 2022 07:03:32 +0000 Received: from AM9PR04MB8397.eurprd04.prod.outlook.com ([fe80::f9b1:83:c855:6c2]) by AM9PR04MB8397.eurprd04.prod.outlook.com ([fe80::f9b1:83:c855:6c2%3]) with mapi id 15.20.5746.028; Thu, 27 Oct 2022 07:03:32 +0000 From: Claudiu Manoil To: Vladimir Oltean , "netdev@vger.kernel.org" CC: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "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: AQHY6TRiZjWnDLnzvkSv/h/ebvX9va4h0AuQ Date: Thu, 27 Oct 2022 07:03:31 +0000 Message-ID: References: <20221026121330.2042989-1-vladimir.oltean@nxp.com> In-Reply-To: <20221026121330.2042989-1-vladimir.oltean@nxp.com> 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: AM9PR04MB8397:EE_|DB8PR04MB7148:EE_ x-ms-office365-filtering-correlation-id: 9a1ffb4a-42ca-47d2-273c-08dab7e95bc4 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: mgnfXNQvOtheqLuhn8GuSRbEEkEWcvu1SNlLZCBN7UNrZ3Di0OvY9R3t2mrGo5axbWVKf/AbNmQKtBg7PAtrpTyh/y2xd3uV4frEZeap5pVscS8ZK8KJYTJM3MzIUv71vHDfTGDVFFYFU88KkKX4TeiN5m95lOJBjlmML7WqED+BlEDphOjT7q5r5sILks7E6QacgSj2GtzT8qCtQIIYyFlbrRIRDQ+sn2JzmaLBFPrYGoJrKE5/rwtodvEcunnsfJ1z8NSMQPwm/NU09wYS97FRTT6VVl31hziUonCztHtnGN1AhZjW8R0U12pZ6hQNtz2w9J1/vkOTfuKYE1tRPYiJ1Xngju1V18zHAgjaAfhQSOWWe8RV4Qtht2wGwwbrMgA6DS4UqssAoj1s45+w2wV2lH9GGQYL6rj9QChLOSGmZfMPaSMqvXm0LjNFeCeMdmG2HeMEGgSpXlLlY+ARTILRoOnxOdjfUNowC4fV/EhBfCdhCRoENs+S1T6oEbtj7d8ojemLMvOxbhFkNtsdlV9ZpvtBzahrFKPc4uCE+YF9Cr9rixQgWocC0yhxbzUUQ4A8k9qPg6PWRk0lbKy21lhCgyiiwLjR70bmo+9qUrGlCiDIui8KB2dL/+WEUdsbrJSD/k4PqE9WbUNmEOqdhtW7ulWQ6Se9kMNQXMVbl+xefRdTGr3ppsuDmF2JZRelxa/4PLi7UkwrDfafhFz1lQ945Q30aidO5Ss3t27EoPZ5xu2V07/KhgyMqi+xVmzepB2kvePX/Y4x40+5agixmw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR04MB8397.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(346002)(39860400002)(376002)(396003)(366004)(136003)(451199015)(38100700002)(122000001)(8676002)(7696005)(52536014)(5660300002)(66946007)(38070700005)(4326008)(478600001)(66446008)(64756008)(66556008)(44832011)(316002)(186003)(110136005)(54906003)(83380400001)(55016003)(71200400001)(76116006)(6506007)(8936002)(33656002)(53546011)(9686003)(26005)(2906002)(4744005)(66476007)(86362001)(41300700001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?VjwQWvu9pead0nu+ze25nY46SGpua1kTF+2DzXG6GSBb6FwWLA6/ZNLspv6l?= =?us-ascii?Q?+b7QBCXrZ5ZUIH5JvA8HkdhlBn94xJZBr2uaZN1WKAPXLV/Gk4kweCbVyms/?= =?us-ascii?Q?ZMnM+4WhABzcNH+CRfXbSS9Qqm3NC1309Yb+2cXfwuujdqyCM3ZrnKsiFjii?= =?us-ascii?Q?85yV6ujFFFVUwc2cjtJXsx1Lzc1LyCPDEWV0Imz1szlm3tw6++3LP20XOsOX?= =?us-ascii?Q?6tZjuFa9Ikr9j9CAEFHUq5u6dxcLK5Y1HlPqQfywvJyzlSUCYS+Yxiy99xV9?= =?us-ascii?Q?yHXNt9HN0iQRHrD5w6e6TIjZ4waMzKnr3/CpCT5pSk4zQ3F28+cPY5W5Cwvp?= =?us-ascii?Q?f/5b1QwqltavG1efnpvZuap2sAd+3puXq0wkgU7Ag26pMlz54evd1QqKwoXF?= =?us-ascii?Q?JketyBpCQJNFepIahffsaj8dBAEu4vLxEQ4fAR1YDXdBS3lZI0Tcj8Dsf08y?= =?us-ascii?Q?w53UvvAJtveGk5PtmMFTgUXEO9kvrHvQITrfX6d+AleQAuHCdibKQiNUJjr7?= =?us-ascii?Q?SW1gEsWLL/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=?us-ascii?Q?rLqheAzzUluYs7SqsODTgzrllQVEp5NlVnxPGsJWLC8qKoOlj2eWouiom8p3?= =?us-ascii?Q?ujHmGxPA80RO9EewbU8S0iHJw+zHmg3N5sKL3VxCxIQa1crL3o45bTupYgWD?= =?us-ascii?Q?unEmT4vUti4x+mt7KXQ9cNdrQKYnFzLL/grNEtx0?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8397.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a1ffb4a-42ca-47d2-273c-08dab7e95bc4 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Oct 2022 07:03:32.0566 (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: hN4D1JUfuc2D/Rtvjqal3vMrDX2lffoyZqQAHlteL3YoDbwV1q4YF3LbwqIKLTEOEL/HdAXGHEsshlhlvIdIrQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB7148 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 Hi, Vladimir, > -----Original Message----- > From: Vladimir Oltean > Sent: Wednesday, October 26, 2022 3:14 PM > To: netdev@vger.kernel.org [...] > Subject: [PATCH v2 net] net: enetc: survive memory pressure without crash= ing >=20 > Under memory pressure, enetc_refill_rx_ring() may fail, and when called > during the enetc_open() -> enetc_setup_rxbdr() procedure, this is not > checked for. >=20 > An extreme case of memory pressure will result in exactly zero buffers > being allocated for the RX ring, and in such a case it is expected that > hardware drops all RX packets due to lack of buffers. >=20 How do you trigger this "extreme case of memory pressure" where no enetc bu= ffer can be allocated? Do you simulate it? Reviewed-by: Claudiu Manoil