From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leon Romanovsky Subject: Re: [PATCH iproute2 2/2] devlink: add batch command support Date: Mon, 13 Nov 2017 10:59:18 +0200 Message-ID: <20171113085918.GE18825@mtr-leonro.local> References: <20171110062014.2693-1-ivecera@redhat.com> <20171110062014.2693-3-ivecera@redhat.com> <20171110065727.GM18825@mtr-leonro.local> <3c672b8b-d3ca-1d50-c4e1-78a36aae6ed7@redhat.com> <20171110194735.GN18825@mtr-leonro.local> <20171112161650.355a927f@xeon-e3> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="I8PrZ52jkgMwZ8Ef" Cc: Ivan Vecera , netdev@vger.kernel.org, jiri@mellanox.com, arkadis@mellanox.com To: Stephen Hemminger Return-path: Received: from mail.kernel.org ([198.145.29.99]:55724 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751891AbdKMI7W (ORCPT ); Mon, 13 Nov 2017 03:59:22 -0500 Content-Disposition: inline In-Reply-To: <20171112161650.355a927f@xeon-e3> Sender: netdev-owner@vger.kernel.org List-ID: --I8PrZ52jkgMwZ8Ef Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Nov 12, 2017 at 04:16:50PM -0800, Stephen Hemminger wrote: > On Fri, 10 Nov 2017 21:47:35 +0200 > Leon Romanovsky wrote: > > > On Fri, Nov 10, 2017 at 08:10:43AM +0100, Ivan Vecera wrote: > > > On 10.11.2017 07:57, Leon Romanovsky wrote: > > > > On Fri, Nov 10, 2017 at 07:20:14AM +0100, Ivan Vecera wrote: > > > >> The patch adds support to batch devlink commands. > > > >> > > > >> Cc: Jiri Pirko > > > >> Cc: Arkadi Sharshevsky > > > >> Signed-off-by: Ivan Vecera > > > >> --- > > > >> devlink/devlink.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++------- > > > >> man/man8/devlink.8 | 16 +++++++++++++ > > > >> 2 files changed, 78 insertions(+), 8 deletions(-) > > > >> > > > > > > > > <..> > > > > > > > >> diff --git a/man/man8/devlink.8 b/man/man8/devlink.8 > > > >> index a480766c..a975ef34 100644 > > > >> --- a/man/man8/devlink.8 > > > >> +++ b/man/man8/devlink.8 > > > >> @@ -12,6 +12,12 @@ devlink \- Devlink tool > > > >> .sp > > > >> > > > >> .ti -8 > > > >> +.B devlink > > > >> +.RB "[ " -force " ] " > > > >> +.BI "-batch " filename > > > >> +.sp > > > >> + > > > >> +.ti -8 > > > >> .IR OBJECT " := { " > > > >> .BR dev " | " port " | " monitor " }" > > > >> .sp > > > >> @@ -32,6 +38,16 @@ Print the version of the > > > >> utility and exit. > > > >> > > > >> .TP > > > >> +.BR "\-b", " \-batch " > > > >> +Read commands from provided file or standard input and invoke them. > > > >> +First failure will cause termination of devlink. > > > > > > > > It is worth to document the expected format of that file. > > > > And IMHO, it is better to have ability to load JSON fie which was > > > > generated by -j, instead of declaring new format/knob. > > > It's just a list of command-lines... like other utils (bridge,ip...) > > > > I'm implementing similar thing in RDMAtool (part of iproute2) and choose JSON > > approach, it is more user and script friendly. > > > > If you want to do batch form rdmatool then it must take list of commands by default. > An additional option to take json input "rdmatool -j --batch..." would be good as well. > I'll do. Thanks > --I8PrZ52jkgMwZ8Ef Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEkhr/r4Op1/04yqaB5GN7iDZyWKcFAloJXuYACgkQ5GN7iDZy WKctNQ/+M5hTIQmmxt7NarIS56lxC128Pz/sJR7lVYGoDRqYA2AhbbdMxeAx0EZP SDPXDvGQF8o/4Lsy/WL4/Q75e2O9Q1diemogyxMl8JeGdi/wC2z3Jniw1ROWOfxE oV8/X3xa08DjmyW1qjq6QyvK+XQUowzR/uKXKWBaDZluJ5/lrzCLD9QKFlWVb4V6 +3kSfaTaVnxhBHfU/RZ2ytDrlOyjzFlEVvllKnH1WEq95ez4V9xo8CSW0mSMzuRy xqiKJmr6FMehMUaZU7oW/5/A0CWsJd7TuVMMcTG3f8tzI+iL9buebFA7zaCAJE6L VP2v52KvqxZhrdCGfBMOAACzYc3wZWpXlVapll8jj0CpIHxBuYIYLlB3+YwQtnB6 hwOidejTY3sBWNMY6/t5Qt/kjL3hRjDYU96XiT5d8mjddUNKMSc1zAr6yokR4adp iL0krhBW3i9SWHaBOgClV8HMo6aewkv/1LfRw+YdEbyRReafwbnNyB4qyr+6UOJ3 Cdvb4413mGHZF27+QwdkPfLgRU3foE4BRSSAgzH2gBvZBu9ZpCjcB9IoFrdWXSTH m2LT0XgO2OQpz525SvukyVZ9Z0XmMN1wYJJB99/WqFSZLh5OXCGy58oUgU0W7CzE AUq+JIIZXioAF0ct+VHTzph9J8PpwFK03ke4hDiDeLL3q66sd78= =ZPsZ -----END PGP SIGNATURE----- --I8PrZ52jkgMwZ8Ef--