diff options
author | Andrew Lunn <andrew@lunn.ch> | 2020-09-18 22:11:04 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-09-19 04:17:45 +0300 |
commit | 97c82c23135187878acea76bc5f0b03007e17ac7 (patch) | |
tree | 1a5da44be3f0c30ed47347a31d7c5bc1ed227ecf /net/dsa | |
parent | ccc3e6b0191c58784c4b4ffc735f81970df33a11 (diff) | |
download | linux-97c82c23135187878acea76bc5f0b03007e17ac7.tar.xz |
net: dsa: Add devlink regions support to DSA
Allow DSA drivers to make use of devlink regions, via simple wrappers.
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
-rw-r--r-- | net/dsa/dsa.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index 9b7019d86165..5c18c0214aac 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c @@ -404,6 +404,22 @@ void dsa_devlink_resource_occ_get_unregister(struct dsa_switch *ds, } EXPORT_SYMBOL_GPL(dsa_devlink_resource_occ_get_unregister); +struct devlink_region * +dsa_devlink_region_create(struct dsa_switch *ds, + const struct devlink_region_ops *ops, + u32 region_max_snapshots, u64 region_size) +{ + return devlink_region_create(ds->devlink, ops, region_max_snapshots, + region_size); +} +EXPORT_SYMBOL_GPL(dsa_devlink_region_create); + +void dsa_devlink_region_destroy(struct devlink_region *region) +{ + devlink_region_destroy(region); +} +EXPORT_SYMBOL_GPL(dsa_devlink_region_destroy); + struct dsa_port *dsa_port_from_netdev(struct net_device *netdev) { if (!netdev || !dsa_slave_dev_check(netdev)) |