From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 429BE3B38A9 for ; Wed, 13 May 2026 18:36:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.67 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778697390; cv=none; b=T/y65SIYIXr3xsxtFqEaWQAs+HQnhWRH3w7gd4t9IirpzzC0H1rdQAUwzqHvtnbIiQ6ZglbBhVvtzSmYaS8p252euP8wSLtO0NyisXe/N/fksjAL1x+5C7mLTlWEwy/HX/pOTjw1+ei8Vl3EdPizeBp4vdLJfhDyQVA64feXqN4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778697390; c=relaxed/simple; bh=+5u5jJ60v1xjveGW2ChiPGnJYtxZ0kG5T3OCYSA6QtY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ldvQrFFb/oAZ3k29AbYPTwvd094X20pULrcDs/l7HtHVR1blgd7JEIY4kjtBDnBiSZ+6GQet4BmaiOJj0s1qAPdZYlKUw+zGL2pYMuOXRpbfYuV8zuxpa3wVlgfmYh3DPysGhX4+sFonyRLCppRfHgXgPGXNWeJMXnS5dpNxSiY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ovn.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.128.67 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ovn.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f67.google.com with SMTP id 5b1f17b1804b1-488ff90d6c7so63610265e9.2 for ; Wed, 13 May 2026 11:36:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778697385; x=1779302185; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=lFrGXmGkGqSJhTRhqyzlGScwr6w06YpxqqRUHTQ9L1A=; b=oU2oLXoWh9pG0FNdIxZF2nalvn+Rh1CaNkEEBbBNf1tnNU26r3sFwfLXtYzy0Mfn5M B8PxRhaIBn4Hl4QROr2motEJxNL9gAdzbdaoMMxulvSZHI7UR+9En+1hCPF2utp3ORNI WDRSfeQ1NCGF9+ZYRUjYFB3oB5vKwKxsKxClTzyYAyELvMm9sGxFiAilb6Mx6uDmj380 RDw+Mh2n1IYCVinhL4NA7bcBVOpYt5iGtQExwk0xyxXokC66BtBp9TZF5pmhOeX6fDo0 a/wJMaNLqrbqCjpdGhnRJIlMLVOGxjwerWm7KadrE+MEcHsqOldfFZ77t3DaKKc9GnEI nZ3A== X-Gm-Message-State: AOJu0YyTFf2XcgC/z/XIH7mPyOhPBXbymuSB7zIaQdJpd3vKcj4JitwC MWnuHawZz+r1in48n0W9D/EW9mv/TI/YicB/gepjRhgpXOBtGRvrB/6y1bYGoqH4 X-Gm-Gg: Acq92OHYWXSphrX6bhDcEhpUyJUkEi3mM2yWlzMzYtGLnMpfg30gUZgyJX4gVneP+jT nG6KxULc1acuFd9YE8RzDMKQBv/IB1LjH59qizrKl5NrmcCNBbKYgexDLGhkm80OKBr/b2e2W3V mItS1nfNAW8ZkxCaHuuxq6Bl3STytB+2IC5P5pVTcPDcVpJJdilQiy5hrC3u2Gj25SWWcYbleF1 375QpJkPxzeTFR8pvjUNFD8+UyPS96IZatQQEgjzYcsdBEAl2Z2C+OQ3JBzFMVARehdNThpJvTN myQRPSQDcpt4rVOq+/vvMOWNL+dJ1/85c9e1obGQk6pJQ2VmAzub7em2pytbWSxAB+TiChH8lOS 6d40LUJMV1AZHKxjHLQriY7Y2xW8aY6xeSy+ZkschPrqsXIx6UKgDKR9EtTm10QH05ywIWzyKB8 TZ9vDoVTBbPWfna6qpOJjJ+VONtitXP/sN4aRWfNMUxuI/aPaIATsWiIGnVHI= X-Received: by 2002:a05:600d:18:b0:48a:5574:3a5d with SMTP id 5b1f17b1804b1-48fce9bd5d1mr49631725e9.7.1778697384382; Wed, 13 May 2026 11:36:24 -0700 (PDT) Received: from im-t490s.redhat.com (37-48-40-237.nat.epc.tmcz.cz. [37.48.40.237]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45da15a6454sm720609f8f.34.2026.05.13.11.36.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 May 2026 11:36:24 -0700 (PDT) From: Ilya Maximets To: netdev@vger.kernel.org Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Aaron Conole , Eelco Chaudron , David Ahern , Ido Schimmel , Shuah Khan , Nikolay Aleksandrov , Kuniyuki Iwashima , Petr Machata , Fernando Fernandez Mancera , Antoine Tenart , Stanislav Fomichev , linux-kernel@vger.kernel.org, dev@openvswitch.org, linux-kselftest@vger.kernel.org, Ilya Maximets Subject: [RFC net-next 3/6] openvswitch: vport: remove infrastructure for separate modules Date: Wed, 13 May 2026 20:35:23 +0200 Message-ID: <20260513183559.2141010-4-i.maximets@ovn.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260513183559.2141010-1-i.maximets@ovn.org> References: <20260513183559.2141010-1-i.maximets@ovn.org> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Since removal of legacy tunnel vport types only the built-in ones remain. So, there is no need for the extra infrastructure for dynamic module loading. Can be reinstated in the future if we need a new vport type. Note: It is technically possible that someone has an out-of-tree module named vport-type-N that implements a different vport type. At this time we're not aware of anyone doing that. People running out-of-tree modules normally just have an out-of-tree openvswitch module as a whole. And there are actually no supported out-of-tree implementations of the openvswitch module known to the community. Alternative to immediate removal would be printing out a deprecation warning whenever a vport module is loaded, but I'm not sure if we need it at this time. Signed-off-by: Ilya Maximets --- net/openvswitch/vport.c | 22 ++-------------------- net/openvswitch/vport.h | 9 +-------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/net/openvswitch/vport.c b/net/openvswitch/vport.c index 7a9caacfd6ac2..ef2fff4353c0a 100644 --- a/net/openvswitch/vport.c +++ b/net/openvswitch/vport.c @@ -57,7 +57,7 @@ static struct hlist_head *hash_bucket(const struct net *net, const char *name) return &dev_table[hash & (VPORT_HASH_BUCKETS - 1)]; } -int __ovs_vport_ops_register(struct vport_ops *ops) +int ovs_vport_ops_register(struct vport_ops *ops) { int err = -EEXIST; struct vport_ops *o; @@ -73,7 +73,6 @@ int __ovs_vport_ops_register(struct vport_ops *ops) ovs_unlock(); return err; } -EXPORT_SYMBOL_GPL(__ovs_vport_ops_register); void ovs_vport_ops_unregister(struct vport_ops *ops) { @@ -81,7 +80,6 @@ void ovs_vport_ops_unregister(struct vport_ops *ops) list_del(&ops->list); ovs_unlock(); } -EXPORT_SYMBOL_GPL(ovs_vport_ops_unregister); /** * ovs_vport_locate - find a port that has already been created @@ -210,12 +208,8 @@ struct vport *ovs_vport_add(const struct vport_parms *parms) if (ops) { struct hlist_head *bucket; - if (!try_module_get(ops->owner)) - return ERR_PTR(-EAFNOSUPPORT); - vport = ops->create(parms); if (IS_ERR(vport)) { - module_put(ops->owner); return vport; } @@ -225,18 +219,7 @@ struct vport *ovs_vport_add(const struct vport_parms *parms) return vport; } - /* Unlock to attempt module load and return -EAGAIN if load - * was successful as we need to restart the port addition - * workflow. - */ - ovs_unlock(); - request_module("vport-type-%d", parms->type); - ovs_lock(); - - if (!ovs_vport_lookup(parms)) - return ERR_PTR(-EAFNOSUPPORT); - else - return ERR_PTR(-EAGAIN); + return ERR_PTR(-EAFNOSUPPORT); } /** @@ -250,7 +233,6 @@ struct vport *ovs_vport_add(const struct vport_parms *parms) void ovs_vport_del(struct vport *vport) { hlist_del_rcu(&vport->hash_node); - module_put(vport->ops->owner); vport->ops->destroy(vport); } diff --git a/net/openvswitch/vport.h b/net/openvswitch/vport.h index 636788b59907c..930f1ccc85581 100644 --- a/net/openvswitch/vport.h +++ b/net/openvswitch/vport.h @@ -116,7 +116,6 @@ struct vport_parms { * before an RCU grace period has elapsed. * @send: Send a packet on the device. * zero for dropped packets or negative for error. - * @owner: Module that implements this vport type. * @list: List entry in the global list of vport types. */ struct vport_ops { @@ -127,7 +126,6 @@ struct vport_ops { void (*destroy)(struct vport *); int (*send)(struct sk_buff *skb); - struct module *owner; struct list_head list; }; @@ -191,12 +189,7 @@ static inline const char *ovs_vport_name(struct vport *vport) return vport->dev->name; } -int __ovs_vport_ops_register(struct vport_ops *ops); -#define ovs_vport_ops_register(ops) \ - ({ \ - (ops)->owner = THIS_MODULE; \ - __ovs_vport_ops_register(ops); \ - }) +int ovs_vport_ops_register(struct vport_ops *ops); void ovs_vport_ops_unregister(struct vport_ops *ops); void ovs_vport_send(struct vport *vport, struct sk_buff *skb, u8 mac_proto); -- 2.53.0