From: David Miller <davem@davemloft.net>
To: kaber@trash.net
Cc: netdev@vger.kernel.org
Subject: Re: [RFC net 00/03]: dev_queue_xmit error propagation
Date: Thu, 11 Jun 2009 03:18:52 -0700 (PDT) [thread overview]
Message-ID: <20090611.031852.90563118.davem@davemloft.net> (raw)
In-Reply-To: <20090609161658.6730.59754.sendpatchset@x2.localnet>
From: Patrick McHardy <kaber@trash.net>
Date: Tue, 9 Jun 2009 18:16:59 +0200 (MEST)
> Currently the ->ndo_hard_start_xmit() callbacks are only permitted to return
> one of the NETDEV_TX codes. This prevents any kind of error propagation for
> virtual devices, like queue congestion of the underlying device in case of
> layered devices, or unreachability in case of tunnels.
>
> These patches change the return conventions so hard_start_xmit() can return
> a NETDEV_TX code, an errno code or a NET_XMIT code. This means it can
> additionally to the NETDEV_TX codes simply return the value of dev_queue_xmit().
>
> When queueing is used, errors can't be propagated back since transmission is
> asynchronously and all non-NETDEV codes are mapped to NETDEV_TX_OK, reflecting
> the fact that the skb is consumed unconditionally.
>
> In case of virtual devices not using queueing, the NETDEV_TX codes are consumed
> by dev_queue_xmit(), everything else is returned to the higher layers.
>
> The end result is that virtual network devices can propagate queue congestion
> state of the underlying device, or other errors, back to the socket layer.
> One immediately useful effect is that TCP can make use of this information
> as is currently done with non-virtual devices. But it also seems useful in case
> of tunnels, which can return more meaningful errors, or for statistics.
>
> Comments welcome. A review of my changes in dev_hard_start_xmit() would be
> especially appreciated :)
These changes look fine to me.
That one if() conditional checking 'ret' for three different
properties is stretching the brain a bit. Maybe you can
encapsulate that sucker into an inline function with suitable
comments. That way when someone reads the test, it just says
what it is looking for, rather than being some complicated
set of tests.
Once you fix that up and the problem Eric spotted in patch #3
feel free to formally submit this.
Thanks!
next prev parent reply other threads:[~2009-06-11 10:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-09 16:16 [RFC net 00/03]: dev_queue_xmit error propagation Patrick McHardy
2009-06-09 16:17 ` [RFC net-sched 01/03]: use symbolic NET_XMIT constants in qdiscs Patrick McHardy
2009-06-09 16:17 ` [RFC net 02/03]: allow to propagate errors through ->ndo_hard_start_xmit() Patrick McHardy
2009-06-16 9:25 ` Jarek Poplawski
2009-06-19 12:23 ` Patrick McHardy
2009-06-09 16:17 ` [RFC vlan 03/03]: propagate transmission state Patrick McHardy
2009-06-09 16:34 ` Eric Dumazet
2009-06-09 16:37 ` Patrick McHardy
2009-06-11 10:18 ` David Miller [this message]
2009-06-11 16:33 ` [RFC net 00/03]: dev_queue_xmit error propagation Patrick McHardy
2009-06-12 0:05 ` David Miller
2009-06-12 0:10 ` Patrick McHardy
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=20090611.031852.90563118.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
/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).