diff options
| author | David S. Miller <davem@davemloft.net> | 2016-07-05 12:06:31 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2016-07-05 12:06:31 -0400 |
| commit | 684a95c064fc63e48c9936fe3d9dfd5ed1ea3b95 (patch) | |
| tree | ba05255580a6015aedcaeaff05ba70d8413cdc5d /net/core/dev.c | |
| parent | 9046a745e29aa4c7e4f1dda3a50199dbe62fc9e8 (diff) | |
| parent | 0b2361d9d946558c90f0ae8b21725022bea9f2cb (diff) | |
Merge branch 'mlxsw-ipv4-unicast-routing'
Jiri Pirko says:
====================
mlxsw: Implement IPV4 unicast routing
This patchset enables IPv4 unicast routing in the Mellanox Spectrum ASIC
switch driver. This builds upon the work that was done by a couple of
previous patchsets.
Patches 1,2,6 add a couple of dependencies outside the driver. Namely, the
ability to propagate ndo_neigh_construct()/destroy() through stacked devices and
a notification whenever DELAY_PROBE_TIME changes. When propagated down, the
ndos allow drivers to add and remove neighbour entries from their private
neighbour table. The DELAY_PROBE_TIME notification gives drivers the ability to
correctly configure their polling interval for neighbour activity, so that
active neighbour won't be marked as STALE.
Patches 3-5,7-8 add the neighbour offloading infrastructure, where patch 7 uses
the DELAY_PROBE_TIME notification in order to correctly configure the device's
polling interval. Patch 8 finally programs neighbours to the device's table
based on NEIGH_UPDATE notifications, so that directly connected routes can
be used.
Patches 9-16 build upon the previous patches and extend the router with
remote routes (nexthop) support.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/dev.c')
| -rw-r--r-- | net/core/dev.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index a4f3b0a9aeaf..b92d63bfde7a 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
| @@ -6087,6 +6087,50 @@ void netdev_lower_state_changed(struct net_device *lower_dev, | |||
| 6087 | } | 6087 | } |
| 6088 | EXPORT_SYMBOL(netdev_lower_state_changed); | 6088 | EXPORT_SYMBOL(netdev_lower_state_changed); |
| 6089 | 6089 | ||
| 6090 | int netdev_default_l2upper_neigh_construct(struct net_device *dev, | ||
| 6091 | struct neighbour *n) | ||
| 6092 | { | ||
| 6093 | struct net_device *lower_dev, *stop_dev; | ||
| 6094 | struct list_head *iter; | ||
| 6095 | int err; | ||
| 6096 | |||
| 6097 | netdev_for_each_lower_dev(dev, lower_dev, iter) { | ||
| 6098 | if (!lower_dev->netdev_ops->ndo_neigh_construct) | ||
| 6099 | continue; | ||
| 6100 | err = lower_dev->netdev_ops->ndo_neigh_construct(lower_dev, n); | ||
| 6101 | if (err) { | ||
| 6102 | stop_dev = lower_dev; | ||
| 6103 | goto rollback; | ||
| 6104 | } | ||
| 6105 | } | ||
| 6106 | return 0; | ||
| 6107 | |||
| 6108 | rollback: | ||
| 6109 | netdev_for_each_lower_dev(dev, lower_dev, iter) { | ||
| 6110 | if (lower_dev == stop_dev) | ||
| 6111 | break; | ||
| 6112 | if (!lower_dev->netdev_ops->ndo_neigh_destroy) | ||
| 6113 | continue; | ||
| 6114 | lower_dev->netdev_ops->ndo_neigh_destroy(lower_dev, n); | ||
| 6115 | } | ||
| 6116 | return err; | ||
| 6117 | } | ||
| 6118 | EXPORT_SYMBOL_GPL(netdev_default_l2upper_neigh_construct); | ||
| 6119 | |||
| 6120 | void netdev_default_l2upper_neigh_destroy(struct net_device *dev, | ||
| 6121 | struct neighbour *n) | ||
| 6122 | { | ||
| 6123 | struct net_device *lower_dev; | ||
| 6124 | struct list_head *iter; | ||
| 6125 | |||
| 6126 | netdev_for_each_lower_dev(dev, lower_dev, iter) { | ||
| 6127 | if (!lower_dev->netdev_ops->ndo_neigh_destroy) | ||
| 6128 | continue; | ||
| 6129 | lower_dev->netdev_ops->ndo_neigh_destroy(lower_dev, n); | ||
| 6130 | } | ||
| 6131 | } | ||
| 6132 | EXPORT_SYMBOL_GPL(netdev_default_l2upper_neigh_destroy); | ||
| 6133 | |||
| 6090 | static void dev_change_rx_flags(struct net_device *dev, int flags) | 6134 | static void dev_change_rx_flags(struct net_device *dev, int flags) |
| 6091 | { | 6135 | { |
| 6092 | const struct net_device_ops *ops = dev->netdev_ops; | 6136 | const struct net_device_ops *ops = dev->netdev_ops; |
