summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-07-04 18:25:16 -0700
committerDavid S. Miller <davem@davemloft.net>2016-07-04 18:25:16 -0700
commit5ee389751922a497d38c4750c5cbe6223873c24c (patch)
tree331db508f1573a8567717af0e2e9ffabd2ad23b6 /net
parentf48cc6b2661ccb6e9d85a5cdd78c0150929a2821 (diff)
parent99f44bb3527b25198387bd56ec1bfc88a4421050 (diff)
Merge branch 'mlxsw-fib-offload'
Jiri Pirko says: ==================== mlxsw: Implement basic FIB offload and router interfaces Introduce LPM trees management including virtual router management for HW. Implement basic FIB offloading using switchdev FIB objects. For now only support local routes and direct routes (next-hop support will be introduced in a follow-up patchset). Introduce router interfaces in patches 10-14. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/dev.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index aba10d2a8bc3..a4f3b0a9aeaf 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5445,6 +5445,52 @@ void *netdev_lower_get_next(struct net_device *dev, struct list_head **iter)
EXPORT_SYMBOL(netdev_lower_get_next);
/**
+ * netdev_all_lower_get_next - Get the next device from all lower neighbour list
+ * @dev: device
+ * @iter: list_head ** of the current position
+ *
+ * Gets the next netdev_adjacent from the dev's all lower neighbour
+ * list, starting from iter position. The caller must hold RTNL lock or
+ * its own locking that guarantees that the neighbour all lower
+ * list will remain unchanged.
+ */
+struct net_device *netdev_all_lower_get_next(struct net_device *dev, struct list_head **iter)
+{
+ struct netdev_adjacent *lower;
+
+ lower = list_entry(*iter, struct netdev_adjacent, list);
+
+ if (&lower->list == &dev->all_adj_list.lower)
+ return NULL;
+
+ *iter = lower->list.next;
+
+ return lower->dev;
+}
+EXPORT_SYMBOL(netdev_all_lower_get_next);
+
+/**
+ * netdev_all_lower_get_next_rcu - Get the next device from all
+ * lower neighbour list, RCU variant
+ * @dev: device
+ * @iter: list_head ** of the current position
+ *
+ * Gets the next netdev_adjacent from the dev's all lower neighbour
+ * list, starting from iter position. The caller must hold RCU read lock.
+ */
+struct net_device *netdev_all_lower_get_next_rcu(struct net_device *dev,
+ struct list_head **iter)
+{
+ struct netdev_adjacent *lower;
+
+ lower = list_first_or_null_rcu(&dev->all_adj_list.lower,
+ struct netdev_adjacent, list);
+
+ return lower ? lower->dev : NULL;
+}
+EXPORT_SYMBOL(netdev_all_lower_get_next_rcu);
+
+/**
* netdev_lower_get_first_private_rcu - Get the first ->private from the
* lower neighbour list, RCU
* variant