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: Mon, 10 Jul 2023 10:28:17 +0000
From: Suman Ghosh <sumang@...vell.com>
To: Michal Kubiak <michal.kubiak@...el.com>
CC: Sunil Kovvuri Goutham <sgoutham@...vell.com>,
        Geethasowjanya Akula
	<gakula@...vell.com>,
        Subbaraya Sundeep Bhatta <sbhatta@...vell.com>,
        Hariprasad Kelam <hkelam@...vell.com>,
        "davem@...emloft.net"
	<davem@...emloft.net>,
        "edumazet@...gle.com" <edumazet@...gle.com>,
        "kuba@...nel.org" <kuba@...nel.org>,
        "pabeni@...hat.com" <pabeni@...hat.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [EXT] Re: [net PATCH V4] octeontx2-pf: Add additional check for
 MCAM rules


>----------------------------------------------------------------------
>On Fri, Jul 07, 2023 at 09:23:21AM +0530, Suman Ghosh wrote:
>> Due to hardware limitation, MCAM drop rule with ether_type == 802.1Q
>> and vlan_id == 0 is not supported. Hence rejecting such rules.
>>
>> Fixes: dce677da57c0 ("octeontx2-pf: Add vlan-etype to ntuple filters")
>> Signed-off-by: Suman Ghosh <sumang@...vell.com>
>
>(...)
>
>> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c
>> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c
>> @@ -604,6 +604,19 @@ static int otx2_tc_prepare_flow(struct otx2_nic
>*nic, struct otx2_tc_flow *node,
>>  			return -EOPNOTSUPP;
>>  		}
>>
>> +		if (!match.mask->vlan_id) {
>> +			struct flow_action_entry *act;
>> +			int i;
>> +
>> +			flow_action_for_each(i, act, &rule->action) {
>> +				if (act->id == FLOW_ACTION_DROP) {
>> +					netdev_err(nic->netdev, "vlan tpid 0x%x with
>vlan_id %d is not supported for DROP rule.\n",
>> +						   ntohs(match.key->vlan_tpid), match.key-
>>vlan_id);
>> +					return -EOPNOTSUPP;
>
>The code got very nested here.
>Please consider moving the above check to a separate helper function, or
>at least reformatting the error log to fix the checkpatch warning about
>80 chars, for example:
[Suman] Will do the suggested reformatting in next version.
>
>			flow_action_for_each(i, act, &rule->action) {
>				if (act->id == FLOW_ACTION_DROP) {
>					netdev_err(nic->netdev,
>						   "vlan tpid 0x%x with vlan_id %d is not
>supported for DROP rule.\n",
>						   ntohs(match.key->vlan_tpid),
>						   match.key->vlan_id);
>					return -EOPNOTSUPP;
>				}
>
>Thanks,
>Michal

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ