DORMANTno replies

[RFC PATCH 3/4] swdevice: new generic op to set bridge port attr

From: <hidden>
Date: 2014-11-21 22:49:40
Subsystem: networking [general], switchdev, the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Jiri Pirko, Ivan Vecera, Linus Torvalds

From: Roopa Prabhu <redacted>

A generic switch device op to offload any type of bridge port attribute.

(This is still TBD)
---
 include/net/switchdev.h   |    8 +++++++-
 net/switchdev/switchdev.c |   17 +++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index a9ccfa4..c97994d 100644
--- a/include/net/switchdev.h
+++ b/include/net/switchdev.h
@@ -145,7 +145,8 @@ int netdev_sw_parent_flow_insert(struct net_device *dev,
 				 const struct swdev_flow *flow);
 int netdev_sw_parent_flow_remove(struct net_device *dev,
 				 const struct swdev_flow *flow);
-
+int netdev_sw_port_set_attr(struct net_device *dev, int attrtype,
+                            void *attrval);
 #else
 
 static inline int netdev_sw_parent_id_get(struct net_device *dev,
@@ -202,6 +203,11 @@ static inline int netdev_sw_parent_flow_remove(struct net_device *dev,
 	return -EOPNOTSUPP;
 }
 
+static int netdev_sw_port_set_attr(struct net_device *dev, int attrtype,
+                                   void *attrval)
+{
+	return -EOPNOTSUPP;
+}
 #endif
 
 #endif /* _LINUX_SWITCHDEV_H_ */
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index dc8e769..48f451b 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -314,3 +314,20 @@ int netdev_sw_parent_flow_remove(struct net_device *dev,
 	return ops->ndo_sw_parent_flow_remove(dev, flow);
 }
 EXPORT_SYMBOL(netdev_sw_parent_flow_remove);
+
+/**
+ *	netdev_sw_port_set_attr - set a port attr
+ *	@dev: port device
+ *	@attrttype: netlink attribute
+ *	@attrval: attribute value
+ *
+ *	Set switch port attribute
+ */
+int netdev_sw_port_set_attr(struct net_device *dev,
+					int attrttype, void *attrval)
+{
+	/* XXX: yet to be implemented */
+
+	return 0;
+}
+EXPORT_SYMBOL(netdev_sw_port_set_attr);
-- 
1.7.10.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help