Commit 043b3e2
devlink: let kernel allocate region snapshot id
Currently users have to choose a free snapshot id before
calling DEVLINK_CMD_REGION_NEW. This is potentially racy
and inconvenient.
Make the DEVLINK_ATTR_REGION_SNAPSHOT_ID optional and try
to allocate id automatically. Send a message back to the
caller with the snapshot info.
Example use:
$ devlink region new netdevsim/netdevsim1/dummy
netdevsim/netdevsim1/dummy: snapshot 1
$ id=$(devlink -j region new netdevsim/netdevsim1/dummy | \
jq '.[][][][]')
$ devlink region dump netdevsim/netdevsim1/dummy snapshot $id
[...]
$ devlink region del netdevsim/netdevsim1/dummy snapshot $id
v4:
- inline the notification code
v3:
- send the notification only once snapshot creation completed.
v2:
- don't wrap the line containing extack;
- add a few sentences to the docs.
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent dd86fec commit 043b3e2
File tree
3 files changed
+62
-15
lines changed- Documentation/networking/devlink
- net/core
- tools/testing/selftests/drivers/net/netdevsim
3 files changed
+62
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
48 | | - | |
| 50 | + | |
| 51 | + | |
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4086 | 4086 | | |
4087 | 4087 | | |
4088 | 4088 | | |
| 4089 | + | |
| 4090 | + | |
4089 | 4091 | | |
4090 | 4092 | | |
4091 | 4093 | | |
| |||
4097 | 4099 | | |
4098 | 4100 | | |
4099 | 4101 | | |
4100 | | - | |
4101 | | - | |
4102 | | - | |
4103 | | - | |
4104 | | - | |
4105 | 4102 | | |
4106 | 4103 | | |
4107 | 4104 | | |
| |||
4119 | 4116 | | |
4120 | 4117 | | |
4121 | 4118 | | |
4122 | | - | |
| 4119 | + | |
| 4120 | + | |
| 4121 | + | |
4123 | 4122 | | |
4124 | | - | |
4125 | | - | |
4126 | | - | |
4127 | | - | |
| 4123 | + | |
| 4124 | + | |
| 4125 | + | |
| 4126 | + | |
4128 | 4127 | | |
4129 | | - | |
4130 | | - | |
4131 | | - | |
| 4128 | + | |
| 4129 | + | |
| 4130 | + | |
| 4131 | + | |
| 4132 | + | |
| 4133 | + | |
| 4134 | + | |
| 4135 | + | |
| 4136 | + | |
| 4137 | + | |
4132 | 4138 | | |
4133 | 4139 | | |
4134 | 4140 | | |
| |||
4138 | 4144 | | |
4139 | 4145 | | |
4140 | 4146 | | |
| 4147 | + | |
| 4148 | + | |
| 4149 | + | |
| 4150 | + | |
| 4151 | + | |
| 4152 | + | |
| 4153 | + | |
| 4154 | + | |
| 4155 | + | |
| 4156 | + | |
| 4157 | + | |
| 4158 | + | |
| 4159 | + | |
| 4160 | + | |
| 4161 | + | |
| 4162 | + | |
| 4163 | + | |
| 4164 | + | |
| 4165 | + | |
| 4166 | + | |
| 4167 | + | |
4141 | 4168 | | |
4142 | 4169 | | |
4143 | 4170 | | |
4144 | 4171 | | |
4145 | 4172 | | |
4146 | 4173 | | |
4147 | 4174 | | |
| 4175 | + | |
| 4176 | + | |
| 4177 | + | |
| 4178 | + | |
4148 | 4179 | | |
4149 | 4180 | | |
4150 | 4181 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
154 | 167 | | |
155 | 168 | | |
156 | 169 | | |
| |||
0 commit comments