netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2] devlink: require resource parameters
@ 2019-11-05 21:13 Jakub Kicinski
  2019-11-06  8:12 ` Jiri Pirko
  2019-11-08  4:38 ` Stephen Hemminger
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Kicinski @ 2019-11-05 21:13 UTC (permalink / raw)
  To: stephen
  Cc: dsahern, oss-drivers, netdev, Jakub Kicinski, Jiri Pirko,
	Arkadi Sharshevsky

If devlink resource set parameters are not provided it crashes:
$ devlink resource set netdevsim/netdevsim0
Segmentation fault (core dumped)

This is because even though DL_OPT_RESOURCE_PATH and
DL_OPT_RESOURCE_SIZE are passed as o_required, the validation
table doesn't contain a relevant string.

Fixes: 8cd644095842 ("devlink: Add support for devlink resource abstraction")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
--
CC: Jiri Pirko <jiri@mellanox.com>
CC: Arkadi Sharshevsky <arkadis@mellanox.com>
---
 devlink/devlink.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/devlink/devlink.c b/devlink/devlink.c
index 5bbe0bddd910..056ac95ee726 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -1121,6 +1121,8 @@ static const struct dl_args_metadata dl_args_required[] = {
 	{DL_OPT_DPIPE_TABLE_NAME,     "Dpipe table name expected."},
 	{DL_OPT_DPIPE_TABLE_COUNTERS, "Dpipe table counter state expected."},
 	{DL_OPT_ESWITCH_ENCAP_MODE,   "E-Switch encapsulation option expected."},
+	{DL_OPT_RESOURCE_PATH,	      "Resource path expected."},
+	{DL_OPT_RESOURCE_SIZE,	      "Resource size expected."},
 	{DL_OPT_PARAM_NAME,	      "Parameter name expected."},
 	{DL_OPT_PARAM_VALUE,	      "Value to set expected."},
 	{DL_OPT_PARAM_CMODE,	      "Configuration mode expected."},
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-08  4:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-05 21:13 [PATCH iproute2] devlink: require resource parameters Jakub Kicinski
2019-11-06  8:12 ` Jiri Pirko
2019-11-08  4:38 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).