From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH iproute2] tc: f_u32: allow skip_hw and skip_sw flags to be last Date: Fri, 9 Nov 2018 08:13:04 -0800 Message-ID: <20181109081304.09e0d040@xeon-e3> References: <20181106032327.9470-1-jakub.kicinski@netronome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dsahern@gmail.com, netdev@vger.kernel.org, oss-drivers@netronome.com To: Jakub Kicinski Return-path: Received: from mail-pf1-f193.google.com ([209.85.210.193]:43747 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727784AbeKJByV (ORCPT ); Fri, 9 Nov 2018 20:54:21 -0500 Received: by mail-pf1-f193.google.com with SMTP id g7-v6so1121904pfo.10 for ; Fri, 09 Nov 2018 08:13:07 -0800 (PST) In-Reply-To: <20181106032327.9470-1-jakub.kicinski@netronome.com> Sender: netdev-owner@vger.kernel.org List-ID: On Mon, 5 Nov 2018 19:23:27 -0800 Jakub Kicinski wrote: > u32 uses NEXT_ARG() incorrectly when parsing skip_hw and skip_sw > flags. NEXT_ARG() ensures there is another argument on the command > line, and is used in handling syntax to move past > and ensure there is a to read. > > Commit 5e5b3008d1fb ("tc: f_u32: Add support for skip_hw and skip_sw > flags") seems to have copy pasted the handling from the previous > command - "police", which needs an extra parameter and is kind of > special due to the use of parse_police() helper. > > The combination of NEXT_ARG() and continue worked fine as long as > skip_sw/skip_hw wasn't last, e.g.: > > $ tc filter add dev dummy0 ingress prio 101 protocol ipv6 \ > u32 match ip6 priority 0xa0 0xe0 skip_hw action pass > > But would fail if it was last: > > $ tc filter add dev dummy0 ingress prio 101 protocol ipv6 \ > u32 match ip6 priority 0xa0 0xe0 flowid :1 skip_hw > Command line is not complete. Try option "help" > > Remove the NEXT_ARG()s and the continues, and let the argc--; argv++; > at the end of the loop do its job. > > Fixes: 5e5b3008d1fb ("tc: f_u32: Add support for skip_hw and skip_sw flags") > Signed-off-by: Jakub Kicinski Applied