Received: by 2002:ab2:68c1:0:b0:1fd:9a81:d0e4 with SMTP id e1csp388983lqp; Sun, 9 Jun 2024 00:20:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV3/YzDCFwElVXy99b5qqkTU8efoZH+cKJd99757aRnr3pFs+HG/joFl5dRaWR1jpbTuR7ol/tMKwVCma2hrZEHMTsyk8nry1Mdy1WBDA== X-Google-Smtp-Source: AGHT+IGwW6G9RoAbhq5b1smZFArP1knDH+BEIuzlUM6rmGOi3k9FOGxgXR+ERVK7oU7Qi01/w2f4 X-Received: by 2002:a17:906:b2ca:b0:a6e:771a:2a8c with SMTP id a640c23a62f3a-a6e771a31admr327950466b.21.1717917657556; Sun, 09 Jun 2024 00:20:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717917657; cv=pass; d=google.com; s=arc-20160816; b=Lltsm3ma4g5ArFxbPkvN8/IBEduboQmWy0l9GEplujKPFTzVE8uBTekIL4TNrNSDEG JScI5cHQ7WUhxCsnPnF8Wry4RJbKb9TrsS1ja8Tsp6vj09GOXo6iEeP14HTiDZuVI1Z1 1DuDuV30m9FWBGsk5zTIZgE1TBFCdiHykd2grIAjT3ofiEBpQs/xzmNiSV/SluY6lY4C ObmnvgJ2qjTimckFtVvhIRylZCeU9FGOFPwnCJcFFYkQuuh8/pXpi8Z50g4T37Q9eFuO 3mEKJcAMPeq7TxLKH3dgCU4MeE3v01xUravUTmVYOIHmsHj4rPi1oJR3Qk9B3PkhDa7d ptJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=yBuBf30Snq1/ScFCv+eHyCx4GQE1qvyltqCPKA7D91Q=; fh=BWm6RDEIR2rOYdkynwzMbC3NvzlPR3PC+FSFTCn6tFY=; b=NZNzejFuoOWmhIgfBESsXj3NdfDIqVZBLxJ/68nUQGBIRuQvP9OtjkOr1eiLumIT/N 4IZMYn28cuDafTjwbTyYjerB21VcJtRaqEiykkZ82zhcg+QVJCI8klXSoNAV0xvnk8fw TFhdpmlFuFyuD8Txft0ObPq5P0G8BxbjBV/dAIu/8F/sdQMdW28f0FiemCpSI8r9gt/R x47kvkqeJSg8B/6dEwDV/ajHVTXBPCa59Zz0CnN8G61pfUjBIOzSw/mEZUdFA2Qw6JCe JiLLoegWxoLRwVAWtFrSew6lI0o2UHJQIXO5N0+HIpyz0YAzbm7P2a/KGvspMbpnaqDO Avqg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=PySHLLVh; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-207259-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207259-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57aae228e59si3603073a12.372.2024.06.09.00.20.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Jun 2024 00:20:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-207259-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=PySHLLVh; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-207259-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-207259-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3D1211F21549 for ; Sun, 9 Jun 2024 07:20:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 89E841C687; Sun, 9 Jun 2024 07:20:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="PySHLLVh" Received: from out-180.mta0.migadu.com (out-180.mta0.migadu.com [91.218.175.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0ED9014295 for ; Sun, 9 Jun 2024 07:20:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717917645; cv=none; b=KHEnS5sUNRwIOqIRXwmb089xufDlJS0x+rRdtorUFQi+WiAIH8pnEvDsL8tQ7yHAYrM12WDa4LzPY9yd3WEfcypp7hxy4YiG95J84lU0oOlXi+VnFQhiknIsNKPOMyrVXKHpM9o7D3FMrGvmdlJVXkzjUarFpqlggOWXX0jrdWk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717917645; c=relaxed/simple; bh=tYZsCR6MpDfSUZaZYcDfWrRPgJ+stN8XSR0FiLVtq2Q=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=cPkg/mrLLOnb1RHIBum1pm4slZWEZDgMwTGqaXTNTBruDb/vA2r7zRh+UQn65BmyqkYEdNw65HzVum5LWs5hh+NPchZ8gB3fzicy37jpj47MZU0PaaFXcWKovRBZiBXKKj6F1OKtseIfQg5iUZhZ06D7ev/6US1i7n4e5TiLaLg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=PySHLLVh; arc=none smtp.client-ip=91.218.175.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: davem@davemloft.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1717917639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=yBuBf30Snq1/ScFCv+eHyCx4GQE1qvyltqCPKA7D91Q=; b=PySHLLVhsh6tMRPDMRMi4JgaSCD34JJppAAaVYOKNx3E6lmGawFPKv/Mln9H2OxsHUBJG6 wnE3UKwrZZsFXVUSNqdz3c5XI0P8if8XE2Mz+o+g54/JoJCmQyZ4ru+iPxbbj3irETb3Jn q9yhjMDo15HsGjvKjeUWLrcVW3rtUW8= X-Envelope-To: edumazet@google.com X-Envelope-To: kuba@kernel.org X-Envelope-To: pabeni@redhat.com X-Envelope-To: bigeasy@linutronix.de X-Envelope-To: netdev@vger.kernel.org X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: yajun.deng@linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Yajun Deng To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: bigeasy@linutronix.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Yajun Deng Subject: [PATCH net-next] net: dev: Simplify the conditional of backlog lock functions Date: Sun, 9 Jun 2024 15:20:22 +0800 Message-Id: <20240609072022.2997-1-yajun.deng@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT The use_backlog_threads() contains the conditional of PREEMPT_RT, so we don't need to add PREEMPT_RT in the backlog lock. Remove the conditional of PREEMPT_RT in the backlog lock. Signed-off-by: Yajun Deng --- net/core/dev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/net/core/dev.c b/net/core/dev.c index e62698c7a0e6..db6b6fc997e6 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -229,7 +229,7 @@ static inline void backlog_lock_irq_save(struct softnet_data *sd, { if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads()) spin_lock_irqsave(&sd->input_pkt_queue.lock, *flags); - else if (!IS_ENABLED(CONFIG_PREEMPT_RT)) + else local_irq_save(*flags); } @@ -237,7 +237,7 @@ static inline void backlog_lock_irq_disable(struct softnet_data *sd) { if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads()) spin_lock_irq(&sd->input_pkt_queue.lock); - else if (!IS_ENABLED(CONFIG_PREEMPT_RT)) + else local_irq_disable(); } @@ -246,7 +246,7 @@ static inline void backlog_unlock_irq_restore(struct softnet_data *sd, { if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads()) spin_unlock_irqrestore(&sd->input_pkt_queue.lock, *flags); - else if (!IS_ENABLED(CONFIG_PREEMPT_RT)) + else local_irq_restore(*flags); } @@ -254,7 +254,7 @@ static inline void backlog_unlock_irq_enable(struct softnet_data *sd) { if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads()) spin_unlock_irq(&sd->input_pkt_queue.lock); - else if (!IS_ENABLED(CONFIG_PREEMPT_RT)) + else local_irq_enable(); } -- 2.34.1