netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Vlad Yasevich <vyasevic@redhat.com>,
	Alexander Duyck <alexander.h.duyck@intel.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	kvm@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	Eric Dumazet <edumazet@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCHv3 net-next 3/8] tun: report orphan frags errors to zero copy callback
Date: Thu, 1 Nov 2012 21:16:32 +0200	[thread overview]
Message-ID: <d9b53564e1d9cbc1ef89fb12fcf48472e618f3e6.1351797353.git.mst@redhat.com> (raw)
In-Reply-To: <cover.1351797353.git.mst@redhat.com>

When tun transmits a zero copy skb, it orphans the frags
which might need to allocate extra memory, in atomic context.
If that fails, notify ubufs callback before freeing the skb
as a hint that device should disable zerocopy mode.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 drivers/net/tun.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 9e28768..b44d7b7 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -728,6 +728,7 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev)
 
 drop:
 	dev->stats.tx_dropped++;
+	skb_tx_error(skb);
 	kfree_skb(skb);
 	rcu_read_unlock();
 	return NETDEV_TX_OK;
-- 
MST

  parent reply	other threads:[~2012-11-01 19:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-01 19:16 [PATCHv3 net-next 0/8] enable/disable zero copy tx dynamically Michael S. Tsirkin
2012-11-01 19:16 ` [PATCHv3 net-next 1/8] skb: report completion status for zero copy skbs Michael S. Tsirkin
2012-11-01 19:16 ` [PATCHv3 net-next 2/8] skb: api to report errors " Michael S. Tsirkin
2012-11-01 19:16 ` Michael S. Tsirkin [this message]
2012-11-01 19:16 ` [PATCHv3 net-next 4/8] vhost-net: cleanup macros for DMA status tracking Michael S. Tsirkin
2012-11-01 19:16 ` [PATCHv3 net-next 5/8] vhost: track zero copy failures using DMA length Michael S. Tsirkin
2012-11-01 19:16 ` [PATCHv3 net-next 6/8] vhost: move -net specific code out Michael S. Tsirkin
2012-11-01 19:16 ` [PATCHv3 net-next 7/8] vhost-net: select tx zero copy dynamically Michael S. Tsirkin
2012-11-01 19:16 ` [PATCHv3 net-next 8/8] vhost-net: reduce vq polling on tx zerocopy Michael S. Tsirkin
2012-11-03  1:31 ` [PATCHv3 net-next 0/8] enable/disable zero copy tx dynamically David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d9b53564e1d9cbc1ef89fb12fcf48472e618f3e6.1351797353.git.mst@redhat.com \
    --to=mst@redhat.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.h.duyck@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=vyasevic@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).