From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (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 BF13130F95F for ; Thu, 29 Jan 2026 01:01:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769648479; cv=none; b=Ewe4au1BLAr3qZEtlPu7Sr0rX3aozHwM1q5pqUPSMvHhzbcHNePB/b8kh1d6ZGp/LN4ZnWyWpd4nvg6y7phnujRg8XIbb1BrD7k+7BgoqY4jkahHAnoAhpwKCatE+gcMA6UCynXnYgnDpb9/uOQ73RVICjWOwi/Hfsp+dMioDYo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769648479; c=relaxed/simple; bh=TWjP6ZADgKUe4VsEEJWe37T1+623sBH9m5v28UVcsp8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VBbTHS4ueYtBzKEZZ3ZsIIJSWQ0XZp/xC785L4KdsG/+jmkOHzxqarSlFTc++fSFYLZYJ1MXKKP9ojKbBY7W/kOdD5fUyuzJ8VNPmFpQeZbI9RDchPdNLnSv5Wcl7fhyc7rseHH6WuYOLpR4VW9OKPJ45TEHFQcl4Kv1pbygRsE= 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=kuOOkmhA; arc=none smtp.client-ip=209.85.210.170 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="kuOOkmhA" Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-81e93c5961cso363839b3a.0 for ; Wed, 28 Jan 2026 17:01:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dama-to.20230601.gappssmtp.com; s=20230601; t=1769648477; x=1770253277; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:from:to:cc:subject:date:message-id:reply-to; bh=n/q7c9XKTy03X7ABvxQisB8sZ2KrW1t2ngCelRKREuA=; b=kuOOkmhAmhXqHnrg/2SnuKR4P3THrl92WEs+oOGXwrUnYXNVK3CMqvlPprC0aTUdX3 EQlOw2zkHfNXjlVEYUKtz9tBPwVuAcXO64NKxDQho/rdZiMJcdqkeTms78TFgdsjPxWv 6HVgC97Y89XaipO57XH0g3w3xwnio0jF2ybZAoU2DcjXa2E6gNGNf/kTV7TdLuoyQ3ZN 0k4xF/wRMA5MIf3ViUwEHPsQmWVuR+J3OZ/A8E49RNeJqDYZKivMOlxlV3BaPKB9zGgh reIGnhaMgQRoXgFret7ErM8iBxtv9DtijSkUpI7GrbyG8LkRBWevdaDfoom8QMVxwWfs akGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769648477; x=1770253277; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=n/q7c9XKTy03X7ABvxQisB8sZ2KrW1t2ngCelRKREuA=; b=mtVaUM4TRzs0/yd/AvSh+q+XpFkjQRi1QzJXJluE1m/e0O5FEg8uKD/RZ4062wcb5Q ygxHdpeKIj4U0QUDiTbfmmpMbyP5fHZDfXDbgCf6VGtmi+qDDP9uND8/stdjJnANZQyJ rjFQ+E0nsIFxKnkyAkequckguLNiPWMVSjew0t36WolPIHd4LB+LKgK5as45i4xfWNRv jf9G8J8ctsxWZE0h+ZFCOU4UN6n1/t+qNrGMHqElUnViQPx6nFVTwiLyEvurqxJ46Y0N +xCp5XsbrbHVBwsHT4fOderfD87EkS2f6jh/WK7HgOtGSs+/sIxgT02DXnVuzMp/I6ui QbFg== X-Gm-Message-State: AOJu0YxBaqOXMnhC29fnr97OtEjfLkzo1UAJG9SMNaWZp5WM5mUoOLqk waiYtduiosJF/UirEgUkfobBUtI+zlDzgmL8sMVdsfgGLtMZ9UUD0foycLmxVNkwutU= X-Gm-Gg: AZuq6aIoHiQYU96hNRSlZetL+byZNH8M1yC47RI2xi9grs/TbcS2sGtC7Jz309vdob1 iAYm8rnWRzUIBe8rKazvMSlupEaRb3yYJOHyp7FdZAc6tZJIhlZknRmfBi+uwkf/SB++mSft5PI +dQgZ64kHgFvgw7FP9yRUriPYgRXSMGKfrnW/3UVZRg+PrTv6VKOCOU2nzvfEXbHnWz/SDbx1nu fERyGZDX5Y/eqCDHNpONlF+p4IG+3DSkOMAwNrsDsiwhzWoLxquRxAMS1M64NG071c6bKSbIPVM Xe4nyRtEOPLQD46gqIoZAYbzRjbMj4YN6fMK6mNRXVXUYjmhL+KbAJ5D5IwsHEolSSfK9k0QfCu Tt0sF1zlFFC6N69f3JRoPOmCKBC0Un0Q9XE+UFcQDwQ/B6gvhtRjqNasRfs8ApWKHRzU= X-Received: by 2002:a05:6a00:761b:b0:81f:9bf3:6deb with SMTP id d2e1a72fcca58-823691975edmr5073986b3a.15.1769648476970; Wed, 28 Jan 2026 17:01:16 -0800 (PST) Received: from localhost ([2a03:2880:2ff:2::]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82379b59e10sm3681291b3a.25.2026.01.28.17.01.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jan 2026 17:01:16 -0800 (PST) Date: Wed, 28 Jan 2026 17:01:15 -0800 From: Joe Damato To: Michael Chan Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Pavan Chebbi , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , shruti.parab@broadcom.com Subject: Re: [PATCH net-next] bnxt_en: Allow ntuple filters for drops Message-ID: Mail-Followup-To: Joe Damato , Michael Chan , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Pavan Chebbi , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , shruti.parab@broadcom.com References: <20260128222718.1679581-1-joe@dama.to> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Jan 28, 2026 at 03:09:21PM -0800, Michael Chan wrote: > On Wed, Jan 28, 2026 at 2:27 PM Joe Damato wrote: > > > > 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. > > Please add the Fixes tag. It looks like the drop action never worked > properly because of the vf check. I haven't been able to verify, but based on reading the code it looks like this path may not have worked since the code was introduced. In that case, a fixes tag isn't needed because this is essentially new functionality. > > --- > > drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c | 10 ++++++---- > > 1 file changed, 6 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c > > index 6b15fedbb16f..fd32231bf8e0 100644 > > --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c > > +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c > > @@ -1353,10 +1353,12 @@ static int bnxt_add_ntuple_cls_rule(struct bnxt *bp, > > if (!bp->vnic_info) > > return -EAGAIN; > > > > - vf = ethtool_get_flow_spec_ring_vf(fs->ring_cookie); > > - ring = ethtool_get_flow_spec_ring(fs->ring_cookie); > > - if ((fs->flow_type & (FLOW_MAC_EXT | FLOW_EXT)) || vf) > > - return -EOPNOTSUPP; > > + if (fs->ring_cookie != RX_CLS_FLOW_DISC) { > > + vf = ethtool_get_flow_spec_ring_vf(fs->ring_cookie); > > + ring = ethtool_get_flow_spec_ring(fs->ring_cookie); > > + if ((fs->flow_type & (FLOW_MAC_EXT | FLOW_EXT)) || vf) > > I think the FLOW_MAC_EXT and FLOW_EXT checks should be done unconditionally. OK, I'll change the patch so that -EOPNOTSUPP is returned unconditionally if (FLOW_MAC_EXT | FLOW_EXT) are set and then do the RX_CLS_FLOW_DISC flow check before calling ethtool_get_flow_spec_ring_vf. > Alternatively, we can also change ethtool_get_flow_spec_ring_vf() to > check that the cookie is not RX_CLS_FLOW_DISC or RX_CLS_FLOW_WAKE. That's up to the maintainers. The existing drivers I checked which use ethtool_get_flow_spec_ring_vf all explicitly check RX_CLS_FLOW_DISC, so it seems to be an established pattern. I think we should fix this in the broadcom driver first and if there is a desire from the maintainers to handle this in ethtool_get_flow_spec_ring_vf, that can be done as a separate series which updates all of the drivers to remove the redundant check.