From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f177.google.com ([209.85.192.177]:46103 "EHLO mail-pf0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752083AbeBWXlu (ORCPT ); Fri, 23 Feb 2018 18:41:50 -0500 Received: by mail-pf0-f177.google.com with SMTP id z24so4134985pfh.13 for ; Fri, 23 Feb 2018 15:41:50 -0800 (PST) Subject: Re: [PATCH iproute2-next v3 2/8] iplink: Correctly report error when network device isn't found To: Serhey Popovych , 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: David Ahern Message-ID: Date: Fri, 23 Feb 2018 16:41:47 -0700 MIME-Version: 1.0 In-Reply-To: <1519304526-18848-3-git-send-email-serhe.popovych@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org List-ID: On 2/22/18 6:02 AM, Serhey Popovych wrote: > @@ -650,6 +658,9 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req, > bool drv = strcmp(*argv, "xdpdrv") == 0; > bool offload = strcmp(*argv, "xdpoffload") == 0; > > + if (offload) > + has_dev(*dev, dev_index); > + I think this is actually the wrong direction. seems to me argv should be 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. > NEXT_ARG(); > if (xdp_parse(&argc, &argv, req, dev_index, > generic, drv, offload))