Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2901162pxb; Tue, 24 Aug 2021 10:11:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoLGCidjo6TMFHhzaq1NjXd/M9cOKqvmKBoiDavDD2gi1yzygav78Weohceq/o8tkiDjv0 X-Received: by 2002:a92:c04e:: with SMTP id o14mr26273341ilf.289.1629825109068; Tue, 24 Aug 2021 10:11:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629825109; cv=none; d=google.com; s=arc-20160816; b=Gf+B4oLY8IOBg2ZPqyKT6UO6Sq3EO+fYftJDzjoSwK2SFfIVYMnEhEZOpQwPKdgp+8 JtShubHATn53o9IIBBIxZKv7j07InBAXU6TdNuRCsIuPSi5fck4/LdAgG2puayirVqNa 2IS+GZSMVqXLo72HzhWsmlfij29+Noexlin6PlxD3BrJ/RaqimPPj14POVNEKBUEa9cC RrO9QbwC1bVggOH/TBvtbisC64Q7utXbr45JnxTZMG6oEhqafL/00WGyvaR8wbgsIyve TA7UOnqb8nWHmJHqR5z6Cz0iE9DLaJyv+yU4qv13Y7+CBtVkkSUf6GDVhd329jjdRa5j V/tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vawXRiIeomn+V4ydBkEQPvOUM+TJW23OkU9+0LacZ7U=; b=dfJn0W6HDZFT8AfZZQKWep6rcNq+TkesfW46+/P01xiccHnoaTInl8/dvPFyjiJSZd 1KRUz3JBiWuq21K4RpXvPG/g6k2iXQwXdyVNsdrQRkLIsZ5BC9fqiTSb69PZ31xvyr54 riILP2c3sFmMyj1sdz3R65oUXsuhwX+I4EY9Zv8ABdi9+wuOHeigLwYM4+eHSGm4Z2a0 Ljj8mq6HT318Y3UqHGC1/X0Oat+R+QFE14T/wk18uMu5DkI1gLQjTkpuB8tH4AhlKijc m0QBMdF2yZ8mnJqAvgfcleq2f2OOCxJ4ULRJrApP5wYWSHZQfMDRjC04xnRwCGUFDDXu PzJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ThkrL+n/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f18si16771660iox.32.2021.08.24.10.11.35; Tue, 24 Aug 2021 10:11:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ThkrL+n/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239515AbhHXRLd (ORCPT + 99 others); Tue, 24 Aug 2021 13:11:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:52062 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239380AbhHXRJE (ORCPT ); Tue, 24 Aug 2021 13:09:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1975861A4F; Tue, 24 Aug 2021 17:00:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629824419; bh=F9KU1kXUlLKMpoObCkZ7bwUTHVJgLsXCOcsbhsXwtCk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ThkrL+n/Yc4rAR73U3BzeukH1iuyJvHx/ZDVKVrXSmQFm1q0MkPPQURUvANBxq+CB moFQjQEEtJSwJ59/SGgiMSbAzKlWh+BNHRbDwTGWyk+yBiXOhRYlVgWmRffAl/IoTP el+IuKOFbptn9DSF74WxN6RRMIeaQG5N+fTtRc2NS2w+eoQkai8oDdLkVqnnEM7B3S 12WtDTpBrrDyrCRFr/nbLWfc9TEqY600bGQSdco0nULCYwk7mdvcBOJejFcAh9c2Bb QPqtMQ5fIOnuuVGvDJjjq9jf97NJA1g0Wwgw4V11NEq8N/j7oKgJH9gzAR2sRNZO9N VgdhMdT0htIeg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Arkadiusz Kubalewski , Przemyslaw Patynowski , Dave Switzer , Tony Nguyen , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.10 70/98] i40e: Fix ATR queue selection Date: Tue, 24 Aug 2021 12:58:40 -0400 Message-Id: <20210824165908.709932-71-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210824165908.709932-1-sashal@kernel.org> References: <20210824165908.709932-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.61-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.10.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.10.61-rc1 X-KernelTest-Deadline: 2021-08-26T16:58+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arkadiusz Kubalewski [ Upstream commit a222be597e316389f9f8c26033352c124ce93056 ] Without this patch, ATR does not work. Receive/transmit uses queue selection based on SW DCB hashing method. If traffic classes are not configured for PF, then use netdev_pick_tx function for selecting queue for packet transmission. Instead of calling i40e_swdcb_skb_tx_hash, call netdev_pick_tx, which ensures that packet is transmitted/received from CPU that is running the application. Reproduction steps: 1. Load i40e driver 2. Map each MSI interrupt of i40e port for each CPU 3. Disable ntuple, enable ATR i.e.: ethtool -K $interface ntuple off ethtool --set-priv-flags $interface flow-director-atr 4. Run application that is generating traffic and is bound to a single CPU, i.e.: taskset -c 9 netperf -H 1.1.1.1 -t TCP_RR -l 10 5. Observe behavior: Application's traffic should be restricted to the CPU provided in taskset. Fixes: 89ec1f0886c1 ("i40e: Fix queue-to-TC mapping on Tx") Signed-off-by: Przemyslaw Patynowski Signed-off-by: Arkadiusz Kubalewski Tested-by: Dave Switzer Signed-off-by: Tony Nguyen Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/i40e/i40e_txrx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index 615802b07521..5ad28129fab2 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c @@ -3556,8 +3556,7 @@ u16 i40e_lan_select_queue(struct net_device *netdev, /* is DCB enabled at all? */ if (vsi->tc_config.numtc == 1) - return i40e_swdcb_skb_tx_hash(netdev, skb, - netdev->real_num_tx_queues); + return netdev_pick_tx(netdev, skb, sb_dev); prio = skb->priority; hw = &vsi->back->hw; -- 2.30.2