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:	Wed, 24 Jun 2015 15:56:17 +0530 (IST)
From:	Govindarajulu Varadarajan <_govind@....com>
To:	David Miller <davem@...emloft.net>
cc:	_govind@....com, netdev@...r.kernel.org, ssujith@...co.com,
	benve@...co.com
Subject: Re: [PATCH net-next] enic: use atomic_t instead of spin_lock in busy
 poll

On Wed, 24 Jun 2015, David Miller wrote:

> From: Govindarajulu Varadarajan <_govind@....com>
> Date: Tue, 23 Jun 2015 21:47:50 +0530
>
>> -static inline bool enic_poll_unlock_napi(struct vnic_rq *rq)
>> +static inline void enic_poll_unlock_napi(struct vnic_rq *rq,
>> +					 struct napi_struct *napi)
>>  {
>> -	bool rc = false;
>> -
>> -	spin_lock(&rq->bpoll_lock);
>> -	WARN_ON(rq->bpoll_state &
>> -		(ENIC_POLL_STATE_POLL | ENIC_POLL_STATE_NAPI_YIELD));
>> -	if (rq->bpoll_state & ENIC_POLL_STATE_POLL_YIELD)
>> -		rc = true;
>> -	rq->bpoll_state = ENIC_POLL_STATE_IDLE;
>> -	spin_unlock(&rq->bpoll_lock);
>> -
>> -	return rc;
>> +	WARN_ON(atomic_read(&rq->bpoll_state) != ENIC_POLL_STATE_NAPI);
>> +	napi_gro_flush(napi, false);
>> +	atomic_set(&rq->bpoll_state, ENIC_POLL_STATE_IDLE);
>>  }
>
> I don't understand why you needed to add this napi_gro_flush() call here,
> and regardless of the reason you must explain this, in detail, in your
> commit message,
>

In napi poll, if gro is enabled, we call napi_gro_receive() to deliver the
packets. Before we call napi_complete(), i.e while re-polling, if low
latency busy poll is called, we use netif_receive_skb() to deliver the packets.
At this point if there are some skb's held in GRO, busy poll could deliver the
packets out of order. So we call napi_gro_flush() to flush skbs before we
move the napi poll to idle.

Let me know if this change is OK, I will send new patch with detailed
description.

Thanks
Govind
--
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