From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f68.google.com ([209.85.215.68]:42096 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750752AbeBUHOr (ORCPT ); Wed, 21 Feb 2018 02:14:47 -0500 Received: by mail-lf0-f68.google.com with SMTP id t204so908445lff.9 for ; Tue, 20 Feb 2018 23:14:46 -0800 (PST) Subject: Re: [PATCH iproute2-next v2 2/7] iplink: Correctly report error when network device isn't found To: David Ahern , netdev@vger.kernel.org References: <1519162649-22449-1-git-send-email-serhe.popovych@gmail.com> <1519162649-22449-3-git-send-email-serhe.popovych@gmail.com> From: Serhey Popovych Message-ID: <181dbb5d-488b-eff7-6e18-d064660b26f9@gmail.com> Date: Wed, 21 Feb 2018 09:14:38 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="x6Keihw3RvcgshRK4uoNTEVuh4QPpwwul" Sender: netdev-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --x6Keihw3RvcgshRK4uoNTEVuh4QPpwwul Content-Type: multipart/mixed; boundary="Yexw94P4MBmARw0JulBnxf2yaVN3rDAed"; protected-headers="v1" From: Serhey Popovych To: David Ahern , netdev@vger.kernel.org Message-ID: <181dbb5d-488b-eff7-6e18-d064660b26f9@gmail.com> Subject: Re: [PATCH iproute2-next v2 2/7] iplink: Correctly report error when network device isn't found References: <1519162649-22449-1-git-send-email-serhe.popovych@gmail.com> <1519162649-22449-3-git-send-email-serhe.popovych@gmail.com> In-Reply-To: --Yexw94P4MBmARw0JulBnxf2yaVN3rDAed Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable David Ahern wrote: > On 2/20/18 2:37 PM, Serhey Popovych wrote: >> Distinguish cases when "dev" parameter isn't given from cases where no= >> network device corresponding to "dev" is found. >> >> Do not check for index validity in xdp_parse(): caller should take car= e >> of this because has more information (e.g. when "dev" is given or not >> found) for this. >> >> Signed-off-by: Serhey Popovych >> --- >> ip/iplink.c | 16 +++++++++++++--- >> ip/iplink_xdp.c | 7 +------ >> 2 files changed, 14 insertions(+), 9 deletions(-) >> >=20 > don't really see any benefit from this one. This clearly shows to user what is wrong with it's command line: either dev/name is missing while parsing VF/XDP or it specifies non existent network device (or at least ll_name_to_index() can't resolve it). Moving ifindex check from xdp_parse() to the caller is done to consolidate all dev/name parsing and validating code in single place: iplink_parse(). >=20 --Yexw94P4MBmARw0JulBnxf2yaVN3rDAed-- --x6Keihw3RvcgshRK4uoNTEVuh4QPpwwul Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAEBAgAGBQJajRxjAAoJEBTawMmQ61bBCs8H/2NNTaTvQ7N22U41h4Q6ijGs OAC+8PZsmyXZ5e/spuYFta5hbgZc+9XrG0UCx8E1lEMelHr+DMv/EwT+m39B9jwx KXjxGHkD2khqXJAtyKxfk3NnG1EFrxTCqp+KPvtYtK51Uu+ePM53AVM3hkkt0Imv 56OqMEbaszmSeSXZDLMgY5CxwHRRjficigL3Rrfo4gqnTbD9EV8eNLJPv5sFePl4 52646qPHu+qB7sqKCIAC/PyGV8HEzxUSZQgHN1NLko+28F+ptqAz/FPbUcTmP0Mj XxsCELd++Iv3Lv8aq3Pws6e6CRTKdS8aRmIYyhthrRG0/ok5gNE2WKU3Lqo0GDQ= =M8Yl -----END PGP SIGNATURE----- --x6Keihw3RvcgshRK4uoNTEVuh4QPpwwul--