From mboxrd@z Thu Jan 1 00:00:00 1970 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 96371149C4E; Thu, 13 Jun 2024 15:40:44 +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=1718293244; cv=none; b=r25PZ4uUh2tp2BBgjFeMWllVq6TyEIazQJyHIJYErpwVuXOp6wbWOmpYE6R+dpAZ8JEpQJBoOf9z+wj9dRxFkTxQW/jDySUqYXO1omzbM/IKsl3B/ULnqcMKDCHgHVtNE+CnbT3vfm6GaR3kWkBQgT22m2SUgJb6zgGl1JFc9lM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718293244; c=relaxed/simple; bh=JcXvOUaKdlxs2Ht40iN7VRSX7BT4jA2+5PBP7oY41xc=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FIGmdWiPLePVrw7cuTBlsfdh2wZvEKUWTTuJs4SFe24jWndCMb1vYO5rFApTtZU+Tlvyt4NwWEqbog1fuA3f46a32UNBFyjQ/LIPuVpqDwuuS10CEpjaoGDsfrESUbfQfDGjN8dyQgdWbBgozMBU7ICbd2zSXf4v20Mpx9m+N04= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WE9Z1NUn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WE9Z1NUn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63916C32786; Thu, 13 Jun 2024 15:40:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718293244; bh=JcXvOUaKdlxs2Ht40iN7VRSX7BT4jA2+5PBP7oY41xc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=WE9Z1NUnN2yyAnjrE9nBV1RUF+SFyoifvSbOJ4sNgec7xO0QNAaq1qrB4mXpLPnaV vg3xdmR4KToKvfpGJrei1/MhoJRAv4FBSVh2MuqwZNT7D4GkaLZjR6hg9voDEMssbc /rka534WIOa/2wRcqXOwGowkNpjoMO+tsbYg6Gy3yIHifMR4KT9iLfuhkk2nLBjRRD l3TC7i5O+LyB5QuDBWq43PFyb96p6xXCL+V8wLKJODYBcLCiNOZEYOK6Y3e60PQKFX bQGD8wVrP183595n1vr/JN2azD2QmxcOXWSIz1eo8H/dwCKb5gpChjK7BB/rMmKtmR SUr0dTvhEoEMg== Date: Thu, 13 Jun 2024 08:40:42 -0700 From: Jakub Kicinski To: Larysa Zaremba Cc: , Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Eric Dumazet , Paolo Abeni , Alexei Starovoitov , "Daniel Borkmann" , Jesper Dangaard Brouer , John Fastabend , Maciej Fijalkowski , , , , , Michal Kubiak Subject: Re: [PATCH iwl-net 0/3] ice: fix synchronization between .ndo_bpf() and reset Message-ID: <20240613084042.7db4c410@kernel.org> In-Reply-To: References: <20240610153716.31493-1-larysa.zaremba@intel.com> <20240611193837.4ffb2401@kernel.org> <20240612140935.54981c49@kernel.org> <20240613071343.019e7dca@kernel.org> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 13 Jun 2024 17:36:16 +0200 Larysa Zaremba wrote: > > > AFAIK, netif_device_detach() does not affect .ndo_bpf() calls. We were trying > > > such approach with idpf and it does work for ethtool, but not for XDP. > > > > I reckon that's an unintentional omission. In theory XDP is "pure > > software" but if the device is running driver will likely have to > > touch HW to reconfigure. So, if you're willing, do send a ndo_bpf > > patch to add a detached check. > > This does not seem that simple. In cases of program/pool detachment, > .ndo_bpf() does not accept 'no' as an answer, so there is no easy existing way > of handling !netif_device_present() either. And we have to notify the driver > that pool/program is no longer needed no matter what. So what is left is somehow > postpone pool/prog removal to after the netdev gets attached again. I see, thanks for investigating! From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 98773C27C75 for ; Thu, 13 Jun 2024 15:40:55 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 32EA34142A; Thu, 13 Jun 2024 15:40:55 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id WvxKO8adtR06; Thu, 13 Jun 2024 15:40:53 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 3663A401FE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1718293253; bh=3EZYUMPFCVToZ2DiRjkM7PDXMmHlNZMJ4zaQ5v7io4E=; h=Date:From:To:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: Cc:From; b=SdZNRY9eeRZ2y45USnU8N7r5Yd1rMEyq8pRybc443I0vqAXDTQbok/qssJrNhGWZD nOCBsUQT/wNBy+UA3/AMTJAlNyjvNl744b9TV3q+g7TInMiP+aIxmizdvR4PKhRgxO vZdNhowBgjk0Bz81GiCRkPiZ3kNholmchW6GI4Ygq4fz87bwxi+hPmp0W8OLXT7E6B jsI/h9RBbvI6zQcb51VaJUWEmbE4MTMN3s7ql4mfzHYU92Im5GGSi1bPT4Yx98CovY 4thJVmFS5pYi/w5TpSpEsqJMQ0Rk2ZTWGjMuKR/3YjxHSDViP5zUmLS+cWIP0Gm3+6 A6ZFRov6S4PKw== Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 3663A401FE; Thu, 13 Jun 2024 15:40:53 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 747B81BF34A for ; Thu, 13 Jun 2024 15:40:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 60549401FE for ; Thu, 13 Jun 2024 15:40:51 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id bFAcqypzVp-w for ; Thu, 13 Jun 2024 15:40:50 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=145.40.73.55; helo=sin.source.kernel.org; envelope-from=kuba@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 4119D401CE DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 4119D401CE Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by smtp2.osuosl.org (Postfix) with ESMTPS id 4119D401CE for ; Thu, 13 Jun 2024 15:40:50 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 3DA62CE26C5; Thu, 13 Jun 2024 15:40:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63916C32786; Thu, 13 Jun 2024 15:40:43 +0000 (UTC) Date: Thu, 13 Jun 2024 08:40:42 -0700 From: Jakub Kicinski To: Larysa Zaremba Message-ID: <20240613084042.7db4c410@kernel.org> In-Reply-To: References: <20240610153716.31493-1-larysa.zaremba@intel.com> <20240611193837.4ffb2401@kernel.org> <20240612140935.54981c49@kernel.org> <20240613071343.019e7dca@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718293244; bh=JcXvOUaKdlxs2Ht40iN7VRSX7BT4jA2+5PBP7oY41xc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=WE9Z1NUnN2yyAnjrE9nBV1RUF+SFyoifvSbOJ4sNgec7xO0QNAaq1qrB4mXpLPnaV vg3xdmR4KToKvfpGJrei1/MhoJRAv4FBSVh2MuqwZNT7D4GkaLZjR6hg9voDEMssbc /rka534WIOa/2wRcqXOwGowkNpjoMO+tsbYg6Gy3yIHifMR4KT9iLfuhkk2nLBjRRD l3TC7i5O+LyB5QuDBWq43PFyb96p6xXCL+V8wLKJODYBcLCiNOZEYOK6Y3e60PQKFX bQGD8wVrP183595n1vr/JN2azD2QmxcOXWSIz1eo8H/dwCKb5gpChjK7BB/rMmKtmR SUr0dTvhEoEMg== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=none dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=WE9Z1NUn Subject: Re: [Intel-wired-lan] [PATCH iwl-net 0/3] ice: fix synchronization between .ndo_bpf() and reset X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maciej Fijalkowski , Jesper Dangaard Brouer , Daniel Borkmann , netdev@vger.kernel.org, John Fastabend , Alexei Starovoitov , Eric Dumazet , Michal Kubiak , Tony Nguyen , magnus.karlsson@intel.com, intel-wired-lan@lists.osuosl.org, bpf@vger.kernel.org, Paolo Abeni , "David S. Miller" , linux-kernel@vger.kernel.org Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Thu, 13 Jun 2024 17:36:16 +0200 Larysa Zaremba wrote: > > > AFAIK, netif_device_detach() does not affect .ndo_bpf() calls. We were trying > > > such approach with idpf and it does work for ethtool, but not for XDP. > > > > I reckon that's an unintentional omission. In theory XDP is "pure > > software" but if the device is running driver will likely have to > > touch HW to reconfigure. So, if you're willing, do send a ndo_bpf > > patch to add a detached check. > > This does not seem that simple. In cases of program/pool detachment, > .ndo_bpf() does not accept 'no' as an answer, so there is no easy existing way > of handling !netif_device_present() either. And we have to notify the driver > that pool/program is no longer needed no matter what. So what is left is somehow > postpone pool/prog removal to after the netdev gets attached again. I see, thanks for investigating!