From patchwork Mon Mar 29 13:40:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ong Boon Leong X-Patchwork-Id: 12170919 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=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 E3E79C433C1 for ; Mon, 29 Mar 2021 19:54:06 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1A4A861554 for ; Mon, 29 Mar 2021 19:54:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1A4A861554 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=S6wWURMLj5CnKkZrAPOJiLa0ZdMO8cW+duFJVTK20WY=; b=Pegp60XBgaTsjdu50I+aIAw+0 7fu6LbmGioHDahwwPUuDVP+ZbFnvtvs63Yg0I0MEfRLydOnOL6hqqN5XyyLc339U/L2QsEfEG2mAZ fQWHHACQrvvuDS+sA94B5XqSwXNDOYjPeZsqR1KVq7rAKlxKeviE4nCp+x8lh2OBAFAUcag5yB15c RMDzpZdaS/ytZHTJS3EYplTpP/CoBf1Cyk31rEuQ1IlN2Ag/FkCwkFNbLNLlg7NILLTzPTIMeMPPN LpnFG9URSZWst9d5vN72I0ZDdaDcxlmaSBQb2cIJgQVXwEICSgI3Sk29AfsOUl1K3fnwMLREAwthL 9pwn6L1qQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lQxvc-001KDo-Bd; Mon, 29 Mar 2021 19:52:01 +0000 Received: from mga06.intel.com ([134.134.136.31]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lQs4M-000gaK-El for linux-arm-kernel@lists.infradead.org; Mon, 29 Mar 2021 13:36:40 +0000 IronPort-SDR: 1Evx9j38xy2NnZ83tiRSmLfM8BKocrVViQhpwNlHQyGqhoOZYWJJ5FjPQW6ZyM/x4uPVZ3MDDC +o8V4SUh6HQw== X-IronPort-AV: E=McAfee;i="6000,8403,9938"; a="252895615" X-IronPort-AV: E=Sophos;i="5.81,287,1610438400"; d="scan'208";a="252895615" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2021 06:36:27 -0700 IronPort-SDR: +l9e/G6tHjwa1KuU/ooNwJpc6WXAW1rN2dalrWNZudQesddftnUyZxNu4rbH9wawqVDBTu4sbQ ugaEgoWhgP0Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,287,1610438400"; d="scan'208";a="411079330" Received: from glass.png.intel.com ([10.158.65.59]) by fmsmga008.fm.intel.com with ESMTP; 29 Mar 2021 06:36:22 -0700 From: Ong Boon Leong To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Jakub Kicinski , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend Cc: Maxime Coquelin , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Ong Boon Leong Subject: [PATCH net-next 1/6] stmmac: intel: set IRQ affinity hint for multi MSI vectors Date: Mon, 29 Mar 2021 21:40:08 +0800 Message-Id: <20210329134013.9516-2-boon.leong.ong@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210329134013.9516-1-boon.leong.ong@intel.com> References: <20210329134013.9516-1-boon.leong.ong@intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210329_143638_862990_BD440B98 X-CRM114-Status: UNSURE ( 9.96 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Intel mGBE has independent hardware IRQ resources for TX and RX DMA operation. In preparation to support XDP TX, we add IRQ affinity hint to group both RX and TX queue of the same queue ID to the same CPU. Signed-off-by: Ong Boon Leong --- drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c index 08b4852eed4c..53a24932a192 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c @@ -810,6 +810,7 @@ static int stmmac_config_multi_msi(struct pci_dev *pdev, struct plat_stmmacenet_data *plat, struct stmmac_resources *res) { + cpumask_t cpu_mask; int ret; int i; @@ -832,12 +833,18 @@ static int stmmac_config_multi_msi(struct pci_dev *pdev, for (i = 0; i < plat->rx_queues_to_use; i++) { res->rx_irq[i] = pci_irq_vector(pdev, plat->msi_rx_base_vec + i * 2); + cpumask_clear(&cpu_mask); + cpumask_set_cpu(i % num_online_cpus(), &cpu_mask); + irq_set_affinity_hint(res->rx_irq[i], &cpu_mask); } /* For TX MSI */ for (i = 0; i < plat->tx_queues_to_use; i++) { res->tx_irq[i] = pci_irq_vector(pdev, plat->msi_tx_base_vec + i * 2); + cpumask_clear(&cpu_mask); + cpumask_set_cpu(i % num_online_cpus(), &cpu_mask); + irq_set_affinity_hint(res->tx_irq[i], &cpu_mask); } if (plat->msi_mac_vec < STMMAC_MSI_VEC_MAX)