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:	Tue, 09 Sep 2014 09:46:20 -0700
From:	John Fastabend <john.fastabend@...il.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
CC:	xiyou.wangcong@...il.com, davem@...emloft.net, jhs@...atatu.com,
	netdev@...r.kernel.org, paulmck@...ux.vnet.ibm.com,
	brouer@...hat.com
Subject: Re: [net-next PATCH v3 10/15] net: sched: rcu'ify cls_rsvp

On 09/09/2014 06:27 AM, Eric Dumazet wrote:
> On Mon, 2014-09-08 at 22:58 -0700, John Fastabend wrote:
>> Signed-off-by: John Fastabend <john.r.fastabend@...el.com>
>> ---
>>   net/sched/cls_rsvp.h |  155 +++++++++++++++++++++++++++++---------------------
>>   1 file changed, 89 insertions(+), 66 deletions(-)
>>
>> diff --git a/net/sched/cls_rsvp.h b/net/sched/cls_rsvp.h
>> index 1020e23..8a35bdc 100644

[...]

>> @@ -521,12 +535,17 @@ insert:
>>
>>   			tcf_exts_change(tp, &f->exts, &e);
>>
>> -			for (fp = &s->ht[h2]; *fp; fp = &(*fp)->next)
>> -				if (((*fp)->spi.mask & f->spi.mask) != f->spi.mask)
>> +			fp = &s->ht[h2];
>> +			for (nfp = rtnl_dereference(*fp); nfp;
>> +			     fp = &nfp->next, nfp = rtnl_dereference(*fp)) {
>> +				__u32 mask = nfp->spi.mask & f->spi.mask;
>> +
>> +				if (mask != f->spi.mask)
>>   					break;
>> -			f->next = *fp;
>> +			}
>> +			rcu_assign_pointer(f->next, nfp);
>
> RCU_INIT_POINTER()
>
>>   			wmb();
>
> Are you sure we need to keep this wmb() ? I dont think so.

Agreed, I'll remove it.

>
>> -			*fp = f;
>> +			rcu_assign_pointer(*fp, f);
>>
>>   			*arg = (unsigned long)f;
>>   			return 0;
>> @@ -546,13 +565,15 @@ insert:
>>   		s->protocol = pinfo->protocol;
>>   		s->tunnelid = pinfo->tunnelid;
>>   	}
>> -	for (sp = &data->ht[h1]; *sp; sp = &(*sp)->next) {
>> -		if (((*sp)->dpi.mask&s->dpi.mask) != s->dpi.mask)
>> +	sp = &data->ht[h1];
>> +	for (nsp = rtnl_dereference(*sp); nsp;
>> +	     sp = &nsp->next, nsp = rtnl_dereference(*sp)) {
>> +		if ((nsp->dpi.mask & s->dpi.mask) != s->dpi.mask)
>>   			break;
>>   	}
>> -	s->next = *sp;
>> +	rcu_assign_pointer(s->next, nsp);
>
> 	RCU_INIT_POINTER()
>
>>   	wmb();
>
> This wmb() can be removed.
>

yep, same here I'll remove it.


Thanks,
John

-- 
John Fastabend         Intel Corporation
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists