All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: "Mogilappagari, Sudheer" <sudheer.mogilappagari@intel.com>
Cc: "Nguyen, Anthony L" <anthony.l.nguyen@intel.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"edumazet@google.com" <edumazet@google.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"Zhang, Xuejun" <xuejun.zhang@intel.com>,
	"Sreenivas, Bharathi" <bharathi.sreenivas@intel.com>
Subject: Re: [PATCH net 3/3] iavf: enable tc filter configuration only if hw-tc-offload is on
Date: Wed, 27 Jul 2022 18:10:39 -0700	[thread overview]
Message-ID: <20220727181039.19c7622a@kernel.org> (raw)
In-Reply-To: <IA1PR11MB6266229ADD3AF60477F4FE04E4979@IA1PR11MB6266.namprd11.prod.outlook.com>

On Wed, 27 Jul 2022 23:37:27 +0000 Mogilappagari, Sudheer wrote:
> > > +	if (!(adapter->netdev->features & NETIF_F_HW_TC)) {
> > > +		dev_err(&adapter->pdev->dev,
> > > +			"Can't apply TC flower filters, turn ON hw-tc-offload and try again");  
> > > +		return -EOPNOTSUPP;
> > > +	}
> > > +
> > >  	filter = kzalloc(sizeof(*filter), GFP_KERNEL);
> > >  	if (!filter)
> > >  		return -ENOMEM;  
> > 
> > tc_can_offload() checks this in the core already, no?  
> 
> Hi Jakub,
> Seems like there is no check in core code in this path. Tested again
> to confirm that no error is thrown by core code. Below is the call
> trace while adding filter.
> [  927.358001]  dump_stack_lvl+0x44/0x58
> [  927.358009]  ice_add_cls_flower+0x73/0x90 [ice]
> [  927.358066]  tc_setup_cb_add+0xc7/0x1e0
> [  927.358074]  fl_hw_replace_filter+0x143/0x1e0 [cls_flower]
> [  927.358081]  fl_change+0xbc3/0xed8 [cls_flower]
> [  927.358086]  tc_new_tfilter+0x382/0xbc0

Oh, you're right, we moved to drivers doing the check it seems.

But you already have a check in iavf_setup_tc_block_cb()
- tc_cls_can_offload_and_chain0() should validate the device has
TC offload enabled. It that not working somehow?

  reply	other threads:[~2022-07-28  1:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-25 17:04 [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2022-07-25 Tony Nguyen
2022-07-25 17:04 ` [PATCH net 1/3] iavf: Fix max_rate limiting Tony Nguyen
2022-07-25 17:04 ` [PATCH net 2/3] iavf: Fix 'tc qdisc show' listing too many queues Tony Nguyen
2022-07-25 17:04 ` [PATCH net 3/3] iavf: enable tc filter configuration only if hw-tc-offload is on Tony Nguyen
2022-07-26  2:45   ` Jakub Kicinski
2022-07-27 23:37     ` Mogilappagari, Sudheer
2022-07-28  1:10       ` Jakub Kicinski [this message]
2022-07-28 19:57         ` Mogilappagari, Sudheer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220727181039.19c7622a@kernel.org \
    --to=kuba@kernel.org \
    --cc=anthony.l.nguyen@intel.com \
    --cc=bharathi.sreenivas@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sudheer.mogilappagari@intel.com \
    --cc=xuejun.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.