From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f49.google.com ([209.85.215.49]:36213 "EHLO mail-lf0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751095AbeBYMHR (ORCPT ); Sun, 25 Feb 2018 07:07:17 -0500 Received: by mail-lf0-f49.google.com with SMTP id t79so18357337lfe.3 for ; Sun, 25 Feb 2018 04:07:17 -0800 (PST) Subject: Re: [PATCH iproute2-next v3 2/8] iplink: Correctly report error when network device isn't found To: David Ahern , netdev@vger.kernel.org References: <1519304526-18848-1-git-send-email-serhe.popovych@gmail.com> <1519304526-18848-3-git-send-email-serhe.popovych@gmail.com> From: Serhey Popovych Message-ID: <7e10e648-cb50-4e0c-a4fb-b672eda0db0c@gmail.com> Date: Sun, 25 Feb 2018 14:07:08 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="P0V6WOCsoofOhjKQUUD1p3BdLNjOO1fBa" Sender: netdev-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --P0V6WOCsoofOhjKQUUD1p3BdLNjOO1fBa Content-Type: multipart/mixed; boundary="lNtBSkgtQqTcF2rkX0mvhaDr1Ydin91j0"; protected-headers="v1" From: Serhey Popovych To: David Ahern , netdev@vger.kernel.org Message-ID: <7e10e648-cb50-4e0c-a4fb-b672eda0db0c@gmail.com> Subject: Re: [PATCH iproute2-next v3 2/8] iplink: Correctly report error when network device isn't found References: <1519304526-18848-1-git-send-email-serhe.popovych@gmail.com> <1519304526-18848-3-git-send-email-serhe.popovych@gmail.com> In-Reply-To: --lNtBSkgtQqTcF2rkX0mvhaDr1Ydin91j0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable David Ahern wrote: > On 2/22/18 6:02 AM, Serhey Popovych wrote: >> @@ -650,6 +658,9 @@ int iplink_parse(int argc, char **argv, struct ipl= ink_req *req, >> bool drv =3D strcmp(*argv, "xdpdrv") =3D=3D 0; >> bool offload =3D strcmp(*argv, "xdpoffload") =3D=3D 0; >> =20 >> + if (offload) >> + has_dev(*dev, dev_index); >> + >=20 > I think this is actually the wrong direction. seems to me argv should b= e > passed to xdp_parse rather than the generic, drv, offload bool's. That > function can then the check on which option it is and has the knowledge= > about whether a device is needed or not. Okay, I probably will prepare another change instead that accounts your suggestions. Will add it to v4 later. >=20 >=20 >> NEXT_ARG(); >> if (xdp_parse(&argc, &argv, req, dev_index, >> generic, drv, offload)) --lNtBSkgtQqTcF2rkX0mvhaDr1Ydin91j0-- --P0V6WOCsoofOhjKQUUD1p3BdLNjOO1fBa 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) iQEcBAEBAgAGBQJakqbxAAoJEBTawMmQ61bBEtwH/AnTZ7KENZ9HpWG9/1cKMqm0 PiL6jlzgS4j2NWAfBRDikhfEnI7nhXgq7kWId/w0swPYXpAfyH26MwiI9MaSEiZS ccYlFAgA22RCucpLro15bC56EagJeKf2QL/5dEEbncUccoiE8dIYMdLdqzTwFajn 2QI3QeCSQk+ktSJFbNUV7OpjpuQOa1KrOd2T4GoKHk+E0TkpFY0p/Xb9rgD8LpjK bPErWnD6tQ11kJ/BXx65omF7JV085BN+wQNcm/J4WIUmosiesOoJmZOx69Q6bXOE lftgiVfHYM1p6GkW7OcOurJhUoFTXk8Njxu7RkZy4udMQaXrX8dKS1mEFCISmnI= =fc2y -----END PGP SIGNATURE----- --P0V6WOCsoofOhjKQUUD1p3BdLNjOO1fBa--