From: David Miller Subject: Re: [PATCH net] net/sched: cls_u32: fix cls_u32 on filter replace Date: Thu, 08 Feb 2018 15:29:05 -0500 (EST) Message-ID: <20180208.152905.67063167764180003.davem@davemloft.net> References: <20180208151039.11231-1-ivecera@redhat.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, ogerlitz@mellanox.com, jiri@resnulli.us, xiyou.wangcong@gmail.com, jhs@mojatatu.com To: ivecera@redhat.com Return-path: Received: from shards.monkeyblade.net ([184.105.139.130]:49146 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751786AbeBHU3H (ORCPT ); Thu, 8 Feb 2018 15:29:07 -0500 In-Reply-To: <20180208151039.11231-1-ivecera@redhat.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Ivan Vecera Date: Thu, 8 Feb 2018 16:10:39 +0100 > The following sequence is currently broken: > > # tc qdisc add dev foo ingress > # tc filter replace dev foo protocol all ingress \ > u32 match u8 0 0 action mirred egress mirror dev bar1 > # tc filter replace dev foo protocol all ingress \ > handle 800::800 pref 49152 \ > u32 match u8 0 0 action mirred egress mirror dev bar2 > Error: cls_u32: Key node flags do not match passed flags. > We have an error talking to the kernel, -1 > > The error comes from u32_change() when comparing new and > existing flags. The existing ones always contains one of > TCA_CLS_FLAGS_{,NOT}_IN_HW flag depending on offloading state. > These flags cannot be passed from userspace so the condition > (n->flags != flags) in u32_change() always fails. > > Fix the condition so the flags TCA_CLS_FLAGS_NOT_IN_HW and > TCA_CLS_FLAGS_IN_HW are not taken into account. > > Fixes: 24d3dc6d27ea ("net/sched: cls_u32: Reflect HW offload status") > Signed-off-by: Ivan Vecera Ugh, private kernel flags are always troublesome for this reason. Applied and queued up for -stable.