提交 b5de82f3 编写于 作者: P Petr Machata 提交者: David S. Miller

mlxsw: spectrum_span: Change LAG lower selection

When offloading mirror-to-gretap, mlxsw needs to preroute the path that
the encapsulated packet will take. That path may include a LAG device
above a front panel port. So far, mlxsw resolved the path to the first
up front panel slave of the LAG interface, but that only reflects
administrative state of the port. It neglects to consider whether the
port actually has a carrier, and what the LACP state is.

So instead of checking upness of the device, check carrier state and
txability.
Signed-off-by: NPetr Machata <petrm@mellanox.com>
Reviewed-by: NJiri Pirko <jiri@mellanox.com>
Signed-off-by: NIdo Schimmel <idosch@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 eeed992b
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <linux/list.h> #include <linux/list.h>
#include <net/arp.h> #include <net/arp.h>
#include <net/gre.h> #include <net/gre.h>
#include <net/lag.h>
#include <net/ndisc.h> #include <net/ndisc.h>
#include <net/ip6_tunnel.h> #include <net/ip6_tunnel.h>
...@@ -254,7 +255,9 @@ mlxsw_sp_span_entry_lag(struct net_device *lag_dev) ...@@ -254,7 +255,9 @@ mlxsw_sp_span_entry_lag(struct net_device *lag_dev)
struct list_head *iter; struct list_head *iter;
netdev_for_each_lower_dev(lag_dev, dev, iter) netdev_for_each_lower_dev(lag_dev, dev, iter)
if ((dev->flags & IFF_UP) && mlxsw_sp_port_dev_check(dev)) if (netif_carrier_ok(dev) &&
net_lag_port_dev_txable(dev) &&
mlxsw_sp_port_dev_check(dev))
return dev; return dev;
return NULL; return NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册