From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47BADC432C0 for ; Tue, 19 Nov 2019 04:36:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1BF9922317 for ; Tue, 19 Nov 2019 04:36:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727597AbfKSEgV (ORCPT ); Mon, 18 Nov 2019 23:36:21 -0500 Received: from stargate.chelsio.com ([12.32.117.8]:27495 "EHLO stargate.chelsio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727217AbfKSEgV (ORCPT ); Mon, 18 Nov 2019 23:36:21 -0500 Received: from localhost (scalar.blr.asicdesigners.com [10.193.185.94]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id xAJ4aBWl022049; Mon, 18 Nov 2019 20:36:12 -0800 Date: Tue, 19 Nov 2019 09:57:56 +0530 From: Rahul Lakkireddy To: Jakub Kicinski Cc: netdev@vger.kernel.org, davem@davemloft.net, nirranjan@chelsio.com, vishal@chelsio.com, dt@chelsio.com Subject: Re: [PATCH net-next v4 2/3] cxgb4: check rule prio conflicts before offload Message-ID: <20191119042754.GA21175@chelsio.com> References: <20191118153606.27aa9863@cakuba.netronome.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191118153606.27aa9863@cakuba.netronome.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Monday, November 11/18/19, 2019 at 15:36:06 -0800, Jakub Kicinski wrote: > Hi Rahul! > > Please remember to CC people who have you feedback to make sure we > don't miss the next version of the set. > Ok, got it. > On Mon, 18 Nov 2019 22:30:18 +0530, Rahul Lakkireddy wrote: > > Only offload rule if it satisfies following conditions: > > 1. The immediate previous rule has priority < current rule's priority. > > 2. The immediate next rule has priority > current rule's priority. > > Hm, the strict comparison here looks suspicious. > > The most common use case for flower is to insert many non-conflicting > rules (different keys) at the same priority. From looking at this > description and the code: > Yes, I had seen this regression in one of my tests and updated the check below to consider equal priority in the equation. But, looks like I missed to update the commit and comment. It should be <= and >=, respectively. Will fix in v5. > + if ((prev_fe->valid && prio < prev_fe->fs.tc_prio) || > + (next_fe->valid && prio > next_fe->fs.tc_prio)) > + valid = false; > > I get the feeling that either you haven't tested flower well or these > ->valid flags are unreliable? > I'm guessing the confusion here is because of my commit message. Let me know if I'm missing something else. Here, the ->valid tells if the rule is active in hardware. If previous entry's prio is greater than current entry's prio OR if next entry's prio is less than current entry, then reject the rule. If current entry's prio is equal, then still consider accepting the rule. > > Also rework free entry fetch logic to search from end of TCAM, instead > > of beginning, because higher indices have lower priority than lower > > indices. This is similar to how TC auto generates priority values. > > > > Signed-off-by: Rahul Lakkireddy > > --- > > v4: > > - Patch added in this version. > > FWIW in the networking world we like the version history to be included > in the commit message, i.e. above the --- lines. It's useful > information. Ok, got it. Thanks, Rahul