From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [patch iproute2 net-next v11 3/4] tc: introduce support for block-handle for filter operations Date: Sat, 20 Jan 2018 10:37:16 +0100 Message-ID: <20180120093716.GE2147@nanopsycho.orion> References: <20180117104657.8605-1-jiri@resnulli.us> <20180117104817.8702-3-jiri@resnulli.us> <2862d2ff-7a9c-cdaf-c3a3-3208b2ea61b3@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, davem@davemloft.net, jhs@mojatatu.com, xiyou.wangcong@gmail.com, mlxsw@mellanox.com, andrew@lunn.ch, vivien.didelot@savoirfairelinux.com, f.fainelli@gmail.com, michael.chan@broadcom.com, ganeshgr@chelsio.com, saeedm@mellanox.com, matanb@mellanox.com, leonro@mellanox.com, idosch@mellanox.com, jakub.kicinski@netronome.com, simon.horman@netronome.com, pieter.jansenvanvuuren@netronome.com, john.hurley@netronome.com, alexander.h.duyck@intel.com, ogerlitz@mellanox.com, john.fastabend@gmail.com, daniel@iogearbox.net To: David Ahern Return-path: Received: from mail-wr0-f193.google.com ([209.85.128.193]:39184 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751055AbeATJhS (ORCPT ); Sat, 20 Jan 2018 04:37:18 -0500 Received: by mail-wr0-f193.google.com with SMTP id z48so3691740wrz.6 for ; Sat, 20 Jan 2018 01:37:17 -0800 (PST) Content-Disposition: inline In-Reply-To: <2862d2ff-7a9c-cdaf-c3a3-3208b2ea61b3@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: Fri, Jan 19, 2018 at 09:51:22PM CET, dsahern@gmail.com wrote: >On 1/17/18 2:48 AM, Jiri Pirko wrote: >> @@ -89,7 +93,21 @@ static int tc_filter_modify(int cmd, unsigned int flags, int argc, char **argv, >> NEXT_ARG(); >> if (d[0]) >> duparg("dev", *argv); >> + if (block_index) { >> + fprintf(stderr, "Error: \"dev\" cannot be used in the same time as \"block\"\n"); > >'in the same time' does not sound right. something like: 'dev and block >are mutually exlusive' ack > >> + return -1; >> + } >> strncpy(d, *argv, sizeof(d)-1); >> + } else if (matches(*argv, "block") == 0) { >> + NEXT_ARG(); >> + if (block_index) >> + duparg("block", *argv); >> + if (d[0]) { >> + fprintf(stderr, "Error: \"block\" cannot be used in the same time as \"dev\"\n"); > >same here. Correct the ones below as well. ack > > >> + return -1; >> + } >> + if (get_u32(&block_index, *argv, 0) || !block_index) >> + invarg("invalid block index value", *argv);