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: Tue, 21 Nov 2023 16:20:11 +0000
From: Suman Ghosh <sumang@...vell.com>
To: Simon Horman <horms@...nel.org>
CC: Wojciech Drewek <wojciech.drewek@...el.com>,
        Sunil Kovvuri Goutham
	<sgoutham@...vell.com>,
        Geethasowjanya Akula <gakula@...vell.com>,
        Subbaraya
 Sundeep Bhatta <sbhatta@...vell.com>,
        Hariprasad Kelam <hkelam@...vell.com>,
        Linu Cherian <lcherian@...vell.com>,
        Jerin Jacob Kollanukkaran
	<jerinj@...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] octeontx2-pf: Fix ntuple rule creation to
 direct packet to VF with higher Rx queue than its PF

>> >ethtool_rxnfc *nfc)
>> >>  	struct ethhdr *eth_hdr;
>> >>  	bool new = false;
>> >>  	int err = 0;
>> >> +	u64 vf_num;
>> >>  	u32 ring;
>> >>
>> >>  	if (!flow_cfg->max_flows) {
>> >> @@ -1100,9 +1101,26 @@ int otx2_add_flow(struct otx2_nic *pfvf,
>> >> struct
>> >ethtool_rxnfc *nfc)
>> >>  	if (!(pfvf->flags & OTX2_FLAG_NTUPLE_SUPPORT))
>> >>  		return -ENOMEM;
>> >>
>> >> +	/* Number of queues on a VF can be greater or less than
>> >> +	 * the PF's queue. Hence no need to check for the
>> >> +	 * queue count. Hence no need to check queue count if PF
>> >> +	 * is installing for its VF. Below is the expected vf_num
>value
>> >> +	 * based on the ethtool commands.
>> >> +	 *
>> >> +	 * e.g.
>> >> +	 * 1. ethtool -U <netdev> ... action -1  ==> vf_num:255
>> >> +	 * 2. ethtool -U <netdev> ... action <queue_num>  ==> vf_num:0
>> >> +	 * 3. ethtool -U <netdev> ... vf <vf_idx> queue <queue_num>
>==>
>> >> +	 *    vf_num:vf_idx+1
>> >> +	 */
>> >> +	vf_num = ethtool_get_flow_spec_ring_vf(fsp->ring_cookie);
>> >> +	if (!is_otx2_vf(pfvf->pcifunc) && vf_num)
>> >> +		goto bypass_queue_check;
>> >
>> >Let's just add this condition to the next if, no need for goto.
>> [Suman] I kept it a separate check to make the code more readable.
>Otherwise the next if condition will be complicated.
>
>Readability is subjective, but, FWIIW, I'd also prefer to avoid a goto
>here.
[Suman] Okay. Since both of you are suggesting the same change, I will update the same in v2.
>
>> >> +
>> >>  	if (ring >= pfvf->hw.rx_queues && fsp->ring_cookie !=
>> >RX_CLS_FLOW_DISC)
>> >>  		return -EINVAL;
>> >>
>> >> +bypass_queue_check:
>> >>  	if (fsp->location >= otx2_get_maxflows(flow_cfg))
>> >>  		return -EINVAL;
>> >>
>> >> @@ -1182,6 +1200,9 @@ int otx2_add_flow(struct otx2_nic *pfvf,
>> >> struct
>> >ethtool_rxnfc *nfc)
>> >>  		flow_cfg->nr_flows++;
>> >>  	}
>> >>
>> >> +	if (flow->is_vf)
>> >> +		netdev_info(pfvf->netdev,
>> >> +			    "Make sure that VF's queue number is within its
>queue
>> >> +limit\n");
>> >>  	return 0;
>> >>  }
>> >>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ