From: Ben Greear Date: Mon, 25 Apr 2005 03:12:36 +0000 (-0700) Subject: [NET]: Document ->hard_start_xmit() locking in comments. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=af191367a752625b9f05a25a9a76c727b9b17cab;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git [NET]: Document ->hard_start_xmit() locking in comments. Signed-off-by: David S. Miller --- diff --git a/net/core/dev.c b/net/core/dev.c index 42344d903692..7bd4cd4502c4 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -1214,6 +1214,19 @@ int __skb_linearize(struct sk_buff *skb, int gfp_mask) * A negative errno code is returned on a failure. A success does not * guarantee the frame will be transmitted as it may be dropped due * to congestion or traffic shaping. + * + * ----------------------------------------------------------------------------------- + * I notice this method can also return errors from the queue disciplines, + * including NET_XMIT_DROP, which is a positive value. So, errors can also + * be positive. + * + * Regardless of the return value, the skb is consumed, so it is currently + * difficult to retry a send to this method. (You can bump the ref count + * before sending to hold a reference for retry if you are careful.) + * + * When calling this method, interrupts MUST be enabled. This is because + * the BH enable code must have IRQs enabled so that it will not deadlock. + * --BLG */ int dev_queue_xmit(struct sk_buff *skb)