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: <20100621105329.GA9506@redhat.com>
Date:	Mon, 21 Jun 2010 13:53:29 +0300
From:	"Michael S. Tsirkin" <mst@...hat.com>
To:	Rusty Russell <rusty@...tcorp.com.au>
Cc:	Stephen Hemminger <shemminger@...tta.com>,
	Sridhar Samudrala <sri@...ibm.com>,
	virtualization@...ts.linux-foundation.org,
	Jiri Pirko <jpirko@...hat.com>, Shirley Ma <xma@...ibm.com>,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH for-2.6.35] virtio_net: fix oom handling on tx

On Mon, Jun 21, 2010 at 07:53:43PM +0930, Rusty Russell wrote:
> On Mon, 21 Jun 2010 06:03:16 pm Michael S. Tsirkin wrote:
> > On Mon, Jun 21, 2010 at 12:13:49PM +0930, Rusty Russell wrote:
> > > -		return NETDEV_TX_BUSY;
> > > +		kfree_skb(skb);
> > > +		return NETDEV_TX_OK;
> > 
> > If we do so, let's increment the dropped counter and/or error counter?
> 
> Yep, here's the extra change:

Looks good to me.

> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -571,14 +571,16 @@ static netdev_tx_t start_xmit(struct sk_
>  	/* This can happen with OOM and indirect buffers. */
>  	if (unlikely(capacity < 0)) {
>  		if (net_ratelimit()) {
> -			if (likely(capacity == -ENOMEM))
> +			if (likely(capacity == -ENOMEM)) {
>  				dev_warn(&dev->dev,
>  					 "TX queue failure: out of memory\n");
> -			else
> +			} else {
> +				dev->stats.tx_fifo_errors++;
>  				dev_warn(&dev->dev,
>  					 "Unexpected TX queue failure: %d\n",
>  					 capacity);
>  		}
> +		dev->stats.tx_dropped++;
>  		kfree_skb(skb);
>  		return NETDEV_TX_OK;
>  	}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ