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=-1.0 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS 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 675A9C10F11 for ; Wed, 10 Apr 2019 17:00:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 292492083E for ; Wed, 10 Apr 2019 17:00:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=netronome-com.20150623.gappssmtp.com header.i=@netronome-com.20150623.gappssmtp.com header.b="x+je8iiF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727381AbfDJRAT (ORCPT ); Wed, 10 Apr 2019 13:00:19 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:38058 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727338AbfDJRAT (ORCPT ); Wed, 10 Apr 2019 13:00:19 -0400 Received: by mail-qk1-f193.google.com with SMTP id g1so1669895qki.5 for ; Wed, 10 Apr 2019 10:00:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=5eHlkRNUQ4LuAgDoaXf3iiZiqG2floQCrk9wybMFFvo=; b=x+je8iiF+lx6pp37N+0NSjRcSkLioKH/OudiZ4tZ0Z8pX4WI3/qTAKw8hweQPLI6W+ KJoqnJ6NF0S1JCAF44i3UhVToPBgtnYxOJjIsZGfB7yYAe70zmv2CIM/++WkDjx2HVYd 7a2rrH+xmN6BBrpmwwYCuUSFJAVEFy2oLR/FJ3uAKQS2cHgBAAktQ6vLJuzGDeUtbXnS 2bmWptCCW/m4zrYQLuErWppAEJyJ4oi8d5IlN0hhdVgZ3syuWxmjOagpAi1fgHUsCazA a4PxhfyVObfdgx+ktcc+Q//vrLNM5rQlLomK2kXD2Qv/njIVdRSBOapk4LUqfQzl8Mfs sz9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=5eHlkRNUQ4LuAgDoaXf3iiZiqG2floQCrk9wybMFFvo=; b=LUd0MR8H2Uul5BRXPCDQorkMRsj5PsPptLUNrZbWfWvQ0/eXOdqGkOitVHrCou6rs4 Jqoq4ADWUxFQaUddHcpbiRGtMgGAGSJRjUvechr8dfOPVIVkb9+k/5oyVbdgU8Cb9RhH J++1TQ0nRAMN5hvq8403nvbkNbP5BziTJ7b7ConqkSZf4cEHEkNZM/1d4cbAUhu6tJfy cKqptedBmTEPZPzQox7zhRsGT8zUxo59rmIx1sZOWTy1E1pST/mcvuBHfOe01ry6DSl1 SAZr+1vhAHKV9PxTrkamW4DYeYToLJ3avMPC3xNiGVLvVdTuZX082T4jJZv1GdAVu6q4 ZKTg== X-Gm-Message-State: APjAAAXl+lLhTUkJh7FZwjTizru6w4CypqNn2VTLovQ5LuvXlhp7zBRO HG9wkl6+uyJek95I3W/fnHQiVw== X-Google-Smtp-Source: APXvYqw4DyLjOu1DukZhMcpXzuIDyD4wtzYMLO9fhEqVstqkxslFXw5YBiisiFUMB6l/kzipTZ0M0Q== X-Received: by 2002:a37:9e0d:: with SMTP id h13mr34864351qke.135.1554915618646; Wed, 10 Apr 2019 10:00:18 -0700 (PDT) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id m189sm21302615qkf.2.2019.04.10.10.00.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Apr 2019 10:00:18 -0700 (PDT) Date: Wed, 10 Apr 2019 10:00:14 -0700 From: Jakub Kicinski To: Vlad Buslov Cc: "netdev@vger.kernel.org" , "jhs@mojatatu.com" , "xiyou.wangcong@gmail.com" , "jiri@resnulli.us" , "davem@davemloft.net" , "john.hurley@netronome.com" Subject: Re: [PATCH net-next] net: sched: flower: insert filter to ht before offloading it to hw Message-ID: <20190410100014.784a7f9a@cakuba.netronome.com> In-Reply-To: References: <20190405175626.4123-1-vladbu@mellanox.com> <20190408152655.1891ee77@cakuba.netronome.com> <20190409101023.4fe0ad04@cakuba.netronome.com> <20190410084830.378b37fa@cakuba.netronome.com> <20190410090905.248bf773@cakuba.netronome.com> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, 10 Apr 2019 16:26:38 +0000, Vlad Buslov wrote: > >> Actually, I intended to modify fl_reoffload() to ignore filters with > >> 'deleted' flag set when adding, but I guess reusing 'reoffload_count' to > >> retry fl_hw_destroy_filter() would also work. > > > > Yeah, I don't see how you can ignore deleted safely. Perhaps lack of > > coffee :) > > Well, drivers are supposed to account for double deletion or deletion of > filters that were not successfully offloaded to them. If filter is not > marked as skip_sw, its creation will succeed even if hw callbacks have > failed, but __fl_delete() still calls fl_hw_destroy_filter() on such > filters. The main thing is that we must guarantee that code doesn't > delete a new filter with same key. However, in case of flower classifier > 'cookie' is pointer to filter, and filter is freed only when last > reference to it is released, so code is safe in this regard. > > So I guess there is nothing wrong with reoffload calling cb() > on all classifier filters (including marked as 'deleted'), if delete > code doesn't miss any of the callbacks afterwards. Yup. Plus multiple/spurious deletes are already a fact of life, since we don't keep track of which callback accepted the filter and which didn't.