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 215EDC282DA for ; Tue, 16 Apr 2019 21:49:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E6D2220880 for ; Tue, 16 Apr 2019 21:49:40 +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="i1Cs1pYX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730516AbfDPVtk (ORCPT ); Tue, 16 Apr 2019 17:49:40 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:41725 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727942AbfDPVtj (ORCPT ); Tue, 16 Apr 2019 17:49:39 -0400 Received: by mail-qt1-f196.google.com with SMTP id w30so25126410qta.8 for ; Tue, 16 Apr 2019 14:49:38 -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=6r3KLlXHGneGfzAlo2z4CY0VJOI8OeYTB+FoIDKoUQo=; b=i1Cs1pYXgdrBTJkp95Yo4g/blQ6ukRELRsToccJx68p8ccL/O925zCPtRcm9Tt963D q2XWdkFwxo+b8oe0wI/EfcnXGLvR3uSmrpBHUof5ubwlMpl7PslkXA8Y6P81teC74kko x4fXA3WWzSaD7R9WxD++WcZqW/H0PMgX8RL8bXmjsVN59fyDCeC9A6ypZEBEV4oY4tfi BjgOdzYmH814OjERISYsAjVZuQOvejUs/EZB+dHEhfnE3kvCWSLmGHa31/gzSZWjL4j/ egsCikll3UPm2YTQN9nFT4K/KCkraaplgxZocn/RvRXlyBkg6bxVWSlLIgJw7swqldi0 T7dg== 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=6r3KLlXHGneGfzAlo2z4CY0VJOI8OeYTB+FoIDKoUQo=; b=eF/QU92v67RwtRwn1GlpJBd26BAiS9v22G/r2vl9JqBXmunSLqMCzQqL0SDQYNDGRn rhIQnNTQFtre/kgshBboWSXo0bb4LGQm2d8luyhEphYH/oLSTUSukRayezQ6pwKRgdfo 8tl3lhB3GNxGSWeyU59KHh7Ua3aS0uKTECJ7Sd/8fzVSxTA6CXIn57O829tEoQdN3Ttj s5QDitfShXLPowmOO4119XktJ39f+hoavzV676djzoM/7i+kJNDAR27D/8915GW3tpQt ihtKfsQFizOvAZUmxGGJVl4hUJregJeoxOMoswq0ep49BbISsHihzzAn5OkJ+9ZTArvP Eb0w== X-Gm-Message-State: APjAAAWxtOjpugWANZI42P/YJoe8bersSMY/evqKfhAqtsFSqUq6nxGy l73C6wy0NPO1IND9zpvW//3BYg== X-Google-Smtp-Source: APXvYqxLxYLnnESrk4sGTFXnYVTRd/yhmLnORHcmwAiQNEcNRpKy3he4aZM9vyOFmw++ZEmyNzbr/Q== X-Received: by 2002:ac8:2d13:: with SMTP id n19mr64650486qta.31.1555451378375; Tue, 16 Apr 2019 14:49:38 -0700 (PDT) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id f123sm21130069qkd.63.2019.04.16.14.49.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Apr 2019 14:49:38 -0700 (PDT) Date: Tue, 16 Apr 2019 14:49:33 -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 Subject: Re: [RFC PATCH net-next] net: sched: flower: refactor reoffload for concurrent access Message-ID: <20190416144933.4ddb0e68@cakuba.netronome.com> In-Reply-To: <20190416142047.3453-1-vladbu@mellanox.com> References: <20190410100014.784a7f9a@cakuba.netronome.com> <20190416142047.3453-1-vladbu@mellanox.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 Tue, 16 Apr 2019 17:20:47 +0300, Vlad Buslov wrote: > @@ -1551,6 +1558,10 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, > goto errout_mask; > > if (!tc_skip_hw(fnew->flags)) { > + spin_lock(&tp->lock); > + list_add(&fnew->hw_list, &head->hw_filters); > + spin_unlock(&tp->lock); > + > err = fl_hw_replace_filter(tp, fnew, rtnl_held, extack); > if (err) > goto errout_ht; Duplicated deletes should be fine, but I'm not sure same is true for adds. Won't seeing an add with the same cookie twice confuse drivers? There's also the minor issue of offloaded count being off in that case :)