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] [thread-next>] [day] [month] [year] [list]
Message-ID: <IA1PR11MB6266229ADD3AF60477F4FE04E4979@IA1PR11MB6266.namprd11.prod.outlook.com>
Date:   Wed, 27 Jul 2022 23:37:27 +0000
From:   "Mogilappagari, Sudheer" <sudheer.mogilappagari@...el.com>
To:     Jakub Kicinski <kuba@...nel.org>,
        "Nguyen, Anthony L" <anthony.l.nguyen@...el.com>
CC:     "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: Monday, July 25, 2022 7:46 PM
> To: Nguyen, Anthony L <anthony.l.nguyen@...el.com>
> Cc: davem@...emloft.net; pabeni@...hat.com; edumazet@...gle.com;
> Mogilappagari, Sudheer <sudheer.mogilappagari@...el.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 Mon, 25 Jul 2022 10:04:52 -0700 Tony Nguyen wrote:
> > From: Sudheer Mogilappagari <sudheer.mogilappagari@...el.com>
> >
> > Allow configuration of tc filter only if NETIF_F_HW_TC is set for the
> > device.
> >
> > Fixes: 0075fa0fadd0 ("i40evf: Add support to apply cloud filters")
> > Signed-off-by: Sudheer Mogilappagari <sudheer.mogilappagari@...el.com>
> > Signed-off-by: Jun Zhang <xuejun.zhang@...el.com>
> > Tested-by: Bharathi Sreenivas <bharathi.sreenivas@...el.com>
> > Signed-off-by: Tony Nguyen <anthony.l.nguyen@...el.com>
> > ---
> >  drivers/net/ethernet/intel/iavf/iavf_main.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c
> > b/drivers/net/ethernet/intel/iavf/iavf_main.c
> > index 3dbfaead2ac7..9279bb37e4aa 100644
> > --- a/drivers/net/ethernet/intel/iavf/iavf_main.c
> > +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
> > @@ -3802,6 +3802,12 @@ static int iavf_configure_clsflower(struct
> iavf_adapter *adapter,
> >  		return -EINVAL;
> >  	}
> >
> > +	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

Thanks
Sudheer


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ