Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4669218imm; Fri, 18 May 2018 08:46:50 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpHxpKzIMh/CKR0Vg9uaHMLasIj7vcty//gy3HzYtEBjNIVRTEqUi6n8o3rpikqM1lQHxtF X-Received: by 2002:a65:5308:: with SMTP id m8-v6mr8140693pgq.42.1526658410132; Fri, 18 May 2018 08:46:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526658410; cv=none; d=google.com; s=arc-20160816; b=Cega3WjG1wcn7dzSn0D6rClOMFA0rIQcN1UsMCIRWzZ7MrYU1NZT/6qF/1UjveyOuX JrfcePIwd2pVqqlVo/6kA591+0NwPSBxPl+7bTzubpOCuyzq42Z1WvN6Sfj+4nMRiJY2 +WB9ahSpLKYW3FRoeLhQ5fodsRRSqrVBrPvgvfY3ZEkQeQkCmxbrahcNEcqwMPEoF2/v nUeefMWvzNvkyWdkj52DU5uGIGAq1B0NpLZvshKTeJJC4IDPIBkdJYZM2EZvtCDRqS6Q QQbGCCL8BOg2q2t/qVeMPh/b9f7Bzz+e0Ek46ygqSx+6NiTfXT0j8NFFSWhO6EvxyiSS qG9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=rgHU4O2dLOAtpwWUCuoaeWGtYx4dfieoUlD9aGu7r74=; b=m68qFsgvqJF9DktWPXLeSAifPGFpeQinQKMKl+2VavkAEHZiz5C3HkDoD/Jgl0AQU9 anbPC37UOvr28T38csS1M10scjpMLJ4rom+xhkjp9JFXV2f6uuQy0Ku2dZ7uO6tp/P1t C+jLuKu0LDRht1r0Eybz+cjL9Qv3ZBOBsQYi4nGst921CaB2jrVH//BTB+lK3KzdJgsm l8wW20184fGrzxiqCTobXZZr7k7U6vw3MnwndDnoYxnJCs2KxKqj3PAYHC1KXLPUn4M7 eQCZcylv8CVLlk/z38HaFZkv5/D1YPX3GplgTN1Pi9UNM5AvoZxqKL/ALkck9M6xouzr IDBA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c10-v6si7678081pla.127.2018.05.18.08.46.35; Fri, 18 May 2018 08:46:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mellanox.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752227AbeERPpo (ORCPT + 99 others); Fri, 18 May 2018 11:45:44 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:53649 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751112AbeERPpn (ORCPT ); Fri, 18 May 2018 11:45:43 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from vladbu@mellanox.com) with ESMTPS (AES256-SHA encrypted); 18 May 2018 18:47:33 +0300 Received: from reg-r-vrt-018-180.mtr.labs.mlnx (reg-r-vrt-018-180.mtr.labs.mlnx [10.213.18.180]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id w4IFjfwM023963; Fri, 18 May 2018 18:45:41 +0300 From: Vlad Buslov To: netdev@vger.kernel.org Cc: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net, linux-kernel@vger.kernel.org, Vlad Buslov Subject: [PATCH] net: sched: don't disable bh when accessing action idr Date: Fri, 18 May 2018 18:45:24 +0300 Message-Id: <1526658324-6570-1-git-send-email-vladbu@mellanox.com> X-Mailer: git-send-email 2.7.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Underlying implementation of action map has changed and doesn't require disabling bh anymore. Replace all action idr spinlock usage with regular calls that do not disable bh. Signed-off-by: Vlad Buslov --- net/sched/act_api.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/net/sched/act_api.c b/net/sched/act_api.c index 72251241..3f4cf93 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c @@ -77,9 +77,9 @@ static void free_tcf(struct tc_action *p) static void tcf_idr_remove(struct tcf_idrinfo *idrinfo, struct tc_action *p) { - spin_lock_bh(&idrinfo->lock); + spin_lock(&idrinfo->lock); idr_remove(&idrinfo->action_idr, p->tcfa_index); - spin_unlock_bh(&idrinfo->lock); + spin_unlock(&idrinfo->lock); gen_kill_estimator(&p->tcfa_rate_est); free_tcf(p); } @@ -156,7 +156,7 @@ static int tcf_dump_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb, struct tc_action *p; unsigned long id = 1; - spin_lock_bh(&idrinfo->lock); + spin_lock(&idrinfo->lock); s_i = cb->args[0]; @@ -191,7 +191,7 @@ static int tcf_dump_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb, if (index >= 0) cb->args[0] = index + 1; - spin_unlock_bh(&idrinfo->lock); + spin_unlock(&idrinfo->lock); if (n_i) { if (act_flags & TCA_FLAG_LARGE_DUMP_ON) cb->args[1] = n_i; @@ -261,9 +261,9 @@ static struct tc_action *tcf_idr_lookup(u32 index, struct tcf_idrinfo *idrinfo) { struct tc_action *p = NULL; - spin_lock_bh(&idrinfo->lock); + spin_lock(&idrinfo->lock); p = idr_find(&idrinfo->action_idr, index); - spin_unlock_bh(&idrinfo->lock); + spin_unlock(&idrinfo->lock); return p; } @@ -323,7 +323,7 @@ int tcf_idr_create(struct tc_action_net *tn, u32 index, struct nlattr *est, } spin_lock_init(&p->tcfa_lock); idr_preload(GFP_KERNEL); - spin_lock_bh(&idrinfo->lock); + spin_lock(&idrinfo->lock); /* user doesn't specify an index */ if (!index) { index = 1; @@ -331,7 +331,7 @@ int tcf_idr_create(struct tc_action_net *tn, u32 index, struct nlattr *est, } else { err = idr_alloc_u32(idr, NULL, &index, index, GFP_ATOMIC); } - spin_unlock_bh(&idrinfo->lock); + spin_unlock(&idrinfo->lock); idr_preload_end(); if (err) goto err3; @@ -369,9 +369,9 @@ void tcf_idr_insert(struct tc_action_net *tn, struct tc_action *a) { struct tcf_idrinfo *idrinfo = tn->idrinfo; - spin_lock_bh(&idrinfo->lock); + spin_lock(&idrinfo->lock); idr_replace(&idrinfo->action_idr, a, a->tcfa_index); - spin_unlock_bh(&idrinfo->lock); + spin_unlock(&idrinfo->lock); } EXPORT_SYMBOL(tcf_idr_insert); -- 2.7.5