[TCP/DCCP]: Introduce net_xmit_eval
Throughout the TCP/DCCP (and tunnelling) code, it often happens that the return code of a transmit function needs to be tested against NET_XMIT_CN which is a value that does not indicate a strict error condition. This patch uses a macro for these recurring situations which is consistent with the already existing macro net_xmit_errno, saving on duplicated code. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This commit is contained in:
committed by
David S. Miller
parent
1ed176a801
commit
b9df3cb8cf
@@ -66,6 +66,10 @@ struct netpoll_info;
|
||||
#define NET_RX_CN_HIGH 4 /* The storm is here */
|
||||
#define NET_RX_BAD 5 /* packet dropped due to kernel error */
|
||||
|
||||
/* NET_XMIT_CN is special. It does not guarantee that this packet is lost. It
|
||||
* indicates that the device will soon be dropping packets, or already drops
|
||||
* some packets of the same priority; prompting us to send less aggressively. */
|
||||
#define net_xmit_eval(e) ((e) == NET_XMIT_CN? 0 : (e))
|
||||
#define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0)
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user