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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 22A9CC432C3 for ; Thu, 14 Nov 2019 13:30:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 06F5D20715 for ; Thu, 14 Nov 2019 13:30:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727021AbfKNNaD (ORCPT ); Thu, 14 Nov 2019 08:30:03 -0500 Received: from stargate.chelsio.com ([12.32.117.8]:48650 "EHLO stargate.chelsio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726139AbfKNNaD (ORCPT ); Thu, 14 Nov 2019 08:30:03 -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 xAEDTt9T014762; Thu, 14 Nov 2019 05:29:56 -0800 Date: Thu, 14 Nov 2019 18:51:44 +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 2/2] cxgb4: add TC-MATCHALL classifier ingress offload Message-ID: <20191114132143.GB12021@chelsio.com> References: <20191113191610.0974298f@cakuba> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191113191610.0974298f@cakuba> 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 Wednesday, November 11/13/19, 2019 at 19:16:10 -0800, Jakub Kicinski wrote: > On Wed, 13 Nov 2019 20:09:21 +0530, Rahul Lakkireddy wrote: > > +static int cxgb4_matchall_alloc_filter(struct net_device *dev, > > + struct tc_cls_matchall_offload *cls) > > +{ > > + struct cxgb4_tc_port_matchall *tc_port_matchall; > > + struct port_info *pi = netdev2pinfo(dev); > > + struct adapter *adap = netdev2adap(dev); > > + struct ch_filter_specification *fs; > > + int ret, fidx; > > + > > + /* Since the rules with lower indices have higher priority, place > > + * MATCHALL rule at the highest free index of the TCAM because > > + * MATCHALL is usually not a high priority filter and is generally > > + * used as a last rule, if all other rules fail. > > + */ > > The rule ordering in HW must match the ordering in the kernel. > Ok. Will maintain the same ordering as in kernel in v2. > > + fidx = cxgb4_get_last_free_ftid(dev); > > + if (fidx < 0) > > + return -ENOMEM; > Thanks, Rahul