Skip to contentSkip to conversation

switchdev: Remove unused transaction item queue

PATCH Applied Florian Fainelli 3 participants 3 messages Feb 28, 2019 – Mar 2, 2019

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 switchdev: Remove unused transaction item queue

There are no more in tree users of the switchdev_trans_item_{dequeue,enqueue} or switchdev_trans_item structure in the kernel since commit 00fc0c51e35b ("rocker: Change world_ops API and implementation to be switchdev independant").

Remove this unused code and update the documentation accordingly since.

---
 Documentation/networking/switchdev.txt |  19 -----
 include/net/switchdev.h                |  12 ---
 net/switchdev/switchdev.c              | 100 +------------------------
 3 files changed, 2 insertions(+), 129 deletions(-)
Documentation/networking/switchdev.txt +0 -19
index 633dd1fd81b7..86174ce8cd13 100644
@@ -371,22 +371,3 @@ The driver can monitor for updates to arp_tbl using the netevent notifier
 NETEVENT_NEIGH_UPDATE.  The device can be programmed with resolved nexthops
 for the routes as arp_tbl updates.  The driver implements ndo_neigh_destroy
 to know when arp_tbl neighbor entries are purged from the port.
-
-Transaction item queue
-^^^^^^^^^^^^^^^^^^^^^^
-
-For switchdev ops attr_set and obj_add, there is a 2 phase transaction model
-used. First phase is to "prepare" anything needed, including various checks,
-memory allocation, etc. The goal is to handle the stuff that is not unlikely
-to fail here. The second phase is to "commit" the actual changes.
-
-Switchdev provides an infrastructure for sharing items (for example memory
-allocations) between the two phases.
-
-The object created by a driver in "prepare" phase and it is queued up by:
-switchdev_trans_item_enqueue()
-During the "commit" phase, the driver gets the object by:
-switchdev_trans_item_dequeue()
-
-If a transaction is aborted during "prepare" phase, switchdev code will handle
-cleanup of the queued-up objects.
include/net/switchdev.h +0 -12
index e4f751e19ecf..0ebd67ae7012 100644
@@ -20,14 +20,7 @@
 #define SWITCHDEV_F_SKIP_EOPNOTSUPP	BIT(1)
 #define SWITCHDEV_F_DEFER		BIT(2)
 
-struct switchdev_trans_item {
-	struct list_head list;
-	void *data;
-	void (*destructor)(const void *data);
-};
-
 struct switchdev_trans {
-	struct list_head item_list;
 	bool ph_prepare;
 };
 
@@ -105,11 +98,6 @@ struct switchdev_obj_port_mdb {
 #define SWITCHDEV_OBJ_PORT_MDB(OBJ) \
 	container_of((OBJ), struct switchdev_obj_port_mdb, obj)
 
-void switchdev_trans_item_enqueue(struct switchdev_trans *trans,
-				  void *data, void (*destructor)(void const *),
-				  struct switchdev_trans_item *tritem);
-void *switchdev_trans_item_dequeue(struct switchdev_trans *trans);
-
 typedef int switchdev_obj_dump_cb_t(struct switchdev_obj *obj);
 
 enum switchdev_notifier_type {
net/switchdev/switchdev.c +2 -98

144 lines not on this page · raw message

Signature · 1 line
2.17.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Thu, Feb 28, 2019 at 01:29:16AM CET, [email protected] wrote:

There are no more in tree users of the switchdev_trans_item_{dequeue,enqueue} or switchdev_trans_item structure in the kernel since commit 00fc0c51e35b ("rocker: Change world_ops API and implementation to be switchdev independant").

Remove this unused code and update the documentation accordingly since.

maintainer Applied
#2 lore raw
In reply to Florian Fainelli

From: Florian Fainelli <[email protected]>
Date: Wed, 27 Feb 2019 16:29:16 -0800

Quoted 8 lines

There are no more in tree users of the switchdev_trans_item_{dequeue,enqueue} or switchdev_trans_item structure in the kernel since commit 00fc0c51e35b ("rocker: Change world_ops API and implementation to be switchdev independant").

Remove this unused code and update the documentation accordingly since.

Applied, thanks Florian.