[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4AF87070.6020007@trash.net>
Date: Mon, 09 Nov 2009 20:41:36 +0100
From: Patrick McHardy <kaber@...sh.net>
To: Linux Netdev List <netdev@...r.kernel.org>
CC: Herbert Xu <herbert@...dor.apana.org.au>,
Jarek Poplawski <jarkao2@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Stephen Hemminger <shemminger@...tta.com>
Subject: RFC: net: allow to propagate errors through ->ndo_hard_start_xmit()
I've updated my patch to propagate error values (errno and NET_XMIT
codes) through ndo_hard_start_xmit() and incorporated the suggestions
made last time, namely:
- move slightly complicated return value check to inline function and
add a few comments
- fix error handling while in the middle of transmitting GSO skbs
I've also audited the tree once again for invalid return values and
found a single remaining instance in a Wimax driver, I'll take care
of that later.
Two questions remain:
- I'm not sure the error handling in dev_hard_start_xmit() for GSO
skbs is optimal. When the driver returns an error, it is assumed
the current segment has been freed. The patch then frees the
entire GSO skb, including all remaining segments. Alternatively
it could try to transmit the remaining segments later.
- Stephen recently introduced an enum for the netdev_tx codes, with
this patch drivers are allowed to return different values.
The mainly useful part about Stephen's patch IMO is the netdev_tx
typedef to make it easier to locate ndo_start_xmit() functions
which are defined in different files than the netdev_ops.
So we could remove the enum again and simply typedef an int.
Any opinions are welcome :)
View attachment "01.diff" of type "text/x-patch" (6262 bytes)
Powered by blists - more mailing lists