From nobody Sun Feb 8 16:53:26 2026 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8CD6023D7C2 for ; Fri, 30 Jan 2026 00:23:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769732616; cv=none; b=OtopkoGqu8zmg3S76ayc8wN8AOdflDcI8qrsgdw+deAZxyLyME3cs0NezuUphEq1GgERJrzP1EO88kYzKOPZy0zTuGjuGDLa4skwWJgvb/ATJsxEx48DbBqQ+pK7A+V/y7xSjXpQpmf3na5v1JJLV1lNKNbckk+zNs+e1oPPtnQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769732616; c=relaxed/simple; bh=Bez8Q5r36ysIFUldkr/8dIXuKz9tz3zg5yj/t6pbohQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=MtxiNDa6IS/srl2qcdWVbVFXKNJEUy/S5SkMwnR0HiySx38lGyVeFJZsQcMSBF4b/ES8BjFCAa/C79Gf0n4hBUsYoZLfLL754TUmXazj/AopQZa97otHftsNdr6XAuXGb58s+ABUklWH6LusEy5wNbcflX+Dk6HEMvl9pJMHZrc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dama.to; spf=none smtp.mailfrom=dama.to; dkim=pass (2048-bit key) header.d=dama-to.20230601.gappssmtp.com header.i=@dama-to.20230601.gappssmtp.com header.b=aWiE6dzV; arc=none smtp.client-ip=209.85.210.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dama.to Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=dama.to Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dama-to.20230601.gappssmtp.com header.i=@dama-to.20230601.gappssmtp.com header.b="aWiE6dzV" Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-82318702afbso1397206b3a.1 for ; Thu, 29 Jan 2026 16:23:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dama-to.20230601.gappssmtp.com; s=20230601; t=1769732614; x=1770337414; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=CYTSAYfgo6LKzK29EiEZAvRbOdiFgqzpufodvAYyN7c=; b=aWiE6dzVYgyLdm2dATGrh3CuKH3Dt4ukbf70oT5h1MquA2ArAGXRRU5X1p6Qfjtcou mP4lhQzvDLJ/52jEwOEr8QVbJ0XXgQ7mlIectLwNVBxGt5hiYIu1ITVsMcqICy5dxrlk ZxsdaWzYYvZqBfmmVt4FlRTSz68+8bMMsOUhRyaOubqXXmrq5j8rNYOjTmbOyCxfgq87 m0xnc031GZFXuBWdD98gyYR5gS+2W9zJl+VBonaO6jR23MmDD+bKTl8G81fFuOzKeOqx iRaOQ35j6DWKMWvL2tjiKXn1qdRloqOwLYiD6LdU0Gak5FZhHkN366wpqmHbsMRuX4Km y4YA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769732614; x=1770337414; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CYTSAYfgo6LKzK29EiEZAvRbOdiFgqzpufodvAYyN7c=; b=UgCKv0p77bLIVDbAu6Pvw2YRnzt/gtfJJYLKzNM/PywxLTc/QqomuBADORt7Y3Owvh N+zhJsjTKmNFniTIQuUtr1ssgdiTN0n3Vn1jzsX7ahYMwVieVph5JdQXGPpnNGeBjpYa p84j2AEFE0iZzsE0nxq2HVgIMe3YLyRkQFwKAJMQEfE2w2epHKPinHXxENkHuv0f99b6 bVemZ9OhqqpblZ2QkdIJNb2WrcoxDkXmz041QPzTsGIGAlHjVC1SJ7T5d2jxZru4G7gw yh74ADaxXDk2YiZ9bYOHIcK9JEvUBrV+HVxoD+y0c4u5ZHpa0bQY2UWS/xwhSSMby1hU FKlQ== X-Forwarded-Encrypted: i=1; AJvYcCXniWg2XNtOvMERXRZXaSLPUZZLn2iTQpSjAfY3N95QjqEtzwLenGe4XK3cztLf7V12rf9IfDePQHijeEU=@vger.kernel.org X-Gm-Message-State: AOJu0Yw85LIkNDd296MTOTmZbITTgU0YZ6zJKpsHuCqWkdfe+Ywbqato N3XAP8MwYk7/aL5jDJppBf1sEQr83oZmEvSI/GadWDiVoIAe51BSV8TPLtG6aSlqsWc= X-Gm-Gg: AZuq6aLN6HmRrQ288kdckWxzVXMUVVHjMTc8cZXG7Qh7hNzLm/ryDowujlsnjbDGhN8 JugLp5RTlS8/BSUigZht8jaBw24JK2aYCzHcWyJIgJ8bQGEfR+2ysuXNSdW9HaVlc3lRplek4xk UAwiqlyRW8aIhed+qpRD8t8reT2tFCFXqhaSdCDOfSQ32nYxZ2EEWxDd7jBdOc3bg2QNCLP6/T0 +TTCXo1agaC0MW92bTs3XPHmJSHSxVkiphkpotWRHGV0QYqvP49EjL9ZkFs0t9MJmeN5ylyGVfL Hn4In9hciG6oTvu8GeelSKGBXWDeATOZdRaaeG1RoODZieWf0Q43DRmnFwdl8o7UoJyxPfVZD1A qmk6hEVF4LzepAwAsoQ7NfwAc5adsgabWPqeYCF/6nJejWJrz4+sSs9YJFJkEjEMAMiU= X-Received: by 2002:a05:6a00:13a2:b0:81f:41cb:c7de with SMTP id d2e1a72fcca58-823ab64017fmr990174b3a.14.1769732613888; Thu, 29 Jan 2026 16:23:33 -0800 (PST) Received: from localhost ([2a03:2880:2ff:8::]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82379c22672sm6406716b3a.51.2026.01.29.16.23.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jan 2026 16:23:33 -0800 (PST) From: Joe Damato To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Chan , Pavan Chebbi , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: shruti.parab@broadcom.com, Joe Damato Subject: [PATCH net-next v2] bnxt_en: Allow ntuple filters for drops Date: Thu, 29 Jan 2026 16:23:22 -0800 Message-ID: <20260130002323.2561266-1-joe@dama.to> X-Mailer: git-send-email 2.47.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" It appears that in commit 7efd79c0e689 ("bnxt_en: Add drop action support for ntuple"), bnxt gained support for ntuple filters for packet drops. However, support for this does not seem to work in recent kernels or against net-next: % sudo ethtool -U eth0 flow-type udp4 src-ip 1.1.1.1 action -1 rmgr: Cannot insert RX class rule: Operation not supported Cannot insert classification rule The issue is that the existing code uses ethtool_get_flow_spec_ring_vf, which will return a non-zero value if the ring_cookie is set to RX_CLS_FLOW_DISC, which then causes bnxt_add_ntuple_cls_rule to return -EOPNOTSUPP because it thinks the user is trying to set an ntuple filter for a vf. Fix this by first checking that the ring_cookie is not RX_CLS_FLOW_DISC. After this patch, ntuple filters for drops can be added: % sudo ethtool -U eth0 flow-type udp4 src-ip 1.1.1.1 action -1 Added rule with ID 0 % ethtool -n eth0 44 RX rings available Total 1 rules Filter: 0 Rule Type: UDP over IPv4 Src IP addr: 1.1.1.1 mask: 0.0.0.0 Dest IP addr: 0.0.0.0 mask: 255.255.255.255 TOS: 0x0 mask: 0xff Src port: 0 mask: 0xffff Dest port: 0 mask: 0xffff Action: Drop Signed-off-by: Joe Damato Reviewed-by: Michael Chan --- v2: - Extract the FLOW_MAC_EXT and FLOW_EXT check so it happens unconditional= ly.=20 - Eliminate the local variable ring, which was used in only one place and call ethtool_get_flow_spec_ring instead. v1: https://lore.kernel.org/netdev/20260128222718.1679581-1-joe@dama.to/ drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/ne= t/ethernet/broadcom/bnxt/bnxt_ethtool.c index 6b15fedbb16f..eebe78628cbb 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c @@ -1346,18 +1346,22 @@ static int bnxt_add_ntuple_cls_rule(struct bnxt *bp, struct bnxt_l2_filter *l2_fltr; struct bnxt_flow_masks *fmasks; struct flow_keys *fkeys; - u32 idx, ring; + u32 idx; int rc; u8 vf; =20 if (!bp->vnic_info) return -EAGAIN; =20 - vf =3D ethtool_get_flow_spec_ring_vf(fs->ring_cookie); - ring =3D ethtool_get_flow_spec_ring(fs->ring_cookie); - if ((fs->flow_type & (FLOW_MAC_EXT | FLOW_EXT)) || vf) + if (fs->flow_type & (FLOW_MAC_EXT | FLOW_EXT)) return -EOPNOTSUPP; =20 + if (fs->ring_cookie !=3D RX_CLS_FLOW_DISC) { + vf =3D ethtool_get_flow_spec_ring_vf(fs->ring_cookie); + if (vf) + return -EOPNOTSUPP; + } + if (flow_type =3D=3D IP_USER_FLOW) { if (!bnxt_verify_ntuple_ip4_flow(&fs->h_u.usr_ip4_spec, &fs->m_u.usr_ip4_spec)) @@ -1481,7 +1485,7 @@ static int bnxt_add_ntuple_cls_rule(struct bnxt *bp, if (fs->ring_cookie =3D=3D RX_CLS_FLOW_DISC) new_fltr->base.flags |=3D BNXT_ACT_DROP; else - new_fltr->base.rxq =3D ring; + new_fltr->base.rxq =3D ethtool_get_flow_spec_ring(fs->ring_cookie); __set_bit(BNXT_FLTR_VALID, &new_fltr->base.state); rc =3D bnxt_insert_ntp_filter(bp, new_fltr, idx); if (!rc) { base-commit: 239f09e258b906deced5c2a7c1ac8aed301b558b --=20 2.47.3