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: Fri, 10 Nov 2017 08:57:27 +0200 Message-ID: <20171110065727.GM18825@mtr-leonro.local> References: <20171110062014.2693-1-ivecera@redhat.com> <20171110062014.2693-3-ivecera@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6jDZ2N1G6US2iTyc" Cc: netdev@vger.kernel.org, jiri@mellanox.com, arkadis@mellanox.com To: Ivan Vecera Return-path: Received: from mail.kernel.org ([198.145.29.99]:44134 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750800AbdKJG5f (ORCPT ); Fri, 10 Nov 2017 01:57:35 -0500 Content-Disposition: inline In-Reply-To: <20171110062014.2693-3-ivecera@redhat.com> Sender: netdev-owner@vger.kernel.org List-ID: --6jDZ2N1G6US2iTyc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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. > + > +.TP > +.BR "\-force" > +Don't terminate devlink on errors in batch mode. > +If there were any errors during execution of the commands, the application return code will be non zero. > + > +.TP > .BR "\-n" , " --no-nice-names" > Turn off printing out nice names, for example netdevice ifnames instead of devlink port identification. > > -- > 2.13.6 > --6jDZ2N1G6US2iTyc Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEkhr/r4Op1/04yqaB5GN7iDZyWKcFAloFTdcACgkQ5GN7iDZy WKd4FQ//Yu6Cpond5ia4aYmyP4w4eeoX7p0lmsOykskMwSxTUNy3Cp5WmqaJPzLh TMEkEG4Gle0LH+7Q3mJX796clwJxb3WxMht3v8fhzqHdGYfBSvPMRJM3Y2EsusSm bSZRG6mA1D3ZbWZFqT4UvyMtyh5pybf2njaqxuPVP5SpuEuJcGdcJdSQtvQYRH8V zuDLtOH7msCY2PMlX8aDTGxmwHNpewYqKo4tJDElkL3oSA1n0mC/QmPqKveQtlCB aB0PZcL79aMC/4RWKi5dPier4XHnbDzT2nYo2LcbprEu0kv94aqGu439UGb03vTB nVh4ozwEbPEbaKg+mdqigsYm0lUnkexynbKUK31sSC93AsTXPyuwnRUSGhdczXAh jzjnlA+Vq8YrUWn8cntbftqY62rdQpp608ZIEvl7gPiYiGmnwrC5dBkxzyeFZHTb X/9P5RuE+wXcgJ0ib0lrhVsFtYVyd6dJYKQ29nS205V8+V0ewjQ97wVpppYNJvDo ltkSloeRuvx/iqn57/Ee4M/+tuK+r7l0B2gU13qibJZq6DWoc5Rg5G9LRT3/mVpH byV83sdIKJJ7VuifJrOazlEb3bpmqdsgUNV6CBqD/q3qrtvhi76pf+GPzRUdxDUp Z7Nsg3Y3VY/7tGgrp5ydymxLjZMccutgocbzHBmtlkZntARIMFA= =+glf -----END PGP SIGNATURE----- --6jDZ2N1G6US2iTyc--