Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp138150lqo; Thu, 16 May 2024 01:28:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVxqlzt+LIJAeLBitC20IyLc5wPBx1zYalYhN+yWqU8Uv/grUJ9MyPh5vvjtC+OtYLDzNFI+QH35n1U0vam87h/HV0DmrGXxUds6T09yw== X-Google-Smtp-Source: AGHT+IGOxAUXh+Rt+dFLSonqh6OEyUn3ubalSgaTPzvmbprlhv9rJI74YhYGkUxPd3mXGHeeFwGU X-Received: by 2002:a9d:7609:0:b0:6ef:9b63:7c04 with SMTP id 46e09a7af769-6f0e92b7f26mr19702993a34.33.1715848085104; Thu, 16 May 2024 01:28:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715848085; cv=pass; d=google.com; s=arc-20160816; b=BxDfifDqh1jewhWf6vwsWiO7HHVYI+trIquq1A2ogYIfwkK1Vdq3IhQKGhWxl725Gi 6T17YkWML4ZOqASvT5qDE2JsjDBkbVp7UUs53378cwiSQ6ncZp8H5ZV/gbswOGpzdVED 6N0aPvnebtOQTd9vemMtk5NiuYpbzrfOelA7uIiS2/QwdQobvBE+5F8X6mr1VSn6HOet t7qLyZkR5BWumDTouMEZK3TBKef6zHxl1cEvKYhIkXEZMeTOAOJ0k6My3HhD0jprrSuj wB8JwpmCy8f3ZKYdrDjKYsi/uBWQ002XFR3nC44iDmM1Ym3Uvs/UbAU/8ycgxGIYmgY6 lsUA== 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=+3U4xUApSYgddyfwELO5jrGeTunG7x8fJn6ivijjQlo=; fh=F+KPl+emI2kj5d6AZgGlOrQ2+B3WIESDRfRoKXpfa7Y=; b=h/uuEa0VRAY6I0piE/d1aNStZwqNVxg1xyWMx0eqpqrleMtlMFv+dP3O5+mzDf9wbh NRIqb+g9K1jLp7KX47NjygwNteAQ5swA5GtIlecc8wBGzzbcP9xQO7MOMi1ahNvkon1R YWixkg7wzzaLSTuoBmzKsGOfbbVUcCIatEKg0F66lWPWqMJ3Jd1dPAxw4T+elYcspywB EvzWPmOGHfN8CqDaZnrUUHab39rMB9/COejB6oLgjMwqM4BEUrRyCptd7C0aEbPeQ0Dx 558BclqEyq1O0O8rt9pOmn6xdZH5Nc17FY/buy7GD7g+GZOSjnT0+1KGG+9va4FloTfo n1UQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mU5Wpl8f; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-180762-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180762-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-65b9651e61esi312433a12.40.2024.05.16.01.28.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 01:28:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180762-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mU5Wpl8f; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-180762-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180762-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 51BF3281F80 for ; Thu, 16 May 2024 08:28:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C2A35134738; Thu, 16 May 2024 08:27:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mU5Wpl8f" 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 DD40C76C76; Thu, 16 May 2024 08:27:39 +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=1715848060; cv=none; b=RvDc4oqlSnjVlynd59jXYHHQiaW5ixBahfTodPni30cmxMd5lemJEkZUv91RisdvnOpdNzajj9tzOkCeVV3Eo9w6Ir/UPNnElkVFa/0IhAb642YrF53f7SKm/Hu/XJ41YeFhmE3rl9Ql5rGB6/t8wuoTnHE7HL2YRgtOcBy6HCI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715848060; c=relaxed/simple; bh=9LRNAuur+huZKRDmejnPug6GuKAfA0xgXvFKeLB4wLo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=c3MY8r2X+bApFrF5Ii19k48KLfSWVgdYZsmxBwjqRgpjDC4G2whS2/PfHZZpE7pBo1V+Uw1DRSctGwyZpWgwws7adlCMvmMaRWlu+6EBwG24KBOooAu3PV7LdR+ZunUUuFP12mcVgQGTQCSyzTBpuuVb20gAQgCcYqLXm3hiP8w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mU5Wpl8f; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40375C32789; Thu, 16 May 2024 08:27:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715848059; bh=9LRNAuur+huZKRDmejnPug6GuKAfA0xgXvFKeLB4wLo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mU5Wpl8fCqZC6kZltsIgQeTYGjz4QB/WYbrXvz7R/+YdO0nxnKnRx2KdNJnYxLCs0 zCLxREkNgG/FkZ1VQ84uTCOBuPLL0tGIH5PADs083gnXzlTc/MQKYaT9nyzs/iLGeY i0OiRL7ef/29o/JLkpJxgFJak0dQpyhCVpXjaDyNEyJebiTFeHVBSIHzt9tZAR71CC KQAithRyMZ+Qza+XemZzid9Is1m3GSkn2/8cpzwnuY9yxQbxH9O39ABXJ+S/a7vgQp W1iLGegicc2MvRaHMRaGhRkRTRUw24wzkArSJLTSR/4CcB8m/BboT57kW3qAty8UNi mavlwMDJmJAMQ== Date: Thu, 16 May 2024 09:27:33 +0100 From: Simon Horman To: Larysa Zaremba Cc: intel-wired-lan@lists.osuosl.org, Jacob Keller , maciej.fijalkowski@intel.com, Magnus Karlsson , Przemek Kitszel , igor.bagnucki@intel.com, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH iwl-net 2/3] ice: add flag to distinguish reset from .ndo_bpf in XDP rings config Message-ID: <20240516082733.GD179178@kernel.org> References: <20240515160246.5181-1-larysa.zaremba@intel.com> <20240515160246.5181-3-larysa.zaremba@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: <20240515160246.5181-3-larysa.zaremba@intel.com> On Wed, May 15, 2024 at 06:02:15PM +0200, Larysa Zaremba wrote: > Commit 6624e780a577 ("ice: split ice_vsi_setup into smaller functions") > has placed ice_vsi_free_q_vectors() after ice_destroy_xdp_rings() in > the rebuild process. The behaviour of the XDP rings config functions is > context-dependent, so the change of order has led to > ice_destroy_xdp_rings() doing additional work and removing XDP prog, when > it was supposed to be preserved. > > Also, dependency on the PF state reset flags creates an additional, > fortunately less common problem: > > * PFR is requested e.g. by tx_timeout handler > * .ndo_bpf() is asked to delete the program, calls ice_destroy_xdp_rings(), > but reset flag is set, so rings are destroyed without deleting the > program > * ice_vsi_rebuild tries to delete non-existent XDP rings, because the > program is still on the VSI > * system crashes > > With a similar race, when requested to attach a program, > ice_prepare_xdp_rings() can actually skip setting the program in the VSI > and nevertheless report success. > > Instead of reverting to the old order of function calls, add an enum > argument to both ice_prepare_xdp_rings() and ice_destroy_xdp_rings() in > order to distinguish between calls from rebuild and .ndo_bpf(). > > Fixes: efc2214b6047 ("ice: Add support for XDP") > Reviewed-by: Igor Bagnucki > Signed-off-by: Larysa Zaremba Reviewed-by: Simon Horman