From patchwork Tue Nov 12 02:23:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Xu X-Patchwork-Id: 13871668 X-Patchwork-Delegate: kuba@kernel.org Received: from fhigh-a5-smtp.messagingengine.com (fhigh-a5-smtp.messagingengine.com [103.168.172.156]) (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 CFA5DF50F; Tue, 12 Nov 2024 02:24:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.156 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731378301; cv=none; b=j8Oj3EPSgxN5zPVRYoLGfxD8uYJmOhOvTNVfMf17EeRQ4LAN5MA2SaCzlzQw+z1XPNeIw4nmwWYCbgyCNYwdAY4q2HOeVG/NsWsK6Bg67xRIBpr1PY4av80dR9DeXg8RqyhEQLxBdY69GeSfvKhDg0QS2zLxVy9cwhGuQx8wFBw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731378301; c=relaxed/simple; bh=Ijbk3Pr2g1cV1stuaPcO0SMWb4AI2/oyYbU/HhQZie4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mcx0FzM79hb1fuKCPBKvixuyyY/PHdNydK71JSQqn8LXgOoemJ2v/pLTaxGfgyd55rO9Vu7mwY+M5ZIlwfvHsvneW2Vg9yAvHCH40pyYHPCYTM6d08/bM+b9jqrRQpgPO593QBDgK9l35eu1FtGIMvyE5QyyZj9U6VyixEkVsp4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz; spf=pass smtp.mailfrom=dxuuu.xyz; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b=pXJXmMZO; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=ODauS2q7; arc=none smtp.client-ip=103.168.172.156 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dxuuu.xyz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b="pXJXmMZO"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ODauS2q7" Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfhigh.phl.internal (Postfix) with ESMTP id D3BA2114011B; Mon, 11 Nov 2024 21:24:58 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Mon, 11 Nov 2024 21:24:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1731378298; x= 1731464698; bh=VxZnqmS/y+9L9W/ar0XabTk2ezV5wTswTuwNGTb+0Lk=; b=p XJXmMZO4EcJ9M3g7QsYsl99o4fsO9iWVm21OPlQrQadq2/BqXapdtD1Ed4VlpQ8N yCz0wGCxv/+FgtR6/5vxNfhyqNt/YzzZYg4qgzJjxH2N3/gHTbo4aqnm2VsSKUWL mSDSUHwjegw3CGyxIunvKUPijOj4AR7nUukqbLZ51C9wTu0Fp1x6dRHSUsygwy4y rpAMFAyhDyQTaQglS491Rwg7BGAHSevH9zZsL+k5St0wBErY57K4G13S4yyxhbH3 RkzKb1J9I6bxGU7eGKoIXKybQY9ujO+Us7xa8xao82hHvCZLUPgUZddig7cfNNlT QUF78SbR4vOGFaYQZZJ2A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1731378298; x=1731464698; bh=V xZnqmS/y+9L9W/ar0XabTk2ezV5wTswTuwNGTb+0Lk=; b=ODauS2q7rCuQD63mR xFfsWxo1sqRVQHLBTfez7LMHIoqfPmuk5SXe50s5piP8PkslmeYdSnZt2OoMAkGV 713cxFdstqnegKCGGKr41iXaSW/uqR+8abbb9Djvh6VE2VK6hwqbiO0aHjhYO7B+ SGo+Duk73Z976C97D7EBvFhLpkRVSWzEGI9DumSOBr74XnFn7M3HgHVshKPfNIDR cWXZZ/D8hq3Uus7bzX3MpmqmX+ueyediaqdLOaoxylmaXk4MKZCQ+czXf/YkU0jx QTBb2dJzxOBewyfXAyajQVJb6AdqK7dtpgLsiJzuuhhZdOLdxhya+p8AATTf8QQ3 mK8/g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudefgdegiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdejtd dmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepffgr nhhivghlucgiuhcuoegugihusegugihuuhhurdighiiiqeenucggtffrrghtthgvrhhnpe fgfefggeejhfduieekvdeuteffleeifeeuvdfhheejleejjeekgfffgefhtddtteenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegugihusegugi huuhhurdighiiipdhnsggprhgtphhtthhopeduvddpmhhouggvpehsmhhtphhouhhtpdhr tghpthhtohepphgrsggvnhhisehrvgguhhgrthdrtghomhdprhgtphhtthhopehkrghlvg hshhdqrghnrghkkhhurhdrphhurhgrhihilhessghrohgruggtohhmrdgtohhmpdhrtghp thhtohepmhhitghhrggvlhdrtghhrghnsegsrhhorggutghomhdrtghomhdprhgtphhtth hopehprghvrghnrdgthhgvsggsihessghrohgruggtohhmrdgtohhmpdhrtghpthhtohep vgguuhhmrgiivghtsehgohhoghhlvgdrtghomhdprhgtphhtthhopegurghvvghmsegurg hvvghmlhhofhhtrdhnvghtpdhrtghpthhtoheprghnughrvgifodhnvghtuggvvheslhhu nhhnrdgthhdprhgtphhtthhopehkuhgsrgeskhgvrhhnvghlrdhorhhgpdhrtghpthhtoh epmhgrrhhtihhnrdhlrghusehlihhnuhigrdguvghv X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Nov 2024 21:24:57 -0500 (EST) From: Daniel Xu To: pabeni@redhat.com, kalesh-anakkur.purayil@broadcom.com, michael.chan@broadcom.com, pavan.chebbi@broadcom.com, edumazet@google.com, davem@davemloft.net, andrew+netdev@lunn.ch, kuba@kernel.org, martin.lau@linux.dev Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: [PATCH net v2 1/2] bnxt_en: ethtool: Supply ntuple rss context action Date: Mon, 11 Nov 2024 19:23:30 -0700 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Commit 2f4f9fe5bf5f ("bnxt_en: Support adding ntuple rules on RSS contexts") added support for redirecting to an RSS context as an ntuple rule action. However, it forgot to update the ETHTOOL_GRXCLSRULE codepath. This caused `ethtool -n` to always report the action as "Action: Direct to queue 0" which is wrong. Fix by teaching bnxt driver to report the RSS context when applicable. Fixes: 2f4f9fe5bf5f ("bnxt_en: Support adding ntuple rules on RSS contexts") Reviewed-by: Michael Chan Signed-off-by: Daniel Xu --- drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c index cfd2c65b1c90..a218802befa8 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -1187,10 +1187,14 @@ static int bnxt_grxclsrule(struct bnxt *bp, struct ethtool_rxnfc *cmd) } } - if (fltr->base.flags & BNXT_ACT_DROP) + if (fltr->base.flags & BNXT_ACT_DROP) { fs->ring_cookie = RX_CLS_FLOW_DISC; - else + } else if (fltr->base.flags & BNXT_ACT_RSS_CTX) { + fs->flow_type |= FLOW_RSS; + cmd->rss_context = fltr->base.fw_vnic_id; + } else { fs->ring_cookie = fltr->base.rxq; + } rc = 0; fltr_err: From patchwork Tue Nov 12 02:23:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Xu X-Patchwork-Id: 13871669 X-Patchwork-Delegate: kuba@kernel.org Received: from fhigh-a5-smtp.messagingengine.com (fhigh-a5-smtp.messagingengine.com [103.168.172.156]) (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 993A2205E08; Tue, 12 Nov 2024 02:25:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.156 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731378303; cv=none; b=ALikbiZC1LA5SjOj48jrJ5shs+bAmVT+uk3qwhQFMdIRq2jcxxfVT9dUYm6cuueX1K7i0qb38ehRytKh/WK4CBZ50GxiNyzMm8z0jl4hLP+iJK7trN75q+EDXcG/fH5BtCTHyvhEg+Bu9GSfFyUIW0SQAR9mx6yb6/Yreb9nSbM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731378303; c=relaxed/simple; bh=UE3vj6R4b14gmnIic/V4MuJDC9lLf6MMJSEQ2nOuG7o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hcHDgtLWUo+b1X/ykn3nPaeSOR9DmAXz/906980XC1qikTebNCK+OzdcDw4DbVgHDI6mUdYrhVoEzh+hja5/cYc8ihVdVIk2CdZX0UrmOsBvKMeO3TSMbjyqRZ2VgviGzMppD4HlIrD8PjgPqtIfOHM4uIfl5QXlA3YDhFvg/Io= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz; spf=pass smtp.mailfrom=dxuuu.xyz; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b=unl2x5gt; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=c0BSVeg5; arc=none smtp.client-ip=103.168.172.156 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dxuuu.xyz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dxuuu.xyz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dxuuu.xyz header.i=@dxuuu.xyz header.b="unl2x5gt"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="c0BSVeg5" Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.phl.internal (Postfix) with ESMTP id AAD3511401E8; Mon, 11 Nov 2024 21:25:00 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Mon, 11 Nov 2024 21:25:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm2; t=1731378300; x= 1731464700; bh=sd0kI9SctekWnjOScuar49C2YSEhrmC/Es+ie4cWrqs=; b=u nl2x5gtx85ZO+wxrUEPRNkDBm13v28WX9uUk9dm/ullXa8NaOeYnhW4bDi2IsMDY iR/MKNOfyGFdYHTeOy6pbBr5gs4vFPmztRNJTucsSzKxDADMbVn3lxBlj7hNEVoK DuhziB0wU6zpgjhRzs1tn4ezb7p5KYb5HXLvBc69+LSgWuvqU9EaCfQE5hsJSa98 j8IkS363wxL/Zs/GxwTriXL0D930T6GVt+0z2qu0zQ7UksQ5J9qjk9yL1WCFRoMW 4/5RXYUjDt/eAQbVi87/GOAs4ezmu7aes44Yb8z94tQ6eE53r6+7bgxLyIoPsM2M GSiuwQSKLeE1Wy8qulfEQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1731378300; x=1731464700; bh=s d0kI9SctekWnjOScuar49C2YSEhrmC/Es+ie4cWrqs=; b=c0BSVeg5O8d1fk2kW AKIxjfzAMcyACi7H64/Putf7tDJ3bXecTEtl5KLWL2Obx/OJjyt37wUfeHaY5p8M IjjUXDVKUw1k4I8tJEBcbjdeklBID8+bIB+hi4SM5YBvZdJvREnV9XQVRMWbwCz7 qOXoKrC98u/5vWKpRIlGi6eEKcs6QqWVh3I//maV0hYY/pr/Rx1nitCHkYyI7Oyh /VCmFgzfe1n3mgYrV21l2x+uoVkotsArlmN7nshDn/xWBkjWn4VZuewLjmsbXrit A40VBLwmJ6AAV4ib9RTNKb5R2Q2jSCcFiMXv97X7/eArffL1OvTZ8boOLEVW3nkO 9zXlg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudefgdegiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdejtd dmnecujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepffgr nhhivghlucgiuhcuoegugihusegugihuuhhurdighiiiqeenucggtffrrghtthgvrhhnpe fgfefggeejhfduieekvdeuteffleeifeeuvdfhheejleejjeekgfffgefhtddtteenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegugihusegugi huuhhurdighiiipdhnsggprhgtphhtthhopedufedpmhhouggvpehsmhhtphhouhhtpdhr tghpthhtohepphgrsggvnhhisehrvgguhhgrthdrtghomhdprhgtphhtthhopegvughumh griigvthesghhoohhglhgvrdgtohhmpdhrtghpthhtohepuggrvhgvmhesuggrvhgvmhhl ohhfthdrnhgvthdprhgtphhtthhopehshhhurghhsehkvghrnhgvlhdrohhrghdprhgtph htthhopegrnhgurhgvfidonhgvthguvghvsehluhhnnhdrtghhpdhrtghpthhtohepkhhu sggrsehkvghrnhgvlhdrohhrghdprhgtphhtthhopehmihgthhgrvghlrdgthhgrnhessg hrohgruggtohhmrdgtohhmpdhrtghpthhtohepmhgrrhhtihhnrdhlrghusehlihhnuhig rdguvghvpdhrtghpthhtohepphgrvhgrnhdrtghhvggssghisegsrhhorggutghomhdrtg homh X-ME-Proxy: Feedback-ID: i6a694271:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Nov 2024 21:24:59 -0500 (EST) From: Daniel Xu To: pabeni@redhat.com, edumazet@google.com, davem@davemloft.net, shuah@kernel.org, andrew+netdev@lunn.ch, kuba@kernel.org, michael.chan@broadcom.com, martin.lau@linux.dev, pavan.chebbi@broadcom.com Cc: netdev@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: [PATCH net v2 2/2] selftests: drv-net: rss_ctx: Add test for ntuple rule Date: Mon, 11 Nov 2024 19:23:31 -0700 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Extend the rss_ctx test suite to test that an ntuple action that redirects to an RSS context contains that information in `ethtool -n`. Otherwise the output from ethtool is highly deceiving. This test helps ensure drivers are compliant with the API. Signed-off-by: Daniel Xu --- tools/testing/selftests/drivers/net/hw/rss_ctx.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/drivers/net/hw/rss_ctx.py b/tools/testing/selftests/drivers/net/hw/rss_ctx.py index 29995586993c..4fa158f37155 100755 --- a/tools/testing/selftests/drivers/net/hw/rss_ctx.py +++ b/tools/testing/selftests/drivers/net/hw/rss_ctx.py @@ -3,7 +3,8 @@ import datetime import random -from lib.py import ksft_run, ksft_pr, ksft_exit, ksft_eq, ksft_ne, ksft_ge, ksft_lt +import re +from lib.py import ksft_run, ksft_pr, ksft_exit, ksft_eq, ksft_ne, ksft_ge, ksft_lt, ksft_true from lib.py import NetDrvEpEnv from lib.py import EthtoolFamily, NetdevFamily from lib.py import KsftSkipEx, KsftFailEx @@ -96,6 +97,14 @@ def _send_traffic_check(cfg, port, name, params): f"traffic on inactive queues ({name}): " + str(cnts)) +def _ntuple_rule_check(cfg, rule_id, ctx_id): + """Check that ntuple rule references RSS context ID""" + text = ethtool(f"-n {cfg.ifname} rule {rule_id}").stdout + pattern = f"RSS Context ID: {ctx_id}" + ksft_true(re.search(pattern, text, re.IGNORECASE), + "RSS context not referenced in ntuple rule") + + def test_rss_key_indir(cfg): """Test basics like updating the main RSS key and indirection table.""" @@ -433,6 +442,8 @@ def test_rss_context(cfg, ctx_cnt=1, create_with_cfg=None): ntuple = ethtool_create(cfg, "-N", flow) defer(ethtool, f"-N {cfg.ifname} delete {ntuple}") + _ntuple_rule_check(cfg, ntuple, ctx_id) + for i in range(ctx_cnt): _send_traffic_check(cfg, ports[i], f"context {i}", { 'target': (2+i*2, 3+i*2),