From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [net-next PATCH v3] net: sched: cls_flower: Classify packets using port ranges Date: Sat, 10 Nov 2018 08:14:58 +0100 Message-ID: <20181110071458.GA2019@nanopsycho.orion> References: <154180867008.52041.3062211283036334314.stgit@anamhost.jf.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, davem@davemloft.net, jakub.kicinski@netronome.com, sridhar.samudrala@intel.com, jhs@mojatatu.com, xiyou.wangcong@gmail.com To: Amritha Nambiar Return-path: Received: from mail-wr1-f67.google.com ([209.85.221.67]:45369 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728659AbeKJRFY (ORCPT ); Sat, 10 Nov 2018 12:05:24 -0500 Received: by mail-wr1-f67.google.com with SMTP id k15-v6so4058934wre.12 for ; Fri, 09 Nov 2018 23:21:24 -0800 (PST) Content-Disposition: inline In-Reply-To: <154180867008.52041.3062211283036334314.stgit@anamhost.jf.intel.com> Sender: netdev-owner@vger.kernel.org List-ID: Sat, Nov 10, 2018 at 01:11:10AM CET, amritha.nambiar@intel.com wrote: [...] >@@ -1026,8 +1122,7 @@ static void fl_init_dissector(struct flow_dissector *dissector, > FLOW_DISSECTOR_KEY_IPV4_ADDRS, ipv4); > FL_KEY_SET_IF_MASKED(mask, keys, cnt, > FLOW_DISSECTOR_KEY_IPV6_ADDRS, ipv6); >- FL_KEY_SET_IF_MASKED(mask, keys, cnt, >- FLOW_DISSECTOR_KEY_PORTS, tp); >+ FL_KEY_SET(keys, cnt, FLOW_DISSECTOR_KEY_PORTS, tp); You still need to set the key under a condition. Something like: if (FL_KEY_IS_MASKED(mask, tp) || FL_KEY_IS_MASKED(mask, tp_min) || FL_KEY_IS_MASKED(mask, tp_max) FL_KEY_SET(keys, cnt, FLOW_DISSECTOR_KEY_PORTS, tp); > FL_KEY_SET_IF_MASKED(mask, keys, cnt, > FLOW_DISSECTOR_KEY_IP, ip); > FL_KEY_SET_IF_MASKED(mask, keys, cnt, [...]