]> git.proxmox.com Git - mirror_iproute2.git/commit
devlink: support kernel-side snapshot id allocation
authorJakub Kicinski <kuba@kernel.org>
Tue, 5 May 2020 17:04:57 +0000 (10:04 -0700)
committerDavid Ahern <dsahern@gmail.com>
Tue, 5 May 2020 17:10:27 +0000 (17:10 +0000)
commitec04b6fc241b183e550b41831ecd1ff5d720f510
tree46fc51b79a3bc13b94cc18e8bf67206cd19bbc0f
parent8c109059b58f57ee3a3aada209df2d022158b939
devlink: support kernel-side snapshot id allocation

Make ID argument optional and read the snapshot info
that kernel sends us.

$ devlink region new netdevsim/netdevsim1/dummy
netdevsim/netdevsim1/dummy: snapshot 0
$ devlink -jp region new netdevsim/netdevsim1/dummy
{
    "regions": {
        "netdevsim/netdevsim1/dummy": {
            "snapshot": [ 1 ]
        }
    }
}
$ devlink region show netdevsim/netdevsim1/dummy
netdevsim/netdevsim1/dummy: size 32768 snapshot [0 1]

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
devlink/devlink.c