]> git.baikalelectronics.ru Git - kernel.git/commit
net: Fix bridge enslavement failure
authorIdo Schimmel <idosch@nvidia.com>
Thu, 10 Sep 2020 11:01:26 +0000 (14:01 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Sep 2020 22:06:48 +0000 (15:06 -0700)
commit8fd8661013ff02315cc41601596c1609f21c10fd
tree8cf0e971d1b6760c02115f8d2a753d19b3e78206
parentd688d59b0e3b9fbd8f65fe0edc789aae361a8d5c
net: Fix bridge enslavement failure

When a netdev is enslaved to a bridge, its parent identifier is queried.
This is done so that packets that were already forwarded in hardware
will not be forwarded again by the bridge device between netdevs
belonging to the same hardware instance.

The operation fails when the netdev is an upper of netdevs with
different parent identifiers.

Instead of failing the enslavement, have dev_get_port_parent_id() return
'-EOPNOTSUPP' which will signal the bridge to skip the query operation.
Other callers of the function are not affected by this change.

Fixes: 9b9719137104 ("net: devlink: introduce devlink_compat_switch_id_get() helper")
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reported-by: Vasundhara Volam <vasundhara-v.volam@broadcom.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c