aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/skbuff.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2012-11-01 05:16:22 -0400
committerDavid S. Miller <davem@davemloft.net>2012-11-02 21:29:57 -0400
commite19d6763cc300fcb706bd291b24ac06be71e1ce6 (patch)
tree05608ee69740360480b4c66a368eb21987993058 /net/core/skbuff.c
parent202975b4c522c197e4e2269d389aafbf056a4c37 (diff)
skb: report completion status for zero copy skbs
Even if skb is marked for zero copy, net core might still decide to copy it later which is somewhat slower than a copy in user context: besides copying the data we need to pin/unpin the pages. Add a parameter reporting such cases through zero copy callback: if this happens a lot, device can take this into account and switch to copying in user context. This patch updates all users but ignores the passed value for now: it will be used by follow-up patches. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/skbuff.c')
-rw-r--r--net/core/skbuff.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 6e04b1fa11f2..4abdf71a23f8 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -519,7 +519,7 @@ static void skb_release_data(struct sk_buff *skb)
519 519
520 uarg = skb_shinfo(skb)->destructor_arg; 520 uarg = skb_shinfo(skb)->destructor_arg;
521 if (uarg->callback) 521 if (uarg->callback)
522 uarg->callback(uarg); 522 uarg->callback(uarg, true);
523 } 523 }
524 524
525 if (skb_has_frag_list(skb)) 525 if (skb_has_frag_list(skb))
@@ -797,7 +797,7 @@ int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask)
797 for (i = 0; i < num_frags; i++) 797 for (i = 0; i < num_frags; i++)
798 skb_frag_unref(skb, i); 798 skb_frag_unref(skb, i);
799 799
800 uarg->callback(uarg); 800 uarg->callback(uarg, false);
801 801
802 /* skb frags point to kernel buffers */ 802 /* skb frags point to kernel buffers */
803 for (i = num_frags - 1; i >= 0; i--) { 803 for (i = num_frags - 1; i >= 0; i--) {