From patchwork Wed Sep 8 09:47:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gaetan Rivet X-Patchwork-Id: 1525714 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=u256.net header.i=@u256.net header.a=rsa-sha256 header.s=fm2 header.b=cuxifO/y; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=qRruzrDj; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H4HPx3dknz9sW8 for ; Wed, 8 Sep 2021 19:48:21 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 70E4F406FF; Wed, 8 Sep 2021 09:48:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RZOMQAj1zoqE; Wed, 8 Sep 2021 09:48:12 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id 84E83406BD; Wed, 8 Sep 2021 09:48:11 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 8072BC002B; Wed, 8 Sep 2021 09:48:10 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 38FBFC000D for ; Wed, 8 Sep 2021 09:48:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id E84886073B for ; Wed, 8 Sep 2021 09:48:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=u256.net header.b="cuxifO/y"; dkim=pass (2048-bit key) header.d=messagingengine.com header.b="qRruzrDj" Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9sY3drFJOwrY for ; Wed, 8 Sep 2021 09:48:08 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by smtp3.osuosl.org (Postfix) with ESMTPS id 40485607FC for ; Wed, 8 Sep 2021 09:48:08 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id AACF4320084E; Wed, 8 Sep 2021 05:48:07 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 08 Sep 2021 05:48:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=u256.net; h=from :to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=xjPrh+duQbSRz 8PkgcBnnxjYfRFxp9f26yBlYpJk8kc=; b=cuxifO/yfTuQ/XsReyNX1/dpWyuaE aE/MiQ08IFQeoD7QNjWJnKDGvbvYvCi9gxa1n61tnwGTYBdjSxwdH6t5EdzikfwC Gtp9RaKQ8orrq4iEUKZHdVPNQa6sLk9gq/FSBeOyY8/q/MgQ41wdIvGGC3i+DpnY Dq8McEyIoCQlrjLPsUBa5f95sYhRXmT7k791+l3PBigSfu6YQc/9MBZGupi+tOz4 h3Kw7NkshjLzOQLsmb9y7HwTrG8hSx0MGj+X10aOX8ePXQifR3ThCidcqR6YbtcL jiZ46s5z0s5FtB2qnDp+nrYe/EM0xYg7EenujZcGZ1epTiHzb4TgcCKYQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=xjPrh+duQbSRz8PkgcBnnxjYfRFxp9f26yBlYpJk8kc=; b=qRruzrDj HRkaFQBGrTmRxYPQ4Lc0+M1QNN0AyeZyzn5k7MqbolV1fx5wzW96z6L2a7c1PvBK cdcQqBgTtEMUyVHAx0BlkM7Usj8hIhkib4fFHw7Vky0nF1o4BQ8wEYswBMdQnbrZ wkBsaobt+Ds+srar87lnTYzMrfQfIYPAsvuXMU97m0PNlwrintxH+50+aHb3EDgi g+he+paPsQXjWCbquzYmK72iXIkBsAtwvZcKpm6JN2AsvAD/2NiH9LBIJ6Digieo pZt+D67egkqYDdE5SVZEZQQgasgxpUVp4b6IwmkddlGvLPz6oii7k8AYtiaXGhJT gfFc7U6o6u6c9w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudefjedgudekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefirggvthgr nhcutfhivhgvthcuoehgrhhivhgvsehuvdehiedrnhgvtheqnecuggftrfgrthhtvghrnh ephefgveffkeetheetfeeifedvheelfeejfeehveduteejhfekuedtkeeiuedvteehnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepghhrihhvvg esuhdvheeirdhnvght X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 8 Sep 2021 05:48:06 -0400 (EDT) From: Gaetan Rivet To: ovs-dev@openvswitch.org Date: Wed, 8 Sep 2021 11:47:28 +0200 Message-Id: <92371a3d37f517049feb517d7bf1b3df625a4524.1631094144.git.grive@u256.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Cc: Eli Britstein , Maxime Coquelin Subject: [ovs-dev] [PATCH v5 04/27] netdev: Add flow API uninit function X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Add a new operation for flow API providers to uninitialize when the API is disassociated from a netdev. Signed-off-by: Gaetan Rivet Reviewed-by: Eli Britstein Reviewed-by: Maxime Coquelin --- lib/netdev-offload-provider.h | 3 +++ lib/netdev-offload.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/lib/netdev-offload-provider.h b/lib/netdev-offload-provider.h index 348ca7081..bc52a3f61 100644 --- a/lib/netdev-offload-provider.h +++ b/lib/netdev-offload-provider.h @@ -96,6 +96,9 @@ struct netdev_flow_api { /* Initializies the netdev flow api. * Return 0 if successful, otherwise returns a positive errno value. */ int (*init_flow_api)(struct netdev *); + + /* Uninitializes the netdev flow api. */ + void (*uninit_flow_api)(struct netdev *); }; int netdev_register_flow_api_provider(const struct netdev_flow_api *); diff --git a/lib/netdev-offload.c b/lib/netdev-offload.c index 8075cfbd8..5ddd4d01d 100644 --- a/lib/netdev-offload.c +++ b/lib/netdev-offload.c @@ -332,6 +332,10 @@ netdev_uninit_flow_api(struct netdev *netdev) return; } + if (flow_api->uninit_flow_api) { + flow_api->uninit_flow_api(netdev); + } + ovsrcu_set(&netdev->flow_api, NULL); rfa = netdev_lookup_flow_api(flow_api->type); ovs_refcount_unref(&rfa->refcnt);