aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/core
diff options
context:
space:
mode:
authorDanielle Ratson <danieller@mellanox.com>2020-07-09 16:18:15 +0300
committerDavid S. Miller <davem@davemloft.net>2020-07-09 13:15:29 -0700
commit46737a194945e540e3e2eb1fc870207928a9c2eb (patch)
tree60689b2ab9c1323229b9e9a1b3f9d3314a5735bb /net/core
parentdevlink: Move set attribute of devlink_port_attrs to devlink_port (diff)
downloadwireguard-linux-46737a194945e540e3e2eb1fc870207928a9c2eb.tar.xz
wireguard-linux-46737a194945e540e3e2eb1fc870207928a9c2eb.zip
devlink: Move switch_port attribute of devlink_port_attrs to devlink_port
The struct devlink_port_attrs holds the attributes of devlink_port. Similarly to the previous patch, 'switch_port' attribute is another exception. Move 'switch_port' to be devlink_port's field. Signed-off-by: Danielle Ratson <danieller@mellanox.com> Reviewed-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/devlink.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/devlink.c b/net/core/devlink.c
index f28ae63cdb6b..452b2f8a054e 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -7521,13 +7521,13 @@ static int __devlink_port_attrs_set(struct devlink_port *devlink_port,
devlink_port->attrs_set = true;
attrs->flavour = flavour;
if (switch_id) {
- attrs->switch_port = true;
+ devlink_port->switch_port = true;
if (WARN_ON(switch_id_len > MAX_PHYS_ITEM_ID_LEN))
switch_id_len = MAX_PHYS_ITEM_ID_LEN;
memcpy(attrs->switch_id.id, switch_id, switch_id_len);
attrs->switch_id.id_len = switch_id_len;
} else {
- attrs->switch_port = false;
+ devlink_port->switch_port = false;
}
return 0;
}
@@ -9461,7 +9461,7 @@ int devlink_compat_switch_id_get(struct net_device *dev,
* any devlink lock as only permanent values are accessed.
*/
devlink_port = netdev_to_devlink_port(dev);
- if (!devlink_port || !devlink_port->attrs.switch_port)
+ if (!devlink_port || !devlink_port->switch_port)
return -EOPNOTSUPP;
memcpy(ppid, &devlink_port->attrs.switch_id, sizeof(*ppid));