lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 28 Jul 2022 19:57:45 +0000
From:   "Mogilappagari, Sudheer" <sudheer.mogilappagari@...el.com>
To:     Jakub Kicinski <kuba@...nel.org>
CC:     "Nguyen, Anthony L" <anthony.l.nguyen@...el.com>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "pabeni@...hat.com" <pabeni@...hat.com>,
        "edumazet@...gle.com" <edumazet@...gle.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "Zhang, Xuejun" <xuejun.zhang@...el.com>,
        "Sreenivas, Bharathi" <bharathi.sreenivas@...el.com>
Subject: RE: [PATCH net 3/3] iavf: enable tc filter configuration only if
 hw-tc-offload is on



> -----Original Message-----
> From: Jakub Kicinski <kuba@...nel.org>
> Sent: Wednesday, July 27, 2022 6:11 PM
> To: Mogilappagari, Sudheer <sudheer.mogilappagari@...el.com>
> Cc: Nguyen, Anthony L <anthony.l.nguyen@...el.com>; davem@...emloft.net;
> pabeni@...hat.com; edumazet@...gle.com; netdev@...r.kernel.org; Zhang,
> Xuejun <xuejun.zhang@...el.com>; Sreenivas, Bharathi
> <bharathi.sreenivas@...el.com>
> Subject: Re: [PATCH net 3/3] iavf: enable tc filter configuration only if
> hw-tc-offload is on
> 
> 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?

Hi Jakub,
You are correct. tc_cls_can_offload_and_chain0() check in iavf_setup_tc_block_cb()
is taking caring of it already. So, this patch is not required.

I had tested with ice driver since it was same as iavf wrt this check.
We will modify ice driver to use tc_cls_can_offload_and_chain0().

Thanks
Sudheer

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ