Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp1715605rdb; Sun, 8 Oct 2023 23:36:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEaLztbhs7KGtPXZa3CQV09l+BCgEE19DJPr/wP1CJvFwD3EMjcGnSnF6lMKd7iujWXbsr+ X-Received: by 2002:a05:6a20:6a0c:b0:13a:59b1:c884 with SMTP id p12-20020a056a206a0c00b0013a59b1c884mr16068235pzk.40.1696833401319; Sun, 08 Oct 2023 23:36:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696833401; cv=none; d=google.com; s=arc-20160816; b=Ze79HueKDK+6ZNpGgqfUQqOeoNOlT0PJvgSnqdz/PZf4ZPvfAAjo90i9Q+VBoKOCh+ BRG6Nh/JjTf4BX7DD9XaziOxLS/w1sFocOjOR3Ed8DpE7GtLpXSUyW2WGlPJ3qTrRLwj NubqTRz1p006gomtNglyxfHMgK08QAuEKl5l9gIC5GKFv6ApJY2ETqCP5Ec9wauWMbm3 EjjdS09AauXj8H0cKcOL7Knwrg+Mluf9qfo5q54sx9groMXaZpxBRgyqFBl7TKjL1uJf bIGTa5JiTT36loayXbPZxLmFRywuQ/2MMwRHkxLM2NDx8m2uipB9XwWViPDrUJqywVeX zgkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=CmIQ54e83rjRXX3PATkVVfhvUKNPzP9GQbPr3Vu327M=; fh=eAbprgbPav8oVtxmiJPKOyR3uRTzAs2RTD0b1w6FoPE=; b=Amkz3Bs2AP1cdMrhpuil7wiO6t0BTG0PZyDZTvUlZAMV7wA1nuB/NJHcGfy1oEjqVO Yvqk9WWlk4HknoXDZls12C47ypzFHN+gBBktof0WofjIog5VlzHz1swDYlOdC+XGSBhr e0jDWlrXO5s/5s4fAxV5QM7LwZjLvcQfRvocwymCASld4NQ6dWCiPJkDgjwWdpFGkEWm eTDIg5CYQe8rNbApGsiqFO+jAIRX1ujH9HsS+DK/HFTVylZWCenLKv6GdBqg4sSAAXWW x3rd+PEIwYcP18/cAq+MjzVhXn5DKpBqrcpX0NJkSFwPNQWBsg3tR1/P3ikEJ+hLB868 jZIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=oe4Hl8EN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id m9-20020a056a00080900b00690296eb869si7061127pfk.257.2023.10.08.23.36.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Oct 2023 23:36:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=oe4Hl8EN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 83D328069349; Sun, 8 Oct 2023 23:36:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345168AbjJIGg0 (ORCPT + 99 others); Mon, 9 Oct 2023 02:36:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229551AbjJIGgZ (ORCPT ); Mon, 9 Oct 2023 02:36:25 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45BE1A3; Sun, 8 Oct 2023 23:36:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1696833384; x=1728369384; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=uyI1GBRwRYaf3PKDtrd6L3XsdGth2lmbbXpOUwPRAaE=; b=oe4Hl8ENdDB5f9uM6egRewbmMXi2z1lTuu/z5MFC1PK/3qWch3RX9eSJ VIj442C5Y/b9eQHkEUcGpAZoNwlWol11TtqSLXyR4ngrlxx//QG1vdHQG XOdUTrfHnwlPK8qGmsQewVbNviaFJ4qFHmX7uCFPmJWzI+lee80DnkesT ZnfVB5d37uq4+H5/3awgS5pvGQ02KFJvYcf7SA2dcW6z3DQfyM0qhCL8c qTbW9OXer3d8erij8tLvWBGEamxYr7WAU8EBSsJqkHVGk55BXz12grjHj QRnL52RnjgRuLrBATUspt74SjRI55LSqV6h4azoSYjixJzurs/x/tmPNj g==; X-CSE-ConnectionGUID: 2bV9ZySXRE2QAaSa4DhkSg== X-CSE-MsgGUID: RucYwCjpRZyg8bGFVoQ3cA== X-ThreatScanner-Verdict: Negative X-IronPort-AV: E=Sophos;i="6.03,209,1694761200"; d="scan'208";a="9573346" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 08 Oct 2023 23:36:22 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Sun, 8 Oct 2023 23:35:50 -0700 Received: from localhost (10.10.85.11) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.21 via Frontend Transport; Sun, 8 Oct 2023 23:35:50 -0700 Date: Mon, 9 Oct 2023 08:35:49 +0200 From: Horatiu Vultur To: Jamal Hadi Salim CC: Chengfeng Ye , Jakub Kicinski , , , , , , , Subject: Re: [PATCH] net/sched: use spin_lock_bh() on &gact->tcf_lock Message-ID: <20231009063549.gcehavudj4gxz4oc@soft-dev3-1> References: <20230926182625.72475-1-dg573847474@gmail.com> <20231004170120.1c80b3b4@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sun, 08 Oct 2023 23:36:38 -0700 (PDT) X-Spam-Level: ** The 10/05/2023 07:46, Jamal Hadi Salim wrote: Hi Jamal, > On Thu, Oct 5, 2023 at 5:01 AM Chengfeng Ye wrote: > > > > Hi Jakub, > > > > Thanks for the reply, > > > > I inspected the code a bit more, it seems that the TC action is called from > > tcf_proto_ops.classify() callback, which is called from Qdisc_ops enqueue > > callback. > > > > Then Qdisc enqueue callback is from > > > > -> __dev_queue_xmit() > > -> __dev_xmit_skb() > > -> dev_qdisc_enqueue() > > > > inside the net core. It seems that this __dev_queue_xmit() callback is > > typically called from BH context (e.g., NET_TX_SOFTIRQ) with BH > > already disabled, but sometimes also can from a work queue under > > process context, one case is the br_mrp_test_work_expired() inside > > net/bridge/br_mrp.c. Does it indicate that this TC action could also be > > called with BH enable? I am not a developer so really not sure about it, > > as the networking code is a bit long and complicated. > > net/bridge/br_mrp.c seems to need some love +Cc Horatiu Vultur > > Maybe that code needs to run in a tasklet? > In any case your patch is incorrect. I am currently out traveling and it would be a little bit hard for me to look at this right now. I can have a look after I come back in office around mid November. But I was wondering if this is stil an issue for MRP as Cong Wang pointed out, the function __dev_queue_xmit is already disabling the BH. > > cheers, > jamal > -- /Horatiu