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]
Message-ID: <9bce05f8-8a57-492c-9567-2ecb1f6b8e10@intel.com>
Date: Wed, 24 Jul 2024 13:28:51 -0600
From: Ahmed Zaki <ahmed.zaki@...el.com>
To: Simon Horman <horms@...nel.org>
CC: <intel-wired-lan@...ts.osuosl.org>, <netdev@...r.kernel.org>,
	<anthony.l.nguyen@...el.com>, Sridhar Samudrala
	<sridhar.samudrala@...el.com>, Marcin Szycik <marcin.szycik@...ux.intel.com>
Subject: Re: [PATCH iwl-next v3 12/13] iavf: refactor add/del FDIR filters



On 2024-07-24 10:30 a.m., Simon Horman wrote:
> On Wed, Jul 24, 2024 at 10:14:19AM -0600, Ahmed Zaki wrote:
> 
> ...
> 
>>>> +/**
>>>> + * iavf_fdir_del_fltr - delete a flow director filter from the list
>>>> + * @adapter: pointer to the VF adapter structure
>>>> + * @loc: location to delete.
>>>> + *
>>>> + * Return: 0 on success or negative errno on failure.
>>>> + */
>>>> +int iavf_fdir_del_fltr(struct iavf_adapter *adapter, u32 loc)
>>>> +{
>>>> +	struct iavf_fdir_fltr *fltr = NULL;
>>>> +	int err = 0;
>>>> +
>>>> +	spin_lock_bh(&adapter->fdir_fltr_lock);
>>>> +	fltr = iavf_find_fdir_fltr(adapter, loc);
>>>> +
>>>> +	if (fltr) {
>>>> +		if (fltr->state == IAVF_FDIR_FLTR_ACTIVE) {
>>>> +			fltr->state = IAVF_FDIR_FLTR_DEL_REQUEST;
>>>> +		} else if (fltr->state == IAVF_FDIR_FLTR_INACTIVE) {
>>>> +			list_del(&fltr->list);
>>>> +			kfree(fltr);
>>>> +			adapter->fdir_active_fltr--;
>>>> +			fltr = NULL;
>>>> +		} else {
>>>> +			err = -EBUSY;
>>>> +		}
>>>> +	} else if (adapter->fdir_active_fltr) {
>>>> +		err = -EINVAL;
>>>> +	}
>>>> +
>>>> +	if (fltr && fltr->state == IAVF_FDIR_FLTR_DEL_REQUEST)
>>>> +		iavf_schedule_aq_request(adapter, IAVF_FLAG_AQ_DEL_FDIR_FILTER);
>>>
>>> It seems that prior to this change the condition and call to
>>> iavf_schedule_aq_request were not protected by fdir_fltr_lock, and now they
>>> are. If so, is this change intentional.
>>>
>>
>> yes it is, fltr is member of the list that should be protected by the
>> spinlock.
> 
> Thanks,
> 
> I would suggest moving this into a separate patch: changing locking is a
> bit different to refactoring.
> 
> Or, if not, at least mentioning it in the patch description.

I will mention it in the commit message. A separate patch is an overkill 
IMHO since the function location has changed and the patch would not be 
applied to previous versions.

Thanks,
Ahmed




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ