Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1334070lqa; Mon, 29 Apr 2024 05:57:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVAg5jCP0KK7u90HnG9+HjnANlEvB2GxGoKw6b7fxpx+20m9NWCmup0hBAP7Zmcg9Oj7s3EFW6/Nn8nD6UL9DHuOKJfsMDmDhgK0pa3mQ== X-Google-Smtp-Source: AGHT+IF5qarhtQP06NPQ5duaykIppAWQPi5queXimVzXyigiX8QunJdPWfRFgSg7Od0WEEuuEdjA X-Received: by 2002:ac8:5741:0:b0:43a:5f5e:c10b with SMTP id 1-20020ac85741000000b0043a5f5ec10bmr18712224qtx.20.1714395477459; Mon, 29 Apr 2024 05:57:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714395477; cv=pass; d=google.com; s=arc-20160816; b=XT/cE4kV5/dM9G9b6ezrWzaCExJssfxxaTMhNREsoAyiPzqAj5m6nG8WeYgbTZhRQq qw8UxgmlBCVdtK5YUGIAL2SCHFQUOqksyer2r0OUhDUluGvnkbJCdoLzi3/t6fItPCjd VPqwLGMQezDLc79MptCF9uCaRV4a+dOJulanWR4tK4u0+r96jPQddj42xw+d75Vr8ab/ rfPg6oSHjwD/OXx41ptp9SAtzeajOHrNbkAe7kyMULr1GO+3vrYjR3R/mA10+ZnBlck0 XpfSYOkgeImMx9WWj2cHuhMRWEtnE/QrhOcasXBUkKY+yTqLXeH4j1tbgXNyo5XWCjzQ aC5A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ABLcTSSDifSNKcnXO04m5SNsi9qk8dBoJg/dPda/TgA=; fh=eRE0Kkp2OyLau3cz8rtdR1cnXW20GIyJG/xzAgHV7Tk=; b=VXLCMK+f97xNypZk0m5MsCwhUMh34pyq4WpxNzEPwV77to7BCVkdwA65V6T8ZlIQ3a ZtVLGzvAA03aJhDKBXMehCNGrfjtQaW2JzwAXMV7OYV1PQME1yzqZkXHAOKesYwPTjpa INtk1ZuD4vAdmZfyjNCO3HZAYIi5cLHXmX2sQYUMZHMjotJxoaEvo1bEcRKbNDl2PEwe 9mz3lxFuIX4TfnvCoMPitaRSCse6QT4PZDPpoFeqQt5xsa7FS6hGeVtrnwfLFaEMWQdH 0g3SzSfvJs3plSW/xH1AW3YK8Y+aat1wyFANdyQE/YtSoN01FAcZKMfQs0ojrllvlrdu LCsQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vPKOdYBh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-162298-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162298-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h21-20020ac87d55000000b0043adb38636asi3073170qtb.505.2024.04.29.05.57.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 05:57:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162298-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vPKOdYBh; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-162298-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162298-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1FEB91C213C7 for ; Mon, 29 Apr 2024 12:57:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D4800548FF; Mon, 29 Apr 2024 12:57:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="vPKOdYBh" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 00DD610971; Mon, 29 Apr 2024 12:57:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395468; cv=none; b=UzGZvjVXUfc1ccWSGHvllKvvz4xHmHmTONGv0yIR//QJ7PFzvxwM27Z4IP2doD//XqvfwpQBhJ0IJWnjyD+rV8WoRGAUKankmwfIgEMBR5ZogwR05skey6PejmfuY+USQGFXpbkUAerA+IQwbrME+f60jy8WwLOXdfLK42tJPxk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714395468; c=relaxed/simple; bh=szOipog58uDKQbq3rAwx1O2WRdTgbJ6PtSPilHFTcyk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KQfHZ5JR2qXORd1DdZwptWyNZAdBXrtZM7PYg2L7+ifb67YdKEjSFpB/b42W5fQ8nmWnedqbEbjgwjEZ2NP4Ni3PcxsS8v2KvSTzovnpESt9PY7m30+gu4E8tOf6KVvafMrZD9lUzNuX3tPK6enkcIA8XAf8mQeUdvgq+nvLsHI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vPKOdYBh; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15165C4AF17; Mon, 29 Apr 2024 12:57:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714395467; bh=szOipog58uDKQbq3rAwx1O2WRdTgbJ6PtSPilHFTcyk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vPKOdYBhYxfxgg84blVbmKXkH4I8XVvqkXnVC5rpmsKRgOGOg0J3chsFG5yIkBpKk Px3JvrOfoEXJcX5e6/WOWaZo95+M8KM1PSmlsTHIrvS3GBgreWCXuzmfaglaCDSRG3 J+rTHCVIcbXXy/gF1437bPFzlSyG0G3uMHUqnUcwqAGEVpw81K80tR66IoME3i0q7X ArNjAr/FkyGJ2qSYMW8w6mRAW98KVvGkx8hPjj5hE7sKrlhXBYtkRry5rNXkWXl/+a sFUSPd6YETlv0vzcyz2HhMUAca7dUKOnlGcIl9GOjaTWLnvSRDVmOTcPaHE6lH55u1 Q10No13LLAgyg== Date: Mon, 29 Apr 2024 13:57:42 +0100 From: Simon Horman To: Alexander Lobakin Cc: intel-wired-lan@lists.osuosl.org, Michal Kubiak , Wojciech Drewek , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , nex.sw.ncis.osdt.itp.upstreaming@intel.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH iwl] idpf: don't enable NAPI and interrupts prior to allocating Rx buffers Message-ID: <20240429125742.GX516117@kernel.org> References: <20240426144408.1353962-1-aleksander.lobakin@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240426144408.1353962-1-aleksander.lobakin@intel.com> On Fri, Apr 26, 2024 at 04:44:08PM +0200, Alexander Lobakin wrote: > Currently, idpf enables NAPI and interrupts prior to allocating Rx > buffers. > This may lead to frame loss (there are no buffers to place incoming > frames) and even crashes on quick ifup-ifdown. Interrupts must be > enabled only after all the resources are here and available. > Split interrupt init into two phases: initialization and enabling, > and perform the second only after the queues are fully initialized. > Note that we can't just move interrupt initialization down the init > process, as the queues must have correct a ::q_vector pointer set > and NAPI already added in order to allocate buffers correctly. > Also, during the deinit process, disable HW interrupts first and > only then disable NAPI. Otherwise, there can be a HW event leading > to napi_schedule(), but the NAPI will already be unavailable. > > Fixes: d4d558718266 ("idpf: initialize interrupts and enable vport") > Reported-by: Michal Kubiak > Reviewed-by: Wojciech Drewek > Signed-off-by: Alexander Lobakin Reviewed-by: Simon Horman