From patchwork Tue Oct 11 05:56:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khalid Elmously X-Patchwork-Id: 1688461 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=OYd8yN5R; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4MmlRz1v3Hz23jy for ; Tue, 11 Oct 2022 16:57:34 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1oi8GS-0008Fk-UC; Tue, 11 Oct 2022 05:57:16 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1oi8GO-0008EY-Ce for kernel-team@lists.ubuntu.com; Tue, 11 Oct 2022 05:57:12 +0000 Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id D6BCE40008 for ; Tue, 11 Oct 2022 05:57:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1665467831; bh=ZPQ9qQ3vpF60EILfePBJGXK27488hD0uZsQB5P52pPE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OYd8yN5RMX1D4tAMQOew2XQKBtZ0yeUihyyTvX60Hj+CcgFIjWsDpTXguxA1+no6q vxGCrWrDWDZcW6NhckpUQh8WeMvJP2Dn1TfDenTaU6oEIzGCv1v4MZcYZ+4XCOtlG5 dGKo+dbXj2u5lTdn1cL+c+1a+R4EytSZuy88AGnvnC48F55vB0dCJlaKfmXYn5KWug 74SyGXDsRQ+4fL9/V0G3W2t3B2O3JM+egp7RNT2tOHIkxMXDEckg7qT3kWT69u6Zva jxSEXRCLdJI0+BtRtT7/klI6QLsTkpscgpJyqPwffSuaDt5V9FauEJ5V9rS3XLr8yg 7ZPdgTu7dLDag== Received: by mail-qk1-f200.google.com with SMTP id w13-20020a05620a424d00b006e833c4fb0dso8458682qko.2 for ; Mon, 10 Oct 2022 22:57:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZPQ9qQ3vpF60EILfePBJGXK27488hD0uZsQB5P52pPE=; b=6tJclwbk4xs5SfnayMI7u04tMYFDzeHT2tI9VVAPb7jwT1fk0XrdktHNDqelP0+rDC kR+Vn29K7E6jiOE8HK9HPgbHOQsp74cCYPg/j253+RNioB3uEhjkrtGKvwoi87//meR4 qmj1ivO1O7uR1LIOMLtcSlfPG1O1JogbC0xDTstjr9ozPr4JDhdIDnegfn2FsIzMoQ22 3gCwo1oGlyEpBnfPy/5mW6MOD1iXmmqlyMHLbsZfrvVh5uinCYaIxIfwzYVuh0WVJXmo BfHOGReCclIcG8ORlI7mfy5nB76dfiFlbsKy68CbL5z7CnUceVky8vBsnHbCZc8FGjls YE0A== X-Gm-Message-State: ACrzQf0poHHnBL9p+oLXh1Ka3kQaDpzhIVGuuC2fsCEL5g1G/OzQ5BgA 6K29naE2RlLbQzW3wzpW2AgIeNaynaiVTTCuJniEmpLYyyn0ugl9zLe9WCwPPdRyiNwxG1JrNiA tArYe7dBwbXOEHSwKEIq6aT/QGLseDiUTJmug/csr1Q== X-Received: by 2002:a05:6214:23c5:b0:4b1:a94e:3a21 with SMTP id hr5-20020a05621423c500b004b1a94e3a21mr18085125qvb.90.1665467830790; Mon, 10 Oct 2022 22:57:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6z6zRQloK5NH6iqe7Ud33GnBddQoHlbaMICFerdBOm5AdYpxi/5Ix3Yrad0iLwX6hhrBg1gg== X-Received: by 2002:a05:6214:23c5:b0:4b1:a94e:3a21 with SMTP id hr5-20020a05621423c500b004b1a94e3a21mr18085121qvb.90.1665467830481; Mon, 10 Oct 2022 22:57:10 -0700 (PDT) Received: from rpi4-work.fuzzbuzz.org ([38.147.253.164]) by smtp.gmail.com with ESMTPSA id z8-20020ac81008000000b0039351b26714sm9848927qti.7.2022.10.10.22.57.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 22:57:10 -0700 (PDT) From: Khalid Elmously To: kernel-team@lists.ubuntu.com Subject: [PATCH 03/19] gve: Add netif_set_xps_queue call Date: Tue, 11 Oct 2022 01:56:48 -0400 Message-Id: <20221011055704.642271-4-khalid.elmously@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221011055704.642271-1-khalid.elmously@canonical.com> References: <20221011055704.642271-1-khalid.elmously@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Catherine Sullivan BugLink: https://bugs.launchpad.net/bugs/1953575 Configure XPS when adding tx queues to the notification blocks. Fixes: dbdaa67540512 ("gve: Move some static functions to a common file") Signed-off-by: Catherine Sullivan Signed-off-by: David Awogbemila Signed-off-by: David S. Miller (cherry picked from commit 4edf8249bcd1c554b1a34166ca4ea5630031ecf5) Signed-off-by: Khalid Elmously --- drivers/net/ethernet/google/gve/gve_utils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/google/gve/gve_utils.c b/drivers/net/ethernet/google/gve/gve_utils.c index 93f3dcbeeea9..45ff7a9ab5f9 100644 --- a/drivers/net/ethernet/google/gve/gve_utils.c +++ b/drivers/net/ethernet/google/gve/gve_utils.c @@ -18,12 +18,16 @@ void gve_tx_remove_from_block(struct gve_priv *priv, int queue_idx) void gve_tx_add_to_block(struct gve_priv *priv, int queue_idx) { + unsigned int active_cpus = min_t(int, priv->num_ntfy_blks / 2, + num_online_cpus()); int ntfy_idx = gve_tx_idx_to_ntfy(priv, queue_idx); struct gve_notify_block *block = &priv->ntfy_blocks[ntfy_idx]; struct gve_tx_ring *tx = &priv->tx[queue_idx]; block->tx = tx; tx->ntfy_id = ntfy_idx; + netif_set_xps_queue(priv->dev, get_cpu_mask(ntfy_idx % active_cpus), + queue_idx); } void gve_rx_remove_from_block(struct gve_priv *priv, int queue_idx)