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-next>] [day] [month] [year] [list]
Message-Id: <1422859762.7028.2@smtp.corp.redhat.com>
Date:	Mon, 02 Feb 2015 06:57:22 +0008
From:	Jason Wang <jasowang@...hat.com>
To:	Haiyang Zhang <haiyangz@...rosoft.com>
Cc:	"davem@...emloft.net" <davem@...emloft.net>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	KY Srinivasan <kys@...rosoft.com>,
	"olaf@...fle.de" <olaf@...fle.de>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"driverdev-devel@...uxdriverproject.org" 
	<driverdev-devel@...uxdriverproject.org>
Subject: RE: [PATCH net] hyperv: Fix the error processing in netvsc_send()



On Fri, Jan 30, 2015 at 11:05 PM, Haiyang Zhang 
<haiyangz@...rosoft.com> wrote:
> 
> 
>>  -----Original Message-----
>>  From: Jason Wang [mailto:jasowang@...hat.com]
>>  Sent: Friday, January 30, 2015 5:25 AM
>>  > +	if (ret != 0) {
>>  > +		if (section_index != NETVSC_INVALID_INDEX)
>>  > +			netvsc_free_send_slot(net_device, section_index);
>>  
>>  What if ret is -EINVAL or -ENOSPC? Looks like we need free the skb 
>> in
>>  this case also.
> 
> In these cases, skb is freed in netvsc_start_xmit().
> 
> 
>>  >
>>  > +	} else if (skb) {
>>  > +		dev_kfree_skb_any(skb);
>>  
>>  The caller - netvsc_start_xmit() do this also, may be handle this in
>>  caller is better since netvsc_start_xmit() is the only user that 
>> tries
>>  to send a skb?
> 
> When the packet is sent out normally, we frees it in netvsc_send() if 
> it's
> copied to send-buffer. The free is done in netvsc_send(), because the 
> copy
> is also in this function. If it's not copied, it will be freed in 
> another
> function -- netvsc_xmit_completion().
> 
> netvsc_start_xmit() only does free skb in error case.

Ok.
> 
> 
>>  btw, I find during netvsc_start_xmit(), ret was change to -ENOSPC 
>> when
>>  queue_sends[q_idx] < 1. But non of the caller check -ENOSPC in fact?
> 
> In this case, we don't request re-send, so set ret to a value other 
> than
> -EAGAIN. 

Why not? We have available slots for it to be sent now. Dropping the 
packet in this case may cause out of order sending.
> It's handled in the same way as errors != -EAGAIN, so we don't
> need to check this value specifically.

Thanks

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ