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]
Date:   Fri, 3 Feb 2017 07:53:44 +0100
From:   Jiri Pirko <jiri@...nulli.us>
To:     David Miller <davem@...emloft.net>
Cc:     netdev@...r.kernel.org, idosch@...lanox.com, eladr@...lanox.com,
        mlxsw@...lanox.com, ogerlitz@...lanox.com, jhs@...atatu.com,
        ivecera@...hat.com, jbenc@...hat.com
Subject: Re: [patch net-next 17/19] mlxsw: spectrum: Introduce ACL core with
 simple TCAM implementation

Thu, Feb 02, 2017 at 11:34:48PM CET, davem@...emloft.net wrote:
>From: Jiri Pirko <jiri@...nulli.us>
>Date: Thu,  2 Feb 2017 16:12:57 +0100
>
>> +static int mlxsw_sp_acl_tcam_region_id_get(struct mlxsw_sp_acl_tcam *tcam,
>> +					   u16 *p_id)
>> +{
>> +	u16 id;
>> +
>> +	id = find_first_zero_bit(tcam->used_regions, tcam->max_regions);
>> +	if (id < tcam->max_regions) {
>> +		set_bit(id, tcam->used_regions);
> ...
>> +static void mlxsw_sp_acl_tcam_region_id_put(struct mlxsw_sp_acl_tcam *tcam,
>> +					    u16 id)
>> +{
>> +	clear_bit(id, tcam->used_regions);
>> +}
>> +
>> +static int mlxsw_sp_acl_tcam_group_id_get(struct mlxsw_sp_acl_tcam *tcam,
>> +					  u16 *p_id)
>> +{
>> +	u16 id;
>> +
>> +	id = find_first_zero_bit(tcam->used_groups, tcam->max_groups);
>> +	if (id < tcam->max_groups) {
>> +		set_bit(id, tcam->used_groups);
> ...
>> +static void mlxsw_sp_acl_tcam_group_id_put(struct mlxsw_sp_acl_tcam *tcam,
>> +					   u16 id)
>> +{
>> +	clear_bit(id, tcam->used_groups);
>> +}
>
>Please use __set_bit() and __clear_bit() here since it seems very clear that
>you do not require atomic operations.

Will do.

Powered by blists - more mailing lists